Community Forum

problems with the conversion script

Forum Overview >> Scripting

CategoryScripting
Created02.11.2016 23:29


Seby Sdfkz (sdfkz) 02.11.2016 23:44
I have a problem with the way the script to convert from fs 15 in fs17. FS15 script works but does not work fs17 conversion I did with giants editor

Lua script:

greiferfurca = {};

function greiferfurca.prerequisitesPresent(specializations)
return SpecializationUtil.hasSpecialization(Attachable, specializations);
end;

function greiferfurca:load(savegame)


local rotationNode1 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.rotation1#index"));
if rotationNode1 ~= nil then
self.rotation1 = {};
self.rotation1.node = rotationNode1;
local x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.rotation1#minRot"));
self.rotation1.minRot = {};
self.rotation1.minRot[1] = Utils.degToRad(Utils.getNoNil(x, 0));
self.rotation1.minRot[2] = Utils.degToRad(Utils.getNoNil(y, 0));
self.rotation1.minRot[3] = Utils.degToRad(Utils.getNoNil(z, 0));
x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.rotation1#maxRot"));
self.rotation1.maxRot = {};
self.rotation1.maxRot[1] = Utils.degToRad(Utils.getNoNil(x, 0));
self.rotation1.maxRot[2] = Utils.degToRad(Utils.getNoNil(y, 0));
self.rotation1.maxRot[3] = Utils.degToRad(Utils.getNoNil(z, 0));
self.rotation1.rotTime = Utils.getNoNil(getXMLString(xmlFile, "vehicle.rotation1#rotTime"), 2)*1000;
self.rotation1.touchRotLimit = Utils.degToRad(Utils.getNoNil(getXMLString(xmlFile, "vehicle.rotation1#touchRotLimit"), 10));
end;


Error LOG:

C:/Users/sdfkz/Documents/My Games/FarmingSimulator2017/mods/greifer_furca/greiferfurca1.i3d (15.54) ms
Warning: Missing schema overlay for 'vehicle.attacherJoints.attacherJoint(0)' in 'C:/Users/sdfkz/Documents/My Games/FarmingSimulator2017/mods/greifer_furca/greiferfurca.xml'
Warning: Missing schema overlay for 'vehicle.attacherJoints.attacherJoint(1)' in 'C:/Users/sdfkz/Documents/My Games/FarmingSimulator2017/mods/greifer_furca/greiferfurca.xml'
Warning (LUA): 'getXMLString': Argument 1 has wrong type. Expected: Int. Actual: Nil
..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (604): expectedType == Value::VoidType
LUA call stack:
=C:/Users/sdfkz/Documents/My Games/FarmingSimulator2017/mods/greifer_furca/greiferfurca.lua (15) : getXMLString
=dataS/scripts/vehicles/Vehicle.lua (0)
=dataS/scripts/BaseMission.lua (0) : load
=dataS/scripts/BaseMission.lua (0) : loadVehicle
=dataS/scripts/shop/BuyVehicleEvent.lua (0) : loadVehiclesAtPlace
=dataS/scripts/network/Connection.lua (0) : run
=dataS/scripts/gui/ShopScreen.lua (0) : sendEvent
=dataS/scripts/gui/ShopConfigScreen.lua (0) : update
=dataS/scripts/gui/elements/Gui.lua (0) : update
=dataS/scripts/main.lua (0) : update
Warning (LUA): 'getXMLString': Argument 1 has wrong type. Expected: Int. Actual: Nil
..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (604): expectedType == Value::VoidType
LUA call stack:
=C:/Users/sdfkz/Documents/My Games/FarmingSimulator2017/mods/greifer_furca/greiferfurca.lua (33) : getXMLString
=dataS/scripts/vehicles/Vehicle.lua (0)
=dataS/scripts/BaseMission.lua (0) : load
=dataS/scripts/BaseMission.lua (0) : loadVehicle
=dataS/scripts/shop/BuyVehicleEvent.lua (0) : loadVehiclesAtPlace
=dataS/scripts/network/Connection.lua (0) : run
=dataS/scripts/gui/ShopScreen.lua (0) : sendEvent
=dataS/scripts/gui/ShopConfigScreen.lua (0) : update
=dataS/scripts/gui/elements/Gui.lua (0) : update
=dataS/scripts/main.lua (0) : update
Warning (LUA): 'getXMLString': Argument 1 has wrong type. Expected: Int. Actual: Nil
..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (604): expectedType == Value::VoidType
LUA call stack:


please help me! Thanks!


Samuel H. (modelleicher) 03.11.2016 12:27
Hello,

Giants Editor conversion does not convert custom scripts, so you have to do it manually.

First of all, you need to replace all the "xmlFile" with "self.xmlFile"

Other than that the load() function should be fine. For the rest of the script you basically have to test if it runs and if not go look at the errors and compare to FS17 default scripts.. (some variables and tables have changed position, name, or are completely replaced by others)







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