Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#544127 15/08/14 07:48 PM
Joined: Jul 2014
E
Errebor Offline OP
stranger
OP Offline
stranger
E
Joined: Jul 2014
Hi modders.

Is it possible to write a script that is forcing an object to rotate around x axis? If so, please write an example. And analogously what with the counterclockwise rotation?

Thanks for reading and hopefuly replying.

Errebor #544143 15/08/14 09:25 PM
Joined: Jul 2014
Location: Finland
journeyman
Offline
journeyman
Joined: Jul 2014
Location: Finland
It is possible but not very easy. There is a call to make object rotating around global Y-axis very easily. However, rotating around other axes is more problematic and less practical.

Here's a code for X-Axis rotation:

Code

Init Section:
// -------------------------------

MyGlobalAngle(0.0);
TimerLaunch("Rotate", 33);


KB Section:
// -------------------------------

PROC IncrementAngle()
AND MyGlobalAngle(_angle)
AND RealSum(_angle, 0.017, _new_angle)
THEN 
NOT MyGlobalAngle(_angle);
MyGlobalAngle(_new_angle);


IF TimerFinished("Rotate")
AND ItemGetHandle(ITEM_HUS_TEST_2, _Handle)
AND ItemGetPosition(ITEM_HUS_TEST_2, _x, _y, _z)
AND MyGlobalAngle(_angle)
THEN
TimerLaunch("Rotate", 33);
ItemHandleToTransform(_Handle, _x, _y, _z, 0.0, 0.0, _angle, 1, CHARACTER_Player1);
IncrementAngle();

Last edited by BioSpirit; 15/08/14 09:27 PM.
Errebor #544447 16/08/14 03:01 PM
Joined: Jul 2014
E
Errebor Offline OP
stranger
OP Offline
stranger
E
Joined: Jul 2014
This way you can modify every angle any way you want. Thank you very much. You right that rotating around other axes is more problematic and less practical.


Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5