Quantcast

Jump to content

» «
Photo

[IV | REL/WIP] FuelScript IV

724 replies to this topic
a-k-t-w
  • a-k-t-w

    Wannabe GTA IV Dev

  • Members
  • Joined: 30 Sep 2008

#61

Posted 26 February 2009 - 08:21 AM

QUOTE (Gangsta Killa @ Feb 26 2009, 17:11)
I'll implement a few console commands, and set some prices for them in the ini.

I meant that the console fills you car up for free. Because sometimes I buy a car (with the vehicle selector) to find that it has not enough petrol to make it to the nearest station, and it is especially annoying when you buy a boat, seeing as there are no boat refuel stations, I'm pretty much screwed.

Andrew
  • Andrew

  • Andolini Mafia Family
  • Joined: 21 Jul 2003
  • None

#62

Posted 26 February 2009 - 08:28 AM

Ah, yeah I'll do that, as for boat / heli fuel stations. They are planned. Eventually.

a-k-t-w
  • a-k-t-w

    Wannabe GTA IV Dev

  • Members
  • Joined: 30 Sep 2008

#63

Posted 26 February 2009 - 11:03 AM Edited by a-k-t-w, 26 February 2009 - 11:06 AM.

Another suggestion: Fuel tank size.

And by that I mean customizing any car in the ini with a custom tank size. I mean it would lower/higher the time to refuel because the tank is smaller/larger. I drive a faggio sometimes, and when I run out of petrol, It takes me far too long to fill it up. It's not like it has a huge-ass fuel tank that can hold 200L of fuel whatsthat.gif I've got alot of suggestions, I just forgot them all rolleyes.gif

customizable for each vehicle. Here's an example of how it should appear in the ini:
CODE
//Custom Tank size:
//example code thingy:
163://car id// 10 //how long much petrol it puts in the tank
12: 100
45: 62
Defult: 100 //The default fuel tank size if there is no config for that car.

Andrew
  • Andrew

  • Andolini Mafia Family
  • Joined: 21 Jul 2003
  • None

#64

Posted 26 February 2009 - 11:58 AM

I'll look into being able to get the vehicle ID, and seeing if I can do something with that.

CaptainDingo
  • CaptainDingo

    Not actually a captain, or a dingo.

  • Members
  • Joined: 18 Jan 2009

#65

Posted 26 February 2009 - 02:43 PM

Just remember that if you make the Faggio's tank smaller, you'll have to refill it more often so either way you're going to be spending time at the gas pump. tounge.gif

a-k-t-w
  • a-k-t-w

    Wannabe GTA IV Dev

  • Members
  • Joined: 30 Sep 2008

#66

Posted 26 February 2009 - 08:36 PM Edited by a-k-t-w, 26 February 2009 - 09:12 PM.

No, thats not how it should work either. Just because the tank is smaller, dosn't mean it would use more petrol.

Edit: Another suggestion! If you can somehow manage to get vehicle ids, you might be able to re-set petrol status after you exit, and re-launch the game. Like this: You get into a car and the ini then sets petrol for that type of car. The best way to be able to save the fuel when re-launching the game biggrin.gif Only down side is, if you were to hop into another car, but the same type (e.g. infurnes -> infurnes) it will be the same amout of petrol tounge.gif but who cares? It will be able to save the petrol somewhat!

Andrew
  • Andrew

  • Andolini Mafia Family
  • Joined: 21 Jul 2003
  • None

#67

Posted 26 February 2009 - 11:48 PM

QUOTE (a-k-t-w @ Feb 26 2009, 21:36)
No, thats not how it should work either. Just because the tank is smaller, dosn't mean it would use more petrol.

Edit: Another suggestion! If you can somehow manage to get vehicle ids, you might be able to re-set petrol status after you exit, and re-launch the game. Like this: You get into a car and the ini then sets petrol for that type of car. The best way to be able to save the fuel when re-launching the game biggrin.gif Only down side is, if you were to hop into another car, but the same type (e.g. infurnes -> infurnes) it will be the same amout of petrol tounge.gif but who cares? It will be able to save the petrol somewhat!

Nah the IDs aren't the games pointer to a specific car, rather the cars model. I suppose I could do it by using the car model names. Or hash of the models. I'll look into something like that, shouldn't be too hard, just have an ini or txt file as the database. And then use a function to look it up to set the size of the tank.

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#68

Posted 27 February 2009 - 12:02 AM

QUOTE (Gangsta Killa @ Feb 27 2009, 00:48)
QUOTE (a-k-t-w @ Feb 26 2009, 21:36)
No, thats not how it should work either. Just because the tank is smaller, dosn't mean it would use more petrol.

Edit: Another suggestion! If you can somehow manage to get vehicle ids, you might be able to re-set petrol status after you exit, and re-launch the game. Like this: You get into a car and the ini then sets petrol for that type of car. The best way to be able to save the fuel when re-launching the game  biggrin.gif Only down side is, if you were to hop into another car, but the same type (e.g. infurnes -> infurnes) it will be the same amout of petrol tounge.gif but who cares? It will be able to save the petrol somewhat!

Nah the IDs aren't the games pointer to a specific car, rather the cars model. I suppose I could do it by using the car model names. Or hash of the models. I'll look into something like that, shouldn't be too hard, just have an ini or txt file as the database. And then use a function to look it up to set the size of the tank.

You can get the vehicle ID by using Vehicle.GetHashCode, but it will be worthless to you because vehicles get new IDs on every load.

I guess i have an idea how we could save the current fuel level.. we definately need the names of all player garages. does anyone know where to find them?

Andrew
  • Andrew

  • Andolini Mafia Family
  • Joined: 21 Jul 2003
  • None

#69

Posted 27 February 2009 - 09:08 AM

QUOTE (HazardX @ Feb 27 2009, 01:02)
QUOTE (Gangsta Killa @ Feb 27 2009, 00:48)
QUOTE (a-k-t-w @ Feb 26 2009, 21:36)
No, thats not how it should work either. Just because the tank is smaller, dosn't mean it would use more petrol.

Edit: Another suggestion! If you can somehow manage to get vehicle ids, you might be able to re-set petrol status after you exit, and re-launch the game. Like this: You get into a car and the ini then sets petrol for that type of car. The best way to be able to save the fuel when re-launching the game  biggrin.gif Only down side is, if you were to hop into another car, but the same type (e.g. infurnes -> infurnes) it will be the same amout of petrol tounge.gif but who cares? It will be able to save the petrol somewhat!

Nah the IDs aren't the games pointer to a specific car, rather the cars model. I suppose I could do it by using the car model names. Or hash of the models. I'll look into something like that, shouldn't be too hard, just have an ini or txt file as the database. And then use a function to look it up to set the size of the tank.

You can get the vehicle ID by using Vehicle.GetHashCode, but it will be worthless to you because vehicles get new IDs on every load.

I guess i have an idea how we could save the current fuel level.. we definately need the names of all player garages. does anyone know where to find them?

I've got it to save one of the fuel levels when you exit a car, but saving all across a garage would be fantastic. I'm looking at trying to implement different tank sizes for each vehicle. But it's working out which vehicle the player is in which is the problem. Using model name seems to cause problems.

a-k-t-w
  • a-k-t-w

    Wannabe GTA IV Dev

  • Members
  • Joined: 30 Sep 2008

#70

Posted 27 February 2009 - 10:02 AM Edited by a-k-t-w, 27 February 2009 - 01:46 PM.

No no no you didn't understand what I was saying. I know that you can't save the specific car id. I ment for example: You get into a infurnes. The ini logs that car. So when you reload the game, ANY infurnes will have that amount of petrol.

Edit: OH, woopsie daisy user posted image

Andrew
  • Andrew

  • Andolini Mafia Family
  • Joined: 21 Jul 2003
  • None

#71

Posted 27 February 2009 - 01:24 PM

QUOTE (a-k-t-w @ Feb 27 2009, 11:02)
No no no you didn't understand what I was saying. I know that you can't save the specific car id. I ment for example: You get into a infurnes. The ini logs that car. So when you reload the game, ANY infurnes will have that amount of petrol.

Thats what is being looked at, at the moment getting and using any sort of vehicle identifier seems to be tricky.

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#72

Posted 27 February 2009 - 07:54 PM

QUOTE (Gangsta Killa @ Feb 27 2009, 14:24)
QUOTE (a-k-t-w @ Feb 27 2009, 11:02)
No no no you didn't understand what I was saying. I know that you can't save the specific car id. I ment for example: You get into a infurnes. The ini logs that car. So when you reload the game, ANY infurnes will have that amount of petrol.

Thats what is being looked at, at the moment getting and using any sort of vehicle identifier seems to be tricky.

Vehicle.Model.Hash should work to identify the car model at least, or does it cause problems too?

Andrew
  • Andrew

  • Andolini Mafia Family
  • Joined: 21 Jul 2003
  • None

#73

Posted 27 February 2009 - 11:54 PM

It casued some problems, but that might of been because I didn't set the code up correctly. I'll try again using that, if it works sucessfully, then hopefully I can set a database of vehicles, and their tank size. Which could also leave room for other expansions.

S_G
  • S_G

    Rat

  • Members
  • Joined: 22 Jan 2006

#74

Posted 28 February 2009 - 11:44 AM

I'm going to have fun playing with this one. Thanks!

I haven't read the thread, so excuse me if I'm asking something that has already been covered or changed. Are you still using that "vehicle speed as fuel consumption" check? If so, there should be a simpler and more realistic way of calculating fuel consumption.

Is there a way to get vehicle RPM? Or only its speed? If you can get its RPM, then that, in conjunction with speed, and various other factors (vehicle weight, engine type, and fuel type affect fuel efficiency; turbocharged vehicles should have better fuel efficiency; etc.) will allow you get an excellent fuel consumption calculation.

If you can't get RPM, then the best way to calculate fuel efficiency is to run checks on the vehicle's speed every few milliseconds or so, whatever is most convenient for this purpose. Depending on the rate of acceleration, fuel consumption should change similarly. Fast acceleration = faster rate of fuel loss until acceleration slows down; fast deceleration = fuel consumption drops very low; car speed remaining fairly constant = fuel consumption is low to medium, depending on actual speed; car speed is idle = fuel consumption is minimal.

Andrew
  • Andrew

  • Andolini Mafia Family
  • Joined: 21 Jul 2003
  • None

#75

Posted 28 February 2009 - 02:08 PM

At the moment there is no way to get the vehicles RPM. You can change the current fuel drain yourself via the INI. Though I'll look at changing the calculation and still have the option to use it from the ini.

In the next release:

- Users can now add their own fuel stations, by adding a station to the fuelStations.pet file
- Some helipads / boat fueling stations are now added.
- Have some vehicles petrol tank size set by a carDB file.

mazda0mpv
  • mazda0mpv

    Player Hater

  • Members
  • Joined: 07 Dec 2008

#76

Posted 28 February 2009 - 08:36 PM

QUOTE (Gangsta Killa @ Feb 28 2009, 14:08)
At the moment there is no way to get the vehicles RPM.

I think it's possible because there is a speedometer which has RPM. click here

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#77

Posted 28 February 2009 - 09:00 PM Edited by HazardX, 28 February 2009 - 10:53 PM.

QUOTE (mazda0mpv @ Feb 28 2009, 21:36)
QUOTE (Gangsta Killa @ Feb 28 2009, 14:08)
At the moment there is no way to get the vehicles RPM.

I think it's possible because there is a speedometer which has RPM. click here

Thanks for the hint. I took a look at the sourcecode. The speedometer grabs the RPM value directly from the games memory, without using script functions. I'll try to include it as a function in the scripthook.

[EDIT]I've included it now. It doesn't return the actual RPM, but a value between 0 and 1 that indicates how close you are to the maximum RPM.

Andrew
  • Andrew

  • Andolini Mafia Family
  • Joined: 21 Jul 2003
  • None

#78

Posted 01 March 2009 - 01:30 AM

QUOTE (HazardX @ Feb 28 2009, 22:00)
QUOTE (mazda0mpv @ Feb 28 2009, 21:36)
QUOTE (Gangsta Killa @ Feb 28 2009, 14:08)
At the moment there is no way to get the vehicles RPM.

I think it's possible because there is a speedometer which has RPM. click here

Thanks for the hint. I took a look at the sourcecode. The speedometer grabs the RPM value directly from the games memory, without using script functions. I'll try to include it as a function in the scripthook.

[EDIT]I've included it now. It doesn't return the actual RPM, but a value between 0 and 1 that indicates how close you are to the maximum RPM.

Thats awesome, that should help alot.

S_G
  • S_G

    Rat

  • Members
  • Joined: 22 Jan 2006

#79

Posted 01 March 2009 - 04:56 AM

QUOTE (HazardX @ Feb 28 2009, 17:00)
Thanks for the hint. I took a look at the sourcecode. The speedometer grabs the RPM value directly from the games memory, without using script functions. I'll try to include it as a function in the scripthook.

[EDIT]I've included it now. It doesn't return the actual RPM, but a value between 0 and 1 that indicates how close you are to the maximum RPM.

Very nice! That's more useful than the actual RPM, since all we are checking to see is how much we are pushing it.

Andrew
  • Andrew

  • Andolini Mafia Family
  • Joined: 21 Jul 2003
  • None

#80

Posted 01 March 2009 - 11:13 PM Edited by Gangsta Killa, 01 March 2009 - 11:21 PM.

Each car now has its own tank size and fuel drain. All stored in one file. Now starts the long and tedious task of collecting all the car details and specifiying there parameters.

Having a crazy idea here, now I've got this system implemented I could add different types of fuel.

a-k-t-w
  • a-k-t-w

    Wannabe GTA IV Dev

  • Members
  • Joined: 30 Sep 2008

#81

Posted 02 March 2009 - 01:24 AM

biggrin.gif Different typ- F*** YEA

Andrew
  • Andrew

  • Andolini Mafia Family
  • Joined: 21 Jul 2003
  • None

#82

Posted 02 March 2009 - 09:21 AM Edited by Gangsta Killa, 05 March 2009 - 09:34 AM.

By doing different types, I'd have to rework the station / refilling aspects. I think for 2.2 I'll leave it with the user station additions and the carDB.

a-k-t-w
  • a-k-t-w

    Wannabe GTA IV Dev

  • Members
  • Joined: 30 Sep 2008

#83

Posted 02 March 2009 - 02:39 PM

Different types of fuel would be very interesting. It would be funny putting unleaded into a deasle car, and watching the engine blow up later. tounge2.gif

Andrew
  • Andrew

  • Andolini Mafia Family
  • Joined: 21 Jul 2003
  • None

#84

Posted 02 March 2009 - 08:35 PM

Well slowly gathering the vehicles ids / hash for the vehicle database. Christ theres alot of vehicles. I'm only up to 50od.

jisco
  • jisco

    Player Hater

  • Members
  • Joined: 01 Jan 2009

#85

Posted 02 March 2009 - 08:43 PM

where do i put the "radar_fire" file? please help! smile.gif

a-k-t-w
  • a-k-t-w

    Wannabe GTA IV Dev

  • Members
  • Joined: 30 Sep 2008

#86

Posted 02 March 2009 - 08:45 PM

What 'radar_fire' file?

Andrew
  • Andrew

  • Andolini Mafia Family
  • Joined: 21 Jul 2003
  • None

#87

Posted 02 March 2009 - 08:48 PM

QUOTE (jisco @ Mar 2 2009, 21:43)
where do i put the "radar_fire" file? please help! smile.gif

You need to use either SparkIV or OpenIV to open the blips.wtd file, and replace the firestation icon.

jisco
  • jisco

    Player Hater

  • Members
  • Joined: 01 Jan 2009

#88

Posted 03 March 2009 - 02:04 PM

QUOTE (Gangsta Killa @ Mar 2 2009, 20:48)
QUOTE (jisco @ Mar 2 2009, 21:43)
where do i put the "radar_fire" file? please help! smile.gif

You need to use either SparkIV or OpenIV to open the blips.wtd file, and replace the firestation icon.

thx man! smile.gif

C06alt
  • C06alt

    Street Cat

  • Members
  • Joined: 08 Aug 2005

#89

Posted 03 March 2009 - 04:35 PM

Great job on this Gangsta Killa. Nice to see a well executed fuel mod that covers all the angles.

Andrew
  • Andrew

  • Andolini Mafia Family
  • Joined: 21 Jul 2003
  • None

#90

Posted 03 March 2009 - 07:24 PM

QUOTE (C06alt @ Mar 3 2009, 17:35)
Great job on this Gangsta Killa. Nice to see a well executed fuel mod that covers all the angles.

Thanks, I'm hoping to expand on this and include more features.

The carDB is getting there slowly. I think I'll set a standard fuelDrain / tankSize depending on the type of car. I'll let anyone else customize it to their likings.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users