Adding new options

Game development with Board Game Arena Studio
Post Reply
User avatar
DrKarotte
Posts: 185
Joined: 22 September 2015, 23:42

Adding new options

Post by DrKarotte » 27 August 2019, 14:39

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.

User avatar
Een
Posts: 2279
Joined: 16 June 2010, 19:52

Re: Adding new options

Post by Een » 27 August 2019, 17:18

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!

User avatar
DrKarotte
Posts: 185
Joined: 22 September 2015, 23:42

Re: Adding new options

Post by DrKarotte » 27 August 2019, 17:49

Thanks, that's perfect then :-)

Post Reply

Return to “Developers”