SetAngle, axis, float_enum_angle
SetAngle, z, 30
Object_ID->Setangle, z, 25
This function sets the object to a specific world angle. Axis is x, y, or z. The float value sets the angle (in degrees) of the calling object to that value. This always refers to the local coordinate system the object is currently in.
Note: According to console test, this does not affect Actors. With Tribunal, this function accepts local float variables, but only within the currently active cells. This is relevant for exteriors, you can not move objects an arbitrary distance, the target location must be within the active cells (current cell of player plus surrounding cells). (Forum info / reposted by Srikandi). For actors, see the "Face, x, y" function.
Notes (by Simpleton):
SetAngle doesn't work how sfd says it does. My guess is nobody ever noticed before because nobody ever uses it with the X or Y axis, which is where it gets funky. I wasn't going to explain how it worked because it's long and complicated and nobody but me cares, but I've got time to kill and there's always a chance somebody will run across this problem and need help.
Probably the oddest thing about SetAngle, X/Y is that neither have anything to do with the X or Y axis'. Luckily they do have a system to them that, with a bit of imagination, isn't too hard to understand. The way I found easiest to understand was to imagine a protractor with an arm being held up at a bit of an angle, so that flat side is on the table and the curved part is about 45 degrees off the table. The angle between the table and the protractor is y, and the angle of the arm on the protractor is x.
There are a couple differences, one being that if you set y to 0 the "protractor" is pointing straight up, and a positive x actually goes down instead of up (i.e. the "arm" would go down into the table). So if you set all the angles to 0 and then add 1 to x each frame the object would spin in a vertical circle that is moving down while it's pointing at you. But, if y is 90 (protractor is lying flat on the table) then adding 1 to x each frame would spin the object around the z axis.
Interestingly in the last example if you were to add 1 to *z* each frame you would get the same results. That's because while what changing x does depends on the angle in y and vise versa, changing z always does the same thing: spin the object around the z axis.
So, there ya go, and even if you don't understand what I said, you have to give me credit for pulling that picture of a protractor out of my a**.
(ManaUser:)
I'm afraid I don't understand the protractor analogy but the worst thing about SetAngle is that it doesn't always save right. Particularly when an object has been rotated on more than one axis, I've noticed it facing some wonky direction after reloading.