• 🏆 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!

Mana = Heal

Status
Not open for further replies.

Ham

Ham

Level 5
Joined
Jan 16, 2009
Messages
132
I am making a map, which when the mana goes to 0, the unit becomes another unit i actually got the tigger for it, i made it myself, but i wonder if there is a way to simplify it:

manauo7.jpg


(with this tigger i must pick the unit who will be changed), and it actually stops me from other tiggers such like adding the unit at the beging of the game (if so, can't be picked by the actual tigger) for last, it's a tigger for only 1 player, and i need it for more than one
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
Try using these triggers:

  • Trigger 1
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Trigger - Add to Trigger 3 <gen> the event (Unit - Picked unit's mana becomes Equal to 0.00)
      • Custom script: call DestroyGroup (udg_TempGroup)
  • Trigger 2
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
    • Actions
      • Trigger - Add to Trigger 3 <gen> the event (Unit - Entering unit's mana becomes Equal to 0.00)
First two triggers are picking up every possible units, but third executes main actions. You can change conditions in first two triggers too meet your unit type, etc...

  • Trigger 3
    • Events
    • Conditions
    • Actions
      • -------- This trigger doesn't need any events nor conditions --------
      • -------- Everything was set in previous 2 triggers --------
      • -------- Your actions here --------
Note that this system is very simple and much more efficient could be done using JASS and vJASS. I am using similar system in my map and as far as I know it doesn't create any laggs. Just take care of any possible leaks. :)
 
Level 5
Joined
May 23, 2008
Messages
148
Also, if it won't work, that's probably because the unit cannot have its mana less than or equal to 0.000 (you'd have to set it via trendchipiggers to such value, or manaburn it and have none mana regeneration at all).
 

Ham

Ham

Level 5
Joined
Jan 16, 2009
Messages
132
it's working properly child_0f_bodom (btw that band isn't great, they have to many songs alike) thanks very much, but now i found out something else, when i replace an unit the replaced unit goes hidden in middle of map (i can see with a skill) it pings if the unit were there. i think this is for another thread anyways thanks it's sloved now
 
Last edited:
Level 5
Joined
May 23, 2008
Messages
148
it's working properly child_0f_bodom (btw that band isn't great, they have to many songs alike) thanks very much, but now i found out something else, when i replace an unit the replaced unit goes hidden in middle of map (i can see with a skill) it pings if the unit were there. i think this is for another thread anyways thanks it's sloved now

Dude, if a unit doesn't exist anymore, it's coordinates are (0.000, 0.000).
 
Status
Not open for further replies.
Top