Using amount of mana as an event?

maldruzard

Member
Reaction score
2
Hey there!

I'm trying to make a good ol' "tired" effect for units when they get under a certain amount of mana. The way I currently am doing this is by having a periodic event track unit mana and any less than or equal to 100 mana have their movement speed set to a lower number, and when they go above that point of mana, another periodic trigger reverts their movement speed to normal.

This is the trigger:

Events
Time - Every 0.10 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Mana of (Picked unit)) Less than or equal to 99.00
(Unit-type of (Picked unit)) Equal to Survivor
Then - Actions
Unit - Set (Picked unit) movement speed to 150.00

The other trigger is the same, but obviously the with the movement speed and mana values at different numbers. However, I'm not sure if this is the best way to do this. Though the triggers work well enough, I want a dummy to be spawned and cast 'slow' on the unit when under 100 mana, just for the visual effect and buff to explain why the unit is slower. Because of this, I do not think adding a spawn dummy to this trigger would work, due to the overwhelmingly large amount of dummies that would be spawned and destroyed.

Is it at all possible to use a unit's mana dropping below a certain point as an event so I do not have to use periodic time-based events?

Cheers!
 

Tharius

Occasionally Around
Reaction score
39
There isn't any event that directly triggers when a unit's mana hits a certain point, but you could have it trigger whenever a unit casts a spell, and add a condition where the casting unit's mana is less than a certain amount (100 mana?). You would still need a second trigger checking whether the unit's mana is back to normal, but if you added the unit to a table, it would work easily. You may also want another trigger that checks a unit's mana if they're the target of a Mana Burn or Drain Mana spell.

edit: Apparently, I don't know how to read the WE.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
There isn't any event that directly triggers when a unit's mana hits a certain point
There's the Unit - Mana event.
Trigger:
  • Mana Detection
    • Events
      • Unit - No unit's mana becomes Less than 50.00
    • Conditions
    • Actions
      • Unit - Kill (Triggering unit)

Of course, this requires you using either preset units or a trigger that adds new units to it for detection with the Trigger - Add Event action.
 

maldruzard

Member
Reaction score
2
Ahh Thank you Kaerf! Works like a charm now :) I saw that mana detection event before, but I didn't know how to link it to my units when they weren't pre-placed on my map!

Cheers both of you :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top