I have all of my file operations, game save, load, defaults, etc. in a separate lua file from the main. Since this all new for me I am puzzled by the problem that is happening.
When the file save/load functions are in the main code there is no problems with their execution however when removed and having the main call these functions I get the following error:
main.lua:710 attempt to call global function ‘setNewGameDefaults’ (a nil value).
This is reading the set defaults for a new game requested by the user, if the file does not exist for some reason or if there are new defaults added it builds the file and then loads it to the game.
See attached: