Greetings. This is my first post here and I really hope it can be solved. It will probably look like a nightmare at first, but I'm pretty sure it can be worked out.
I've got a slight problem. It seems that OFP's vehicle fuel accounting does not work very well.
What I'm trying to do is to put just enough fuel into an M1A2 Abrams to make it have a maximum cruising range of 420km (just like the real one). I am calculating the fuel mileage by using a mileage calculator script that I downloaded from this site. (It calculates distance traveled in meters).
Here's how I'm doing the calculating. In my M1A2's config.cpp I set fuelCapacity=500, which means that it has 500 gallons of fuel. Now, I load up my mission and activate the mileage script. I then added the following to the Init line of the M1A2:
vehicle1 setFuel 0.0027
So, now I'm using 0.0027% of 500 gallons of fuel, which equals 1.35 gallons.
Using only 1.35 gallons of fuel, the M1A2 will travel 980 meters before running out. That would place the maximum cruising range at 362km (50km short of what I'm wanting it to be).
Well, it looks like 500 gallons of fuel isn't going to be enough, so I edited the config.cpp and set it to fuelCapacity=800.
I reload my mission and mileage script and put the same Init on the M1A2. So, now I'm using 0.0027% of 800 gallons of fuel, which equals 2.16 gallons.
Well, guess what. It still only travels 980 meters even though I just added 300 gallons more fuel to it!
And this is the funny part. I put the same Init line on a Hummer and it only got about 30 meters before running out of gas.
Anyone got any ideas?