[InternalPlugins] Get currently selected "Engine Boost:"

Frank Geyer

Hi all,

Does anyone know a convenient way of fetching the currently selected "Engine Boost Mapping", e.g. 1-5 for a Le Mans Prototype car, while the driver is on the track, if available for the vehicle, by the InternalPlugins of rFactor1?

Thank you very much in advance!

Cheers
Frank
 
I don't think this is possible. The only way you could find this info is by sniffing memory.
 
Hi Noel, hi Lazza,

thanx for your quick replies. I really was afraid that you guys gonna say that :( ... ;) but I was hoping till the end to avoid an approach like this ...

Cheers
Frank
 
There are several things I would love access too but the only way to find them is in memory and I haven't had any luck with this method. The other problem with reading stuff from memory is you have to account for the different EXEs that are out there (Online/Offline/G27).
 
@Noel: True true - and how good your intensions are !?!? Messing around with memory values will always be followed by the bitter taste of cheating ... or am I wrong in this case ???

Cheers
Frank
 
Sorry for being so late, Frank.

mm.. Actually, there is a 'second' place where you can read it.. less 'hacky' than a memory search..

Once you know the player's PLR file location (ScoringInfoV1->mPlrFileName) you can go that same folder and look for a special file:
tempGarage.svm

That file is a read-only version of the garage setup in use by the player. In use I mean player is on track (out of monitor mode) and the file is updated everytime the player joins or exit the track.

You will find there all the settings available in the garage as regular strings with a special format (among additional information), and you may read this file as a regular ini file with the GetPrivateProfileString() method depending on the garage parameter's category.

In your case:

[ENGINE]
//RevLimitSetting=0//7,200
//EngineBoostSetting=0//1

When the line is commented, the default value is in use, when it is uncommented, that means the player changed the value, and the value can be read as: SpinnerIndex//ShowValue

Unfortunatelly, as this value can be changed while on track, you have to take care of player's changing the engine boost value, and for that you have to do one more thing to control it and it is to use the great forgotten:

InternalsPlugin::CheckHWControl( const char *const controlName, float &fRetVal )

You must look for: Control - Increment Boost and Control - Decrement Boost.

Note that you can't edit them, but there function is there and you can read when the player is increasing or decreasing the boost mapping. the RetVal is the value you need to take to know if the player is changing it.

However you haven't finished yet. You need to know the limits of the engine boost control, and that requires more additional job..
- by reading the tempGarage.svm you will find what upgrades the player has selected.
- by reading the tempGarage.svm you will now what .VEH file is the player using
With this information you can now be sure what HDV file is in use and look for it and read the value of:

[ENGINE]
Normal=xxxx.xx

This file describes the engine and there you can find the boost mapping settings:

EngineMapSetting=12
EngineBoostRange=(0 , 1, 12)

Not sure if you want to do this, but this way you don't need to take of executable versions and nobody would blame about memory sniffing. Now, does it worth the pain? :)
 
Hi Sven,

thank you very much for all your explanation !!! Really appreciate those and I will have a look at it all!

Cheers
Frank
 

Back
Top