PDA

View Full Version : Need help changing unit's movement type


maracujah
12-05-2010, 04:23 PM
Hello everyone,

I need help changing the movement type of a unit from foot to flying and vice-cersa. I haven't seen anything like "Unit - Change movement type" in the Actions list of the trigger editor.

The purpose of this is to make a unit go through obstacles when I order the unit to move to a point through triggers.

I have tried using the Unit - Turn Collision On/Off, but even though the unit will go through obstacles if I mannualy order it to, it will go aroung them if I order through triggers. After finding this out, I figured changing the unit's movement type would be the best solution.

I have also tried to do it by using a morph spell, and setting the Normal Form Unit to the unit whose movement type I want to change, and the Alternate Form Unit to a copy of it, but with a different movement type. This caused a fatal error when testing the map.

I am unsure if this can be done with Custom Scripts, as I lack any JASS skills.

Tr!KzZ
12-05-2010, 04:43 PM
I think the common way would be replacing the units..

Just create two units, one with flying as movement type and the other normal as foot.
And then replace the units with each other, should work without problems..

I also don't think there's some trigger for changing movement types.. I've never seen some..

maracujah
12-05-2010, 06:40 PM
Thank you! Replacing units worked perfectly. I had completely ignored that possibility.

Raven0
12-05-2010, 06:58 PM
Alternatively you could add the crow form ability to the unit using the [Unit - Add Ability] function. That will make it flying (you'd have to set it's flying height manually using the [Animation - Set Unit Flying Height] function)

priest170234
12-06-2010, 04:26 AM
Alternatively you could add the crow form ability to the unit using the [Unit - Add Ability] function. That will make it flying (you'd have to set it's flying height manually using the [Animation - Set Unit Flying Height] function)

About that... If it lasts more than a second.. Users may find it annoying to see that ability in their ability icon spaces.