My second experiment with the code, I wanted to make the templates used to generate the character atributes to be scriptable so I made some changes:
new script header: chrtemplate <template-id> {}
containing a list of attributes (speed, mind, sniper... etc.) with min and max values and a rate: the chance of this template to be used for character generation.
and a new section for the team def:
templates {}
with a simple list of templates-ids for this team
if more than one template is given a random one will be chosen excluding those with a rate of 0 (if all rates are 0 default to the first one), the chance of a template being choosen is: rate of this template / sum of the rates of all templates for this team (so rate is not a percent)
I split the patch in three:
Part 1: changes needed to parse the templates from script files
Part 2: changes to the script files
Part 3: actually use the parsed data to generate the character attributes
So what do you think?