Page 1 of 1

Adding new options

Posted: 27 August 2019, 14:39
by DrKarotte
I don't know if this has been asked before somewhere. The question is simple: I want to add new option(s). Unfortunetely, the option is needed during the game, not just in setup. The doc says: "New global variable or game option accessed during the game (if it's only used during setup, it should be safe)." So I am not safe. But how to do this?

Normally, I'd say that I have to create the global gamestate values representing the options using the table upgrade function, and setting them to 0 (i.e. "off" for this option). Does this work? Are there any examples, proofs? I want to be as careful as possible.

Re: Adding new options

Posted: 27 August 2019, 17:18
by Een
Actually now if you try to access a gamestate variable that doesn't exist yet, it's created on the fly with value 0.
So if 0 means OFF for your new option, existing games should be fine!

Re: Adding new options

Posted: 27 August 2019, 17:49
by DrKarotte
Thanks, that's perfect then :-)