Cursed Classes

by fowenix

Adds classes to Factorio.

7 years ago
0.14
5

a Report Bugs Here Or On Forums

7 years ago

Post Any Bugs Here Or On The Forums
Forums: https://forums.factorio.com/viewtopic.php?f=120&t=17292

7 years ago

Error while running the on_load: Cursed-Classes/scripts/startclass.lua:26: attempt to index global 'game' (a nil value) not sure what causes this but i can tell you that i was on a single player map as a crafter and it occuered after attempting to upgrade armor. Now the map wont load.

7 years ago

I get an error when loading a saved game.
Error while running the on_load: Cursed-Classes/scripts/startclass.lua:26: attempt to index global 'game' (a nil value)

installed mods:
bio industries 1.4.8
cursed classes 0.1.0
cursed exp remake 0.5.4
cused ps 0.1.0
logistic train network 0.9.4
score extended 1.0.22
smart trains 1.1.7
bas 0.14.22
blueprint-string 4.0.0
bob inserters 0.14.3
signal strings 0.14.2
stringy trains stop 0.14.1

7 years ago
(updated 7 years ago)

Reason found:
game :: LuaGameScript: This is the main object, through which most of the API is accessed. It is, however, not available inside handlers registered with LuaBootstrap::on_load.

This addon tries to acces the game parameter while loading a saved game.
During init there is no problem, there it is allowed/possible.

Source:http://lua-api.factorio.com/0.14.22/

//edit
think it can be fixed by replacing the onload.main function to:
function main()
loadClasses.main()
end

startclasses is redundant because also called on char creation, I guess.

will test later for problems while playing, so far seems to work.

New response