• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Trigger] I need help about this system

Status
Not open for further replies.
Level 6
Joined
Oct 23, 2010
Messages
179
I have found some ammo system but i want this ammo to be used for 5 different weapons, can someone help me? The map is down below.
 

Attachments

  • wc3test.w3x
    30.1 KB · Views: 39
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Actually I don't understand what's the problem here?

I mean I understand ( and saw it in the map ) that you want 5 different weapons with 5 different ammo types right?

But know there are different ways to do that: In the test map, the Rifleman only need to pick up the ammo and can fire. Is that ok, or should the unit have the weapon in the inventory and the matching ammo to that weapon or what you exactly want?

Greetings and Peace
Dr. Boom
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

This trigger can be the base system trigger. The unit must have BOTH the weapon and the correct ammo type.
  • WeaponSystem
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • -------- Here is the USP .45 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacking unit) has an item of type USP .45) Equal to True
          • (Charges remaining in (Item carried by (Attacking unit) of type |c0080FF00USP .45 Ammo|r)) Greater than 0
        • Then - Actions
          • Item - Set charges remaining in (Item carried by (Attacking unit) of type |c0080FF00USP .45 Ammo|r) to ((Charges remaining in (Item carried by (Attacking unit) of type |c0080FF00USP .45 Ammo|r)) - 1)
        • Else - Actions
          • Unit - Order (Attacking unit) to Stop
          • Item - Remove (Item carried by (Attacking unit) of type |c0080FF00USP .45 Ammo|r)
      • -------- Here is the Colt --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacking unit) has an item of type Colt M4A1) Equal to True
          • (Charges remaining in (Item carried by (Attacking unit) of type |c0080FF00Colt M4A1 Ammo|r)) Greater than 0
        • Then - Actions
          • Item - Set charges remaining in (Item carried by (Attacking unit) of type |c0080FF00Colt M4A1 Ammo|r) to ((Charges remaining in (Item carried by (Attacking unit) of type |c0080FF00USP .45 Ammo|r)) - 1)
        • Else - Actions
          • Unit - Order (Attacking unit) to Stop
          • Item - Remove (Item carried by (Attacking unit) of type |c0080FF00Colt M4A1 Ammo|r)
      • -------- And know you do on the same way with the other weapons and chance the weapon type and the ammo type --------
Now I don't know what you want: If both weapon and ammo are on the ground and can be picked or buy, or it the hero only should pick up the weapon and get the ammo you can use this:
  • WeaponSystem2
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • -------- For the colt --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Colt M4A1
        • Then - Actions
          • Hero - Create |c0080FF00Colt M4A1 Ammo|r and give it to (Hero manipulating item)
        • Else - Actions
      • -------- For the MP5 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to MP5
        • Then - Actions
          • Hero - Create |c0080FF00MP5 Ammo|r and give it to (Hero manipulating item)
        • Else - Actions
      • -------- Simple go on with the rest --------

Greetings and Peace
Dr. Boom
 
Last edited:
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

1) The map size of my map is bigger then yours, so I must add something
2) If I open the map ( my map ) I have more triggers then if I open yours.

1 + 2 = 3) You open the wrong map? You press "ok" if he wants overwrite the map ( because of the same name ), else you do some other thing wrong, because I have the added triggers.

Edit: Omg you sell fire in hell? ...

Greetings and Peace
Dr. Boom
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Why you come up with the idea to put the attacking unit into a variable? =O
Example:
  • Unit - Order (Attacking unit) to Stop
  • Unit Group - Add (Attacking unit) to AOE
  • Unit - Add a 1.00 second Generic expiration timer to (Attacking unit)
->

JASS:
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
call GroupAddUnitSimple( GetAttacker(), udg_AOE )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetAttacker() )

So every time you use "attacking unit" or one of those event responses, it calls a function. Using a variable is faster.
 
Status
Not open for further replies.
Top