Ammo Problem...

Cell

Member!
Joined
Feb 1, 2004
Messages
551
Reaction score
0
Location
California
Website
Visit site
I have 30 charges. And when i shoot once, i want it to go down to 29, and i shoot again it goes down to 28... pls write out the trigger for me thanx :)
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
Create a variable (integer) that with every 'shot' decreases. If you're attacking, it's a different story..... If/then/else trigger to determine whether shot goes.

Trigger 1:
EVENT: Your event
ACTION: If variable=0 THEN Do nothing else ... (I don't really know what you want)
 

Cell

Member!
Joined
Feb 1, 2004
Messages
551
Reaction score
0
Location
California
Website
Visit site
o... i still dont get it..
 

Jimstick

Member!
Joined
Oct 27, 2003
Messages
38
Reaction score
0
Website
Visit site
Make a variable called ammo or somthing to that effect. have it so that every time the guy shoots it goes down one. have a trigger that says something like:

----Event
-------generic unit event - unit is is issued an order targeting an object
-
----Condition
-------unit type - unit type of attacking unit is equal to *your guy*
-------order - issued order is equal to "attack"
-
----Action
-------if ammo is = 0 then order attacking unit to stop else set ammo = (ammo-1)
-
I'm not sure if the "generic unit event - unit is is issued an order targeting an object" will work if you never tell the guy to attack again after the first right-click. But other then that this trigger should work :)
 

NewPosts

New threads

Top