HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Ammunition Problem...

06-14-2004, 07:47 PM#1
Rhodus
I'm having a tiny problem with ammunition. I have the main system working, each weapon contains its own ammunition (using custom values), and that works fine. Problem is I can't get the unit to stop attacking when ammunition reaches zero :/

By the way thanks a bunch to whoever made those awesome starcraft models, they came up at the exact time I needed them, perfect timing on releasing those :D

So yeah, what kind of trigger do I need to stop a unit attacking when ammo reaches 0?
06-14-2004, 09:14 PM#2
th15
This the is the kind of trigger i prefer to use:
Code:
Event:
Unit is attacked
Condition
<whatever>
Action:
If-
 Condition: Custom value of attacking unit = 0
 Then do: Unit order attacking unit to stop
 Else do: Set custom value of attacking unit = custom value of attacking unit - 1
             If-
             Condition: Custom value of attacking unit = 0
             Wait X seconds
             Set custom value of attacking unit = MaxAmmoFactor

The stop action will intercept any attack command while the unit's custom value is at 0.
06-14-2004, 09:45 PM#3
Rhodus
Thank you very much. The ammo system works perfectly now. I excluded the reload action at the end of that trigger.

All sorted out, thanks again.