• 🏆 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!

Why is this "simple" trigger not working?

Level 3
Joined
Feb 3, 2016
Messages
43
  • OnDamageEvent
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (Level of Free Pathing (custom) for (Damage Target)) Equal to 1
    • Actions
      • Unit - For Unit (Damage Target), end cooldown of ability Free Pathing (custom)
      • Unit - Add Cargo Hold (custom) to (Damage Target)
      • Unit - For (Damage Target), Ability Cargo Hold (custom), Disable ability: True, Hide UI: True
      • Unit - Turn collision for (Damage Target) On.
  • AfterDamageEvent
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Free Pathing (custom)
    • Actions
      • -------- This prevents corpses from spawning, apparently "Starts the Effect..." doesn't work --------
      • Unit - Remove Cargo Hold (custom) from (Casting unit)
  • PathingEnable
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Ability Cooldown Remaining of (Ordered unit) for ability Free Pathing (custom)..) Equal to 0.00
    • Actions
      • Unit - Turn collision for (Ordered unit) Off.
The game recognizes that the 'Free Pathing' ability is on cooldown (I used game text message to display cooldown progress on every firing of the 'PathingEnable' trigger), but it seemingly doesn't check if the condition is true/false at all.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
This Event is unreliable:
  • Unit - A unit Finishes casting an ability
Also, we don't fully understand what you're trying to accomplish if you don't provide us with some details. Maybe (Damage Source) is the desired Event Response, maybe there's an entirely better way of doing this, I don't know unless you explain yourself.
 
Last edited:
Level 3
Joined
Feb 3, 2016
Messages
43
This Event is unreliable:
  • Unit - A unit Finishes casting an ability
Also, we don't fully understand what you're trying to accomplish if you don't provide us with some details. Maybe (Damage Source) is the desired Event Response, maybe there's an entirely better way of doing this, I don't know unless you explain yourself.
The goal is give units free pathing as a passive ability, which gets disabled for 5 seconds upon taking damage.

The passive ability was created from the Exhume Corpse ability (which requires the Cargo Hold ability to be present on the same unit).

As for the 'Finishes casting...' instead of 'Starts the effect...', a corpse would still spawn while using the 'Starts the effect...' event (even though it shouldn't according to this post), so I fixed it using 'Finishes casting' as it is the next best thing.
 
Level 3
Joined
Feb 3, 2016
Messages
43
Always put Debug messages in your triggers to find out which part of it works and which does not. You can do this by Game - Send Message and that way you can see which step on the way the Trigger stops running.
I can't find any such menu in the World Editor, how would I enable debug messages?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
Exhume Corpse does not require Cargo Hold to be present as far as I know, I've been using it as a passive cd for a while now without any issues and no corpses spawned. I don't rely on it's cast Event though and just manage things using my own timers.

I doubt Exhume Corpse even fires a cast Event seeing as how it's passive.

Also, he was talking about using Text Messages to debug your triggers. You display some text in your trigger that will appear in-game. You can display the name of a unit, an integer, a real, etc... Or just write your own message "Is this trigger even running?" so you can confirm that the Events and Conditions are being met and determine that your Actions are executing and the order in which they occur.
 
Level 19
Joined
Feb 27, 2019
Messages
590
Pathing enable requires another condition to check if the ordered unit has the ability at level 1.

Exhume Corpses triggers an order event, which means as soon as the collision is turned on it will turn off immediately as the cooldown ends and exhume corpses triggers the event. Id imagine OndamagEvent should START a cooldown, not end it. This can be done nowadays with the start cooldown of ability.
 
Level 3
Joined
Feb 3, 2016
Messages
43
Exhume Corpse does not require Cargo Hold to be present as far as I know, I've been using it as a passive cd for a while now without any issues and no corpses spawned. I don't rely on it's cast Event though and just manage things using my own timers.

I doubt Exhume Corpse even fires a cast Event seeing as how it's passive.

Also, he was talking about using Text Messages to debug your triggers. You display some text in your trigger that will appear in-game. You can display the name of a unit, an integer, a real, etc... Or just write your own message "Is this trigger even running?" so you can confirm that the Events and Conditions are being met and determine that your Actions are executing and the order in which they occur.
It looks like it does fire off of casting the 'passive' ability, as the game outputs my debug message on both 'Starts the effect...' and 'Finishes casting...' events.

And I figured out the culprit, the triggers execute their functions in the following order:
  1. OnDamageEvent (as it should be)
  2. PathingEnable (wrong, should be last)
  3. AfterDamageEvent (wrong, should be second)
However, I am unable to determine if this is because I am manually ordering my 2 units to attack each other (to test out the triggers), or if PathingEnable is triggered by the unit casting the passive ability upon taking damage (which then technically happens before the damage event takes place - which would also mean that a unit auto-attacking is essentially issuing an attack-order unto itself every time it wants to attack).
 
Level 3
Joined
Feb 3, 2016
Messages
43
Pathing enable requires another condition to check if the ordered unit has the ability at level 1.

Exhume Corpses triggers an order event, which means as soon as the collision is turned on it will turn off immediately as the cooldown ends and exhume corpses triggers the event. Id imagine OndamagEvent should START a cooldown, not end it. This can be done nowadays with the start cooldown of ability.
I've tried manually starting the cooldown of the ability, but doing so makes it impossible to reset the cooldown.

It functions as the timer for resetting the pathing, otherwise the following could occur:
  1. Unit takes damage;
  2. Cooldown of Free Pathing starts (via trigger);
  3. Unit takes another instance of damage during the cooldown;
  4. Cooldown progresses normally instead of resetting back from full;
The unit's Free Pathing ability is therefore reset "prematurely", as the unit has taken damage less than 5 seconds ago and the ability is ready before those 5 seconds are up - since the ability did not start counting down the cooldown from full again for the latest instance of damage.
 
Level 3
Joined
Feb 3, 2016
Messages
43
UPDATE: turns out you can reset and start ability cooldowns via triggers properly, and doing so manually now makes everything work in proper order and function as intended.

Sometimes I just need people to point my mistakes before I can legit understand them, so thanks!
 
Top