How to assign different engines to AI cars?

  • Thread starter Johannes Rojola
  • Start date

Johannes Rojola

I've ran into a frustrating problem.

In my mod there is three completely different engines available. And of course these are in three different 'engine.ini" files.

I know that I can change .HDV parameters from vehicle upgrades file, however I can't seem to change the actual line which refers to 'engine.ini" file. Frustrating because that is the most important parameter to change to be able to give AI car a certain engine.

I've solved this by giving every car+engine combination their own .HDV file, but that is very impractical. So is it possible somehow to change this line:

Code:
[ENGINE]
Normal=               // unrestricted engine
RestrictorPlate=        // restrictor plate engine

....through upgrades file?
 
From one of the Panoz upgrades files:

HDV=[ENGINE]
HDV=Normal=FordV8Supercharged_engine
HDV=RestrictorPlate=FordV8Supercharged_engine

In other words, you change it the same way you change any other HDV parameter in the upgrades file. ;)
 
From one of the Panoz upgrades files:



In other words, you change it the same way you change any other HDV parameter in the upgrades file. ;)

That's how I did it but it doesn't work... It always uses the default engine in .HDV file, and if I completely remove the reference to any file from .HDV, game crashes.
 
A number of mods do it that way, including several of the standard rFactor ones, so if it's not working something else must be wrong. How are you verifying which engine is actually being used?

If there are clear differences between the standard and upgrade engine, so you know absolutely for sure it's not being picked up, I would throw something else in the same upgrade just to confirm that it's being picked up correctly - that way you can narrow down the problem to an incorrectly specified upgrade or something with the engine lines being wrong.

If you can't work it out you could probably paste in the relevant lines from the upgrade file, but I think if you double-check everything you might find some typos or something in there. (and obviously it can be difficult for others to check for errors when multiple files are being referenced)
 
How are you verifying which engine is actually being used?

If there are clear differences between the standard and upgrade engine, so you know absolutely for sure it's not being picked up, I would throw something else in the same upgrade just to confirm that it's being picked up correctly - that way you can narrow down the problem to an incorrectly specified upgrade or something with the engine lines being wrong.

If you can't work it out you could probably paste in the relevant lines from the upgrade file, but I think if you double-check everything you might find some typos or something in there. (and obviously it can be difficult for others to check for errors when multiple files are being referenced)

The standard engine is one of the engine.ini files that is assigned in HDV file. However the point is to change that line if engine is switched to some other through upgrades. The differences between engines are so big that it is easy to spot which one is in use. These are the actual lines in upgrade file:

Code:
 HDV=[GENERAL]
    HDV=Mass=7160 
    HDV=[ENGINE]
    HDV=Normal=engine_Cummins_KTA600.ini
    HDV=RestrictorPlate=engine_Cummins_KTA600.ini

Mass change works, I've tested it with some very big numbers. However engine line doesn't work, its uses always the default lines in HDV. I've checked for typos several times :)
 
One thing I've noticed in the upgrades files is that when switching between sections ([GENERAL] to [ENGINE], for example) there's a blank line ("HDV=") between them. Perhaps that is required so it's not trying to go to the ENGINE section within the GENERAL section?

Assuming you haven't deleted any lines above, that might be worth a shot. (take a look at one of the ISI upgrades files, you'll see what I mean)

Edit: Here's a complete HDV section of one of the Panoz upgrades to illustrate:

HDV=[GENERAL]
HDV=Mass-=10.0
HDV=Inertia-=(4.0, 6.5, 4.0)
HDV=CGHeight-=0.0005
HDV=CGRearRange+=(0.0005, 0, 0)
HDV=
HDV=[BODYAERO]
HDV=RadiatorDrag+=(0.0003)
HDV=RadiatorLift+=(0.0001)
HDV=
HDV=[ENGINE]
HDV=RadiatorCooling+=(0.200e-006, 0.400e-006)
 
Last edited:

Haha, I really hope that is the solution. I'll try it when I get home. I really hope this upgrade-system would have massive overhaul in rF2...

Yep, that did it! Single empty HDV= line :D I never really put any emphasis on that before, thank you helping me out.
 
Last edited:
I am experiencing the same problem, except that adding the HDV= line didn't solve it. Here is my code in the _upgrades.ini file.

Code:
	UpgradeLevel="BT49 With Front Wing"
 	{
		Description="Brabham BT49 Cosworth With Front Wing"

		GEN=<FWINGEXISTS>=""
		GEN=<FWING1>=bt50_front_wing.gmt

HDV=[GENERAL]
HDV=Mass=655
HDV=Inertia=(1093.379,1463.877,370.582)
HDV=FuelSetting=65
HDV=FuelRange=(1.0,1.0,220)
HDV=
HDV=[ENGINE]
HDV=Normal=1982_nul
HDV=RestrictorPlate=1982_nul

	}


When I assign a very high value to the mass in the above upgrade, it works, I indeed have a very heavy car.

When I assign the 1982_nul engine via the hdv file, the engine won't start, which is expected (1982_nul.ini is an engine file with screwed up values that I made for testing purposes).

But when I use the above upgrade code, the engine starts like nothing happened, which means that the 1982_nul engine is not used. What have I missed ? I thought it might be the directory where the file is looked for, but I tried pasting 1982_nul.ini in various locations without effect.
 

Back
Top