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

Facing Angle

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
Creating a new unit is not a problem, but the problem is, the unit is a Hero.

I know you can imitate it by creating a dummy that have the same model as the Hero but meh, I would like the unit itself without new ones.

building transformation/root.
Demonstrate ?
Never heard of this before - perhaps I'm outdated, lol.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Ok, countless hours were spent to come to the final conclusion that its just not possible. I tried everything that came to my mind, which was a lot..

Those turning functions can turn the unit instantly, the problem is that there will always be an animation of turning.

Best you can do is to transform your hero via this to a 0 ms unit, and then turn it like you would turn a building like this
JASS:
function SetImmovableUnitFacing takes unit u, real a returns nothing
    call SetUnitPosition(u, GetUnitX(u), GetUnitY(u))
    call SetUnitFacing(u, a)
endfunction

The backdraw of this method is that you have to wait ~0.5 seconds to transform your hero back to its original state, else you will see the parts of the turning animation.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
The backdraw of this method is that you have to wait ~0.5 seconds to transform your hero back to its original state, else you will see the parts of the turning animation.
Without using this method, we have to wait that exact amount of time to see the complete turn animation.
So I think it's pointless.
 
Level 12
Joined
Oct 10, 2009
Messages
438
Eh, the way I remember working around this was using the "Unit custom value" or a hashtable to store the units implied facing angle, that way I could use it to calculate everything based off that angle.

I'm not sure if this is too relevant tho
 
Status
Not open for further replies.
Top