HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Polymorph

01-04-2008, 07:41 PM#1
TheXenocide
Is there a way to polymorph a unit, and still have the unit remember its current order. In my case I want it to remember where it was moving to. I have tried:
Trigger:
Humility Copy
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Autocast (Humility)
Collapse Actions
Unit - Order (Triggering unit) to Human Sorceress - Polymorph (Target unit of ability being cast)
Wait 1.00 seconds
Unit - Order (Target unit of ability being cast) to Move To (Center of DPRegion[(Integer(((Attacked unit)'s custom real value)))])
Wait 10.00 seconds
Unit - Order (Target unit of ability being cast) to Move To (Center of DPRegion[(Integer(((Attacked unit)'s custom real value)))])

The first order is so that the unit walks toward the endpoint while it's polymorphed, the second order is so that it walks toward the endpoint after the polymorph effect ends. However, this doesn't work, the unit will walk to a random point then turn around and walk backward.
01-04-2008, 08:07 PM#2
rain9441
Attacked Unit isn't anything, you'd have to use Target unit of ability being cast.

Target unit of ability being cast simply becomes nothing the second you use a wait.

I use a better solution for that same problem.

Whenever a unit starts the effects of polymorph (or entangle or whatever abilities do this), add the unit to a global group. Have a timer that runs evert 0.50 seconds and just loops through the global group ordering them to move to center of region[value] etc. If the current order of the unit you are looping through is "move" then remove it from the group.

Also be sure to make sure all your units that will be polymorphed are set to Stats - Can Flee = false, if you don't want them running every which way.
01-04-2008, 08:52 PM#3
Strilanc
Using locals makes a whole lot more sense than a global unit group.

You need to store the caster and target in local unit variables, then you can use waits with glee.
01-04-2008, 10:39 PM#4
TheXenocide
Thanks rain, that worked great! As for the "unit is attacked" that was a mistake that got copied over from another trigger.