How to force f1graphics.cfg to control all settings with CSM

Posted by TomMK 
Here's a little trick I came up with to make sure that f1graphics.cfg is always set to control the graphics, without needing the user to manually edit the file.

In the mod's .csm file, add these commands to PostExecute and PreRestore:

PostExecute			=cmd /c copy /y "%Gp4Path%"f1graphics.cfg "%Gp4Path%"f1graphics.tmp && echo 1 > "%Gp4Path%"f1graphics.cfg && more +1 "%Gp4Path%"f1graphics.tmp >> "%Gp4Path%"f1graphics.cfg
PreRestore			=cmd /c move /y "%Gp4Path%"f1graphics.tmp "%Gp4Path%"f1graphics.cfg

It simply uses batch commands to type a "1" onto the first line of f1graphics.cfg, and then processes the rest of the file without change. When the game is over, it restores the original version of the file.

=====================================================


Intel NUC 8i3, 8GB RAM, MS Sidewinder Wheel
Very good tip Tom! :)
I've found while making the GP4 Central 2013 Mod that this is actually a stupid way to achieve this. A better way is simply to use the CSM.ini file, specifically the F1graphics variable and start that value with a 1 as follows:

CSM.ini
F1graphics = 1,,,,,,,,,,,,,,,,,,,,

You live and learn :)

=====================================================


Intel NUC 8i3, 8GB RAM, MS Sidewinder Wheel
Yes, it's easier like this :)
Sorry, only registered users may post in this forum.

Click here to login

Maintainer: mortal, stephan | Design: stephan, Lo2k | Moderatoren: mortal, TomMK, Noog, stephan | Downloads: Lo2k | Supported by: Atlassian Experts Berlin | Forum Rules | Policy