Giving vehicles fuel

Ask questions, discuss ideas, get answers
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Giving vehicles fuel

Post 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.
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: giving vehicles fuel

Post by Swaffy »

Look at the Wasserfall from the SWoWWII expansion.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: giving vehicles fuel

Post 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.
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: giving vehicles fuel

Post 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.
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: giving vehicles fuel

Post 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.
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: giving vehicles fuel

Post 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.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: giving vehicles fuel

Post 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.
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: giving vehicles fuel

Post 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
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: giving vehicles fuel

Post 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.
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
dudejo
Posts: 71
Joined: Tue Nov 30, 2010 2:33 am

Re: giving vehicles fuel

Post 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).
Post Reply