• 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.

Check Whether Defend is On/Off

Status
Not open for further replies.
Level 20
Joined
Feb 24, 2009
Messages
2,999
If you have one unit only, you could use a boolean variable;

When an ability is cast
if ability is equal to defend
then set 'defendon' equal to true

And just compare the trigger with that, but if you have multiple units you'd probably have to check movement speed or something a tad more complex.. Or add a dummy buff to any unit that activates it?
 
Level 8
Joined
Mar 26, 2009
Messages
301
I already have such system. A dummy spell with 0 sec duration adds the buff.. And it is removed when un-defend is cast. But problem is with that. Altough there is nowhere in trigger that removes all buffs or that specific buff, the buff somehow gets removed from unit when using other abilities -or doing nothing at all- (a really weird bug; same happens with a sprint spell. When unit reloads its weapon while sprinting, it disables sprint -returning to normal speed- but effect stays-)
Edit: I was referring to buff method =)
 
Level 8
Joined
Mar 26, 2009
Messages
301
Dropped items are unpickable, leave a SFX instead; previously working spell starts to malfunction. Unit group actions are applied on non-matching units. All started after optimization, that's why I am blaming it. Did I say the tooltip missing buff icons on units randomly appear from time to time? And no there is not a empty buff string in the map; icons of those who have buff and proper settings show up on unit status. These kind of weird things =)
 
Weird bugs such as? Don't blame the Optimizer. There are only two known bugs at the moment (what I can remember), ExecuteFunc and Compression Names (screws up UnitAlive native).

TriggerRegisterVariableEvent is also destroyed, which is a key component in a nice chapter I'm planning to add to my Triggering tutorial.
 
Status
Not open for further replies.
Top