Current solutions for configuration include:
1. Script commands to set different options. Lost when script resets, otherwise they stick around. Great for runtime configuration.
2. Notecards. Expensive to parse, but persistant across script resets. Good for startup configuration, read once type stuff.
3. Script variables. Can be combined with script commands for run time config, stores across resets, but requires opening the source to make them available. Not always an acceptable option.
I propose adding a way to separate certain variables that the scripter registers into a simple key/value pair property sheet, perhaps as a second tab in the script edit window. This would always be available for editing whether the script has its source code viewable or not. The user could then edit values here (such as elevator heights, door orientation, colors, and more) and they would be stored between resets and copies, etc. Of course it would be required to link these in some way to the internal script workings. For simplicity's sake I would have them be string only, but one potential would be having various UI controls for the config sheets such as check boxes, list boxes, radio buttons, etc.
So as an example, I'll use my Primcrafters glasses, which have two parameters: color and tint
The property sheet on the script window would just be labels and text boxes:
CODE
Tint: _____
Color: _____
These would be manipulated with a few new LSL functions.
integer llRegisterProperty(string name, string value)
Registers a new property key with a default value of value if it does not exist. Return value indicates whether new value was created or value already exists. Because these would be stored across script resets, you would not want to reset them to default each time. It would defeat the entire purpose.
string llGetProperty(string name)
Simply retrieves the named property
llSetProperty(string name, string value)
Sets the named property to value
integer llUnregisterProperty(string name)
Removes a registered property at runtime.
The persistance of the properties would only be cross-reset, they would be cleared on actual modification and saving of the script. This clears up any headaches with having old properties registered when you are editing it, but does not impede the use of them as configuration to the end user.
Phew. Comments?
