Giving vehicles fuel
- Vilespring
- Posts: 740
- Joined: Sat Nov 24, 2012 5:47 am
- Location: Somewere in the United States
Giving vehicles fuel
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.
A picture is worth a thousand words, but takes up three thousand times the memory.
Area 51: http://battlefieldarea51mod.weebly.com/

"I didn't steal your pizza"
Area 51: http://battlefieldarea51mod.weebly.com/

"I didn't steal your pizza"
Re: giving vehicles fuel
Look at the Wasserfall from the SWoWWII expansion.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Re: giving vehicles fuel
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.
- Vilespring
- Posts: 740
- Joined: Sat Nov 24, 2012 5:47 am
- Location: Somewere in the United States
Re: giving vehicles fuel
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.
ObjectTemplate.InverseHeatBar 1
ObjectTemplate.setHeatBarType B
but, I don't see a bar display in the either Objects.con or Physics.con.
A picture is worth a thousand words, but takes up three thousand times the memory.
Area 51: http://battlefieldarea51mod.weebly.com/

"I didn't steal your pizza"
Area 51: http://battlefieldarea51mod.weebly.com/

"I didn't steal your pizza"
- Vilespring
- Posts: 740
- Joined: Sat Nov 24, 2012 5:47 am
- Location: Somewere in the United States
Re: giving vehicles fuel
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.
A picture is worth a thousand words, but takes up three thousand times the memory.
Area 51: http://battlefieldarea51mod.weebly.com/

"I didn't steal your pizza"
Area 51: http://battlefieldarea51mod.weebly.com/

"I didn't steal your pizza"
Re: giving vehicles fuel
I'll try to break it down using what knowledge I have.
ObjectTemplate.HeatIncrement 0.00084
ObjectTemplate.HeatIncrement 0.00084
- This is how much is added to the heat bar - regarding how long the engine is being used. In this case, the amount of "fuel lost over time".
http://bfmods.com/mdt/scripting/ObjectT ... ement.html
- Instead of the bar going up (as in "heating up"), the bar starts out full and goes down (in this case, "losing fuel")
http://bfmods.com/mdt/scripting/ObjectT ... atBar.html
- This shows the type of bar used (the image on your screen).
http://bfmods.com/mdt/scripting/ObjectT ... rType.html
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
- Vilespring
- Posts: 740
- Joined: Sat Nov 24, 2012 5:47 am
- Location: Somewere in the United States
Re: giving vehicles fuel
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.
A picture is worth a thousand words, but takes up three thousand times the memory.
Area 51: http://battlefieldarea51mod.weebly.com/

"I didn't steal your pizza"
Area 51: http://battlefieldarea51mod.weebly.com/

"I didn't steal your pizza"
Re: giving vehicles fuel
I have an old jeeprace mod where i used the rocketengine and added this heatcode and it shows up ingame.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.
http://www.youtube.com/watch?v=U6mkiw6VKJw
edit: maybe the difference is where the engine is added
- Vilespring
- Posts: 740
- Joined: Sat Nov 24, 2012 5:47 am
- Location: Somewere in the United States
Re: giving vehicles fuel
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.
EDIT: or, it has to be a certain engine. the car engine works; it runs out of gas, but no display.
A picture is worth a thousand words, but takes up three thousand times the memory.
Area 51: http://battlefieldarea51mod.weebly.com/

"I didn't steal your pizza"
Area 51: http://battlefieldarea51mod.weebly.com/

"I didn't steal your pizza"
Re: giving vehicles fuel
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).
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).