HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Fix Ground Unit Relationship With Ground After It Was A Flying Unit?

03-04-2007, 03:12 AM#1
Brash
I have a character that is a ground unit that morphs into a flying unit and then back after a duration is reached.. which works fine in most cases but if i fly the unit over top of other units or trees or unpathable areas the flying unit will not display regular animation as he changes back to ground unit.. and then suddenly he is now his ground unit form again but is hovering at the same height as when he was in flying form


so then i thought to do something like this:

Trigger:
Collapse Wait until ((Unit-type of CastUnitVar ) Equal to GroundUnit ), checking every 0.10 seconds
Unit - Turn collision for CastUnitVar Off
Unit - Add Crow Form (Dummy Spell) to CastUnitVar
Animation - Change CastUnitVar flying height to (Default flying height of CastUnitVar) at 100000000.00
Unit - Remove Crow Form (Dummy Spell) from CastUnitVar
Unit - Turn collision for CastUnitVar On
Collapse Else - Actions
Do nothing

and that works fine at leveling him out again.. but there still is a problem


When walking on uneven surfaces.. such as hills.. his selection circle doesn't level itself with terrain any more and he moves as if he has no roll or pitch (guessing) .. and parts of his feet are sometimes going into the ground.

If i recast the spell and morph back into the flying unit.. and then back again in an area where i can land with no objects in the way or pathing problems then it fixes him.

is there a way i can right him without having to re-morph and land properly?
03-04-2007, 03:17 AM#2
Ammorth
When it attempts to morph back (or right before), teleport the unit to a spot where it can land (use blink effects to make it look fancy). Just make sure it doesn't get stuck inside a group of trees.
03-04-2007, 03:28 AM#3
Brash
Quote:
Originally Posted by Ammorth
When it attempts to morph back (or right before), teleport the unit to a spot where it can land (use blink effects to make it look fancy). Just make sure it doesn't get stuck inside a group of trees.


that in addition to my code or do i not need to run that?
03-04-2007, 05:02 AM#4
Av3n
Well yes you would have to check if there are trees (or anything that gets in the way) otherwise it'll get stuck

-Av3n