Community Forum

ssetRotation () or setTranslation () with movingTools?

Forum Overview >> Scripting

Created27.10.2017 00:04

Bricktop Jr (Bricktop) 27.10.2017 00:04
Is there a possibility to use setRotation () or setTranslation () with movingTools?
It seems as the positions were only taken over when movingTool is moved (via mouse or key input).
I have tried alternatives with the result: Cylindered.setToolRotation ()/setToolTranslation taken over the values directly.
The problem is: it doesnt work with values of positions.
I would be grateful for alternative suggestions. Greetings

found a solution can be closed. Thx

Kenny Je (kenny456) 02.11.2017 18:38
what solutions you found? I need to move movingtool by a lua script.

Bricktop Jr (Bricktop) 02.11.2017 20:06
VALUE = the changed value
OBJECT = the vehicle

TOOL = the movingTool
^^get like this ('for i, TOOL in pairs(OBJECT.movingTools) do')

for rotation:
(after "setRotation")

if TOOL.delayedNode then
TOOL.curDelayedRot[TOOL.rotationAxis] = VALUE;
TOOL.delayedUpdates = 2;
Cylindered.setDelayedNodeRotation(OBJECT, TOOL);

for translation:
(after "setTranslation")

if TOOL.delayedNode then
TOOL.curDelayedTrans[TOOL.translationAxis] = VALUE;
TOOL.delayedUpdates = 2;
Cylindered.setDelayedNodeTranslation(OBJECT, TOOL);

this fixed my problem.

LUADOC/Script v1.4.4.0/Specializations/Cylindered/postLoad
LUADOC/Script v1.4.4.0/Specializations/Cylindered/setToolRotation
LUADOC/Script v1.4.4.0/Specializations/Cylindered/setToolTranslation


Note: Log in to post. Create a new account here.