• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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 =)
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
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