"Out of Mana" trigger

Status
Not open for further replies.

frostrose

F

frostrose

I'm trying to find out a way to make a unit get a certain buff when they run out of mana. But i can't for the life of me figure out how. It has to work for every unit i have, preferrably. But individual unit-types work fine.
I can only seem to find a way to do it for a single specific unit, using the unit - mana event....
Is there some way to make events like the Unit-mana event work for an entire unit type?
 
  • Untitled Trigger 012
    • Events
      • Put your Events here.
    • Conditions
      • Put your Conditions here if you have any.
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to (This trigger) the event (Unit - (Picked unit)'s mana becomes Equal to 0.00)
 
Hm. While i marvel at the sheer possiblities...
How in the world am i supposed to go about this? I can't seem to make it actually do anything with the new trigger.
  • Broken Morale
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to (This trigger) the event (Unit - (Picked unit)'s mana becomes Less than or equal to 10.00)
      • Unit - Add Wander (Broken Morale) to (Picked unit)
      • Unit - Add Broken Morale Buffsetter to (Picked unit)
I'm rather new with the (wc3) trigger editor and i don't quite understand it yet.
 
I think I'm about to choke from the leakage. :grin:
Yes, that trigger leaks horribly. You need to make it a priority to look up a leak tutorial and fix that.

Now, to the reason it doesn't work.
You have this:

  • Broken Morale
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to (This trigger) the event (Unit - (Picked unit)'s mana becomes Less than or equal to 10.00)
      • Unit - Add Wander (Broken Morale) to (Picked unit)
      • Unit - Add Broken Morale Buffsetter to (Picked unit)
You NEED something like this:

  • Broken Morale
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to (This trigger) the event (Unit - (Picked unit)'s mana becomes Less than or equal to 10.00)
          • Unit - Add Wander (Broken Morale) to (Picked unit)
          • Unit - Add Broken Morale Buffsetter to (Picked unit)
 
I agree to Ghan_04

to frostrose

You must put the
  • Unit - Add Wander (Broken Morale) to (Picked unit)
  • Unit - Add Broken Morale Buffsetter to (Picked unit)
Under the Loop Actions.

Just telling if you didn't saw the difference between the triggers that Ghan_04 gave you
 
Leakless way
  • LOL YOU DONT HAVE MANA
  • Events
    • Time - Every 0.50 seconds of game time
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      • Loop - Actions
        • if (Mana of (Picked Unit)) is equal to 0
          • Then - Actions
            • if Level of (<Ability>) of (Picked Unit) is greater than 0
              • Then - Actions
                • Unit - Add (<Ability>) to (Picked unit)
              • Else - Actions
          • Else - Actions
            • if Level of (<Ability>) of (Picked Unit) is greater than 0
              • Then - Actions
                • Unit - Remove (<Ability>) from (Picked unit)
              • Else - Actions
 
I think i get the general idea @ Need_O2, but i've been looking for a while now and i can't find any way of doing the "If (Mana of (Picked unit)) is equal to 0" part of it. It feels like i've looked all over... Where in the world is it?

Sorry if i'm being a bit of a noob about this =/
 
If your problem still isnt fixed, you can make an ability based off an aura (eg. Devotion Aura) , remove all the effects, add the buffs you want and change the units affected to "self"
Then use the trigger:
Add <Ability> to Triggering Unit
...But then it would show the ability but eh
 
Uhh.....

Why do you need it to run at .50 all the time???

[RAINBOW]It would be way more efficient if you used 2 triggers, one for everytime a unit comes into play, and the second checks periodically for 0 mana

The first one should also turn on/off the 2nd trigger if there are no more units with mana in play (although now that I think about it, it might not make a difference)[/RAINBOW]

Heh, rainboe tags xD
 
My problem is fixed and my map is finished! Thank you for all of your help. =)
 
Status
Not open for further replies.
Back
Top