Anyone Know how to add User Option?

gyogen2

Emperor
Joined
May 8, 2014
Messages
1,201
I am trying to add some user options for a mod, I can get them to show up in the options menu, but I cannot find where/how to define them.

I looked in the setupparameters.xml (and also lua), where there are game options defined, but can find no where for user options (quick combat, mmovement, etc.).

I tried to define them in this file, but either that doesn't work, or I just did it wrong.

Thanks for any help.
 
I can find these in Options.lua
Code:
		UserConfiguration.SetValue("QuickCombat", Options.GetUserOption("Gameplay", "QuickCombat"));
		UserConfiguration.SetValue("QuickMovement", Options.GetUserOption("Gameplay", "QuickMovement"));
		UserConfiguration.SetValue("AutoEndTurn", Options.GetUserOption("Gameplay", "AutoEndTurn"));
		UserConfiguration.SetValue("TutorialLevel", Options.GetUserOption("Gameplay", "TutorialLevel"));
		UserConfiguration.SetValue("EdgePan", Options.GetUserOption("Gameplay", "EdgePan"));
but I haven't been able to parse out whether they are being refered to (and are defined somewhere else) or whether they are both defined and implemented within the Options.lua file.

Trying to analyze what is in Options.lua and compare to what is in Options.xml makes my head spin :sad:
 
Yeah, I found them in lua, and where they correspond in the xml for options. I had hoped they were defined within the lua, but doesn't seem so. I put a new option in, got it to show up, but when selecting the option got an option not registered error.
And as far as I can find, the only entries are in those two files (except for a few luas that reference the value). I hoped it was as easy as civ v to add an option, might be and maybe it's just me.
 
Last edited:
I seem to recall some near boasting about how much more mod-able this version would be. By mod-able did they mean frustrating?
As always with Firaxis, they did included some great options for modding, and then totally messed up some simple things.
The modifiers/requirements system apparently provides some extremely powerful and flexible system (if a bit hard to understand without some references), but then buildings and units still use old mostly hard-coded requirements rather than their new system.

I wouldn't be surprised at all if they totally messed something like user options.:trouble:

I know it's possible to create options, CQUI does this, but it uses a custom options screen called by a button on the minimap buttons bar and those settings are only saved for one game (probably they are stored in the saved game file)
You can also go the old database way. Add a custom table, create a settings.sql file with comments so users understand how to edit values, and use GameInfo to read those settings in-game. You won't have a nice GUI but at least users with some knowledge of computers will be able to set the options to their liking.
 
Back
Top Bottom