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

DoT Trigger not functioning as expected

Status
Not open for further replies.
Level 2
Joined
May 26, 2014
Messages
18
Spiked Net (Kunoichi) is a hero skill based upon the ensnare ability. The spell is functioning perfectly alone. The trigger is doing nothing so far as I can tell. It might as well not exist. I have no clue why. Cooldown on spell is 24 seconds all level. Duration is 12 seconds (heroes) and 23 seconds (units). My map does not allowing multiple copies of heroes, I figured with these numbers I avoid any other instance sof the trigger trying to fire up twice at once.

It comes in two parts, the activator and the DoT.

  • Spiked Net
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Spiked Net (Kunoichi)
    • Actions
      • Set SpikedNetCaster = (Triggering unit)
      • Set SpikedNetTarget = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpikedNetTarget is A Hero) Equal to True
        • Then - Actions
          • Countdown Timer - Start SpikedNetCountdown as a One-shot timer that will expire in 9.00 seconds
          • Set SpikedNetCountdown = (Last started timer)
          • Trigger - Turn on Spiked Net Damage <gen>
        • Else - Actions
          • Countdown Timer - Start SpikedNetCountdown as a One-shot timer that will expire in 21.00 seconds
          • Set SpikedNetCountdown = (Last started timer)
          • Trigger - Turn on Spiked Net Damage <gen>
  • Spiked Net Damage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer((Remaining time for SpikedNetCountdown))) Greater than 0
        • Then - Actions
          • Unit - Cause SpikedNetCaster to damage SpikedNetTarget, dealing (3.00 x (Real((Level of Spiked Net (Kunoichi) for SpikedNetCaster)))) damage of attack type Pierce and damage type Normal
        • Else - Actions
          • Custom script: call DestroyTimer(udg_SpikedNetCountdown)
          • Trigger - Turn off (This trigger)
 
Level 10
Joined
Apr 4, 2010
Messages
509
Maybe explain how it's not functioning correctly? You'll need a third trigger page.

  • Trigger
    • Events
      • Time - SpikedNetCountdown expires
    • Conditions
    • Actions
      • Trigger - Turn off Spiked Net Damage
  • Spiked Net Damage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Cause SpikedNetCaster to damage SpikedNetTarget, dealing (3.00 x (Real((Level of Spiked Net (Kunoichi) for SpikedNetCaster)))) damage of attack type Pierce and damage type Normal
 
To add to what DEE-BOO said, you are destroying the timer in the second trigger which will ruin any future casts. Do not do anything to that timer other than starting it for this spell. Also, don't duplicate your code and you don't need to keep setting SpikedNetCountdown to itself every time.

  • Spiked Net
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Spiked Net (Kunoichi)
    • Actions
      • Set SpikedNetCaster = (Triggering unit)
      • Set SpikedNetTarget = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpikedNetTarget is A Hero) Equal to True
        • Then - Actions
          • Set Duration = 9.00
        • Else - Actions
          • Set Duration = 21.00
      • Countdown Timer - Start SpikedNetCountdown as a One-shot timer that will expire in Duration seconds
      • Trigger - Turn on Spiked Net Damage <gen>
  • Spiked Net Damage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Cause SpikedNetCaster to damage SpikedNetTarget, dealing (3.00 x (Real((Level of Spiked Net (Kunoichi) for SpikedNetCaster)))) damage of attack type Pierce and damage type Normal
  • Disabling Trigger
    • Events
      • Time - SpikedNetCountdown expires
    • Conditions
    • Actions
      • Trigger - Turn off Spiked Net Damage
 
Level 2
Joined
May 26, 2014
Messages
18
To be more specific the rigger is meant to deal damage over time to an enemy who has been "ensnared" by the spell Spiked Net (Kunoichi). It is not dealing any damage and as far as I can tell it is not having any untoward effects either. (Not doing anything.)

I attempted to split the second trigger into two as suggested.

  • Spiked Net 2
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Spiked Net (Kunoichi)
    • Actions
      • Set SpikedNetCaster = (Triggering unit)
      • Set SpikedNetTarget = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpikedNetTarget is A Hero) Equal to True
        • Then - Actions
          • Countdown Timer - Start SpikedNetCountdown as a One-shot timer that will expire in 9.00 seconds
          • Set SpikedNetCountdown = (Last started timer)
          • Trigger - Turn on Spiked Net Damage 2 <gen>
          • Trigger - Turn on Spiked Net Damage 2 pt 2 <gen>
        • Else - Actions
          • Countdown Timer - Start SpikedNetCountdown as a One-shot timer that will expire in 21.00 seconds
          • Set SpikedNetCountdown = (Last started timer)
          • Trigger - Turn on Spiked Net Damage 2 <gen>
          • Trigger - Turn on Spiked Net Damage 2 pt 2 <gen>
  • Spiked Net Damage 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Cause SpikedNetCaster to damage SpikedNetTarget, dealing (3.00 x (Real((Level of Spiked Net (Kunoichi) for SpikedNetCaster)))) damage of attack type Pierce and damage type Normal
  • Spiked Net Damage 2 pt 2
    • Events
      • Time - SpikedNetCountdown expires
    • Conditions
    • Actions
      • Trigger - Turn off Spiked Net Damage 2 <gen>
      • Custom script: call DestroyTimer(udg_SpikedNetCountdown)
      • Trigger - Turn off (This trigger)
Same result, which is to say; No result.
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,658
Change the event from Finishes casting an ability to Starts the effect of an ability.

Be aware that this spell is not MUI nor MPI.

And you are destroying the timer but never create one (except the default one).
You shouldnt destroy the timer.

EDIT:
Damn im slow.
Still starts the effect is one you are still missing.
 
Level 2
Joined
May 26, 2014
Messages
18
I got what you are both saying now. That's easy enough to do since if I am not destroying the timer it absolves me from needing to recreate it each cast.

Trigger IS working now. Damage being dealt as instructed.

Thank you very much for sorting that out.

I do however have one remaining question. First cast I activate the storage variable and never destroy it after expiration will it not leak from that point forward? I confess leaks are a little beyond my scope of understanding. I simply try to plug them where it has been suggesting in the guides.
 
The countdown timer not being destroyed isn't an issue since you re-purpose that same timer the next time the trigger runs. It would, however, be an issue if you actually created a new one each time (but you don't). If you look in Variable Manager, you can see whether a variable is automatically assigned to a new handle or not. In the case of timers, they are. Since starting a timer does not create a new one but simply starts the timer you passed as an argument, you are fine.
 
Level 2
Joined
May 26, 2014
Messages
18
I did not know that about checking their auto-assignment! Awesome. I'm going to leave trigger as is then and is working marvelously just as you made your model. TYVM again!
 
Status
Not open for further replies.
Top