Page 1 of 3

Giving vehicles fuel

Posted: Thu Jan 24, 2013 3:05 am
by Vilespring
I have been trying to make a map where the vehicles have limited fuel, so there are more limiting factors than ammo and good ol' hit points. Another little goal is having individual parts of the tank get damaged (world of tanks, no?) I'm not making this in the map, just the game's Objects RFA. This is a csm.

Re: giving vehicles fuel

Posted: Thu Jan 24, 2013 4:21 am
by Swaffy
Look at the Wasserfall from the SWoWWII expansion.

Re: giving vehicles fuel

Posted: Thu Jan 24, 2013 8:49 am
by Senshi
Yup, that's a good place to start looking. The trick is all about misusing the cooldown system for weapons. Having a visual display for fuel reserves on a vehicle with more than two weapons will require a bit of sorcery, however.

Re: giving vehicles fuel

Posted: Thu Jan 24, 2013 10:55 pm
by Vilespring
Thanks! I just don't know how to get the fuel bar on the screen. People would just stop and go "WTF?" without seeing a bar going lower as you drive. I see
ObjectTemplate.InverseHeatBar 1
ObjectTemplate.setHeatBarType B
but, I don't see a bar display in the either Objects.con or Physics.con.

Re: giving vehicles fuel

Posted: Sun Jan 27, 2013 5:36 am
by Vilespring
I'm getting kind worried now, I have done almost everything, and I can't get the fuel reserves to show in the driver position, even with the willy. I need a tip or two in the right direction.

Re: giving vehicles fuel

Posted: Sun Jan 27, 2013 6:06 am
by Swaffy
I'll try to break it down using what knowledge I have.

ObjectTemplate.HeatIncrement 0.00084 ObjectTemplate.InverseHeatBar 1 ObjectTemplate.setHeatBarType B The code is added to the engine of the vehicle, usually found in the "Physics.con" file.

Re: giving vehicles fuel

Posted: Sun Jan 27, 2013 4:45 pm
by Vilespring
That clears up a lot for me, except how to get a visual bar on the HUD. The willy runs out of gas, but I can't know when.

Re: giving vehicles fuel

Posted: Sun Jan 27, 2013 8:40 pm
by freddy
Vilespring wrote:That clears up a lot for me, except how to get a visual bar on the HUD. The willy runs out of gas, but I can't know when.
I have an old jeeprace mod where i used the rocketengine and added this heatcode and it shows up ingame.

http://www.youtube.com/watch?v=U6mkiw6VKJw

edit: maybe the difference is where the engine is added

Re: giving vehicles fuel

Posted: Mon Jan 28, 2013 10:43 pm
by Vilespring
maybe so, can you put the con file up here?

EDIT: or, it has to be a certain engine. the car engine works; it runs out of gas, but no display.

Re: giving vehicles fuel

Posted: Tue Jan 29, 2013 12:50 am
by dudejo
According to my own research so far, I can confirm one thing.

Whatever makes that heat bar appear, it involves something that planes are coded with. I added heat data to the Mustang airplane's engine data and the heat bar showed up next to the armor gauge, like it's supposed to.

Sadly, I currently can't figure out WTF it's supposed to be.

Edit @ 7:10 pm : To Vilespring, it's not the engine type. Just for kicks, I gave the Mustang airplane the c_ETCar engine type and the heat gauge still appeared (although the plane went nowhere fast).