OXP Variables
Posted: Sun Sep 13, 2009 10:59 pm
OXP Variables
Here is a suggestion for making OXPs more user configurable:
An OXP may include a variables.plist file that lists variables that are created on loading and sets to the value stored in the save file or default value if that variable doesn't exist in the save file (e.g for a new commander). The value would be editable from an option on the F2 screen. The variables.plist file would contain a list of variable names, their types, and something that says what value each variable can take such as fixed option list of text values or a number range, etc.. It should also include the default value and maybe a short description for the configuration screen. This value would be saved into the save file on the next save. If you unload the OXP the values for its variables would be ignored on loading and not saved next time.
This variable would be made accessible to scripts and therefore could used for all sorts of ways of configuring an OXP such as turning on or off OXP features such as ship availabilities. AI behaviours etc. (assuming all those things are scriptable in the first place). I imagine it would be useful during testing as well so you can try out different setting until you are happy and then set those as the defaults or hardcode some or all of the the values and remove those hardcoded ones from the plist file.
I would also imagine the variable name would automatically be prefixed by the OXP name in the script to prevent name clash and would also appear in the configuration screen without prefix but grouped by OXP name.
I see this as ideal for complex OXPs where there is some controversy over what is included. (An example is the OSE OXP where from my reading of this board there are lots of people who would like to have parts optional.) An OXP developer could then set up options in their OXP that the user can configure and the developer would be able to have the OXP alter safely without the user risking breaking the OXP by hacking changes manually. Obviously configurability of an OXP would be down to the developer.
This suggestion should also be backwardly compatible with all existing OXPs as none of them have the variables.plist file and so have no variables to load or save.
Phantor Gorth
Here is a suggestion for making OXPs more user configurable:
An OXP may include a variables.plist file that lists variables that are created on loading and sets to the value stored in the save file or default value if that variable doesn't exist in the save file (e.g for a new commander). The value would be editable from an option on the F2 screen. The variables.plist file would contain a list of variable names, their types, and something that says what value each variable can take such as fixed option list of text values or a number range, etc.. It should also include the default value and maybe a short description for the configuration screen. This value would be saved into the save file on the next save. If you unload the OXP the values for its variables would be ignored on loading and not saved next time.
This variable would be made accessible to scripts and therefore could used for all sorts of ways of configuring an OXP such as turning on or off OXP features such as ship availabilities. AI behaviours etc. (assuming all those things are scriptable in the first place). I imagine it would be useful during testing as well so you can try out different setting until you are happy and then set those as the defaults or hardcode some or all of the the values and remove those hardcoded ones from the plist file.
I would also imagine the variable name would automatically be prefixed by the OXP name in the script to prevent name clash and would also appear in the configuration screen without prefix but grouped by OXP name.
I see this as ideal for complex OXPs where there is some controversy over what is included. (An example is the OSE OXP where from my reading of this board there are lots of people who would like to have parts optional.) An OXP developer could then set up options in their OXP that the user can configure and the developer would be able to have the OXP alter safely without the user risking breaking the OXP by hacking changes manually. Obviously configurability of an OXP would be down to the developer.
This suggestion should also be backwardly compatible with all existing OXPs as none of them have the variables.plist file and so have no variables to load or save.
Phantor Gorth