Anything wrong with this Trigger?

Level 6
Joined
Apr 15, 2016
Messages
118
  • Death Strangle
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Death Strangle
    • Actions
      • Set DeathStrangle_Loc = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 2000.00 of DeathStrangle_Loc matching ((((Matching unit) is A Hero) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))) and do (Actions)
        • Loop - Actions
          • Set DeathStrangle_GroupLoc = (Position of (Picked unit))
          • Unit - Create 1 Dummy Death Strangle for (Owner of (Triggering unit)) at DeathStrangle_GroupLoc facing Default building facing degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Entangling Roots (Picked unit)
          • Custom script: call RemoveLocation(udg_DeathStrangle_GroupLoc)
      • Custom script: call RemoveLocation(udg_DeathStrangle_Loc)

Basically, the ability is meant to be AoE Entangling Roots, with No Target and no Point (similar to War Stomp).

What is happening tho, when I cast it as Player 1 it works fine. I then tested it by giving any random Player (let's say, Player 15) a event so that he would cast, to see if it's working properly, and it happens that it isn't. It creates the Dummies tho, but they simply don't cast entangling roots. They are simply created and then die from the generic expiration timer. Casting it with my unit still works fine.

Can't see what's wrong there. If it's too obvious, forgive my limitation.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
  • I see nothing that should vary between owning player here; the only references to player use Triggering Unit.
  • Why use Begins Channeling? 99% of the time you want Starts the Effect, though the others do occasionally have use for animation or channeling spell purposes.
  • It's generally better to have only one generic dummy type in your map and then when you spawn one for whatever purpose just manually add the appropriate spell you will want it to cast.
  • Dummies do not match spell level with the caster (if there are levels to this ability).
  • A properly configured dummy can cast instantaneously without needing to turn to face its target. This allows a single dummy to cast on all of these targets rather than one dummy per target. The relevant stats: cast point 0, cast backswing 0, movement type none, speed base 0. Of course all the normal dummy stuff, too, and the dummy skills must have 0 cooldown.
 
Level 6
Joined
Apr 15, 2016
Messages
118
Weird, perhaps the error is in Object Editor. I tried changing the dummy for some Abominations (Unit). It creates them normally.

  • I see nothing that should vary between owning player here; the only references to player use Triggering Unit.
  • Why use Begins Channeling? 99% of the time you want Starts the Effect, though the others do occasionally have use for animation or channeling spell purposes.
  • It's generally better to have only one generic dummy type in your map and then when you spawn one for whatever purpose just manually add the appropriate spell you will want it to cast.
  • Dummies do not match spell level with the caster (if there are levels to this ability).
  • A properly configured dummy can cast instantaneously without needing to turn to face its target. This allows a single dummy to cast on all of these targets rather than one dummy per target. The relevant stats: cast point 0, cast backswing 0, movement type none, speed base 0. Of course all the normal dummy stuff, too, and the dummy skills must have 0 cooldown.
What are some good Dummy Attributes other than Locust, no model and selection scale 0?
 
Level 29
Joined
Sep 26, 2009
Messages
2,594
no need to have selection scale 0. Once unit has locust, it cannot be targeted and selection circle is not drawn as well.
Proper dummy unit should have:
  • Locust ability
  • Art - Animation - Cast Backswing: 0.0
  • Art - Animation - Cast Point: 0.0
  • Art - Death Time (seconds): 0.1 (min value)
  • Art - Model File: none / invalid model path so that no model is drawn in game
  • Art - Shadow Image (Unit): None
  • Combat - Attacks Enabled: None
  • Combat - Death Type: Can't raise, Does not decay
  • Movement - Speed Base: 0
  • Movement - Type: None
  • Stats - Food Cost: 0
  • Stats - Hide Minimap Display: True
  • Stats - Unit Classification: NOT worker. I personally set Ward and Walkable

This way you have dummy unit that other units cannot attack/interact with and the dummy is able to cast spells instantly.
 
Uninitialized players may not validate the "is unit enemy" condition.
Also throw out of the window those damn one line matching filters. Better filter them inside the unit group loop.
You may also replace Begin casting by finish casting, it would make things more reliable in a gameplay perspective.
 
Level 6
Joined
Apr 15, 2016
Messages
118
Uninitialized players may not validate the "is unit enemy" condition. Now this is something that I wasn't aware, could perhaps be this?
Also throw out of the window those damn one line matching filters. Better filter them inside the unit group loop. I was looking for a substitute for these, I rarely see an approved resource using these. How would a trigger look swapping these for something better? Something like Condition - Picked Unit is Alive Equal to True?
You may also replace Begin casting by finish casting, it would make things more reliable in a gameplay perspective. In this case might be correct, but I usually use these Begin Casting due to animation issues and manipulation.
Edited quoting.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Uninitialized players may not validate the "is unit enemy" condition.
Also throw out of the window those damn one line matching filters. Better filter them inside the unit group loop.
You may also replace Begin casting by finish casting, it would make things more reliable in a gameplay perspective.
Pyro mentioned this but you want to use Starts the effect of an ability.

Finishes Casting is almost NEVER the Event you want to use and really only comes in handy for determining that you've finished a full channeling of a spell like Earthquake for example. Begins Casting is not reliable either and if you're using this then your triggered spells are likely heavily abusable/buggy. You can try this for yourself, begin casting a triggered spell and then immediately interrupt it with a "Stop" order, repeat this process and watch as your trigger repeatedly fires while the ability never spends any mana/goes on cooldown.

[Events]

Begins Casting
: Your Hero has reached it's target (if any), the Icon for the Ability is now glowing green and your Hero has entered the "Cast Point" phase. This will start a Timer with a Duration set to your caster's Art - Cast Point field (modifiable in the Object Editor). Once that Timer expires, the Ability will "start it's effect", assuming that the target (if any) is still within Cast Range. There's a buffer range of 300.00 to allow some leeway here (see Gameplay Constants -> Spells - Target Motion Allowance). This Event should NOT be used to detect when a Hero successfully casts an ability and is instead focused on preparing the cast. Every single ability-related Event Response is available here.

Begins Channeling: I forget all of the details, but as the name implies, this is meant to be used with Channeled abilities like Earthquake as well as anything that uses Casting Time to delay the ability. Casting Time is actually considered "channeling" and fires this Event. I imagine you'd want to rely on this Event over "Begins Casting" when channeling something this way, as it likely occurs when Casting Time has started rather than finished. Every single ability-related Event Response is available here.

Starts The Effect Of An Ability: Your Hero has finished it's "Cast Point" phase, the Timer has expired, and the ability has been confirmed as a 100% successful cast. Any effects like launching a Missile (ie: Storm Bolt) will have occurred at this phase. Mana cost has been spent, Cooldown has started, etc. This will be your go-to Event for custom triggered spells most of the time. Every single ability-related Event Response is available here.

Stops Casting: Your Hero has either manually cancelled their cast with a new Order like "Stop" or has been Stunned, Silenced, or disabled in some way that interrupts spellcasting. This cancels and destroys the "Cast Point" timer and your Hero is now free to do something else. No costs have been paid. You no longer have access to the (Target unit of ability being cast) or anything targeting related.

Finishes Casting: I forget all of the details, but it's behavior is basically like "Stops Casting" but only runs if "Starts The Effect" has occurred prior. This one can actually be completely bypassed in certain cases and is not reliable outside of Channeling abilities. You no longer have access to the (Target unit of ability being cast) or anything targeting related.

So if you want to interrupt an ability or skip it's animations/cooldown/mana cost then use Begins Casting. If you want your trigger to sync up with the ability without any issues then use Starts The Effect. Exceptions may apply for Channeled abilities. Also, I mentioned Heroes in this explanation but this applies to any kind of Unit. Furthermore, setting a unit's Art - Cast Point to 0.00 may cause different results since there is no delay.
 
Last edited:
Pyro mentioned this but you want to use Starts the effect of an ability.

Finishes Casting is almost NEVER the Event you want to use and really only comes in handy for determining that you've finished a full channeling of a spell like Earthquake for example. Begins Casting is not reliable either and if you're using this then your triggered spells are likely heavily abusable/buggy. You can try this for yourself, begin casting a triggered spell and then immediately interrupt it with a "Stop" order, repeat this process and watch as your trigger repeatedly fires while the ability never spends any mana/goes on cooldown.
My bad. I had in mind the start effect of an ability but my tongue (fingers ?) twisted.
 
Last edited:
Top