Community Forum

Lua call stack

Forum Overview >> Farming Simulator 19

CategoryFarming Simulator 19
Created25.03.2019 16:59


Sven M. (fsven) (SvenFendt13) 25.03.2019 16:59
Hello,
I have a Lua call stack problem with the Vestas WIn Turbine since Patch 1.3, but I can't fix it. Here is the log:
2019-03-23 17:55 Warning (script): 'getRotation': Argument 1 has wrong type. Expected: Int. Actual: Nil
2019-03-23 17:55 ..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (791): expectedType == Value::VoidType || expectedType == Value::ClassType
2019-03-23 17:55 LUA call stack:
2019-03-23 17:55 dataS/scripts/shared/scenegraph.lua (18) : getRotation
2019-03-23 17:55 dataS/scripts/placeables/WindTurbinePlaceable.lua (160) : rotate
2019-03-23 17:55 dataS/scripts/network/NetworkNode.lua (98) : update
2019-03-23 17:55 dataS/scripts/network/Server.lua (58) : updateActiveObjects
2019-03-23 17:55 dataS/scripts/BaseMission.lua (1500) : update
2019-03-23 17:55 dataS/scripts/FSBaseMission.lua (1971) : update
2019-03-23 17:55 dataS/scripts/missions/mission00.lua (469) : update
2019-03-23 17:55 dataS/scripts/main.lua (1863) : update
2019-03-23 17:55 Error: Running LUA method 'update'.
2019-03-23 17:55 dataS/scripts/shared/scenegraph.lua(19) : attempt to perform arithmetic on local 'x' (a nil value)
Can anyone help me with this?
PS: It could be, that I wrote this Thread a second time, because I can't find the first thread anymore.

Bilbo Beutlin (BBeutlin) 27.03.2019 03:27
Take a mod which works, eg. the wind turbine on ModHub.

If you examine this and compare with your faulty mod you'll probably get an idea what's wrong.

Sven M. (fsven) (SvenFendt13) 27.03.2019 16:31
So, now I compared it with the turbine from the ModHub. Also I compared it with a turbine from a other website. But I still could not find the mistake. Besides, I have no idea what to look for. Unfortunately I can't find out the Fault from the Log as a not too experienced person in the modding area.

Bilbo Beutlin (BBeutlin) 27.03.2019 23:23
Because the call stack on
"dataS/scripts/shared/scenegraph.lua (18) : getRotation"
I'd guess the node to rotation is missing or wrong.
Double-check by comparing i3d and xml.

Sven M. (fsven) (SvenFendt13) 28.03.2019 21:12
So now I added the line <windTurbine headNode="0" rotationNode="0|0" /> in the xml file and the call stack is fixed. But the rotation speed is much higher than I set it with the meshRotateShader than before I added this line. For me it's to fast.

Sven M. (fsven) (SvenFendt13) 28.03.2019 21:26
So now I added the line <windTurbine headNode="0" rotationNode="0|0" /> in the xml file and the call stack is fixed. But the rotation speed is much higher than I set it with the meshRotateShader than before I added this line. For me it's to fast.

Bilbo Beutlin (BBeutlin) 28.03.2019 22:51
Try with xml attribute 'headRotation'.
See LUADOC Placeables -> WindTurbinePlaceable.

Sven M. (fsven) (SvenFendt13) 29.03.2019 21:15
I am sorry to have to ask this question, but where exactly should I use 'headrotation' in this line:
<windTurbine headNode="0" rotationNode="0|0" /> ?
Or do I have to add as a single attribute?
Since I have not really dealt with LUADOC, I do not know how to apply it, I'm sorr.y


Bilbo Beutlin (BBeutlin) 29.03.2019 22:10
Example:
<windTurbine headNode=".." rotationNode=".." headRotation="0.5" />
where '0.5' halves the rotation speed.

Sven M. (fsven) (SvenFendt13) 29.03.2019 23:46
I've added it, but it doesn't work...

Bilbo Beutlin (BBeutlin) 30.03.2019 06:25
Ok - wrong assumption. The 'headRotation' is the value stored in savegame.

There's no other xml attribute read by the lua, so you have to fiddle around with the shader parameters.

Sven M. (fsven) (SvenFendt13) 30.03.2019 15:58
Have now specified the sound as the rotationNode. Thus, the rotor rotates normally and the error is corrected.
Thank you for everything Bilbo Beutlin!!!


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