| 07-14-2004, 12:27 AM | #1 |
Hey, I need help with a trigger for a game I'm making. I need a trigger similiar to a gun reloading. The gold being the bullets left in the gun and wood being how many clips left like in Night Of The Dead. I really don't know where to start and would appreciate some help! =D |
| 07-14-2004, 02:03 AM | #2 |
Code:
Reloading Trig
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Attacking unit)) Equal to Marine
Actions
Player - Set (Owner of (Attacking unit)) Current gold to (((Owner of (Attacking unit)) Current gold) - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Attacking unit)) Current gold) Less than or equal to 0
Then - Actions
Player - Make (Owner of (Attacking unit)) treat (Owner of (Attacked unit)) as an Ally
Wait 3.00 seconds
Player - Make (Owner of (Attacking unit)) treat (Owner of (Attacked unit)) as an Enemy
Sound - Play ReloadSoundVar at 100.00% volume, attached to (Attacking unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Attacking unit)) Current lumber) Greater than 0
Then - Actions
Player - Set (Owner of (Attacking unit)) Current gold to 50
Player - Set (Owner of (Attacking unit)) Current lumber to (((Owner of (Attacking unit)) Current lumber) - 1)
Else - Actions
Do nothing
Else - Actions
Do nothing |
| 07-15-2004, 09:55 PM | #3 |
basically since i don't have the editor up you would do something like Unit: Unit begins attacking Condtions: Unit = (to w/e you wan't) Actions: Subtract 1 gold Trigger Turn off Trigger Turn on Hope this helps ![]() |
