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

[Solved] Help with Mass Polymorph

Level 21
Joined
Dec 3, 2020
Messages
524
So I know people have made this thread many times but I tried copying from others' solutions and nothing seems to work...
I already have a working custom Entangling Roots ability working with dummy units, using Faerie Fire as a base spell.

For the Mass Polymorph spell I am using Dispel Magic as a base spell and it it used inside a Spell Book (non heroic spell; not item).
And yes, the dummy unit is set up correctly, since it works for my other ability (entangling roots)

And yes, the Polymorph ability that the dummy uses does not require the upgrade and the dummy has enough mana and cast range and vision.

PS: the units seem to turn into sheep for a milisecond? At least the sheep sound is made when Mass Polymorph is being cast and the little cloud that appears when a unit is being transformed appears.
The duration for heroes and non heroes is 20 seconds of the Polymorph...

My trigger:

  • Events
    • Unit - A unit Starts the effect of an ability
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability being cast) Equal to Mass Polymorph
  • Actions
    • if (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • if - Conditions
      • Then - Actions
        • Set MassPolymorphPoint = (Target point of ability being cast)
        • Set MassPolymorphGroup = (Units within 150.00 of MassPolymorphPoint matching (((Matching unit is A ground unit) Equal to True))
        • Unit Group - Pick every unit MassPolymorphGroup and do (Actions)
          • Loop - Actions
            • Unit - Create 1 Dummy Unit for Player 2 (Blue) at MassPolymorphPoint facing Default building facing degrees
            • Unit - Add Polymorph to Last created unit
            • Unit - Order (Last created unit) to Human Sorceress - Polymorph (Picked unit)
            • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
        • Custom script: call RemoveLocation (udg_MassPolymorphPoint)
        • Custom script: call DestroyGroup (udg_MassPolymorphGroup)
      • Else- Actions
        • Do nothing
 
Last edited:
Level 21
Joined
Dec 3, 2020
Messages
524
I just tested it without the "if" and now the units don't even get turned to sheep for even a milisecond...
I am using a custom spell for the dummy unit based on the Neutral Hostile Polymorph.

I shall create the dummy unit for Neutral Hostile instead, let's see if it works.
Edit: again, it works but only for 0.01 seconds??? Why... how???
The polymorph is set to 20 seconds in the object editor. I am using it on ghouls with nothing custom added to them that would prevent the spell to work.

Edit 2: perhaps it is because Dispel Magic is removing the Polymorph from them... Let me give it a 0.50 seconds delay at the beginning of the actions lol

Edit 3: yeah!!! it works, it was Dispel Magic (the base spell of Mass Polymorph) actually dispelling the Polymorph from all the units :xxd:
Note to self: use Death and Decay

But thank you so much! You made me think "outside" the box :-D
I will replace it with Death and Decay since I actually don't want it dispelling anything. Or perhaps I can modify the targets allowed to None?
Would that prevent Dispel Magic from affecting any units?

1 question sir, the spell does not seem to affect level 1 Water Elemental (any water elementals), why?
Wow it redirects the polymorph from the Water Elemental on a nearby unit, even outside of the AoE. What?!?!
As a matter of fact, it does not work on any summoned units...
I even removed the Matching conditions. I did:
  • Set MassPolymorphGroup = (Units within 200.00 of MassPolymorphPoint)
And it does not affect summoned units...

Please help!

PS: I will just replace Dispel Magic with Death and Decay but tomorrow since I go sleep now.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
You must be looking at older threads. Your trigger should look like this:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Mass Polymorph
  • Actions
    • Set MassPolymorphPoint = (Target point of ability being cast)
    • Set MassPolymorphGroup = (Units within 150.00 of MassPolymorphPoint matching (((Matching unit is A ground unit) Equal to True))
    • Unit - Create 1 Dummy Unit for (Triggering player) at MassPolymorphPoint facing Default building facing degrees
    • Set MassPolymorphDummy = (Last created unit)
    • Unit - Add Polymorph to MassPolymorphDummy
    • Unit - Add a 0.20 second Generic expiration timer to MassPolymorphDummy
    • Unit Group - Pick every unit MassPolymorphGroup and do (Actions)
      • Loop - Actions
        • Unit - Order MassPolymorphDummy to Human Sorceress - Polymorph (Picked unit)
    • Custom script: call RemoveLocation (udg_MassPolymorphPoint)
    • Custom script: call DestroyGroup (udg_MassPolymorphGroup)
Note that your Unit Group only cares if the units are "A ground unit". This means that you're ordering your Dummy to cast Polymorph on:
Structures, Magic Immune, Mechanical, Invulnerable, Dead units (not good!), etc.

Luckily, Warcraft 3 is designed in a way that this probably won't be an issue since Polymorph cannot target these units anyway, so the Dummy will simply get the "You cannot target that" error. But you should definitely take this into consideration and fix it!

Next you need to create a proper Dummy unit, which I'm almost certain you don't have because the majority of info on Dummy units is wrong.
  1. Copy and paste the Locust (Undead/Special). This comes with the Locust ability and is designed specifically for this purpose.
  2. Modify the Model to use Vexorian's custom Dummy model. This is useful for Art/Special Effect related stuff as it's hidden and has the needed attachment points. Alternatively, you can type an invalid path like "none" in the Custom field to give it an empty model.
  3. Set it's Shadow and Attacks Enabled to None so it doesn't bite anyone.
  4. Set it's Movement Type to None and Speed Base to 0. This is necessary for the Dummy to cast spells "instantly".

With these settings the Dummy unit can be used in all of your triggers and can cast ANY number of spells at any time, assuming those spells don't have some kind of Channeling time.

Finally, you want to look at the ability you're telling the Dummy unit to cast. It needs 99999 cast range, 0 mana cost, 0 cooldown, proper Targets Allowed, and NO requirements. A good debugging practice is to give the Dummy ability to a Footman under your control and see if he can cast it in-game. This should tell you what's going wrong almost immediately.

I know this sounds conceited but if you need up to date info then I suggest looking for one of my posts. "Hiveworkshop Uncle X topic" gets the job done on Google. Unfortunately, people got a lot of things wrong in the early days of Warcraft 3 and that info stuck and is still used today.
 
Last edited:
Level 20
Joined
Feb 27, 2019
Messages
593
Could polymorph be hardcoded not to work on summoned units? If so there may be a gameplay constant that can change that.

If the dummy cant cast polymorph on a target could the neutral hostile AI then decide to cast it on another nearby unit? You could create the dummy for owner of triggering unit instead and see if that helps.

I dont think Death and decay is a good ability to base the spell on because its a channeling ability. Changing dispels targets allowed to none should work.
 
Level 21
Joined
Dec 3, 2020
Messages
524
Could polymorph be hardcoded not to work on summoned units? If so there may be a gameplay constant that can change that.

If the dummy cant cast polymorph on a target could the neutral hostile AI then decide to cast it on another nearby unit? You could create the dummy for owner of triggering unit instead and see if that helps.

I dont think Death and decay is a good ability to base the spell on because its a channeling ability. Changing dispels targets allowed to none should work.
I'm about to find out if polymorph can target summoned units.
And you are right, I will use Dispel Magic since it's not a channeled ability.

Love your name btw :xxd:

EDIT: you are right! Polymorph cannot target summoned units... OOF
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
I'm about to find out if polymorph can target summoned units.
And you are right, I will use Dispel Magic since it's not a channeled ability.

Love your name btw :xxd:
Polymorph has a Maximum Creep Level of 5 by default. Just set it to 99 like Hex does so it can target anything regardless of Level. These two abilities are coded exactly the same as far as I understand.
 
Level 21
Joined
Dec 3, 2020
Messages
524
Polymorph has a Maximum Creep Level of 5 by default. Just set it to 99 like Hex does so it can target anything regardless of Level. These two abilities are coded exactly the same as far as I understand.
Doesn't work. I shall just use Hex and make the units transformed use the sheep not a frog lol

According to battle.net site: "You can only use Polymorph on Creeps level 5 and below. Polymorph can be dispelled! Polymorph changes a unit's normal armor type to "Medium" armor type while they are in the form of a sheep. Polymorph will not work on Summoned units."

"Hex does not affect summoned units. Hexed units move at speed 100. Hex can be used to interrupt spells that require spell channeling."
Oof...

Tested: hex doesn't target summoned units

So, @Uncle, any ideas? I'd really like it to work on summoned units.

Hmm since the base spell is Dispel Magic, I could just make it so it deals X damage to summoned units, apart from Polymorphing the non summoned ones.
But a solution would be great!
But wait, then Dispel Magic will just remove the polymorph from the units lol. I will try setting 200 damage with None as targets.
Yeah doesn't work as expected oof.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
Doesn't work. I shall just use Hex and make the units transformed use the sheep not a frog lol

According to battle.net site: "You can only use Polymorph on Creeps level 5 and below. Polymorph can be dispelled! Polymorph changes a unit's normal armor type to "Medium" armor type while they are in the form of a sheep. Polymorph will not work on Summoned units."

"Hex does not affect summoned units. Hexed units move at speed 100. Hex can be used to interrupt spells that require spell channeling."
Oof...

Tested: hex doesn't target summoned units

So, @Uncle, any ideas? I'd really like it to work on summoned units.

Hmm since the base spell is Dispel Magic, I could just make it so it deals X damage to summoned units, apart from Polymorphing the non summoned ones.
But a solution would be great!
But wait, then Dispel Magic will just remove the polymorph from the units lol. I will try setting 200 damage with None as targets.
Yeah doesn't work as expected oof.
You could make it damage summoned units so it at least does something to them. Otherwise, I don't see a solution without weird side effects.
 
Level 21
Joined
Dec 3, 2020
Messages
524
You could make it damage summoned units so it at least does something to them. Otherwise, I don't see a solution without weird side effects.
Well it will not work because this means Dispel Magic will dispel the Polymorph from the non summoned units :sad:.

Maybe manually removing the summon classification from units in the area before casting the spell would work
I will try this yeah! I will also test what happens if I give them back the summon classification while they're polymorphed.
If it bugs out I shall just remove it and return if after X time (X being the duration of the Polymorph; 30 seconds in my case).
Will just add all units with the summon class to a unit group, then remove the class then add it back to the units of the unit group.
Easy as pie.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
Well it will not work because this means Dispel Magic will dispel the Polymorph from the non summoned units :sad:.


I will try this yeah! I will also test what happens if I give them back the summon classification while they're polymorphed.
If it bugs out I shall just remove it and return if after X time (X being the duration of the Polymorph; 30 seconds in my case).
Will just add all units with the summon class to a unit group, then remove the class then add it back to the units of the unit group.
Easy as pie.
You just trigger the damage. If (Picked unit) is summoned -> Deal X damage
 
Level 21
Joined
Dec 3, 2020
Messages
524
This. Solved.
set IsSummoned = false
if unit is summoned
set IsSummoned = true
remove classification summoned
endif
order dummy to cast ability
if IsSummoned = true
add classification summoned
endif
Worked flawlessly!
I created a summonedGroup unit group variable though.
Before the dummy uses the ability i check if the unit is summoned, remove the classification, add it to this summonedGroup unit group and then
I pick all units in that unit group after the dummy has cast polymorph on all the units and then just add the summoned classification to these units.
The units stay polymorphed which is good (even when I give them back the summoned classification).
 
Top