Page 1 of 1

[0.14.x] Error code 102 or 103 opening "__mod name__/control.lua"

Posted: Sun Sep 18, 2016 5:44 am
by osldgoth
I've seen in the wiki (which appears out of date)
Because control.lua is reloaded and re-run every time a new game session is started, you don't need to completely restart Factorio to notice changes made to control.lua; simply saving/loading or starting a new game is sufficient.
as well as under the factorio api as early as 0.14.6 under Data-Lifecycle and section#3: control.lua initialization.
Because this is run every time a save file is created or loaded you don't need to restart the game to see changes made to the control.lua file. Simply restarting or reloading a save will re-run this stage.
Whenever I do this and attempt to load a save, I get
opening file __mod name__/control.lua-- error code -103

or attempt to start a new game I get error
opening file __mod name__/control.lua-- error code -102
A new game with error 102 seems to crash the game to desktop (just closes the game?)

Is the game supposed to continue after control.lua is changed or are we required to restart the game every time? These statements should not be in the api if the game doesn't function that way.

Re: [0.14.x] what is error code - 103? 102

Posted: Sun Sep 18, 2016 7:56 am
by aubergine18
The game definitely reloads control.lua every time you load a save of start a new game (otherwise it would be almost impossible update mods for existing games). I know from my own mods that simply exiting to main menu then reloading a game will give me the up-to-date control.lua that I just edited.

The errors you're getting are likely from something else - for example trying to access non-existent property, such as someEntity.built_by doesn't exist since 0.14.6 (accessing it will give error, not nil)

Re: [0.14.x] what is error code - 103? 102

Posted: Sun Sep 18, 2016 12:25 pm
by posila
Factorio doesn't have any error codes. It is either error returned from some OS API call that didn't got translated to error message; from Lua library or you read it wrong and it says there is an error on line 103. Can you post log?

Re: [0.14.x] what is error code - 103? 102

Posted: Tue Sep 20, 2016 5:07 am
by osldgoth
I've found out how it is caused: I had the mod zipped in factorio mod folder, when a different control.lua is added/changed to the zip these are the errors factorio gives. removing the mod from the zip file prevents it.
Error 103
Error 102

Re: [0.14.x] what is error code - 103? 102

Posted: Sat Apr 28, 2018 12:17 pm
by Fractaliste
I got the same error with the following script I wrote in control.lua (I' on the Factorio's current stable release). It happens when I try to load a save.
control.lua
Logs are :
factorio-current.log

Re: [0.14.x] what is error code - 103? 102

Posted: Sat Apr 28, 2018 1:53 pm
by steinio
ERROR_SEM_IS_SET
102 (0x66)
The semaphore is set and cannot be closed.
https://msdn.microsoft.com/de-de/librar ... s.85).aspx