• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] My Ammo System Help

Status
Not open for further replies.
I just thought up how to make a ammo system for shooting games but i need some help. Here is how it works:

Your ammo will equal your mana. Whenever you attack it drains mana per attk(Do i need a trigger or could i just use searing arrows with no bonuses?). When your mana gets to 0 you cant attk(how do i do this? Is it like this:
Events:
when mana=0
Actions:
?
Dont kown any actions for this...). Then you have clips(mana pots) that regen your mana. Then you can get better guns that increase your ammo(mana).

I need some help with the trigger that stops you from attking when mana=0. If you can help it would be great :thumbs_up:.

Thanks
(if any1 like idea they may use in map :smile: )
 
A good idea would be to give them searing arrows -that does the amount of damage fully- then give him an attack of 1-1, so that way he has to shoot searing arrows =/

Edit: Actually I'm not sure but I believe you can use triggers to set it so that when he's out of mana to disable his primary attack, then when his mana is > 1 then renable it.. sadly WoW got revenge on me by DELETING MY WHOLE GAMES FOLDER when I uninstalled it (Supreme Commander was worth it) and that includes Warcraft 3 or I'd play with this system to see
 
Last edited:
OK this thread was a while ago but ill just post here. Ive created a new system like this(this time with arrows for my village map:wink:):
  • arrowammo
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If ((Iron Arrows 0032 <gen> is Owned) Equal to True) then do (Item - Set charges remaining in Iron Arrows 0032 <gen> to ((Charges remaining in Iron Arrows 0032 <gen>) - 1)) else do (Trigger - Run arrowammo2 <gen> (ignoring conditions))
      • If ((Charges remaining in Iron Arrows 0032 <gen>) Equal to 0) then do (Item - Remove Iron Arrows 0032 <gen>) else do (Do nothing)
That was the first one. Heres the second:
  • arrowammo2
    • Events
    • Conditions
    • Actions
      • Unit - Pause (Attacking unit)
      • Wait 0.50 seconds
      • Unit - Unpause (Attacking unit)
what im asking is how can i make the item generic. So if a pick up any "Iron arrows" it works not just the one item?

(PS: also is there a way an item with charges can stack? For example can an arrow pack of ten use the same item slot and make 20?)

Thanks!
 
Level 13
Joined
Aug 31, 2005
Messages
823
what im asking is how can i make the item generic. So if a pick up any "Iron arrows" it works not just the one item?

for integer A equals 1 to 6
If item (type of item carried by hero in slot (integer a)) equal to iron arrow then [continue your original trigger here]

Yea there is a way to stack items. It has something to do with a 'set number of charges' function or something. Its really late here or i'd look it up. Maybe someone else knows more. If not i'll repost some other time with details.
 
ugh i tried a little different way like this and its not working

  • arrowammo
    • Events
      • Unit - A unit Is attacked
    • Actions
      • If (((Attacking unit) has an item of type Iron Arrows) Equal to True) then do (Item - Set charges remaining in (Item carried by (Attacking unit) of type Iron Arrows) to ((Charges remaining in (Item carried by (Attacking unit) of type Iron Arrows)) - 1)) else do (Trigger - Run arrowammo2 <gen> (ignoring conditions))
      • If ((Charges remaining in (Item carried by (Attacking unit) of type Iron Arrows)) Equal to 0) then do (Item - Remove (Item carried by (Attacking unit) of type Iron Arrows)) else do (Do nothing)
 
Last edited:
Level 11
Joined
Jul 12, 2005
Messages
764
Why do you make 2 triggers for this? Try the If/Then/Else Action with more actions and conditions:

Event: Unit is attacked
Condition: If (Attacking unit) has an item of type Iron Arrows) Equal to True
Actions:
Set charge to -1 (i'm not gonne write it..)
Pause Attacking Unit
Wait x sec
Unpause Attacking Unit
If Charges remaining in (Item carried by (Attacking unit) of type Iron Arrows)) Equal to 0
-Remove Item
 
Status
Not open for further replies.
Top