Index field error
Posted: Sat Dec 16, 2017 8:09 pm
The game gives me this error at line 1
attempt to index field 'global' (a nil value)
I am trying to configure in game settings for my mod, but i have to create a string from the number inputted with MJ concatenated to it.
I have the setting type as an int and runtime-global.
Any help?
attempt to index field 'global' (a nil value)
I am trying to configure in game settings for my mod, but i have to create a string from the number inputted with MJ concatenated to it.
I have the setting type as an int and runtime-global.
Code: Select all
EV = settings.global["epic_robot_energy-Multi"].value
data.raw["logistic-robot"]["logistic-robot"].max_energy = (tostring(EV) .. "MJ")
data.raw["construction-robot"]["construction-robot"].max_energy = (tostring(EV) .. "MJ")