HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

SetUnitFacing failing after many calls?

12-24-2010, 04:20 AM#1
rogueteddybear
I am animating a moving projectile, so on a timer interval of about .025, i use SetUnitFacing on a dummy to rotate it.

The dummy unit rotates fine for a while but then seems to set its own facing to something like 320.0 and slowly decreases afterwards. I should note that this happens even when the rotate angle value is the same the whole time!

So does SetUnitFacing really fail after many calls on the same unit? Is there a way to prevent/get around this?

EDIT: I've discovered that the dummy unit i use for the effect suddenly takes control of itself and moves towards the coordinates (0,0) (center of the map).
Why he does this I have no idea.

EDIT2: For some reason, i've discovered that the dummy unit is recieving a point order from player 15 to move to the center of the map. I have no idea how or why.
12-24-2010, 10:32 AM#2
Anitarf
Try giving the dummy unit to one of the regular players instead of player 15.
12-24-2010, 05:14 PM#3
jrhetf4xb
And, in most cases, if your missiles/units start charging the center of the map it is very possible that you are accessing null or incorrect data.
12-24-2010, 05:23 PM#4
Anitarf
Ah, right, perhaps this isn't a problem with some innate behaviour of player 15, but a trigger issue instead. Try hooking all calls to functions that issue target orders and print a debug message if any of those functions are used on a projectile unit. If the debug messages appear, it's definitely a trigger issue.
12-24-2010, 06:21 PM#5
rogueteddybear
That is interesting. What I did to solve this was to use the object data for a dummy unit from Vexorian's xe caster system. I'm not sure what option there helped me fix it.

Although the incorrect data access is still probably happening. Also I'm not issuing point orders to the dummy unit, I am only setting its position/rotation.