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

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
osldgoth
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Feb 26, 2015 3:52 am
Contact:

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

Post 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.

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

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

Post 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)
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

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

Post 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?

osldgoth
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Feb 26, 2015 3:52 am
Contact:

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

Post 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

Fractaliste
Inserter
Inserter
Posts: 28
Joined: Wed Dec 06, 2017 9:20 am
Contact:

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

Post 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

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

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

Post 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
Image

Transport Belt Repair Man

View unread Posts

Post Reply

Return to “Technical Help”