Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

the_gas

Petrol Mod

Recommended Posts

the_gas

I have always enjoyed the petrol mods that come out for gta games. Anything that can add an extra level of realism is good imo.

 

Anyway, what are the chances of one being created for GTA IV? Once you enter a car it is stored in memory so hopefully it should save the amount of petrol you put in it. This was always a problem with previous petrol mods.

Share this post


Link to post
Share on other sites
a-k-t-w

Yes, I think this is possible. Just make the car stop working after you run out of petrol?

Share this post


Link to post
Share on other sites
the_gas

Yeah i have no idea how to do it, but it would be a great realism mod. If it is made, hopefully the car you are driving will remember how much petrol you have put in it. Thats been the problem with previous petrol mods, as soon as you put the car in the garage, the amount of petrol put in was lost, and you could go from having a full tank to nothing at all.

 

Another nice addition would be petrol station icons added to the map.

Share this post


Link to post
Share on other sites
HazardX

Doing a petrol mod wouldn't be too hard. But it is not possible to store the amount of petrol in the savegame, as far as i know.

Share this post


Link to post
Share on other sites
the_gas

But if you get into a car, and then leave it, that car is stored in memory, ie it stays there unless you quit the game, or get into another car. So there must be some way of getting said car to remember the amount of said petrol.

Share this post


Link to post
Share on other sites
HazardX
But if you get into a car, and then leave it, that car is stored in memory, ie it stays there unless you quit the game, or get into another car. So there must be some way of getting said car to remember the amount of said petrol.

Yes, this works as long as the current game runs. But as soon as you load a savegame all objects will get new unique IDs and thus the stored information is gone.

Share this post


Link to post
Share on other sites
FakeJ66

it should be possbile by lua-scripting as far as i know. because there is a mod for sa already. and it's a cleo script.

Share this post


Link to post
Share on other sites
Intosia

Cant be to hard. Give every car a 'gas amount' and a 'fuel ratio'. Then just read the velocity of the car and do some math. Or am i missing something?

Share this post


Link to post
Share on other sites
the_gas

Good Good, hopefully someone can make it. As long as it remembers my petrol count if i leave my car to say go online, or go to a strip club, then im happy.

Share this post


Link to post
Share on other sites
Pandur

Of course there must also be a way to refill your car at the gas stations!!!

Surely a lot of work, but should be possible!

 

I hope for it, too!

Share this post


Link to post
Share on other sites
the_gas

Who will be our knight in shining armour? confused.gif

Share this post


Link to post
Share on other sites
Andrew

Hmm could be interesting, I wouldnt even be sure on the maths involved. There isn't any way of drawing to the screen properly yet. So any display that we had last time doesn't work.

 

 

Share this post


Link to post
Share on other sites
Symbiote
Cant be to hard. Give every car a 'gas amount' and a 'fuel ratio'. Then just read the velocity of the car and do some math. Or am i missing something?

^ The problem with this is that it would use up gas whenever you're moving, even if you're only coasting. So it'd be better to have it do the math when W is pressed/the controller trigger is squeezed.

Share this post


Link to post
Share on other sites
the_gas
Cant be to hard. Give every car a 'gas amount' and a 'fuel ratio'. Then just read the velocity of the car and do some math. Or am i missing something?

^ The problem with this is that it would use up gas whenever you're moving, even if you're only coasting. So it'd be better to have it do the math when W is pressed/the controller trigger is squeezed.

That's a good shout.

Share this post


Link to post
Share on other sites
Andrew
Cant be to hard. Give every car a 'gas amount' and a 'fuel ratio'. Then just read the velocity of the car and do some math. Or am i missing something?

^ The problem with this is that it would use up gas whenever you're moving, even if you're only coasting. So it'd be better to have it do the math when W is pressed/the controller trigger is squeezed.

That's a good shout.

Even if you're coasting in a car you're using up fuel. Since the engine is still running and still ticking over.

Share this post


Link to post
Share on other sites
the_gas

True, but but the petrol consumption in this situation must be lower than at top speed, if this can be factored in i doubt it.

Share this post


Link to post
Share on other sites
Andrew

Very true, IV has a velocity varible. I think this holds the amount of acceleration being applied to the car.

 

I made a very basic mod, my scripting skills arent good, lol. No filling stations yet, or no way to refill the tank, not to mention that one tank is for every car in the game. And it currently drains fuel based on the speed.

Edited by Gangsta Killa

Share this post


Link to post
Share on other sites
Symbiote

Well that's a good start! And yes, sorry, my logic was wrong because I don't know much about the mechanics of cars. I figured only pushing the gas pedal used gas.

Share this post


Link to post
Share on other sites
Andrew

I had a check into the Velocity value, its empty. So that can't be used to drive. I'm going to see if its possible to get a controller press.

 

Currently the petrol works like so.

 

-One tank for all cars

-Petrol is drained depending on the speed of the car.

-Amout used goes up in 0.25f increments expect at top speed where its a 2.0f drain

-Fuel is drained every second.

 

At the present moment, a tank that has 60 fuel, will get you from The Algonquin safehouse to somewhere on the first island. I tried to find a way to turn off the cars engine once you'd ran out of fuel, or set a flag to say can't start car. At the moment I'm having to freeze the cars position and turn on its hazard lights.

Share this post


Link to post
Share on other sites
the_gas

Good work Gangsta, sorry i cant be of more help. Hopefully you can continue to improve the mods realism.

Share this post


Link to post
Share on other sites
Andrew

I'm trying, not got time to work on it today, until later on tonight. I'm using the .net scripthook. Having some fun with the native calls now.

 

I've got a couple of ideas on how to store fuel for a few different cars.

 

Edit: Trying to work out how the "SET_ENGINE_ON" native works, each way I've tried causes an error in the script.

 

Edited by Gangsta Killa

Share this post


Link to post
Share on other sites
HazardX

Did you try to set the EngineHealth of the car to 0? It would be a way to stop it from working.

Share this post


Link to post
Share on other sites
Gen0cide_

But then, say you coasted into the petrol station, you wouldn't be able to refuel as youre engine would be destroyed.

 

Oh, and couldn't you dump saved petrol info into a txt file in a folder that the script could create. If you label it according to what slot the game is saved in, and have the info apply itself to certain car names at each safehouse in a certain order, you would only get mismatched petrol values when there are two cars at the same safehouse at the same time. And that wouldn't really matter as the only real difference is probably the color of the cars

Share this post


Link to post
Share on other sites
Pandur

 

Did you try to set the EngineHealth of the car to 0? It would be a way to stop it from working.

 

Hmm, also it will force the engine to smoke...

 

SET_ENGINE_ON only lets the char restart the engine, as far as I know. I tried to make a lua file that makes the char turning engines on and off without leaving the car. For me, it was only possible with a tricky function...

 

I havent found a native that forces the engines off till now.

Share this post


Link to post
Share on other sites
the_gas

Guys, gonna level with you. I ain't got a clue what you are on about, but we have faith in you to make this mod possible. happy.gif

Share this post


Link to post
Share on other sites
Leopard_

 

Guys, gonna level with you. I ain't got a clue what you are on about, but we have faith in you to make this mod possible.  happy.gif

Good news for you. I've done an gas mod (with an working gas station!). Going to release soon i think.. just gonna have to upload it. I'll edit this post when i have uploaded it.

 

EDIT:

Fuel mod, right here.

 

Leopard

Edited by Leopard_

Share this post


Link to post
Share on other sites
Pandur

 

Good news for you. I've done an gas mod (with an working gas station!). Going to release soon i think.. just gonna have to upload it. I'll edit this post when i have uploaded it.

 

wow.gif Awesome!!! I definitelly try this one out!!!

Share this post


Link to post
Share on other sites
Andrew
Did you try to set the EngineHealth of the car to 0? It would be a way to stop it from working.

I did indeed, set to 0, but it smokes and continues to run until you crash it then it stops.

 

@Leopard, how did you manage to stop the cars engine?

Share this post


Link to post
Share on other sites
Leopard_

 

@Leopard, how did you manage to stop the cars engine?

I turned off the engine, then setted the engine health to 0. Combination works great. Niko never success starting the car tounge2.gif

But the smoke appears, which i don't want.

Might aswell share what i have...

 

void OnVehicleFuelStop(Ped ped){Vehicle veh;GetCarCharIsUsing(ped, &veh);SetEngineHealth(veh, 0.0);SetCarEngineOn(veh, 0, 1);BottomText("Out of fuel", 4000);}

 

 

 

Share this post


Link to post
Share on other sites
sammclean23

going to go in game tonight and find more stations

 

have you found any others since the one included in the mod (leopard)

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.