HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

SetUnitFacing and SetUnitFacingTimed

03-30-2004, 10:00 PM#1
Vexorian
Apparently, at least for me, there is no way to change a unit's facing angle inmediatelly, they always take a good time to turn, is there a fix for that? (this is giving me three headaches)
03-31-2004, 02:02 AM#2
Grater
Funny that I've been using "SetUnitFacing" and friends for ages it's a central part of my spellcaster system. Just use 0 for the time parameter (if the function has one).
03-31-2004, 05:19 AM#3
PitzerMike
Quote:
Originally Posted by Lord Vexorian
Apparently, at least for me, there is no way to change a unit's facing angle inmediatelly, they always take a good time to turn, is there a fix for that? (this is giving me three headaches)

SetUnitFacing is a pisser. It doesn't only take time to turn.
It will also stop turning when it nears the given angle to 12.5 degrees. You won't get any closer to the exact angle you want. Of course one could do some calculating and add/subtract 12.5 deg to/from the angle you really want...

But no, for your first prob I don't know any fixes
03-31-2004, 11:47 PM#4
Grater
I see. It's a graphical thing. It seems that when you turn a unit with a trigger, it's immediately considered to be pointing that direction, for purposes like spellcasting or attacking (and probably moving), but the animation if smoothed out so it looks like it takes time to turn... because I only ever used turn unit on dummy units I always assumed it was instant...
I can see how this could be a bother if you want it to look like the unit if facing a particular direction...
04-01-2004, 08:06 AM#5
Cubasis
It is, atleast in the cinematics i've worked on, this can be a pain. When you need to have conversations and stuff. :/

If you find something out or sumtin, plz report.

tnx

Cubasis
04-02-2004, 09:18 PM#6
Vexorian
I tested way a lot of things, even temporary changing the turn rate, none worked
04-03-2004, 04:31 AM#7
Narwanza
Hey, I just thought of something. Instead of having the unit actually turn, why not emulate it? Have you ever drawn those triangles where you connect lines that are across from each other and when all the lines are drawn there is the illusion of a curve? Why not make a function that removes the current unit, and replaces him with one in the exact same spot but facing 1 more degree towards where you want him to be. Then loop it however fast it would be needed to make him face the right direction in the given amount of time. It would simulate turning, but yet not be turning allowing a person to 'turn' a unit in an extremely short amount of time.
04-03-2004, 12:35 PM#8
Cubasis
lol Narwanza.

That would be HORRIBLY inefficient :) lol. As then every time it moves, it has to destroy a unit, and create (allocate memory, fill it, create visuals, blah) a new unit... heh.

AND you'd need to capture the new handle of the unit and put it in all the variables you need. So that wouldn't really help.

There must be some way to do this simpler.

Cubasis
04-03-2004, 01:34 PM#9
Narwanza
At least I came up with a solution that would work........
04-03-2004, 09:42 PM#10
Vexorian
Quote:
Originally Posted by Narwanza
Hey, I just thought of something. Instead of having the unit actually turn, why not emulate it? Have you ever drawn those triangles where you connect lines that are across from each other and when all the lines are drawn there is the illusion of a curve? Why not make a function that removes the current unit, and replaces him with one in the exact same spot but facing 1 more degree towards where you want him to be. Then loop it however fast it would be needed to make him face the right direction in the given amount of time. It would simulate turning, but yet not be turning allowing a person to 'turn' a unit in an extremely short amount of time.
The problem is that I am in need for a fix for this because I want to recicle casters when creating projectiles instead of creating new casters for projectiles