Community Forum

autoLoadWood

Forum Overview >> Scripting

CategoryScripting
Created31.05.2019 12:42


Andrei Sprinseana (xsenio) 31.05.2019 12:42
Greetings, there are 2 trailers for the forest, I really like them, I’m already fed up with loading the wood, I wanted to register auto-loading on them, but on one everything works and the second doesn’t work, although the registrations are identical, it has been checked many times. It always gives such an error.

Warning (script): 'setTranslation': Argument 3 has wrong type. Expected: Float. Actual: Nil
..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (791): expectedType == Value::VoidType || expectedType == Value::ClassType
LUA call stack:
=D:/Documents/My Games/FarmingSimulator2019/mods/trailer2/Script/autoLoadWood.lua (757) : setTranslation
=D:/Documents/My Games/FarmingSimulator2019/mods/trailer2/Script/autoLoadWood.lua (227) : updateLoad
dataS/scripts/vehicles/SpecializationUtil.lua (30)
dataS/scripts/vehicles/Vehicle.lua (659) : raiseEvent
dataS/scripts/i3d/I3DManager.lua (71) : asyncCallbackFunction
dataS/scripts/vehicles/Vehicle.lua (333) : loadSharedI3DFile
dataS/scripts/BaseMission.lua (753) : load
dataS/scripts/BaseMission.lua (868) : loadVehicle
dataS/scripts/BaseMission.lua (846) : loadVehiclesAtPlaceStep
dataS/scripts/shop/BuyVehicleEvent.lua (102) : loadVehiclesAtPlace
dataS/scripts/network/Connection.lua (77) : run
dataS/scripts/gui/ShopController.lua (253) : sendEvent
dataS/scripts/gui/ShopConfigScreen.lua (1588) : update
dataS/scripts/gui/base/Gui.lua (608) : update
dataS/scripts/main.lua (1859) : update
Warning (script): 'setScale': Argument 1 has wrong type. Expected: Float. Actual: Nil
..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (791): expectedType == Value::VoidType || expectedType == Value::ClassType
LUA call stack:
=D:/Documents/My Games/FarmingSimulator2019/mods/trailer2/Script/autoLoadWood.lua (758) : setScale
=D:/Documents/My Games/FarmingSimulator2019/mods/trailer2/Script/autoLoadWood.lua (227) : updateLoad
dataS/scripts/vehicles/SpecializationUtil.lua (30)
dataS/scripts/vehicles/Vehicle.lua (659) : raiseEvent
dataS/scripts/i3d/I3DManager.lua (71) : asyncCallbackFunction
dataS/scripts/vehicles/Vehicle.lua (333) : loadSharedI3DFile
dataS/scripts/BaseMission.lua (753) : load
dataS/scripts/BaseMission.lua (868) : loadVehicle
dataS/scripts/BaseMission.lua (846) : loadVehiclesAtPlaceStep
dataS/scripts/shop/BuyVehicleEvent.lua (102) : loadVehiclesAtPlace
dataS/scripts/network/Connection.lua (77) : run
dataS/scripts/gui/ShopController.lua (253) : sendEvent
dataS/scripts/gui/ShopConfigScreen.lua (1588) : update
dataS/scripts/gui/base/Gui.lua (608) : update
dataS/scripts/main.lua (1859) : update
Warning (script): 'setScale': Argument 1 has wrong type. Expected: Float. Actual: Nil
..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (791): expectedType == Value::VoidType || expectedType == Value::ClassType
LUA call stack:
=D:/Documents/My Games/FarmingSimulator2019/mods/trailer2/Script/autoLoadWood.lua (760) : setScale
=D:/Documents/My Games/FarmingSimulator2019/mods/trailer2/Script/autoLoadWood.lua (227) : updateLoad
dataS/scripts/vehicles/SpecializationUtil.lua (30)
dataS/scripts/vehicles/Vehicle.lua (659) : raiseEvent
dataS/scripts/i3d/I3DManager.lua (71) : asyncCallbackFunction
dataS/scripts/vehicles/Vehicle.lua (333) : loadSharedI3DFile
dataS/scripts/BaseMission.lua (753) : load
dataS/scripts/BaseMission.lua (868) : loadVehicle
dataS/scripts/BaseMission.lua (846) : loadVehiclesAtPlaceStep
dataS/scripts/shop/BuyVehicleEvent.lua (102) : loadVehiclesAtPlace
dataS/scripts/network/Connection.lua (77) : run
dataS/scripts/gui/ShopController.lua (253) : sendEvent
dataS/scripts/gui/ShopConfigScreen.lua (1588) : update
dataS/scripts/gui/base/Gui.lua (608) : update
dataS/scripts/main.lua (1859) : update
Warning (script): 'setScale': Argument 1 has wrong type. Expected: Float. Actual: Nil
..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (791): expectedType == Value::VoidType || expectedType == Value::ClassType
LUA call stack:
=D:/Documents/My Games/FarmingSimulator2019/mods/trailer2/Script/autoLoadWood.lua (771) : setScale
=D:/Documents/My Games/FarmingSimulator2019/mods/trailer2/Script/autoLoadWood.lua (228) : updateUnload
dataS/scripts/vehicles/SpecializationUtil.lua (30)
dataS/scripts/vehicles/Vehicle.lua (659) : raiseEvent
dataS/scripts/i3d/I3DManager.lua (71) : asyncCallbackFunction
dataS/scripts/vehicles/Vehicle.lua (333) : loadSharedI3DFile
dataS/scripts/BaseMission.lua (753) : load
dataS/scripts/BaseMission.lua (868) : loadVehicle
dataS/scripts/BaseMission.lua (846) : loadVehiclesAtPlaceStep
dataS/scripts/shop/BuyVehicleEvent.lua (102) : loadVehiclesAtPlace
dataS/scripts/network/Connection.lua (77) : run
dataS/scripts/gui/ShopController.lua (253) : sendEvent
dataS/scripts/gui/ShopConfigScreen.lua (1588) : update
dataS/scripts/gui/base/Gui.lua (608) : update
dataS/scripts/main.lua (1859) : update

Bilbo Beutlin (BBeutlin) 31.05.2019 15:35
Backtrace the errors for the given source code lines in 'autoLoadWood.lua'.
I'd guess there are missing certain TG's in the vehicle.i3d - or maybe wrong node assignment in the vehicle.xml.

Andrei Sprinseana (xsenio) 31.05.2019 16:17
Bilbo thanks for responding, but it’s written exactly the same way on the first trailer both in XML and in i3D it is assigned the same way, but on the first one it works and on the second one it doesn’t work either.

Andrei Sprinseana (xsenio) 31.05.2019 16:20
it works

https://ibb.co/F8r3f8J


<dynamicMountAttacher triggerNode="dynamicMountTrigger" rootNode="odaz9370" jointNode="odaz9370" forceAcceleration="30"/>
<AutoLoadWood SizeY="5" SizeX="10" Speed="500">
<woodTrigger xOff="1.2" yOff="-3" zOff="1.5" />
<fillPose xOff="0" yOff="2" zOff="0" />
<unloadPose xOff="0" yOff="5" zOff="0" />
<limitToLen minLen="2.5" maxLen="21" delimbOk="0" />
</AutoLoadWood>
<loadMarker node="loadMarker"/>
<unloadMarker node="unloadMarker"/>

<tensionBelts>
<tensionBeltsConfigurations>
<tensionBeltsConfiguration>
<tensionBelts linkNode="belt" jointNode="odaz9370" width="0.075" maxEdgeLength="0.1" geometryBias="0.01" ratchetPosition="0.2" defaultOffset="-0.25" defaultOffsetSide="0.1" defaultHeight="2.75" interactionRadius="1.5" totalInteractionRadius="6.5" activationTrigger="beltActivationTrigger">
<tensionBelt startNode="0>8|1|0" endNode="0>8|1|0|0" offsetLeft="0.95"/>
<tensionBelt startNode="0>8|1|1" endNode="0>8|1|1|0"/>
<tensionBelt startNode="0>8|1|2" endNode="0>8|1|2|0"/>
<tensionBelt startNode="0>8|1|3" endNode="0>8|1|3|0"/>
<tensionBelt startNode="0>8|1|4" endNode="0>8|1|4|0"/>
<tensionBelt startNode="0>8|1|5" endNode="0>8|1|5|0"/>
<tensionBelt startNode="0>8|1|6" endNode="0>8|1|6|0"/>
<tensionBelt startNode="0>8|1|7" endNode="0>8|1|7|0"/>
<tensionBelt startNode="0>8|1|8" endNode="0>8|1|8|0" offsetRight="0.8"/>
</tensionBelts>
</tensionBeltsConfiguration>
<tensionBeltsConfiguration />
</tensionBeltsConfigurations>
</tensionBelts>

<!--Configurable options for EasyAutoLoad-->
<easyAutoLoad objectsIndex="ealObjectsIndex" triggersIndex="ealTriggersIndex" markerPositionsIndex="ealMarkerPositionsIndex" markerIndex="ealMarkerIndex" triggerAnimation="moveTrigger" centerMarkerIndex="1" unloadHeightOffset="-0.75">
<levelBarOptions coloredIcons="true" iconColor="0.6307 0.6307 0.6307 1" fillLevelColor="0.991 0.3865 0.01 1"/>
<palletIcon colorIcon="text/pallet.png" overlayIcon="text/palletIconOverlay.png"/>
<roundBaleIcon colorIcon="text/roundBale.png" overlayIcon="text/roundBaleIconOverlay.png"/>
<squareBaleIcon colorIcon="text/squareBale.png" overlayIcon="text/squareBaleIconOverlay.png"/>
<weightIcon colorIcon="text/weightIcon.png" overlayIcon="text/weightIconOverlay.png"/>
<moveableMarkerOptions minX="0 3 -25 -25" maxX="0 25 25 -3" minY="0 0.08 0.08 0.08 " maxY="0 15 15 15" minZ="0 -20 -30 -20" maxZ="0 20 -16 20" markerMoveSpeed="0.05"/>
</easyAutoLoad>

<ai>
<allowTurnBackward value="false"/>
<turningRadiusLimitation radius="8"/>
</ai>

<baseMaterial>
<material name="Flatbet" baseNode="0>8">
<shaderParameter name="colorMat0" value="0.3 0.08 0.06"/>
</material>
<material name="Stoika" baseNode="0>7|0">
<shaderParameter name="colorMat0" value="0.3 0.08 0.06"/>
</material>
<material name="Plastina" baseNode="0>2|16|0|0">
<shaderParameter name="colorMat6" value="0.3 0.08 0.06"/>
</material>
</baseMaterial>

<baseMaterialConfigurations>
<baseMaterialConfiguration material="0" color="0.3 0.08 0.06" />
<baseMaterialConfiguration material="0" color="0 0.21 0.37" />
<baseMaterialConfiguration material="0" color="0.18 0.23 0.21" />
<material name="Flatbet" shaderParameter="colorMat0" />
<material name="Stoika" shaderParameter="colorMat0" />
<material name="Plastina" shaderParameter="colorMat6" />
</baseMaterialConfigurations>

<foliageBending>
<bendingNode minX="-1.3" maxX="1.3" minZ="-4.5" maxZ="5.5" yOffset="0.6" />
</foliageBending>

<wearable wearDuration="480" workMultiplier="5" fieldMultiplier="2"/>
<washable dirtDuration="90" washDuration="1" workMultiplier="3" fieldMultiplier="2"/>

<i3dMappings>
<i3dMapping id="odaz9370" node="0>"/>
<i3dMapping id="dynamicMountTrigger" node="0>8|5"/>
<i3dMapping id="beltActivationTrigger" node="0>8|1|9"/>
<i3dMapping id="autoLoadWood" node="0>8|6"/>
<i3dMapping id="autoLoadWoodBegin" node="0>8|7"/>
<i3dMapping id="loadMarker" node="0>8|8" />
<i3dMapping id="unloadMarker" node="0>8|9" />

<i3dMapping id="belt" node="0>8|1" />
<i3dMapping id="AttacherJoint" node="0>6" />

<i3dMapping id="ealObjectsIndex" node="0>8|4|1" />
<i3dMapping id="ealTriggersIndex" node="0>8|4|3" />
<i3dMapping id="ealMarkerPositionsIndex" node="0>8|4|2" />
<i3dMapping id="ealMarkerIndex" node="0>8|4|0" />
</i3dMappings>

Andrei Sprinseana (xsenio) 31.05.2019 16:20
this does not work

https://ibb.co/dGmssS2

<dynamicMountAttacher triggerNode="dynamicMountTrigger" rootNode="Polupritep" jointNode="Polupritep" forceAcceleration="30"/>
<AutoLoadWood SizeY="5" SizeX="10" Speed="500">
<woodTrigger xOff="1.2" yOff="-3" zOff="1.5" />
<fillPose xOff="0" yOff="2" zOff="0" />
<unloadPose xOff="0" yOff="5" zOff="0" />
<limitToLen minLen="2.5" maxLen="21" delimbOk="0" />
</AutoLoadWood>
<loadMarker node="loadMarker"/>
<unloadMarker node="unloadMarker"/>

<tensionBelts>
<tensionBeltsConfigurations>
<tensionBeltsConfiguration>
<tensionBelts linkNode="belt" jointNode="Polupritep" width="0.075" maxEdgeLength="0.1" geometryBias="0.01" ratchetPosition="0.2" defaultOffset="-0.25" defaultOffsetSide="0.1" defaultHeight="2.75" interactionRadius="1.5" totalInteractionRadius="6.5" activationTrigger="beltActivationTrigger">
<tensionBelt startNode="0>4|1|0" endNode="0>4|1|0|0" offsetLeft="0.95"/>
<tensionBelt startNode="0>4|1|1" endNode="0>4|1|1|0"/>
<tensionBelt startNode="0>4|1|2" endNode="0>4|1|2|0"/>
<tensionBelt startNode="0>4|1|3" endNode="0>4|1|3|0"/>
<tensionBelt startNode="0>4|1|4" endNode="0>4|1|4|0"/>
<tensionBelt startNode="0>4|1|5" endNode="0>4|1|5|0"/>
<tensionBelt startNode="0>4|1|6" endNode="0>4|1|6|0"/>
<tensionBelt startNode="0>4|1|7" endNode="0>4|1|7|0"/>
<tensionBelt startNode="0>4|1|8" endNode="0>4|1|8|0" offsetRight="0.8"/>
</tensionBelts>
</tensionBeltsConfiguration>
<tensionBeltsConfiguration />
</tensionBeltsConfigurations>
</tensionBelts>

<!--Configurable options for EasyAutoLoad-->
<easyAutoLoad objectsIndex="ealObjectsIndex" triggersIndex="ealTriggersIndex" markerPositionsIndex="ealMarkerPositionsIndex" markerIndex="ealMarkerIndex" triggerAnimation="moveTrigger" centerMarkerIndex="1" unloadHeightOffset="-0.75">
<levelBarOptions coloredIcons="true" iconColor="0.6307 0.6307 0.6307 1" fillLevelColor="0.991 0.3865 0.01 1"/>
<palletIcon colorIcon="text/pallet.png" overlayIcon="text/palletIconOverlay.png"/>
<roundBaleIcon colorIcon="text/roundBale.png" overlayIcon="text/roundBaleIconOverlay.png"/>
<squareBaleIcon colorIcon="text/squareBale.png" overlayIcon="text/squareBaleIconOverlay.png"/>
<weightIcon colorIcon="text/weightIcon.png" overlayIcon="text/weightIconOverlay.png"/>
<moveableMarkerOptions minX="0 3 -25 -25" maxX="0 25 25 -3" minY="0 0.08 0.08 0.08 " maxY="0 15 15 15" minZ="0 -20 -30 -20" maxZ="0 20 -16 20" markerMoveSpeed="0.05"/>
</easyAutoLoad>

<ai>
<allowTurnBackward value="false"/>
<turningRadiusLimitation radius="8"/>
</ai>

<foliageBending>
<bendingNode minX="-1.2" maxX="1.2" minZ="-2.9" maxZ="3.7" yOffset="0.6" />
</foliageBending>

<wearable wearDuration="480" workMultiplier="5" fieldMultiplier="2"/>
<washable dirtDuration="90" washDuration="1" workMultiplier="3" fieldMultiplier="2"/>

<i3dMappings>
<i3dMapping id="Polupritep" node="0>"/>
<i3dMapping id="dynamicMountTrigger" node="0>4|4"/>
<i3dMapping id="beltActivationTrigger" node="0>4|1|9"/>
<i3dMapping id="autoLoadWood" node="0>4|5"/>
<i3dMapping id="autoLoadWoodBegin" node="0>4|6"/>
<i3dMapping id="loadMarker" node="0>4|7" />
<i3dMapping id="unloadMarker" node="0>4|8" />

<i3dMapping id="belt" node="0>4|1" />
<i3dMapping id="AttacherJoint" node="0>0|3" />

<i3dMapping id="ealObjectsIndex" node="0>4|3|1" />
<i3dMapping id="ealTriggersIndex" node="0>4|3|3" />
<i3dMapping id="ealMarkerPositionsIndex" node="0>4|3|2" />
<i3dMapping id="ealMarkerIndex" node="0>4|3|0" />
</i3dMappings>

Bilbo Beutlin (BBeutlin) 31.05.2019 17:15
Check the xml tag 'AutoLoadWood' - usually the tags begin lower case -> 'autoLoadWood'?
XML is case-sensitive.

Second I'm not sure both autoloaders 'autoLoadWood' AND 'easyAutoLoad' will work together without conflicts.

Andrei Sprinseana (xsenio) 31.05.2019 17:36
So at the first works.


first <type name="lesovoz" parent="baseTipper" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
<specialization name="dynamicMountAttacher" />
<specialization name="autoLoadWood2" />
</type>
<type name="platforma" parent="baseTipper" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
<specialization name="easyAutoLoader" />
</type>

second <type name="lesovoz1" parent="baseTipper" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
<specialization name="dynamicMountAttacher" />
<specialization name="autoLoadWood2" />
</type>
<type name="platforma1" parent="baseTipper" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
<specialization name="easyAutoLoader" />
</type>

Andrei Sprinseana (xsenio) 31.05.2019 17:40
Made through vehicleTypeConfigurations

Andrei Sprinseana (xsenio) 05.06.2019 09:00
Everything turned out, slightly edited the script and earned. The topic can be closed.

Boo Yeah (Buckhorn2) 16.10.2020 15:28
Sorry to revive an old thread but Andrei can you recall what you edited in the script to get it to work. I am having a similar issue with the autoloadwood script. It works perfectly on one vehicle and when i added it to the second vehicle its not functioning. everything shows up, except the show position shows up as 862m away from my truck. I tried everything, there is no errors in the log pertaining to the autoload.


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