In the Lua scripts you would copy from the global parameters table into script locals for efficiency like this:
g_script_parameters = g_script_parameters or {}
local angMonkAng, angMonkDam, cocExpRad = {},{},{}
script_name_init( e )
local myPars = g_script_parameters[ e ]
angMonkAng[e] = myPars.angry_monkey_angle
angMonkDam[e] = myPars.angry_monkey_damage
cocExpRad [e] = myPars.coconut_explosion_radius
-- in here I would put some code to check all the values are within allowable
-- ranges and if not set them to sensible defaults to stop the script breaking
-- if the user has typed in something daft
end
script_name_main(e)
....
if angMonkAng[e] == 30 then
-- etc --
end
....
Haven't decided yet on the header format to specify, something like:
-- %PARAM <name> <type> <value> ( <value list> ) "Comment"
or maybe put the type in with the key, like %PARAM_F for float, %PARAM_S for string etc.
This will depend a lot on how we want to display it on the GUI.
Edited to add:
To further expand this description a bit, the <value> is the default, ( <value list> ) would be an optional comma separated list of valid values so the user can select one of them. The "comment" part could be used to populate the little 'hover over help' pop up thingy giving a description of the parameter to the user.
So for example my helicopter script has a parameter to specify whether the chopper is 'for or agin' the player, this would be put in the header as:
-- %PARAM_S Mode "enemy" ( "enemy", "friendly", "neutral" ) "Selects the mode in which this helicopter starts the game."
In the parameters pane this could then put up a "Mode" box with a drop down defaulted to "enemy" which allows the user to select "friendly" or "neutral".
Not quite sure how to deal with script variables that aren't entity specific though, might need to think about that a bit. For example in my pickuppables script the variables apply to all entities with the script attached, "maxWeight" for example which gives the maximum amount the player can carry.
Been there, done that, got all the T-Shirts!