• 🏆 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] One of my spell ain't working...

Status
Not open for further replies.
Level 5
Joined
Jul 14, 2008
Messages
121
My spell is a entangling roots aoe, which roots every enemy unit in 300 distance. Made from Cluster Rocket.

  • Entangling Roots
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Entangling Roots
    • Actions
      • Special Effect - Create a special effect at (Target point of ability being cast) using AncientExplode.mdx
      • Unit Group - Pick every unit in (Units within 300.00 of (Target point of ability being cast) matching (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Entangling Roots Dummy for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
          • Unit - Set level of Entangling Roots Effect for (Last created unit) to (Level of Entangling Roots for (Casting unit))
          • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Entangling Roots (Picked unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
It only roots 1 unit randomly.

{EDIT 1}
My spell is a entangling roots aoe, which roots every enemy unit in 300 distance. Made from Cluster Rocket.

  • Entangling Roots
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Entangling Roots
    • Actions
      • Special Effect - Create a special effect at (Target point of ability being cast) using AncientExplode.mdx
      • Unit Group - Pick every unit in (Units within 300.00 of (Target point of ability being cast) matching (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Entangling Roots Dummy for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
          • If ((Level of Entangling Roots for (Casting unit)) Greater than or equal to 1) then do (Unit - Set level of Entangling Roots Effect for (Last created unit) to (Level of Entangling Roots for (Casting unit))) else do (Do nothing)
          • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Entangling Roots (Picked unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
It only roots 1 unit randomly.

{EDIT 2}
I'm sorry for dual post...
 
Last edited by a moderator:
Level 11
Joined
Feb 22, 2006
Messages
752
Nice, two duplicate threads and a double post in under an hour...

I can't figure out why your code is only randomly entangling one unit, but then again I learned a long time ago that I can't trust GUI to do what it's supposed to do.

There are numerous other problems with your trigger, though.

Don't use unit starts casting an ability, use unit starts the effect of an ability.

You are leaking locations every time you ask for the spell target location. To fix this, make a global location var and save the spell target location to that variable. Once you are done using it, remove it.

You are leaking a special effect. Save it to a global and destroy it when you are done with it (if the model has no animations, then you can destroy it immediately after creating it).

You are also leaking a unit group and a boolexpr, not to mention you aren't taking unit collision into account when selecting your targets.

To fix the group leak, insert this line before the pick every unit action:
Custom Script: set bj_wantDestroyGroup = true

There's really no way to fix the boolexpr leak in GUI, so unless you want to convert to JASS, you're out of luck.

Finally, stop using Casting Unit. Use Get Triggering Unit. It will return the same unit and it's faster.
 
Level 3
Joined
Jul 23, 2008
Messages
29
I might be wrong, but putting all leaks aside, it's impossible for the dummy to cast ER on multiple units at the same time, due to the cooldown of the spell.
Setting its cooldown to 0 might work, but I'm not sure whether you've done that already. If WC3 spells have Global Cooldown, like in WoW (do they?), then I seriously don't know the solution.
 
Level 3
Joined
Jul 23, 2008
Messages
29
From what I can understand, it only creates 1 dummy at the Position of Casting unit. If he changed it to Picked unit, it would create a dummy for every unit picked.
Isn't it so?
 
Level 6
Joined
May 5, 2008
Messages
210
I may knom the problem.
First: Check Range. If Entagle has less range than Cluster Rockets the units can´t cast in the 1 sec livetime.
Second: Check Angle. At les set turn angle of dummy unit to 3, better creat the dummy facing the picked unit.
Third: Check cast time. Set cast piont and the cast backswing point to 0 sec or it will leak.
I hope it hepls you.
 
Level 3
Joined
Jul 23, 2008
Messages
29
That's what I said Dr. Boom, but I think he already solved it, using aznricepuff's method.
 
Status
Not open for further replies.
Top