• 🏆 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] Mass Polymorph

Status
Not open for further replies.
Level 5
Joined
Aug 24, 2010
Messages
133
Please help with a simple spell using channel then creating a dummy to polymorph every unit in range.

For some reason only the first unit picked is polymorphed.
I tried making floating text appear above units its picked and it does appear over every unit.
I also tried making the dummy visible and taking off locust and there is only 1 dummy created.

  • Mass Polymorph
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Mass Polymorph (hero)
    • Actions
      • Set temp_point = (Position of (Triggering unit))
      • Unit Group - Pick every unit in (Units within (600.00 + (300.00 x (Real((Level of Mass Polymorph (hero) for (Triggering unit)))))) of (Position of (Triggering unit))) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an ally of (Triggering player)) Not equal to True
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Unit - Create 1 dummy for (Triggering player) at temp_point facing Default building facing degrees
              • Unit - Add Polymorph Dummy to (Last created unit)
              • Unit - Set level of Polymorph Dummy for (Last created unit) to (Level of Mass Polymorph (hero) for (Triggering unit))
              • Unit - Order (Last created unit) to Human Sorceress - Polymorph (Picked unit)
              • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
              • Custom script: call RemoveLocation (udg_temp_point)
            • Else - Actions
 
Level 24
Joined
Feb 28, 2007
Messages
3,480
My instinct says the problem lies with your custom script.
Your removing the tempPoint location, thus removing the location at which the next dummies should be created.
Put the custom script below the loop and you should be fine.

Also, use "A unit starts the effect of an ability" instead of "begins casting" for your event. If you want to know why, search, it's been talked about a million times already.
 
Level 5
Joined
Aug 24, 2010
Messages
133
Thanks, you were right.
I thought that everytime you create a unit at a point it creates a new location and removing the location doesn't matter because you're referencing a variable point not the created location.
Also thanks for pointing out the event, it was meant to be starts an effect.
 
Level 11
Joined
Nov 15, 2007
Messages
781
Thanks, you were right.
I thought that everytime you create a unit at a point it creates a new location and removing the location doesn't matter because you're referencing a variable point not the created location.
Also thanks for pointing out the event, it was meant to be starts an effect.

You're destroying the point the variable is referencing, so the variable will be nulled in the process.
 
Status
Not open for further replies.
Top