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

[Trigger] Trigger Check

Status
Not open for further replies.
Level 9
Joined
May 21, 2014
Messages
580
I have 3 triggers that make up a spell called "Earthshock".

That spell causes a stun in an area after channeling of 1 (or 2) second(s) is complete. It literally is just War Stomp, but in an area and with channeling stuff.
The channel here isn't continuous; I wanted it like to be Flame Strike. Flame Strike, when casted, has that delay where you should complete the casting, and if cancelled it will still undergo cooldown, and no flame strike happened, just its effects.

Now, what I wanted to ask is if it will cause leaks. I am not asking if it's MUI or not, just leak-related.

Here are the triggers:
  • Earthshock Channel Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Earthshock (Zick Prophet)
      • (Casting unit) Equal to EarthshockHandler
    • Actions
      • Set EarthshockPoint = (Target point of ability being cast)
      • Special Effect - Create a special effect at EarthshockPoint using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Level of Earthshock (Zick Prophet) for (Casting unit)) Greater than or equal to 1
              • (Level of Earthshock (Zick Prophet) for (Casting unit)) Less than or equal to 2
        • Then - Actions
          • Countdown Timer - Start EarthshockTimer as a One-shot timer that will expire in 2.00 seconds
        • Else - Actions
          • Countdown Timer - Start EarthshockTimer as a One-shot timer that will expire in 1.00 seconds
      • Trigger - Turn on Earthshock Interruption <gen>
      • Trigger - Turn on Earthshock <gen>
  • Earthshock Interruption
    • 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
      • (Ordered unit) Equal to EarthshockHandler
    • Actions
      • Countdown Timer - Pause EarthshockTimer
      • Custom script: call RemoveLocation (udg_EarthshockPoint)
      • Custom script: set udg_EarthshockPoint = null
      • Trigger - Turn off Earthshock <gen>
      • Trigger - Turn off Earthshock Interruption <gen>
  • Earthshock
    • Events
      • Time - EarthshockTimer expires
    • Conditions
    • Actions
      • Trigger - Turn off Earthshock Interruption <gen>
      • Unit - Create 1 Dummy Maimer / Stomper for (Owner of EarthshockHandler) at EarthshockPoint facing Default building facing degrees
      • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
      • Unit - Remove (Last created unit) from the game
      • Custom script: call RemoveLocation (udg_EarthshockPoint)
      • Custom script: set udg_EarthshockPoint = null
      • Trigger - Turn off Earthshock <gen>
(Earthshock and Earthshock Interruption are Initially Off)

Thanks for anyone who replies. :ogre_love::ogre_kawaii:

EDIT: Edited the post. I was stupid for not updating my triggers :ogre_rage:
 
Last edited:
Level 12
Joined
May 20, 2009
Messages
822
I THINK "Facing Default building facing degrees" would leak? Not sure.

I also feel like you have to use a Custom Script when destroying special effects. I'm probably wrong about that, though.

In the "Interruption" trigger, you can just use

  • Unit - A unit Stops casting an ability
Instead of those other three events. (That is if it's a channel ability, which it seems like it is since you have that Interruption trigger in the first place)

And now on an MUI note, even though I know you didn't ask for it, you need to not turn off the periodic trigger. (Then of course you need to index)
 
Level 9
Joined
May 21, 2014
Messages
580
I don't see any leaks. However, in the "Interruption" trigger, you can just use

  • Unit - A unit Stops casting an ability
Instead of those other three events. (That is if it's a channel ability, which it seems like it is since you have that Interruption trigger in the first place)

Thank you for your reply. I shall follow your advice to heart.
Too bad I can't +rep you. It says something like "Spread Rep first before giving."
 
Level 12
Joined
Nov 3, 2013
Messages
989
Don't you have to remove the timer after pausing it?

Also greater/lesser than is supposedly faster than greater/lesser than or equal to, no leak but still about performance.

Could also use equal to 1 OR equal to 2, no clue if this is faster or slower than the others though.

using a formula and flooring or converting to integer and back and use them as a multiplier directly to skip the if statement completely is probably faster than both

Note: The war stomp isn't instant so you're having a 1/2 sec wait time + the normal cast time so if you want the stun to be closer to 1/2 seconds you should remove that time from the timers

Edit: Also instead of timer you should use periodic event and check if the caster get stunned, stilence etc
 
Level 9
Joined
May 21, 2014
Messages
580
Don't you have to remove the timer after pausing it?

The same Timer will reset if it was paused, then started.

Also greater/lesser than is supposedly faster than greater/lesser than or equal to, no leak but still about performance.

Could also use equal to 1 OR equal to 2, no clue if this is faster or slower than the others though.

using a formula and flooring or converting to integer and back and use them as a multiplier directly to skip the if statement completely is probably faster than both

I will look into it too. Thanks!

Note: The war stomp isn't instant so you're having a 1/2 sec wait time + the normal cast time so if you want the stun to be closer to 1/2 seconds you should remove that time from the timers

That's fine, I guess. Though I'd think about it. XD Thanks again for the tips. :ogre_haosis:

EDIT: Periodic event? Why so?
 
Level 12
Joined
Nov 3, 2013
Messages
989
  • Untitled Trigger 002
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
      • ((Triggering unit) is Stunned) Equal to True
      • ((Triggering unit) has buff Silence) Equal to True
    • Actions
To check if the caster is disabled, stunned or anything that should prevent him from casting the ability. Since it's a dummy unit that use the actual ability it won't be affected by the caster being stunned or silenced for instance.

If you'd check when the timer expires it wouldn't take into account if the stun was shorter than the timer, e.g the caster starts ability gets mini stunned and then it won't have to start over the cast.
 
Level 9
Joined
May 21, 2014
Messages
580
  • Untitled Trigger 002
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
      • ((Triggering unit) is Stunned) Equal to True
      • ((Triggering unit) has buff Silence) Equal to True
    • Actions
To check if the caster is disabled, stunned or anything that should prevent him from casting the ability. Since it's a dummy unit that use the actual ability it won't be affected by the caster being stunned or silenced for instance.

Now that you mention it, I originally made the timing into "getting to create the dummy unit; even when stunned/silenced/etc." then if it does that I'll conclude the spell is successful. Thinking again, it's kind of awkward. I shall implement it, but if it lags (might be a rare case, a VERY RARE ONE) (And that I think 0.10 periodic event is not enough), I'll stick to the original idea.


If you'd check when the timer expires it wouldn't take into account if the stun was shorter than the timer, e.g the caster starts ability gets mini stunned and then it won't have to start over the cast.

The caster wouldn't have to, because as I said earlier, when the skill begins to start the countdown of "casting the skill", the skill will undergo a cooldown state, even when the spell has not completed yet.

Thank you (again) for taking your time :)
 
If a unit starts casting again, before your unit finished first instance it will leak because "EarthshockPoint" will be overwritten and you can't access anymore to the first location.

I THINK "Facing Default building facing degrees" would leak? Not sure.

I also feel like you have to use a Custom Script when destroying special effects. I'm probably wrong about that, though.
No to both. No leak here.

  • And - All (Conditions) are true
  • Conditions
  • (Level of Earthshock (Zick Prophet) for (Casting unit)) Greater than or equal to 1
  • (Level of Earthshock (Zick Prophet) for (Casting unit)) Less than or equal to 2
The "And - All(conditions)" block is redundant, just add these two conditions without it.

As a red line for you about leaks. If you can still use your location (or what ever) you don't leak.
But you leak if you can't access anymore to the actual location.
For example you set it to a new value without Removing the first location. So after you have set, it's impossible now to remove the first location anymore. --> leak
 
Status
Not open for further replies.
Top