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

New to Editor- How to make Ensnare stun?(trigger/ability editing help)

Status
Not open for further replies.
Level 1
Joined
Jan 16, 2015
Messages
3
I originally tried adding "Stunned" then"Stunned(Pause)" to the "buff" area, the place where ensnare(ground) and ensnare(Air) are, but that did nothing.

Now I'm trying to make a trigger:
upload_2020-4-1_23-35-50.png

Either are not working so I'm not sure what to do.
 

Attachments

  • upload_2020-4-1_23-33-28.png
    upload_2020-4-1_23-33-28.png
    9.4 KB · Views: 31
Level 28
Joined
Feb 18, 2014
Messages
3,576
Replace (Targeted unit) with (Target unit of ability being cast) instead. However, you should know that if you pause the target like that you can no longer unpause after. This is how it should be :
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Ensnare
    • Actions
      • Set Temp_Integer = (Temp_Integer + 1)
      • Set MyTarget[Temp_Integer] = (Target unit of ability being cast)
      • Unit - Pause MyTarget[Temp_Integer]
      • Wait 5.00 seconds
      • Set Temp_Recycle = (Temp_Recycle + 1)
      • Unit - Unpause MyTarget[Temp_Recycle]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Recycle Equal to Temp_Integer
        • Then - Actions
          • Set Temp_Integer = 0
          • Set Temp_Recycle = 0
        • Else - Actions
 
Level 3
Joined
Mar 21, 2020
Messages
35
- Setting the movement speed to 0 and type to NONE doesn't work: units will still move a tiny bit

- "movement" is an ability, you can't access it with normal triggers or the object editor but you can remove them with custom scripts or (v)JASS:
  • Actions
    • Custom script: call UnitRemoveAbilityBJ( 'Amov', GetLastCreatedUnit() )
    • Custom script: call UnitRemoveAbilityBJ( 'ARal', GetLastCreatedUnit() )
    • Custom script: call UnitRemoveAbilityBJ( 'Aatk', GetLastCreatedUnit() )
    • Custom script: call UnitRemoveAbilityBJ( 'Adef', GetLastCreatedUnit() )
- However, you can't add them back with "UnitAddAbility" (it's a problem that has been around for a while). A workaround is by removing the unit and spawning a new one, but this means you're might have to store some real variables (unit properties such as health and mana) to reset the newly created unit back to it's previous one
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
Note that you should most likely use "A unit starts the effect of an ability" as your Event. This is because Begins casting an ability will fire the trigger regardless of whether the ability actually goes off. For instance, if you issue a Stop command immediately after you begin casting the ability, the trigger will run, but the ability won't go on cooldown.

Anyway, in order to create an effect like this you should learn how to use Dummy units. A dummy unit is a unit based on the Undead's Locust. This unit is useful because it has the Locust ability, which makes the unit unselectable and therefore "hidden" if setup properly. I attached a map with a Dummy unit that you can copy and then paste into your own map.

And here's how you can make Ensnare "stun" using a Dummy unit.

After importing the Dummy unit, create a new ability ability based on Storm Bolt and modify it so:
1) It has no missile art and it's missile speed is the same as Ensnares.
2) It has 0 damage, 0 mana cost, 99999 cast range, and the same Targets Allowed as Ensnare.
This way the Dummy will be able to cast it.

Then create this trigger:
  • Ensnare Stun
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ensnare
    • Actions
      • Unit - Create 1 DUMMY for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Add STUN ABILITY to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
How it works:
So when our unit casts Ensnare we create an invisible/unselectable Dummy unit at the position of the casting unit. This Dummy is given the custom Storm Bolt ability we made and ordered to cast it targeting the Ensnare target. This results in the target getting hit by 2 abilities, your Ensnare ability, and the Storm Bolt ability, causing the target to be both ensnared and stunned.

Note that this trigger leaks a Point. This isn't something I would worry about just yet, but once you're more experienced with the editor you should look up Memory Leaks and see how you can design your triggers to avoid them.
 

Attachments

  • Dummy Uncle.w3x
    16.1 KB · Views: 20
Last edited:
Level 12
Joined
Jan 30, 2020
Messages
875
After trying different methods over and over again, I can confirm that the method @Uncle is suggesting is the best when it comes to add a stun effect.

I just wanted to add, for those interested, that the best way to get an AOE stun effect is not using multiple dummies, but a single dummy with a modified Cluster Rockets ability.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
@Macadamia
Yeah, this is the easiest solution imo, the only issues I can imagine are related to Spell Shield interactions and the fact that it will give two buffs (Stunned + Ensnare).

Also, maybe the Cluster Rocket method is more efficient, but I just wanted to add that you can use a single Dummy unit for an AOE stun. If the Dummy unit is setup properly it can cast multiple spells like this just fine:
  • Actions
    • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      • Loop - Actions
        • Unit - Order DUMMY to Human Mountain King - Storm Bolt (Picked unit)
 
Level 12
Joined
Jan 30, 2020
Messages
875
I hear you there.

But thats just because I tried the multiple storm bolt cast method and encountered a few issues that I investigated for a better AOE stun and finally chose Cluster Rocket for my map.

Buuuttt : Cluster Rockets was only really needed in my case because I wanted the stun to be an area of effect lasting 25s and I wanted new entering units to get stun.

I want to say that this works amazingly without any extra trigger than the basic trigger ordering the dummy to cast the spell and giving it a timed life equal to the duration of the AOE stun effect.

Of course this would be a bad method if you only want the AOE stun to affect the units in range only at the moment the ability is cast.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
Gotcha. Either is fine depending on what you need.

Anyway, I've just been trying to spread information about Dummy units because I noticed that a lot of people are using them incorrectly. It's not their fault though, almost all of the info out there regarding Dummy units is incorrect or dated. Same goes for the "A unit begins casting an ability"/"A unit is attacked" events, people don't realize that they can be abused/exploited.
 
Level 12
Joined
Jan 30, 2020
Messages
875
I share the same view.

It is definitely understandable that people get confused with the casting events, but usually with experience , they will know exactly when to use BEGIN CASTING or STARTS THE EFFECT OF AN ABILITY.

I guess we all have to go through these to end up understanding how things really work :)
 
Level 1
Joined
Jan 16, 2015
Messages
3
Wow, the amount of help was really unexpected. Thanks. I implemented and tested every one of the triggers you all suggested.


In the end I combined the two, Warseeker's method to cycle through magic immunity so that Uncle's dummy's storm bolt stuns magic immune targets.

upload_2020-4-2_23-40-50.png


upload_2020-4-3_0-56-11.png


Not perfect (magic immune units are targetable while ensnared), but this works.
Thanks everyone!
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
@BorderDragon
If you set the Storm Bolt ability to a Hero ability and set the Required level to 6 it will pierce through Magic Immunity. This is because it will be considered an Ultimate ability.

Also, I'd try to avoid using Pause/Unpause whenever possible. It has a lot of unwanted side effects in regards to buffs, animations, and other issues.

If I were you I'd scrap that 2nd trigger and stick with my Dummy setup, implementing the fix I just mentioned to make it work against magic immune.
 
Status
Not open for further replies.
Top