Creating GPaedia for a CSM mod with track selection

Sometimes a season has got more than 17 races, especially 2005 and those since 2009.
GP4 can only handle 17 tracks at the most, but in a CSM mod it is possible to provide a selection for all tracks and group them into tracklists.
We will now learn how to create gpaedia with GPaediaMaker (version 1.07 or higher needed) for such a mod.
The F1 2013 CSM mod by kedy89 will be our example.

1) Preparation

As in the previous tutorial part we will examine the mods structure first.
The globalvars.ini file shows how special features like track selection and/or driver replace are implemented and which variable to use for this.
There isn't much to tell about the performance files team and driver data as they completely stick to the real order and the number of teams is 11 - the GP4 standard. Only one driver exchange occurred, Heikki Kovalainen (Lotus) replaced Kimi Räikkonen in races 18 and 19.
Track selection is controlled by the globalvars.ini variables %trackname% and %tracklist%.

2013mod kedy89
tracks and tracklists

[trackname]
Allowchange		=1
Name			=Grand Prix of ...
Name Icon		=Files\Icons\gp2.ico
VarCount		=19
Var1			=Melbourne
Var2			=Sepang
Var3			=Shanghai
Var4			=Sakhir
Var5			=Barcelona
Var6			=Monaco
Var7			=Montreal
Var8			=Silverstone
Var9			=Nürburgring
Var10			=Hungaroring
Var11			=Spa
Var12			=Monza
Var13			=Singapore
Var14			=Yeongam
Var15			=Suzuka
Var16			=Buddh
Var17			=YasMarina
Var18			=Austin
Var19			=Interlagos
VarName1		=Australia - Albert Park Circuit
VarName2		=Malaysia - Sepang International Circuit
VarName3		=China - Shanghai International Circuit
VarName4		=Bahrain - Bahrain International Circuit
VarName5		=Spain - Circuit de Catalunya
VarName6		=Monaco - Circuit de Monaco
VarName7		=Canada - Circuit Gilles-Villeneuve
VarName8		=Great Britain - Silverstone Circuit
VarName9		=Germany - Nürburgring
VarName10		=Hungary - Hungaroring
VarName11		=Belgium - Circuit de Spa-Francorchamps
VarName12		=Italy - Autodromo Nazionale Monza
VarName13		=Singapore - Marina Bay Street Circuit
VarName14		=Korea - Korean International Circuit
VarName15		=Japan - Suzuka International Racing Course
VarName16		=India - Buddh International Circuit
VarName17		=Abu Dhabi - Yas Marina Circuit
VarName18		=USA - Circuit of The Americas
VarName19		=Brazil - Autodromo Jose Carlos Pace
...
Modify			=tracknum,tracklist,racenum,driver07,compounds,physics,gptracknum,tweakpos5,tweakpos6,tweakpos9,tweakpos10,tweakpos19,tweakpos20   ;driverXX,teamnameadrivera,teamnameadriverb,teamnamebdrivera,teamnamebdriverb

[tracklist]
AllowChange		=0
Name			=Tracklist
VarCount		=19
Var1			=2013a
Var2			=2013a
Var3			=2013a
Var4			=2013a
Var5			=2013a
Var6			=2013a
Var7			=2013a
Var8			=2013a
Var9			=2013a
Var10			=2013a
Var11			=2013a
Var12			=2013a
Var13			=2013a
Var14			=2013a
Var15			=2013a
Var16			=2013a
Var17			=2013a
Var18			=2013b
Var19			=2013b
As you can see, in this mod the track order is the same as in the real season. Of course you could also choose another order and put your favourite tracks into tracklist 2013a.

To create trackspecific gpaedia including driver replace data we use the variable %gptracknum%
[gptracknum]
AllowChange		=0
Name			=Track Number (Gpaedia)
VarCount		=19
Var18			=1
Var19			=1

Creating the CSV tables

We will now create the driver-, team- and track-tables with the seasons data.
At this point we need not yet care about the track selection, but will input all necessary data at once.
The team.csv gets 11 columns, the driver.csv 22 + 1 replacing driver = 23 columns, the track.csv 19 columns.

Examples: drivertable, tracktable

Together with the 3 CSV data files we also need 3 CSV format files that are necessary, because we use a track file format slightly different from standard, i.e. rows 5 (City) and 6 are added, while driver and team format are standard.
We put all CSV files into "2013mod_kedy89", a subfolder of the exe files folder.
As subfolders of "2013mod_kedy89" we create the folders "GPaedia", "ini" and "Menu".

Structuring the output with ini files

Now we generate the ini files that control the output and put them into the "ini" folder.
We will create four ini files, two for the GPaedia and two for the Menu (one for each of the two tracklists 2013a and 2013b).

The ini file for the 2013a gpaedia creates 5 gps files GP2013_english.gps, ..., GP2013_italiano.gps in the folder GPaedia\2013a:

;--- gpaedia_2013_ff_mod_kedy89_a.ini ---
;--- GP4 GPaedia Maker configuration file ---

; language variables (0 to 4):
; %ln% ==> en, de, es, fr, it
; %language% ==> English, Deutsch, español, Français, italiano

; gps: language files to create
;     create: yes=1, no=0 (optional, default is 1,0,0,0,0)
gps = 1,1,1,1,1

; define season variable %season%
season=2013

; input path for constant txt files
in_path	= %program_path%\data\

; input path for edited csv and txt files
var_path = %program_path%\%season%mod_kedy89

; output path for created gps files
out_path = %program_path%\%season%mod_kedy89\GPaedia\2013a_

; gps file names (normal)
ln_gps = GP%season%_%language%.gps

; gps file names trackspecific
track_gps = GP%season%_%language%-%tracknum%.gps
;track_gps = GP%season%_%language%-%trackname%.gps

; Process cornerdata 1=yes, 0=no (default: 1)
;corner_data = 0

; English teamlink names as capitals
;teamlink_caps = 1

; Use user defined format files (default = 0)
user_format = 1

; driver 9/10 switch for gp4 with 9.6 patch
sw_driver 9=10
sw_driver 10=9
The ini file for the 2013b gpaedia creates 5 trackspecific gps files GP2013_english-1.gps, ..., GP2013_italiano-1.gps in the folder GPaedia\2013b:
;--- gpaedia_2013_ff_mod_kedy89_b.ini --- 
...
; output path for created gps files
out_path = %program_path%\%season%mod_kedy89\GPaedia\2013b

; gps file names (normal)
;ln_gps = GP%season%_%language%.gps

; gps file names trackspecific
track_gps = GP%season%_%language%-%tracknum%.gps
...
>
; track switches (20=none)
sw_track 1=18
sw_track 2=19
sw_track 3to17=20

; first track of driver tables replace lines (default = 1); only used
with a second tracklist
track_1=18
The menu ini files create 5 str files each in the folder Menu\2013a resp. Menu\2013b:
;--- gpaedia_2013_ff_mod_kedy89_menu_a.ini ---
;--- GP4 GPaedia Maker configuration file ---

; language variables (0 to 4):
; %ln% ==> en, de, es, fr, it
; %language% ==> English, Deutsch, español,
Français, italiano

; gps: language files to create
;     create: yes=1, no=0 (optional, default is
1,0,0,0,0)
gps = 1,1,1,1,1

; define season variable %season%
season=2013

; input path for constant txt files
in_path    = %program_path%\data\

; input path for edited csv and txt files
var_path = %program_path%\%season%mod_kedy89\

; output path for created gps files
out_path = %program_path%\%season%mod_kedy89\Menu\2013a

; Use user defined format files (default = 0)
user_format = 1

; Generate str menu files (default: 0, no menu files created)
; 1: make str files with gp names from track.csv
; 2: like 1, but gp name of track 1 is always "Albert Park"; compatible
with CSM using TSM
make_str = 2
Note: As the Australian GP is the first race normally make_str=1 would be the choice here, but the circuit name in the track table is given as "Melbourne" instead of "Albert Park".
;--- gpaedia_2013_ff_mod_kedy89_menu_b.ini ---
...

; output path for created gps files
out_path = %program_path%\%season%mod_kedy89\Menu\2013b
...

; Generate str menu files (default: 0, no menu files created)
; 1: make str files with gp names from track.csv
; 2: like 1, but gp name of track 1 is always "Albert Park"; compatible
with CSM using TSM
make_str = 2

; track switches (20=none)
sw_track 1=18
sw_track 2=19
sw_track 3to17=20
To run all four ini files at one stroke, we use a batch file (put into the exe path):
REM --- gpaedia_2013mod_kedy89 batch ---

txt2gps_ff.exe 2013mod_kedy89\ini\gpaedia_2013_ff_mod_kedy89_a.ini
txt2gps_ff.exe 2013mod_kedy89\ini\gpaedia_2013_ff_mod_kedy89_b.ini
txt2gps_ff.exe 2013mod_kedy89\ini\gpaedia_2013_ff_mod_kedy89_menu_a.ini
txt2gps_ff.exe 2013mod_kedy89\ini\gpaedia_2013_ff_mod_kedy89_menu_b.ini

Checking the result

We should now look into each folders gpaedia.log file to see if they contain warnings and if the processing has generated the correct gps resp. str files.

Installing the gpaedia and menu files

You just have to copy the generated folders with the gps and str files - but without the log file - into the mods folders GPaedia resp. GPaedia\Menu. Then the swap.ini in folder Data\Setting does the rest:
[Swapfiles]
...
File4		=GPaedia\%tracklist%\GP2013_English.gps,MenuData\PC\GP2001\GP2001_English.gps
File5		=GPaedia\%tracklist%\GP2013_Deutsch.gps,MenuData\PC\GP2001\GP2001_Deutsch.gps
File6		=GPaedia\%tracklist%\GP2013_español.gps,MenuData\PC\GP2001\GP2001_español.gps
File7		=GPaedia\%tracklist%\GP2013_Français.gps,MenuData\PC\GP2001\GP2001_Français.gps
File8		=GPaedia\%tracklist%\GP2013_italiano.gps,MenuData\PC\GP2001\GP2001_italiano.gps
File9		=GPaedia\%tracklist%\GP2013_English-%gptracknum%.gps,MenuData\PC\GP2001\GP2001_English.gps
File10		=GPaedia\%tracklist%\GP2013_Deutsch-%gptracknum%.gps,MenuData\PC\GP2001\GP2001_Deutsch.gps
File11		=GPaedia\%tracklist%\GP2013_español-%gptracknum%.gps,MenuData\PC\GP2001\GP2001_español.gps
File12		=GPaedia\%tracklist%\GP2013_Français-%gptracknum%.gps,MenuData\PC\GP2001\GP2001_Français.gps
File13		=GPaedia\%tracklist%\GP2013_italiano-%gptracknum%.gps,MenuData\PC\GP2001\GP2001_italiano.gps
File14		=GPaedia\Menu\%tracklist%\english.str,ldata\english.str
File15		=GPaedia\Menu\%tracklist%\deutsch.str,ldata\deutsch.str
File16		=GPaedia\Menu\%tracklist%\español.str,ldata\español.str
File17		=GPaedia\Menu\%tracklist%\français.str,ldata\français.str
File18		=GPaedia\Menu\%tracklist%\italiano.str,ldata\italiano.str


Download: 2013CSV_mod_kedy89