HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Unit Facing Problem

08-29-2008, 10:49 PM#1
Karawasa
Hey Guys,

I am trying to move a unit and have it face another direction instantly. The code I am using is:

Collapse JASS:
call SetUnitPosition(Leak,udg_SpawnX[i],udg_SpawnY[i])
call SetUnitFacing(Leak,270.)

The unit is at 90* when it leaks, and as you can see should be set to 270* when moved. What happens though is the unit turns around to face 270*, and so there is a weird and useless animation.

Any ideas?
08-29-2008, 10:59 PM#2
rulerofiron99
Replace the unit.
08-29-2008, 11:11 PM#3
Karawasa
That is what I have been doing. However, it seems like an extremely inefficient method to create a new unit, run all the processes involved(damage detection system etc.), and destroy the old when you could just move the unit.
08-29-2008, 11:44 PM#4
Bobo_The_Kodo
You can't change the facing instantaneously.
08-30-2008, 12:23 AM#5
midiway
try remove 'Amov' ability and then call SetUnitTurnSpeed().

more info here
08-30-2008, 12:51 AM#6
Karawasa
Quote:
Originally Posted by midiway
try remove 'Amov' ability and then call SetUnitTurnSpeed().

more info here

Interesting, but that is for dummy units only? They need to continue moving, would readding 'Amov" undo this fix?
08-30-2008, 03:46 AM#7
DioD
'Amov' removal is permanent and cannot be undo.

There is no way to do "near instant" turning without changing object data.
08-30-2008, 04:10 AM#8
midiway
I've made some test combining a lot of thing: remove amov, add chaos ability, instant timers..., but wasn’t successful, couldn't get instant fancing


ps: removing Amov and then readding doesn't readd the unit movement, but you can workaround using chaos ability
08-30-2008, 07:24 AM#9
ToukoAozaki
try using SetUnitFacingTimed with duration of 0.

Collapse common.j:
native          SetUnitFacingTimed  takes unit whichUnit, real facingAngle, real duration returns nothing

I don't think you can get it real instant, though.
08-30-2008, 09:16 AM#10
DioD
ToukoAozaki
Test functions\code before posting...
08-30-2008, 09:19 AM#11
Troll-Brain
Quote:
Originally Posted by Litany
Without importing a custom model that is.
And how can you edit a model for doing that ?
08-30-2008, 09:21 AM#12
DioD
set turning speed to 1.00 in object editor and orientation interpolation to some negative value (or zero).

You will need model with head bone and then lock unit facing, it instant.
08-30-2008, 06:13 PM#13
Troll-Brain
orientation interpolation == propWin ? (Display value as ...)