Page 1 of 1

LUA Error

Posted: Thu Oct 26, 2017 5:03 pm
by jagular77
Can anyone explain what an LUA error is and how I can figure out how to solve it?

FYI I am a pretty experienced player and I understand how MODs affect the game. I use the same mods in two different saved games and only one has an LUA error. I have tried inserting Mods one at a time to see which one does it, but it appears that this is something that does not happen right away and I am not convinced it is a Mod error which is why I am posting on the technical forum.

I am new to this forum, so if I need to post elsewhere please let me know, but I am hoping you guys can help. Since the log file is long I am posting only the error messages for now, if I delete the log file these errors don't even show up in the new log file right away, and also the error doesn't appear to point to a Mod. any help you can give would be very much appreciated.

Error: index out of range
LUA call stack:
dataS/scripts/utils/Utils.lua (11) : printCallstack
dataS/scripts/utils/Utils.lua (56) : checkChildIndex
dataS/scripts/vehicles/specializations/Lights.lua (59) : indexToObject
dataS/scripts/vehicles/specializations/Lights.lua (227) : loadLights
dataS/scripts/vehicles/Vehicle.lua (627)
dataS/scripts/utils/Utils.lua (1138) : asyncCallbackFunction
Index: 0>33|0|5|0
Error: index out of range
LUA call stack:
dataS/scripts/utils/Utils.lua (11) : printCallstack
dataS/scripts/utils/Utils.lua (56) : checkChildIndex
dataS/scripts/vehicles/specializations/Lights.lua (59) : indexToObject
dataS/scripts/vehicles/specializations/Lights.lua (237) : loadLights
dataS/scripts/vehicles/Vehicle.lua (627)
dataS/scripts/utils/Utils.lua (1138) : asyncCallbackFunction
Index: 0>33|1|5|0
Error: index out of range
LUA call stack:
dataS/scripts/utils/Utils.lua (11) : printCallstack
dataS/scripts/utils/Utils.lua (56) : checkChildIndex
dataS/scripts/vehicles/specializations/Lights.lua (59) : indexToObject
dataS/scripts/vehicles/specializations/Lights.lua (227) : loadLights
dataS/scripts/vehicles/Vehicle.lua (627)
dataS/scripts/utils/Utils.lua (1138) : asyncCallbackFunction
Index: 0>33|0|5|1
Error: index out of range
LUA call stack:
dataS/scripts/utils/Utils.lua (11) : printCallstack
dataS/scripts/utils/Utils.lua (56) : checkChildIndex
dataS/scripts/vehicles/specializations/Lights.lua (59) : indexToObject
dataS/scripts/vehicles/specializations/Lights.lua (237) : loadLights
dataS/scripts/vehicles/Vehicle.lua (627)
dataS/scripts/utils/Utils.lua (1138) : asyncCallbackFunction
Index: 0>33|1|5|1

Re: LUA Error

Posted: Fri Oct 27, 2017 12:44 am
by Smith Modding
It mean your xml is pointing to an incorrect index number. It could be for animations or lights, and the xml doesn't have the right index and is throwing that error to alert you about it. Do you mind posting your vehicle.xml here?

Re: LUA Error

Posted: Fri Oct 27, 2017 1:22 am
by jagular77
I don't see a vehicle.xml, but i do see a vehicleshader.xml is that the one?

Re: LUA Error

Posted: Fri Oct 27, 2017 1:29 am
by Smith Modding
The vehicle.xml is named whatever the mod is called, usually. It's normally in the main file of the mod, like this:
Image

Re: LUA Error

Posted: Fri Oct 27, 2017 3:40 am
by jagular77
Right, but I have 100 or so mods in the folder and this LUA issue does not point to any particular mod. So that is why I am having the issue figuring out where this LUA error comes from.

Re: LUA Error

Posted: Fri Oct 27, 2017 7:35 am
by don_apple
Then you have to test each mod by itself in the mods folder to find the one that is causing those LUA call-stacks. There is no other way to figure out which mod is causing this.

Re: LUA Error

Posted: Fri Oct 27, 2017 3:32 pm
by jagular77
The likelihood is that it is a mod that I am currently using in the game right? The LUA error does not happen in my other saved game with the same mods in the folder.

So unfortunately this is not something where I can just load the game and check the log file, it seems to only happen when the mod is actually purchased in-game. Make sense?

Re: LUA Error

Posted: Fri Oct 27, 2017 3:40 pm
by Smith Modding
Ummm.. yeah.. that's how mods work. The game only loads the vehicle.xml and .i3d when you purchase the object, meaning those errors won't show up until you buy it. Meaning, you have to go through each mod, and buy it, to see which one is causing it. It is 100% a mod, I can guarantee you that.

Re: LUA Error

Posted: Fri Oct 27, 2017 3:49 pm
by jagular77
Ok well, actually some mods generate errors before they are bought, so thanks for the sarcasm. I'm just looking for help here.

Re: LUA Error

Posted: Fri Oct 27, 2017 10:18 pm
by Smith Modding
Yeah, but not lua errors, unless you did something wrong with the modDesc. All you have to do, is find out what mod is causing those errors. You actually shouldn't have to test each mod individually. It should show it before the lua errors start, like in this log example:

Code: Select all

data/vehicles/tools/jcb/jcbPalletFork.i3d (219.20) ms
data/vehicles/tools/damcon/damconPL75.i3d (146.95) ms
data/objects/pallets/treeSaplingPallet.i3d (123.13) ms
data/objects/pallets/treeSapling.i3d (145.18) ms
data/vehicles/steerable/zetor/zetorMajor.i3d (248.76) ms
data/vehicles/trailers/goldhofer/goldhoferStzVp3Front.i3d (144.54) ms
data/vehicles/trailers/goldhofer/goldhoferStzVp3Back.i3d (67.08) ms
data/vehicles/steerable/americanTruck/americanTruckDualAxle.i3d (363.71) ms
data/vehicles/steerable/huerlimann/huerlimannH488.i3d (269.99) ms
data/vehicles/steerable/zetor/zetorForterraHD.i3d (326.09) ms
data/vehicles/tools/amazone/amazoneED3000.i3d (165.83) ms
C:/Users/Bradley/Documents/My Games/FarmingSimulator2017/mods/FS17_SM_UtilityTrailer/utilitytrailer.i3d (462.20) ms
Error: index out of range
LUA call stack:
  dataS/scripts/utils/Utils.lua (11) : printCallstack
  dataS/scripts/utils/Utils.lua (65) : checkChildIndex
  dataS/scripts/vehicles/specializations/Lights.lua (59) : indexToObject
  dataS/scripts/vehicles/specializations/Lights.lua (227) : loadLights
  dataS/scripts/vehicles/Vehicle.lua (631)
  dataS/scripts/utils/Utils.lua (1138) : asyncCallbackFunction
Index: 0>9|1|0|1|1
Error: index out of range
LUA call stack:
  dataS/scripts/utils/Utils.lua (11) : printCallstack
  dataS/scripts/utils/Utils.lua (65) : checkChildIndex
  dataS/scripts/vehicles/specializations/Lights.lua (59) : indexToObject
  dataS/scripts/vehicles/specializations/Lights.lua (227) : loadLights
  dataS/scripts/vehicles/Vehicle.lua (631)
  dataS/scripts/utils/Utils.lua (1101) : asyncCallbackFunction
  dataS/scripts/vehicles/Vehicle.lua (132) : loadSharedI3DFile
  dataS/scripts/BaseMission.lua (769) : load
  dataS/scripts/missions/mission00.lua (461) : loadVehicle
  dataS/scripts/missions/mission00.lua (612) : loadVehiclesStep
  dataS/scripts/BaseMission.lua (797) : asyncCallbackFunction
  dataS/scripts/vehicles/Vehicle.lua (800) : asyncCallbackFunction
  dataS/scripts/utils/Utils.lua (1138) : asyncCallbackFunction
Index: 0>9|1|0|1|1
It would be the utility trailer, because that is the last i3d file it loaded before spitting the error. Note that I purposely made it incorrect to give you an example.
Once you figure that out, go to the mod that is causing it. And since the log is throwing this error:

Code: Select all

LUA call stack:
dataS/scripts/utils/Utils.lua (11) : printCallstack
dataS/scripts/utils/Utils.lua (56) : checkChildIndex
dataS/scripts/vehicles/specializations/Lights.lua (59) : indexToObject
dataS/scripts/vehicles/specializations/Lights.lua (237) : loadLights
dataS/scripts/vehicles/Vehicle.lua (627)
dataS/scripts/utils/Utils.lua (1138) : asyncCallbackFunction
Index: 0>33|1|5|1
It is most likely something to do with the lights. So look at the i3d file for the mod, and make sure that all of the lights are set up correctly and the xml is pointing at the right indexes. If you need help with that, I will help you, just ask

Re: LUA Error

Posted: Fri Oct 27, 2017 10:23 pm
by jagular77
It looks like it is a Mod from the Giants website, the Merlo telehandler

Re: LUA Error

Posted: Sun Oct 29, 2017 12:47 am
by jagular77
anyway that appears to have fixed it. I had an inclination that the Merlo telehandler was the culprit because the error came after it in the log, but I didn't think Giants would endorse a MOD with an error like that.

So, the green Merlo telehandler on the Giants website has a major LUA error, posted above.

thanks for helping me figure that out. If you can download it and fix it I would be so happy because its a cool little machine. Let me know....

Re: LUA Error

Posted: Sun Oct 29, 2017 12:55 am
by Smith Modding
I'll look at it in the next few days *thumbsup*

Re: LUA Error

Posted: Sun Oct 29, 2017 11:15 pm
by don_apple
@jagular77: I've been able to verify that the Merl Turbofarmer indeed causes these LUA call-stacks. I would therefore suggest that you report this issue in the 'ModHub Mods Bug-Reports section: viewforum.php?f=940

Please follow the instructions in the following post to create the bug report: viewtopic.php?f=936&t=110383
.
Reporting it this way will make it possible for Giants to inform the creator of the mod so they can fix it and provide an updated version on the official ModHub

Re: LUA Error

Posted: Wed Sep 28, 2022 2:58 pm
by Mr_Cookie
Hello,
similar problem here. On one Savegame the callstack on the other one not. It happens when I want to Buy multible bags of Food from maize +. I tested every script and mod on a savegame and there it works fine.
log.txt
(111.12 KiB) Downloaded 149 times