getSubobjectAngle(ship_object, sobj_name, angle_type)
setSubobjectAngle(ship_object, sobj_name, angle_type, angle)
explanation:
the first 2 vars in both functions are pretty much self explanitory. angle_type is a string, if set to "absolute" returns the angle of sobj in world angles (degrees in a vector object), "ship" returns the angle in ship coords, and "parent" retuns the angles sobj-parent relative. only the first function returns the coords, the second one sets them with angle, a vector object, in whatever mode angle_type is set to. the functions need to be pretty fast as id intend to use them on a frame by frame basis.
why
to allow scripting of player operated turrets, blindfire, complex animation, working pilot controls, 3d indicators, and many other intresting ideas that havent even crossed my mind yet.
why not just use animation code:
because it can be cumbersome to use it for complicated animations, also it restricts you a handfull of binary trigger events. you dont get persise control on a frame by frame basis. my idea means you can do very complex animation, with very little code. also it frees up coders from needing to implement another trigger event every time a modder gets another cool idea.