• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

"Out of Mana" trigger

Status
Not open for further replies.
Level 1
Joined
Mar 13, 2008
Messages
4
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?
 
Level 4
Joined
Dec 16, 2007
Messages
134
  • 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)
 
Level 1
Joined
Mar 13, 2008
Messages
4
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.
 
Level 22
Joined
Feb 26, 2008
Messages
892
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)
 
Level 4
Joined
Dec 16, 2007
Messages
134
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
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
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
 
Level 1
Joined
Mar 13, 2008
Messages
4
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 =/
 
Level 2
Joined
Feb 17, 2008
Messages
8
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
 
Level 12
Joined
Aug 20, 2007
Messages
866
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
 
Status
Not open for further replies.
Top