One of the many new functions that SRL 4 has to offer is SRLPlayerForm();
It sets, loads, saves your players all in a form. Using it is a piece of cake.
First a list of possibilities :
- Right click menu on tabs
- Ability to use Armies
- Can switch Players by holding Ctrl and drag the tab
- Can add a variable amount of extra options and give the options unique names.
Then the picture :
Thats all i can think of at the moment.
Basically all you need to run it is this :
SCAR Code:
program New;
{.include SRL/SRL.scar}
begin
SetupSRL;
SRLPlayerForm(True, [], [], [], []);
end.
Running that will give you the default player form with no extra settings.
Extra settings :
The '[]' parameters in the function stand for extra settings. '[]' in scar means an array, in this case we are using an array of strings (TStringArray).
In order of appearance this is what the TStringArray's stand for :
- Booleans
- Integers
- Strings
- Extendeds
So lets say we want to add an Integer, the function would then be called like this :
SCAR Code:
SRLPlayerForm(True, [], [''], [], []);
Lets say we want to add 3 booleans, 1 integer, 4 strings and 2 extendeds :
SCAR Code:
SRLPlayerForm(True, ['', '', ''], [''], ['', '', '', ''], ['', '']);
When you leave the name of an extra settings blanc ( '' ) it will name it ie. Integer[0]. When you use 'IntTest' it will ask IntTest.
SCAR Code:
SRLPlayerForm(True, [''], ['', ''], [], []);
will ask :
- Boolean[0]
- Integer[0]
- Integer[1]
SCAR Code:
SRLPlayerForm(True, ['BoolTest'], ['IntTest', 'IntTest2'], [], []);
will ask :
However note that even though the form might ask Booltest the script will know it as Boolean[0]. Same thing goes for the other settings.
It could be used like this for example :
SCAR Code:
SRLPlayerForm(True, ['Pick Equip?', 'Withdraw New Picks?'], ['Nr of Trips'], ['Rock Name to Mine', 'Bank to bank at'], []);
The parameter where i used True is if you want it to show the form or just load the players. True obviously mean show, false means just load nothing else.
Another great feature of the player form is the ability to import and export players from and to the "DeclarePlayers" Procedure, found in the "File" drop down menu
Basically, if you open a script with the procedure "DeclarePlayers" in it all properly filled out, it will parse them into the form for you, and saves you the trouble of having to do it yourself.
Furthermore, if you fill in all of your players in the form and want to put them into the DeclarePlayers format, select your army, and hit the export button. The full DeclarePlayers procedure will be automatically generated for you.
Please note: Importing player data may not always work as the script has to scripted with perfect standards for it to work, I.E:
PHP Code:
Players[0].name := 'Starblaster100';
Space between 'name' and ':=' and ':=' and the String / Number / Bool / Extended
Anything i missed ?