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. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    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

lindsayslorach

Saving cars script

Recommended Posts

lindsayslorach

Hey guys, another topic from me! tounge.gif Hope i'm not too much of a bother. smile.gif

 

I saw "warclaw" started a topic a couple days ago, about the Simple Native Trainer, he was talking about a car storing problem.

 

When I read that, I wanted to try to write my own, simple(ish) script (for fun) for saving a car's info to a text file, and loading it on game start/button press (for testing).

 

I've already got the writing/saving part done, I just cant figure out how to get the reading/loading part.

 

I've read on the net how to read/write text files, but my mind's just blocked, I can't figure out how to read the specific lines and put them into the CreateVehicle() function.

 

Heres my code:

 

 

using System;using System.IO;using System.Windows.Forms;using GTA;namespace SavedCars{   public class CarScript : Script   {       Keys SaveCarKey;       Keys LoadCarsKey;       String SaveFileName;       bool bShowMessages;       public CarScript()       {           this.KeyDown += new GTA.KeyEventHandler(CarScript_KeyDown);           SaveCarKey = Settings.GetValueKey("SaveKey", "KEYS", Keys.NumPad5);           LoadCarsKey = Settings.GetValueKey("LoadKey", "KEYS", Keys.NumPad6);           SaveFileName = Settings.GetValueString("SaveFileName", "OPTIONS", "SavedCars.ini");           bShowMessages = Settings.GetValueBool("ShowMessages", "OPTIONS", false);           //LoadCars();       }       public void CarScript_KeyDown(object sender, GTA.KeyEventArgs e)       {           if (e.KeyWithModifiers == SaveCarKey)           {               if (Player.Character.isInVehicle())               {                   Vehicle MyCar = Player.Character.CurrentVehicle;                   if (Exists(MyCar))                   {                       Vector3 MyVehiclePos = MyCar.Position;                       float MyVehicleHeading = MyCar.Heading;                       if (File.Exists(SaveFileName))                       {                           // File exists, append to it.                           if (bShowMessages)                               Game.DisplayText("File exists, appending.");                           StreamWriter SavedCarsText = File.AppendText(SaveFileName);                           SavedCarsText.WriteLine(MyCar.Model);                           SavedCarsText.WriteLine(MyVehiclePos);                           SavedCarsText.Close();                                                  }                       else                       {                           // File doesnt exist, create it and write to it.                           if (bShowMessages)                               Game.DisplayText("File doesn't exist, creating and writing.");                           StreamWriter SavedCarsText = File.CreateText(SaveFileName);                           SavedCarsText.WriteLine(MyCar.Model);                           SavedCarsText.WriteLine(MyVehiclePos);                           SavedCarsText.WriteLine(MyVehicleHeading);                           SavedCarsText.Close();                       }                   }               }           }           if (e.KeyWithModifiers == LoadCarsKey)           {               LoadCars();           }       }       void SpawnCar(Model mModel, Vector3 vPos, float fHeading) // Please correct me if this is wrong.       {           Vehicle SpawnedCar = World.CreateVehicle(mModel, vPos);           if (Exists(SpawnedCar))           {               SpawnedCar.Heading = fHeading;           }       }       void LoadCars()       {           if (File.Exists(SaveFileName))           {               if (SaveFileName.Length > 0)               {                   // Go through the text file line by line.                   // Save each lines info to a diff variable, every three lines - repeat.                   //SpawnCar(mModel, vPos, fHeading);               }           }       }

 

 

I've made the script save the 3 different types of information (model, pos, heading) on different lines, because I thought it may be easier to read (by the script), rather than using substr, or something similar.

 

Probably not needed, but here's the ini file:

 

[KEYS]SaveKey = NumPad5LoadKey = NumPad6[OPTIONS]SaveFileName = ThisIsMySaveFileName.txtShowMessages = true

 

Edited by lindsayslorach

Share this post


Link to post
Share on other sites
sjaak327

I realise that you are using c# and I am not used to that language. But in C++ getprivateprofilestring and getprivateprofileint are two excellent commands to read a text file, providing you use the "ini file approach".

 

This also gives you the ability to specifiy "key names" like x,y,z and read the correpsonding values easily.

 

 

Share this post


Link to post
Share on other sites
lindsayslorach

Hey, thanks for the reply.

 

Pretty much just before i posted this, I had a look at writing to ini files, I remember Read/WritePrivateProfileX from when I did a little bit of C++.

 

I found an INI class to use, but im not sure how I'm going to set it out, as in naming each key, in increments or something, and how to read only the specific ones at a time.

 

Thanks for your help.

Share this post


Link to post
Share on other sites
LMS

Havn't tested this, but should give you an idea of how to do:

 

 

           // Open streamreader           StreamReader sr = new StreamReader(SaveFileName);           // Read while there's data available           while (sr.Peek() != -1)           {               string model = sr.ReadLine();               string position = sr.ReadLine();               float heading = Convert.ToSingle(sr.ReadLine());           }           sr.Close();

 

 

Anyway, you have to create a function to parse the position from string to vector3, but this isn't hard.

Share this post


Link to post
Share on other sites
lindsayslorach

Hey, thanks LMS!

 

That's pretty much what I found on the net when I first searched for working with text files in C#. But I still can't figure out how to use the (model, position, heading) variables from the while loop, in the CreateVehicle() function.

 

I've just had a think about how i would convert a string to a Vector3, but I'm pretty tired, perhaps you could help me with that aswell, or maybe ill just try again tomorrow.

 

EDIT: Silly me, should have tested before I spoke. I just did a test of the code posted by LMS, by saving the car information like before, and load the info into a string and print it in the console, and it works as expected, the way I read/understood it was that it would get the same line three times and save it into different variable, guess I should have tested. tounge.gif

 

I still need help with the string to vector, as I have no idea how to get that going.

 

Thanks.

Edited by lindsayslorach

Share this post


Link to post
Share on other sites
warclaw

heey there here is warclaw thanks for this topic!!! i want to make more cars parked in GTA IV on the side!!! thanks for you to create a script !!! 1000% respect!!!

 

 

hope you make the script XD thanks thanks!!!!

Share this post


Link to post
Share on other sites
Donny78

Try this >> clicky (updated, tested and fixed a model hash bug).

 

It has a default config in there, put them in your "scripts" folder, it's created with the ScriptHookDotNet so it requires all the hooks requirements ofcourse.

 

It's an old mod which I don't use, forgot about it until reading this so recompiled it with latest hook and uploaded it for you to test. It used to work fine from what I remember, maybe a console message bug still exists but I've not tested it lately and it's not a major bug (maybe more I don't know about though).

 

Let me know if you like it and I'll update it and release it fully as a mod (if there is interest), maybe you have suggestions for it also ?

 

The parked files are created in a "parked" folder in your scripts directory which the mod creates itself (the folder) so make sure you have permissions set for your OS to do that and they save as "vehicle_#.ini", the # representing a number.

 

An example of the save format:

 

 

[Location]X=903.1407Y=-507.8107Z=14.4902Angle=180.5085[Model]ModelHash=-1041692462Color=0FeatureColor1=1FeatureColor2=0SpecularColor=87Dirtyness=0.0321Health=1000EngineHealth=1000.0000PetrolTankHealth=1000.0000

 

 

Type "scripthelp" in the console to see the commands.

Edited by Donny78

Share this post


Link to post
Share on other sites
lindsayslorach

Hey Donny, thanks for that! I was wondering if you could post the source? or would you rather people only had the compiled version?

 

Thanks.

Share this post


Link to post
Share on other sites
Donny78

 

Hey Donny, thanks for that! I was wondering if you could post the source? or would you rather people only had the compiled version?

 

Thanks.

No problem.

 

Sure I will release the source, I'm an open source fan for sure but at the moment it's going through an update so once I've finished that I'll document the source and release it in the showroom (I'll link it from here).

 

It will probably be a couple of days as I have other stuff I'm doing also but it should be pretty soon.

Share this post


Link to post
Share on other sites
lindsayslorach

Awesome! In the mean time, I'm trying different ways to store the info, I've searched google some more, and a lot of the sites suggest using XML files as ini files are old. I'm trying this on a different version of the SavingCars script, as to not mess it up. I've only tested the code on a Windows Form Application, currently implimenting it into my script. Hopefully it works smile.gif.

Share this post


Link to post
Share on other sites
sjaak327

I am happy to post some code in C++ from trainer. It basically uses save and getprivateprofileint/string, and apart from position, colors, health, it also includes any components and livery.

 

If you think it would help you (it's in C++) let me know.

 

Anyway to change from using an ini file to an XML isn't that big of a deal either. I however believe that for the human eye, ini files are a bit better smile.gif

 

 

Share this post


Link to post
Share on other sites
lindsayslorach

Thanks sjaak, that would be awesome if you could post some code, thanks smile.gif

 

Yeah, I realise that for people to edit the save file, it would be better to use ini's, but thats not really the main focus of this script, I guess it would be easier if they wanted to add cars manualy, but then again XML is kinda easy to read/edit, not the best for people who dont really know, but then, they shouldn't be editing it.

Share this post


Link to post
Share on other sites
sjaak327

This is the code to save a car to the ini file:

 

 

Char c; u32 playerIndex = ConvertIntToPlayerIndex(GetPlayerId()); GetPlayerChar(playerIndex, &c); 	if (IsCharInAnyCar©) 	{ 	Car Car; 	GetCarCharIsUsing(c,&Car); 	 	int model; 	int c1,c2,c3,c4,c5,c6,c7,c8,c9; 	int livery; 	u32 cl1,cl2,cl3,cl4; 	f32 x,y,z,h,dirt; 	u32 health; 	CHAR v1[25]; 	CHAR v2[6]; 	CHAR v3[6]; 	CHAR v4[6]; 	CHAR v5[6]; 	CHAR v6[6]; 	CHAR v7[6]; 	CHAR v8[6]; 	CHAR v9[6]; 	CHAR v10[6]; 	CHAR v11[6]; 	CHAR v12[6]; 	CHAR v13[6]; 	CHAR v14[6]; 	CHAR v15[25]; 	CHAR v16[25]; 	CHAR v17[25]; 	CHAR v18[25]; 	CHAR v19[6]; 	CHAR v20[25];  	CHAR v21[25];  	CHAR v22[25];  	CHAR v23[6]; 	JGetCarModel(Car,&model); 	GetCarColours(Car,&cl1,&cl2); 	GetExtraCarColours(Car,&cl3,&cl4); 	GetCarLivery(Car,&livery); 	GetCarCoordinates(Car,&x,&y,&z); 	GetCarHeading(Car,&h); 	GetCarHealth(Car,&health); 	f32 ehealth = GetEngineHealth(Car); 	GetVehicleDirtLevel(Car,&dirt); 	f32 phealth = GetPetrolTankHealth(Car); 	if (IsVehicleExtraTurnedOn(Car,1) ==1) 	{ 	c1=1; 	} 	else 	{ 	c1=0; 	} 	if (IsVehicleExtraTurnedOn(Car,2) ==1) 	{ 	c2=1; 	} 	else 	{ 	c2=0; 	} 	if (IsVehicleExtraTurnedOn(Car,3) ==1) 	{ 	c3=1; 	} 	else 	{ 	c3=0; 	} 	if (IsVehicleExtraTurnedOn(Car,4) ==1) 	{ 	c4=1; 	} 	else 	{ 	c4=0; 	} 	if (IsVehicleExtraTurnedOn(Car,5) ==1) 	{ 	c5=1; 	} 	else 	{ 	c5=0; 	} 	if (IsVehicleExtraTurnedOn(Car,6) ==1) 	{ 	c6=1; 	} 	else 	{ 	c6=0; 	} 	if (IsVehicleExtraTurnedOn(Car,7) ==1) 	{ 	c7=1; 	} 	else 	{ 	c7=0; 	} 	if (IsVehicleExtraTurnedOn(Car,8) ==1) 	{ 	c8=1; 	} 	else 	{ 	c8=0; 	} 	if (IsVehicleExtraTurnedOn(Car,9) ==1) 	{ 	c9=1; 	} 	else 	{ 	c9=0; 	} 	sprintf_s(v1, "%i", model); 	sprintf_s(v2, "%i", cl1); 	sprintf_s(v3, "%i", cl2); 	sprintf_s(v4, "%i", cl3); 	sprintf_s(v5, "%i", cl4); 	sprintf_s(v6, "%i", c1); 	sprintf_s(v7, "%i", c2); 	sprintf_s(v8, "%i", c3); 	sprintf_s(v9, "%i", c4); 	sprintf_s(v10, "%i", c5); 	sprintf_s(v11, "%i", c6); 	sprintf_s(v12, "%i", c7); 	sprintf_s(v13, "%i", c8); 	sprintf_s(v14, "%i", c9); 	sprintf_s(v15, "%G", x); 	sprintf_s(v16, "%G", y); 	sprintf_s(v17, "%G", z); 	sprintf_s(v18, "%G", h); 	sprintf_s(v19, "%i", health); 	sprintf_s(v20, "%G", ehealth); 	sprintf_s(v21, "%G", dirt); 	sprintf_s(v22, "%G", phealth); 	sprintf_s(v23, "%i", livery); 	WritePrivateProfileString("SavedCar1","Model",v1,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Color1",v2,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Color2",v3,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Color3",v4,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Color4",v5,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Component1",v6,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Component2",v7,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Component3",v8,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Component4",v9,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Component5",v10,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Component6",v11,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Component7",v12,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Component8",v13,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Component9",v14,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","x",v15,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","y",v16,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","z",v17,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","heading",v18,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","health",v19,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Ehealth",v20,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Dirt",v21,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","PHealth",v22,"./trainer.ini"); 	WritePrivateProfileString("SavedCar1","Livery",v23,"./trainer.ini"); 	PrintStringWithLiteralStringNow("STRING","Car Saved in Slot 1",5000,1); 	}

 

 

 

To load the car, you basically do the reverse, by using getprivateprofileint (for int values), and getprivateprofilestring for the float values.

 

To give you and example of two such values:

 

 

v2=GetPrivateProfileInt("SavedCar1","Color1",35,"./trainer.ini");GetPrivateProfileString("SavedCar1","heading","176.441",v18,25,TEXT("./trainer.ini"));vh = (float)atof(v18);

 

 

Of course the color1 can be used directly when spawning the car, the heading value needs to be converted from string to float and is put into variable vh, then to be used when spawning the car in the correct heading.

 

 

Edited by sjaak327

Share this post


Link to post
Share on other sites
Hypertenzion
Try this >> clicky (updated, tested and fixed a model hash bug).

 

It has a default config in there, put them in your "scripts" folder, it's created with the ScriptHookDotNet so it requires all the hooks requirements ofcourse.

 

It's an old mod which I don't use, forgot about it until reading this so recompiled it with latest hook and uploaded it for you to test. It used to work fine from what I remember, maybe a console message bug still exists but I've not tested it lately and it's not a major bug (maybe more I don't know about though).

 

Let me know if you like it and I'll update it and release it fully as a mod (if there is interest), maybe you have suggestions for it also ?

 

The parked files are created in a "parked" folder in your scripts directory which the mod creates itself (the folder) so make sure you have permissions set for your OS to do that and they save as "vehicle_#.ini", the # representing a number.

 

An example of the save format:

 

 

[Location]X=903.1407Y=-507.8107Z=14.4902Angle=180.5085[Model]ModelHash=-1041692462Color=0FeatureColor1=1FeatureColor2=0SpecularColor=87Dirtyness=0.0321Health=1000EngineHealth=1000.0000PetrolTankHealth=1000.0000

 

 

Type "scripthelp" in the console to see the commands.

Donny, would you plz upload the mod/script again?

The link to mediafire, is broken and I would really like to try this out! confused.gif

Share this post


Link to post
Share on other sites
Donny78

Sorry dude I don't have that anymore, you would have to get it off someone who downloaded it or wait until I release the mod it came from (WIP). You could also try this version but I don't know how it's working right now since it was last compiled, type 'ParkingHelp' in the console.

 

I'll release the source once it's finished/stable and commented but for now no source (or readme) is included and I won't support this version as it's not a proper release but please feel free to make suggestions/report issues.

 

Edit:

 

There are six save files in the "parked" folder, thier locations are all "Crockett Ave, Oneida Ave" which is the small parking lot near the first safe house you get (Hove Beach?). When you walk out of the first safehouse just head across the street over the fences and down the alley to the right side then carry on going across the road and down the passage then look to your right.

Edited by Donny78

Share this post


Link to post
Share on other sites
Hypertenzion
Sorry dude I don't have that anymore, you would have to get it off someone who downloaded it or wait until I release the mod it came from (WIP). You could also try this version but I don't know how it's working right now since it was last compiled, type 'ParkingHelp' in the console.

 

I'll release the source once it's finished/stable and commented but for now no source (or readme) is included and I won't support this version as it's not a proper release but please feel free to make suggestions/report issues.

Thx! I will try it out and report back if any problems.

 

You may wanna take a look at this: http://www.gtagarage.com/mods/show.php?id=10013

Tried it not long ago, but it is only compatible with 1.0.4.0 (I use 1.0.6.0).

 

I downgraded to 1.0.4.0 to try it out, and the idea was NICE, but one thing made me wanna get rid of it right away:

When saving the cars, he was storing it in a .txt file by car NAME/MODEL and not by hash.

So modded added cars would turn into standard cars from the standard vehicles.img.

 

I see by the .ini file that you are storing by hash, and that is just great and makes it possible to store modded added cars!

I hope you release a beta (The latest WIP version) soon, so we can enjoy this great mod smile.gif

Share this post


Link to post
Share on other sites
Donny78

 

Thx! I will try it out and report back if any problems.

 

You may wanna take a look at this: http://www.gtagarage.com/mods/show.php?id=10013

Tried it not long ago, but it is only compatible with 1.0.4.0 (I use 1.0.6.0).

 

I downgraded to 1.0.4.0 to try it out, and the idea was NICE, but one thing made me wanna get rid of it right away:

When saving the cars, he was storing it in a .txt file by car NAME/MODEL and not by hash.

So modded added cars would turn into standard cars from the standard vehicles.img.

 

I see by the .ini file that you are storing by hash, and that is just great and makes it possible to store modded added cars!

I hope you release a beta (The latest WIP version) soon, so we can enjoy this great mod  smile.gif

 

I just tested it and it seems to work ok (this mod, the WIP). One bug I did find is in the Control form, when you change the model of your vehicle the form resizes incorrectly as I added a new button without resizing the form (my bad) but easy to fix and not a big deal. Reading about the hashes I think I've overlooked something, you won't be able to swap your model to any but a standard IV vehicle, no modified or other games (TOBGT etc) models will show but I'll fix that also for the release and have it detect the version etc.

 

Edit:

 

Ok so I have an issue, I don't have any addons (LD, TBOGT etc) so I can find the vehicles on google no problem >> clicky. What I need to know is though is what I see there, are they the only vehicles in the game or does it have the same and them added or do they replace some vehicles and keep some of the originals etc.

 

If someone could point me to or post a list it would help me alot.

Edited by Donny78

Share this post


Link to post
Share on other sites
Hypertenzion
Thx! I will try it out and report back if any problems.

 

You may wanna take a look at this: http://www.gtagarage.com/mods/show.php?id=10013

Tried it not long ago, but it is only compatible with 1.0.4.0 (I use 1.0.6.0).

 

I downgraded to 1.0.4.0 to try it out, and the idea was NICE, but one thing made me wanna get rid of it right away:

When saving the cars, he was storing it in a .txt file by car NAME/MODEL and not by hash.

So modded added cars would turn into standard cars from the standard vehicles.img.

 

I see by the .ini file that you are storing by hash, and that is just great and makes it possible to store modded added cars!

I hope you release a beta (The latest WIP version) soon, so we can enjoy this great mod  smile.gif

 

I just tested it and it seems to work ok (this mod, the WIP). One bug I did find is in the Control form, when you change the model of your vehicle the form resizes incorrectly as I added a new button without resizing the form (my bad) but easy to fix and not a big deal. Reading about the hashes I think I've overlooked something, you won't be able to swap your model to any but a standard IV vehicle, no modified or other games (TOBGT etc) models will show but I'll fix that also for the release and have it detect the version etc.

 

Edit:

 

Ok so I have an issue, I don't have any addons (LD, TBOGT etc) so I can find the vehicles on google no problem >> clicky. What I need to know is though is what I see there, are they the only vehicles in the game or does it have the same and them added or do they replace some vehicles and keep some of the originals etc.

 

If someone could point me to or post a list it would help me alot.

Sounds great!

Btw. is this mod making it possible to save your cars anywhere, or is it a certain place, only?

Share this post


Link to post
Share on other sites
Donny78

Yes anywhere, I haven't tested it inside interiors yet though (on the list).

Share this post


Link to post
Share on other sites
sjaak327

 

Thx! I will try it out and report back if any problems.

 

You may wanna take a look at this: http://www.gtagarage.com/mods/show.php?id=10013

Tried it not long ago, but it is only compatible with 1.0.4.0 (I use 1.0.6.0).

 

I downgraded to 1.0.4.0 to try it out, and the idea was NICE, but one thing made me wanna get rid of it right away:

When saving the cars, he was storing it in a .txt file by car NAME/MODEL and not by hash.

So modded added cars would turn into standard cars from the standard vehicles.img.

 

I see by the .ini file that you are storing by hash, and that is just great and makes it possible to store modded added cars!

I hope you release a beta (The latest WIP version) soon, so we can enjoy this great mod  smile.gif

 

I just tested it and it seems to work ok (this mod, the WIP). One bug I did find is in the Control form, when you change the model of your vehicle the form resizes incorrectly as I added a new button without resizing the form (my bad) but easy to fix and not a big deal. Reading about the hashes I think I've overlooked something, you won't be able to swap your model to any but a standard IV vehicle, no modified or other games (TOBGT etc) models will show but I'll fix that also for the release and have it detect the version etc.

 

Edit:

 

Ok so I have an issue, I don't have any addons (LD, TBOGT etc) so I can find the vehicles on google no problem >> clicky. What I need to know is though is what I see there, are they the only vehicles in the game or does it have the same and them added or do they replace some vehicles and keep some of the originals etc.

 

If someone could point me to or post a list it would help me alot.

The DLC's have all the original IV vehicles (regardless of installed as add on or separate, ie EFLC).

 

They added the following vehicles:

 

 

MODEL_AKUMA=1672195559, MODEL_APC=562680400,  MODEL_BATI2=3403504941, MODEL_BLADE=3089165662, MODEL_AVAN=4011757448, MODEL_BUFFALO=3990165190, MODEL_BULLET=2598821281, MODEL_BUZZARD=788747387, MODEL_CADDY=1147287684, MODEL_CAVALCADE2=3505073125, MODEL_DOUBLE=2623969160, MODEL_F620=3703357000, MODEL_FAGGIO2=55628203, MODEL_FLOATER=2563534643, MODEL_HAKUCHOU=1265391242, MODEL_POLICEB=4260343491, MODEL_POLICE3=1912215274, MODEL_POLICEW=908697398, MODEL_POLICE4=2321795001, MODEL_SCHAFTER2=3039514899, MODEL_SCHAFTER3=2809443750, MODEL_SERRANO=1337041428, MODEL_SERRANO2=1051281622, MODEL_SKYLIFT=1044954915, MODEL_SLAMVAN=729783779, MODEL_SMUGGLER=944930284, MODEL_LIMO2=4180339789, MODEL_SUPERD=1123216662, MODEL_SUPERD2=1638119866, MODEL_SWIFT=3955379698, MODEL_TAMPA=972671128, MODEL_VADER=4154065143,____________________________ MODEL_BATI=4180675781, MODEL_DAEMON=2006142190, MODEL_DOUBLE2=2535109211, MODEL_GBURRITO=2549763894, MODEL_HAKUCHOU2=4039289119, MODEL_INNOVATION=4135840458, MODEL_PACKER2=207497487, MODEL_PCBUS=2287941233, MODEL_REGINA=4280472072, MODEL_RHAPSODY=841808271, MODEL_TOWTRUCK=2971866336, MODEL_WAYFARER=4217198264, MODEL_YANKEE2=2396846736, MODEL_WOLFSBANE = 0xDB20A373, MODEL_HEXER = 0x11F76C14, MODEL_LYCAN = 0x2FCECEB7, MODEL_NIGHTBLADE = 0xA0438767, MODEL_REVENANT = 0xEA9789D1, MODEL_DIABOLUS = 0xE7AD9DF9, MODEL_ANGEL = 0xDDF716D8,

 

 

Also some of IV's orignal vehicles have been slightly updated, but retain their model name.

 

Some new vehicles are in both TBOGT (top part of the list) and TLAD (bottom part), from memory these are:

 

Hexer, Bati2, Double, Hakouchou, Slamvan and Tampa.

 

Edited by sjaak327

Share this post


Link to post
Share on other sites
Donny78

Thanks for the info dude, very helpfull icon14.gif

 

Edit:

 

RC version, fixed a few bugs and added support for TBOGT and TLAD vehicles (UNTESTED!), not settled on how to handle new custom model vehicles yet though so that's not in it.

 

PS. The other download won't work now, I've removed the files from MF.

Edited by Donny78

Share this post


Link to post
Share on other sites
Hypertenzion

 

Thanks for the info dude, very helpfull  icon14.gif

 

Edit:

 

RC version, fixed a few bugs and added support for TBOGT and TLAD vehicles (UNTESTED!), not settled on how to handle new custom model vehicles yet though so that's not in it.

 

PS. The other download won't work now, I've removed the files from MF.

Thx for the release!

The mod seems to almost work on 1.0.6.0.

When I type "parkinghelp" in the console, the help description appears and disappears very quickly afterwards.

 

The other problem, is that I can't seem to control the parking menu?

When I press F7, I get the nice menu with a lot of options, but I can't choose any of the options, with my mouse or my keyboard.

Edit: Same problem with F8 menu - Cannot choose anything. Howto?

Note: When pressing F7, the player disappears from the car, that he was inside, when pressing F7 (Is this normal?)

 

Hope you can fix this colgate.gif

Edited by Hypertenzion

Share this post


Link to post
Share on other sites
Donny78

No problem.

 

I'll look into it and fix it up for the next release, I'll do a topic of it's own for the next one also.

 

The disapearing is normal, you can't control or see your character on purpose so you can see all your vehicle etc but the mouse and keyboard not working is a bug yes, I'll look into that.

 

Edit:

 

I've just tested it and it seems to function correctly for me when trying to recreate your issues, the message display time from the help command is set to 20 seconds and seems to go that long for me and the mouse/keyboard both function fine.

 

Are you on the latest scripthooks ?

 

Do you have any other mods running also, if so try disabling them and running just this mod.

 

I'm running a couple of custom .NET mods alongside this one, I have the latest patch for IV and the latest scripthooks installed so maybe one of them for you needs an update.

Edited by Donny78

Share this post


Link to post
Share on other sites
Hypertenzion

 

No problem.

 

I'll look into it and fix it up for the next release, I'll do a topic of it's own for the next one also.

 

The disapearing is normal, you can't control or see your character on purpose so you can see all your vehicle etc but the mouse and keyboard not working is a bug yes, I'll look into that.

 

Edit:

 

I've just tested it and it seems to function correctly for me when trying to recreate your issues, the message display time from the help command is set to 20 seconds and seems to go that long for me and the mouse/keyboard both function fine.

 

Are you on the latest scripthooks ?

 

Do you have any other mods running also, if so try disabling them and running just this mod.

 

I'm running a couple of custom .NET mods alongside this one, I have the latest patch for IV and the latest scripthooks installed so maybe one of them for you needs an update.

EDIT:

 

The mod works perfect on both 1.0.6.0 and 1.0.7.0!

Custom added cars WORK!

But only when ENBseries is deactivated cryani.gif (ENBseries seems to change the appearance of the menu and remove the mouse)

You can still click on the menu if you can hit the buttons, but the mouse is invisible.

 

Would you be able to make an even more simple menu for the ENB people?

 

This simple menu is controlled by keyboard only and works with ENB: smile.gif

(Example: user posted image)

 

Menu when ENBseries is activated:

user posted image

 

When making a whole new thread about this mod, make it possible to donate - I think people would love this mod!

Edited by Hypertenzion

Share this post


Link to post
Share on other sites
Donny78

Ok well test this script:

 

 

using GTA;using System;namespace Tester{   public class TesterScript : Script   {       public TesterScript()       {           BindKey(Keys.F1, new KeyPressDelegate(ShowMessage));       }       public void ShowMessage()       {           Game.DisplayText("test message from scripthookdotnet !", 5000);       }   }};

 

 

Name it like "test_script.cs" saved in your "scripts" folder and test it with the ENB series running, if this runs then I'll consider the text menu version as a setting or light version for it for sure.

 

I'd probably do it configurable in the "parking_config.ini" : "UsingENB=True", then it knows what type to show you.

Share this post


Link to post
Share on other sites
Hypertenzion

Got this in my Scripthookdotnet log:

 

2010-09-01 20:34:34 - Loading dynamic scriptfile 'scripts\Test_script.cs' ...

2010-09-01 20:34:34 - 1 Errors in script 'C:\Program Files (x86)\Rockstar Games\Grand Theft Auto IV\scripts\Test_script.cs':

in Line 10: The name 'Keys' does not exist in the current context

 

Could you compile it (Make a DLL) and upload somewhere and I'll test again?

 

EDIT: Tried to run without ENB enabled and got the same error:

 

2010-09-01 22:20:07 - Loading dynamic scriptfile 'scripts\Test_script.cs' ...

2010-09-01 22:20:07 - 1 Errors in script 'C:\Program Files (x86)\Rockstar Games\Grand Theft Auto IV\scripts\Test_script.cs':

in Line 10: The name 'Keys' does not exist in the current context

Edited by Hypertenzion

Share this post


Link to post
Share on other sites
Donny78

My bad it needs to be:

 

 

using GTA;using System;using System.Windows.Forms;namespace Tester{  public class TesterScript : Script  {      public TesterScript()      {          BindKey(Keys.F1, new KeyPressDelegate(ShowMessage));      }      public void ShowMessage()      {          Game.DisplayText("test message from scripthookdotnet !", 5000);      }  }};

 

 

If that doesn't work I'll compile it yes.

Share this post


Link to post
Share on other sites
Hypertenzion

Confirmed working when pressing F1! smile.gif

Share this post


Link to post
Share on other sites
Donny78

 

Confirmed working when pressing F1!  smile.gif

 

Ok cheers, I'll get on a light version pretty soon then. It may not have all the features like the current one but it will be pretty close to it.

Share this post


Link to post
Share on other sites
Hypertenzion
Confirmed working when pressing F1!  smile.gif

 

Ok cheers, I'll get on a light version pretty soon then. It may not have all the features like the current one but it will be pretty close to it.

Thx! inlove.gif

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.


  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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