Understanding a CSM Mod - First Steps
To get some inside knowledge of CSM only one way does exist: examine as many existing CSM mods as possible and learn from them. As no complete CSM tutorial or even a help file exists, it may not be easy for a interested beginner, to get into this. This little tutorial will help to make the first steps easier by giving a general overview and touching some aspects of CSM.
The "2017 mod V2" bei MSchumi24 and the "2018 F1 mod v0.81" by kedy89 are used as examples. Please download and install them into CSM.
General
- What CSM does
- Mod structure
Examples
- Changing the CSM menu entries
- Adding a new driver
- Installing a new track
What CSM does
CSM is an extension for GP4 that supports mods with new carsets. With CSM running a season using more than 17 tracks or including trackspecific data like driver replaces are possible, that are not supported by the original GP4.
If you install a mod (usually as .cuh file) in CSM, the files will be extracted into a subfolder of CSMs working directory, which is by default "Grand Prix 4\GPSAVES\Carsets". This subfolder can be chosen by the user.
If you start an installed mod from the CSM menu, the program temporarily updates/swaps files and/or folders of the mod into the "Grand Prix 4" directory, then starts GP4 using GpxPatch. After finishing the GP4 program, CSM restores the files from a backup folder, supposed "autorestore" is set in [File], [Options].
Mod structure
The general structure of a mod is shown in a new carset template. In CSM select [File] and "Install new carset template". You can see the folder structure and the basic ini files but without any data there is not much to learn from.
Lets look into a mods folder, e.g. "2018 F1". It contains the two subfolders "data" and "Settings" and the main file "2018.csm". Open "2018.csm" with a text editor. You will see a list of definitions, pointing to files or folders to be used. In section [General] a specification "Name" sets the name of the mod used in the CSM menu "Load and restore mods". This may be different from the mods folder name. You can edit it here.
In the "Settings" folder you will find several ini files besides a MergeINI.lst. This is the controlling center of the mod and we will examine some of the files a bit deeper.
In the CSM.ini the line "F1graphics" in section [Misc] is interesting:
The "Globalvars.ini" and the "Swap.ini" are most interesting. We will use them to examine and even patch a mod. All setting possibilities of the Globalvars.ini are discussed in "CSM stuff (brain goes boom)" by ZaZ.
Changing the CSM menu entries
Look into the Globalvars.ini. Go to the [trackname] label.
You see "Allowchange" set to 1. This creates the track drop-down selection list in the CSM menu.
The menu uses the values of "Name" and "Name Icon" for the selection entry in the CSM menu "The mod's configurables" while "VarName1" ... "Varname21" define the track names in the drop-down list at the bottom. You may change them here, for example you could add the tracks number changing "Australia - Melbourne" to "01 Australia - Melbourne". The "Varname1 Icon" sets the path and name of the icon file. The icon is then displayed in front of the VarName. The VarPreview entries add pictures of the tracks.
If you have chosen a track, then in the menu "Load and restore mods" under the mods picture a picture showing which track is currently selected is displayed. This is set in the "2018.csm" in the mods main folder:
The text "The 2018 mod ..." of the rtf file is merged with the %trackname% picture.
You may configure more sophisicated menu displays using font settings. For example in the 1991 mod "The mod's configurables" menu has entries with changing background between white and black. This is done by adding the following to the variable settings in the Globalvars.ini.
and so on with changing Backcolor and Textcolor every time.
Adding a new driver
As an example I will take the 2017 F1 mods driver replace "button" for "alonso" in race 6, Monaco. You have to work on the following, where point 1 is most important:
1. The performance files
2. Helmet
3. Globalvars.ini driver settings
4. Teamart driver picture (and ev. helmet picture)
5. Driver and team gpaedia
1) Performance files are used by the GpxPatch program. They are text files that define the team and driver names and numbers for the ingame driver selection menu and set the qualifying and racing performance values. You find detailed information about the structure of a performance file in the grandprixgames.org threads "GP4 performance files" and "Performance files".
In the 2017 mod the performance text files are all in the GpXpatch subfolder of the data folder. Most mods use a subfolder "Performance" instead, like the 2018 mod does. Alonso as the default first driver of the McLaren Honda team is found in the default performance text file as well as in any other trackspecific performance file except the one for the Monaco Grand Prix, where he has to be replaced by Button.
Default "performance.txt":
Monaco "performance_monaco.txt":
2) Helmet
But he has the wrong helmet; we still see the standard helmet of the original GP4. A helmet texture, a .tex file that you can open with Slimtex, has to be made and put into the data\Helmets\button folder. To make the helmet appear ingame additional changes are necessary.
3) Globalvars.ini driver setting
Look into the data\Helmets\helmets.ini. You see that driver 11 is represented by the variable %driver11%, which is by default "alonso". To get "button" for track 6, we have to add a driver change into the Globalvars.ini:
Now with the modify setting in the trackname definition
4) Teamart driver picture
The [driver11] setting should also point to the correct files in the data\Teamart folders "Drivers" and "Helmets", where you find the gpi graphic files for the ingame driver pictures and the driver gpaedia background helmets. You can display gpi files using the ZAZ GP4 tool Slimtex.
In the 2017 mod the teamart helmets are disabled. In the TeamArt\Drivers folder there should be a file "button.gpi" but you will not find it. This picture has yet to be created. If you want to do this, you have to make a 256x256 tga file and convert it to gpi with Slimtex (Batch to gpi). In the game the standard image (Barrichello) is shown instead of a Button image.
5) Driver and team gpaedia
The last and probably least important update has to be made with the gpaedia.
The gpaedia files are found in the data\GPaedia folder in the subfolders belonging to the tracklist 2018a.
The two tracklists 2018a and 2018b have been defined in the Globalvars.ini file. This is necessary for a season with more than 17 tracks.
The 5 files "GP2017_English-6.gps" ... "GP2017_italiano-6.gps" have got the trackspecific data for the Monaco GP. They are made using the tool GPaediaMaker and the GPaedia 2017 files.
Now, when you select the Monaco GP and look at the drivers gpaedia, Jenson Button should be shown as driver 11. But he doesn't! You see Alonso. What is wrong?
If you look into "GP2017_English-6.gps" with a text editor you will see that Button is there. The gps files are okay. How are the gps files included into the game? This is made by swapping them due to the settings in the Swap.ini file. This looks like
Just add the line
Installing a new track
Tracks are not part of a CSM mod. Though the TSM is included into the CSM GUI it is in fact an independent program. For some seasons trackpacks are made and together with the mod you will have a complete GP4 set. If this is not the case, you have to gather available tracks fitting the season and install them yourself.
To install a trackpack you have to use the TSM. Select "Manage tracks", "Tasks", "Install tracks".
Single tracks are often just archive files and I prefer to install them manually.
Tracks are stored into the subfolder "Tracks" of the "Grand Prix 4" folder. Here you have ini files (one or two for a season) to define which tracks belong to the season. In TSM they are called "Profiles". The 2018 season needs two files: 2018a.ini and 2018b.ini that look like this on my computer:
2018a.ini:
2018b.ini:
As you see I prefer a track folder structure like
To install the new "Paul Ricard 2018" track, it's file location has to be written into the 2018a.ini file.
Then all files from the downloaded archive are extracted into the tracks folder, for me it is "Paul Ricard\2018".
Finally a "settings.ini" file has to be created in this folder, that has a content like:
Name and Country are displayed in the ingame circuit select menu.
The adjective will be displayed in the racing result menu, if in the GPxPatch tab [GPxTrack] the "Catch menu strings" option is checked. You have to be aware of the fact that the national adjective may also be set by the mods menu str files. In this case it is advisable to uncheck the "Catch menu strings" option. This is true for both the 2017 and 2018 mod. Look into the mods Settings\Swap.ini to see if menu str files are swapped.
If you set the gpi value and include the gpi file in the tracks folder, this will be displayed as trackmap in the game. It will override a trackmap set by the mods data and swapped.
Using a track profile with CSM
A mod can point to a track profile with a setting in the main csm file, e.g. for 2017 or 2018:
This will automatically select the tracklist that belongs to the selected track. CSM does display this in the drop-down list "List" of "The mod's configurables" menu. You have to click on "Load and restore mods" and then back on the configurables button to refresh the display value of "List", but the tracklist is set correctly already.
CSM will now "talk to TSM" and load the specified tracks.
To get some inside knowledge of CSM only one way does exist: examine as many existing CSM mods as possible and learn from them. As no complete CSM tutorial or even a help file exists, it may not be easy for a interested beginner, to get into this. This little tutorial will help to make the first steps easier by giving a general overview and touching some aspects of CSM.
The "2017 mod V2" bei MSchumi24 and the "2018 F1 mod v0.81" by kedy89 are used as examples. Please download and install them into CSM.
General
- What CSM does
- Mod structure
Examples
- Changing the CSM menu entries
- Adding a new driver
- Installing a new track
What CSM does
CSM is an extension for GP4 that supports mods with new carsets. With CSM running a season using more than 17 tracks or including trackspecific data like driver replaces are possible, that are not supported by the original GP4.
If you install a mod (usually as .cuh file) in CSM, the files will be extracted into a subfolder of CSMs working directory, which is by default "Grand Prix 4\GPSAVES\Carsets". This subfolder can be chosen by the user.
If you start an installed mod from the CSM menu, the program temporarily updates/swaps files and/or folders of the mod into the "Grand Prix 4" directory, then starts GP4 using GpxPatch. After finishing the GP4 program, CSM restores the files from a backup folder, supposed "autorestore" is set in [File], [Options].
Mod structure
The general structure of a mod is shown in a new carset template. In CSM select [File] and "Install new carset template". You can see the folder structure and the basic ini files but without any data there is not much to learn from.
Lets look into a mods folder, e.g. "2018 F1". It contains the two subfolders "data" and "Settings" and the main file "2018.csm". Open "2018.csm" with a text editor. You will see a list of definitions, pointing to files or folders to be used. In section [General] a specification "Name" sets the name of the mod used in the CSM menu "Load and restore mods". This may be different from the mods folder name. You can edit it here.
Name =F1 2018 0.81
The "data" folder holds all the stuff needed as cars, helmets, teamart etc., anything except tracks.In the "Settings" folder you will find several ini files besides a MergeINI.lst. This is the controlling center of the mod and we will examine some of the files a bit deeper.
In the CSM.ini the line "F1graphics" in section [Misc] is interesting:
F1graphics =1,%hres%,%vres%,,,,,,,,,,,,,,, . . .
It sets parameters in the graphics configuration file "f1graphics.cfg", e.g. the display resolution using %hres% and %vres%, which are variables defined in the Globalvars.ini.The "Globalvars.ini" and the "Swap.ini" are most interesting. We will use them to examine and even patch a mod. All setting possibilities of the Globalvars.ini are discussed in "CSM stuff (brain goes boom)" by ZaZ.
Changing the CSM menu entries
Look into the Globalvars.ini. Go to the [trackname] label.
...
[trackname]
Allowchange =1
Name =Grand Prix of ...
Name Icon =Files\Icons\gp2.ico
VarCount =21
Var1 =Melbourne
...
VarName1 =Australia - Melbourne
...
VarName1 Icon =Files\Icons\au.ico
...
VarPreview1 =Files\Preview\Tracks\Melbourne.jpg
...
Here the names (Var1,...Var21) of the tracks used by the mod are defined. They will be used with the variable %trackname% in other ini or text files.You see "Allowchange" set to 1. This creates the track drop-down selection list in the CSM menu.
The menu uses the values of "Name" and "Name Icon" for the selection entry in the CSM menu "The mod's configurables" while "VarName1" ... "Varname21" define the track names in the drop-down list at the bottom. You may change them here, for example you could add the tracks number changing "Australia - Melbourne" to "01 Australia - Melbourne". The "Varname1 Icon" sets the path and name of the icon file. The icon is then displayed in front of the VarName. The VarPreview entries add pictures of the tracks.
If you have chosen a track, then in the menu "Load and restore mods" under the mods picture a picture showing which track is currently selected is displayed. This is set in the "2018.csm" in the mods main folder:
...
Preview Back =Data\Files\Preview\Tracks\2018-%trackname%.jpg
Info =Data\Files\Preview\Misc\2018.rtf
...
The text "The 2018 mod ..." of the rtf file is merged with the %trackname% picture.
You may configure more sophisicated menu displays using font settings. For example in the 1991 mod "The mod's configurables" menu has entries with changing background between white and black. This is done by adding the following to the variable settings in the Globalvars.ini.
...
[gpname]
...
Name FontName =Verdana
Name FontSize =8
Name FontBold =1
Name BackColor =255,255,255
Name TextColor =0,0,0
...
[driver]
Name FontName =Verdana
Name FontSize =8
Name FontBold =1
Name BackColor =0,0,0
Name TextColor =255,255,255
...
and so on with changing Backcolor and Textcolor every time.
Adding a new driver
As an example I will take the 2017 F1 mods driver replace "button" for "alonso" in race 6, Monaco. You have to work on the following, where point 1 is most important:
1. The performance files
2. Helmet
3. Globalvars.ini driver settings
4. Teamart driver picture (and ev. helmet picture)
5. Driver and team gpaedia
1) Performance files are used by the GpxPatch program. They are text files that define the team and driver names and numbers for the ingame driver selection menu and set the qualifying and racing performance values. You find detailed information about the structure of a performance file in the grandprixgames.org threads "GP4 performance files" and "Performance files".
In the 2017 mod the performance text files are all in the GpXpatch subfolder of the data folder. Most mods use a subfolder "Performance" instead, like the 2018 mod does. Alonso as the default first driver of the McLaren Honda team is found in the default performance text file as well as in any other trackspecific performance file except the one for the Monaco Grand Prix, where he has to be replaced by Button.
Default "performance.txt":
...
[Team #05]
Name=McLaren,Honda
Performance=855,855,8193
First Driver=14,Fernando Alonso,15313,236,15175,265,ES,ALO
Second Driver=2,Stoffel Vandoorne,15178,262,15019,380,BE,VAN
...
Monaco "performance_monaco.txt":
...
[Team #05]
Name=McLaren,Honda
Performance=855,855,2926
First Driver=22,Jenson Button,15172,128,15539,128,GB,BUT
Second Driver=2,Stoffel Vandoorne,15694,251,15488,371,BE,VAN
...
You will now have "Button" as first McLaren driver when choosing the Monaco track. He will appear in the ingame driver selection list as well as in racing.2) Helmet
But he has the wrong helmet; we still see the standard helmet of the original GP4. A helmet texture, a .tex file that you can open with Slimtex, has to be made and put into the data\Helmets\button folder. To make the helmet appear ingame additional changes are necessary.
3) Globalvars.ini driver setting
Look into the data\Helmets\helmets.ini. You see that driver 11 is represented by the variable %driver11%, which is by default "alonso". To get "button" for track 6, we have to add a driver change into the Globalvars.ini:
[driver11]
allowchange =0
name =
varcount =20
var1 =alonso
var2 =alonso
var3 =alonso
var4 =alonso
var5 =alonso
var6 =button
var7 =alonso
var8 =alonso
var9 =alonso
var10 =alonso
var11 =alonso
var12 =alonso
var13 =alonso
var14 =alonso
var15 =alonso
var16 =alonso
var17 =alonso
var18 =alonso
var19 =alonso
var20 =alonso
Now with the modify setting in the trackname definition
[trackname]
...
Modify =tracknum,racenum,tracklist,...,driver11,...
we get a trackspecific %driver11% that is "button" only for track number 6.4) Teamart driver picture
The [driver11] setting should also point to the correct files in the data\Teamart folders "Drivers" and "Helmets", where you find the gpi graphic files for the ingame driver pictures and the driver gpaedia background helmets. You can display gpi files using the ZAZ GP4 tool Slimtex.
In the 2017 mod the teamart helmets are disabled. In the TeamArt\Drivers folder there should be a file "button.gpi" but you will not find it. This picture has yet to be created. If you want to do this, you have to make a 256x256 tga file and convert it to gpi with Slimtex (Batch to gpi). In the game the standard image (Barrichello) is shown instead of a Button image.
5) Driver and team gpaedia
The last and probably least important update has to be made with the gpaedia.
The gpaedia files are found in the data\GPaedia folder in the subfolders belonging to the tracklist 2018a.
The two tracklists 2018a and 2018b have been defined in the Globalvars.ini file. This is necessary for a season with more than 17 tracks.
The 5 files "GP2017_English-6.gps" ... "GP2017_italiano-6.gps" have got the trackspecific data for the Monaco GP. They are made using the tool GPaediaMaker and the GPaedia 2017 files.
Now, when you select the Monaco GP and look at the drivers gpaedia, Jenson Button should be shown as driver 11. But he doesn't! You see Alonso. What is wrong?
If you look into "GP2017_English-6.gps" with a text editor you will see that Button is there. The gps files are okay. How are the gps files included into the game? This is made by swapping them due to the settings in the Swap.ini file. This looks like
[Main]
Format=
[Vars]
gpaedianum1 =1
gpaedianum2 =1
gpaedianum11 =11
gpaedianum15 =15
gpaedianum16 =15
gpaedianum17 =17
gpaedianum18 =1
gpaedianum19 =1
gpaedianum20 =1
[Swapfiles]
File1 =GPaedia\%tracklist%\GP2017_English.gps,MenuData\PC\GP2001\GP2001_English.gps
File2 =GPaedia\%tracklist%\GP2017_Deutsch.gps,MenuData\PC\GP2001\GP2001_Deutsch.gps
File3 =GPaedia\%tracklist%\GP2017_español.gps,MenuData\PC\GP2001\GP2001_español.gps
File4 =GPaedia\%tracklist%\GP2017_Français.gps,MenuData\PC\GP2001\GP2001_Français.gps
File5 =GPaedia\%tracklist%\GP2017_italiano.gps,MenuData\PC\GP2001\GP2001_italiano.gps
File6 =GPaedia\%tracklist%\GP2017_English-(gpaedianum%tracknum%).gps,MenuData\PC\GP2001\GP2001_English.gps
File7 =GPaedia\%tracklist%\GP2017_Deutsch-(gpaedianum%tracknum%).gps,MenuData\PC\GP2001\GP2001_Deutsch.gps
File8 =GPaedia\%tracklist%\GP2017_español-(gpaedianum%tracknum%).gps,MenuData\PC\GP2001\GP2001_español.gps
File9 =GPaedia\%tracklist%\GP2017_Français-(gpaedianum%tracknum%).gps,MenuData\PC\GP2001\GP2001_Français.gps
File10 =Gpaedia\%tracklist%\GP2017_italiano-(gpaedianum%tracknum%).gps,MenuData\PC\GP2001\GP2001_italiano.gps
...
For track 6 %tracknum% has the value 6 and gpaedianum6 should have the value 6. But this setting has been forgotten in the [Vars] section and here we have the cause for the wrong gpaedia. Fixing it is easily done.Just add the line
gpaedianum6 =6
into the [Vars] section above the track 11 specification. Start the mod with CSM again, and you will see the correct gpaedia now.Installing a new track
Tracks are not part of a CSM mod. Though the TSM is included into the CSM GUI it is in fact an independent program. For some seasons trackpacks are made and together with the mod you will have a complete GP4 set. If this is not the case, you have to gather available tracks fitting the season and install them yourself.
To install a trackpack you have to use the TSM. Select "Manage tracks", "Tasks", "Install tracks".
Single tracks are often just archive files and I prefer to install them manually.
Tracks are stored into the subfolder "Tracks" of the "Grand Prix 4" folder. Here you have ini files (one or two for a season) to define which tracks belong to the season. In TSM they are called "Profiles". The 2018 season needs two files: 2018a.ini and 2018b.ini that look like this on my computer:
2018a.ini:
[Tracks]
Track1=Melbourne\2016\settings.ini
Track2=Sakhir\2016\settings.ini
Track3=Shanghai\2016\settings.ini
Track4=Baku\2017\settings.ini
Track5=Barcelona\2016\settings.ini
Track6=Monaco\2014\settings.ini
Track7=Montreal\2016\settings.ini
Track8=Paul Ricard\2018\settings.ini
Track9=A1Ring\2016\settings.ini
Track10=Silverstone\2016\settings.ini
Track11=Hockenheim\2012\settings.ini
Track12=Hungaroring\2016\settings.ini
Track13=SpaFrancorchamps\2016\settings.ini
Track14=Monza\2018\settings.ini
Track15=singapore\2016\settings.ini
Track16=Sochi\2016\settings.ini
Track17=suzuka\2016\settings.ini
2018b.ini:
[Tracks]
Track1=Austin\2016\settings.ini
Track2=Mexico City\2017\settings.ini
Track3=Interlagos\2016\settings.ini
Track4=abu_dhabi\2016\settings.ini
Track5=none
Track6=none
Track7=none
Track8=none
Track9=none
Track10=none
Track11=none
Track12=none
Track13=none
Track14=none
Track15=none
Track16=none
Track17=none
As you see I prefer a track folder structure like
- Tracks
- A1Ring
- 1976
- 1979
...
- 2016
- PLUS
- abu_dhabi
- 2009
- 2011
- 2012
- 2016
...
To install the new "Paul Ricard 2018" track, it's file location has to be written into the 2018a.ini file.
Then all files from the downloaded archive are extracted into the tracks folder, for me it is "Paul Ricard\2018".
Finally a "settings.ini" file has to be created in this folder, that has a content like:
[Settings]
Name=Paul Ricard
Year=2018
Country=France
Author=gezere
Adjective=French
Event=Grand Prix de France
Wad=suzuka2001.wad
Dat=s1ct17.dat
Gpi=
Important are the Name, Country, Wad and Dat settings.Name and Country are displayed in the ingame circuit select menu.
The adjective will be displayed in the racing result menu, if in the GPxPatch tab [GPxTrack] the "Catch menu strings" option is checked. You have to be aware of the fact that the national adjective may also be set by the mods menu str files. In this case it is advisable to uncheck the "Catch menu strings" option. This is true for both the 2017 and 2018 mod. Look into the mods Settings\Swap.ini to see if menu str files are swapped.
If you set the gpi value and include the gpi file in the tracks folder, this will be displayed as trackmap in the game. It will override a trackmap set by the mods data and swapped.
Using a track profile with CSM
A mod can point to a track profile with a setting in the main csm file, e.g. for 2017 or 2018:
FixedTrackProfile =%tracklist%.ini
TrackProfile =%tracklist%.ini
This will automatically select the tracklist that belongs to the selected track. CSM does display this in the drop-down list "List" of "The mod's configurables" menu. You have to click on "Load and restore mods" and then back on the configurables button to refresh the display value of "List", but the tracklist is set correctly already.
CSM will now "talk to TSM" and load the specified tracks.