
Modding Debug
Moderator: ickputzdirwech
-
- Burner Inserter
- Posts: 17
- Joined: Fri Aug 28, 2015 2:03 am
- Contact:
Modding Debug
It would help if there was some way to either throw "errors" or to show a debug log on the loading screen for development of mods. I find it really tedious waiting for the game to load only to find that inside my data-update.lua file that only one prototype was loaded vs 20. I do know that if you load factorio through the cmd on windows it has this feature when using print, but I have recently switched to the steam version of the game and as soon as the game loads the steam-client-api the console just closes and runs the game without it. I just need some sort of feedback from the mod to know whats happening behind the scene. Thanks! 

Re: Modding Debug
You can write to the log file with log(). And you actually can throw an error with literally error().
-
- Burner Inserter
- Posts: 17
- Joined: Fri Aug 28, 2015 2:03 am
- Contact:
Re: Modding Debug
Thank you, I actually didn't know that. Im assuming thats probably a lua function. Thank you again
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Modding Debug
I knew about log(), but didn't know about error()... though to be fair I can't see a reason to throw an error on purpose, usually when errors happen, I fix them.
Re: Modding Debug
oh this is an easy one: There could be situations, where the game- or lua-engine don't recognize an error, but your code works different than you thought. In that situation, additional error messages in functions can help you determine the problem and make it easier for you to fix them.bobingabout wrote:I knew about log(), but didn't know about error()... though to be fair I can't see a reason to throw an error on purpose, usually when errors happen, I fix them.
But of course, you could easly work with log() instead
