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

    1. GTANet.com

    1. GTA Online

      1. The Contract
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

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

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

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

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

    2. Support

    3. Suggestions

[BETA] Szabo's Persistance Mod - Scripthook (LUA)


Szabo
 Share

Recommended Posts

IMPORTANT NOTE:

Since many people are having problems with the configuration, here is a clarification:

YOU NEED TO CONFIGURE THE MOD! Open the szabopersist.lua file with a plain text editor (e.g.: Notepad) and change the lines of the configurations.

The 'savepath' must contain slashes (these: / ) and NOT backslashes (NOT these: \ ).

Both the 'savepath' AND the 'platetext' values must be between quotation marks, like as follows:

local savepath = "C:/Users/John Doe/Documents/Rockstar Games/"

local platetext = "JOHNNY"

AND NOT LIKE THIS:

local savepath = C:/Users/John Doe/Documents/Rockstar Games/

local platetext = JOHNNY

THE SAVEPATH MUST HAVE A TRAILING (AT THE END) SLASH, HERE ARE EXAMPLES OF WRONG VALUES:

local savepath = "C:\Users\John Doe\Documents\Rockstar Games\" - BACKSLASHES

local savepath = "C:/Users/John Doe/Documents/Rockstar Games" - NO TRAILING SLASH

In the future I'm going to try to find a way to default the path to the "Documents" folder or some other safe place, until then, it's mandatory the configurations must be correct. If it doesn't work, paste your configurations here. (Also, read the FAQ below).

untitled-1.jpg

This mod allows you to save cars wherever you want, and also keeps the last 3 cars you entered from magically disappearing. It creates markers on the map that shows where your cars are; the markers are small and colour-coded.

 

No more vanishing custom cars! No more lack of garage storage! With this mod, the world is your garage!

The 'last entered cars' feature can be optionally disabled (either by configuration file or in-game hotkey).

 

Sounds Interesting? Read on!

 

----

 

To install, make sure you have installed Script Hook and the LUA Plugin for Script Hook, and place the .lua file in the scripts/addins folder, delete the other scripts in that folder if you're not using them.

 

Dev Link for version 0.0.1.06b: https://drive.google.com/open?id=0B-imfIHFgQA5OUg5a09zLXZxRVU&authuser=0

Link for mod on ModMyV (stable): http://www.modmy5.com/en/mods/e55e346c

Link for mod on GTA5-Mods (stable): https://www.gta5-mods.com/scripts/szabo-s-persistance-mod

 

Script Hook: http://gtaforums.com/topic/788343-vrel-script-hook-v/

LUA Plugin for Script Hook: http://gtaforums.com/topic/789139-vrelhook-lua-plugin-for-script-hook-v/

 

GitHub (development only, for cutting-edge release, use the dev link above): https://github.com/Alan-FGR/Persistance-Mod

 

IMPORTANT!! YOU NEED TO CHANGE THE CONFIGURATIONS IN THE FILE:

 

 

 

-- CONFIGURE THE KEYS BELOW. Further down you find a list of the codes

local savekey = 96

local reloadkey = 110

local disablemodkey = 109

local modenabled = true -- SET TO false if you don't want the persistence to be enabled by default - does not affect saved

--vehicles, this only applies to the 'persistent' ones you drove, which can cause problems in missions

 

-- CONFIGURE THE PATH WHERE THE FILE WILL BE SAVED. NOTE: Make sure Windows allows writing there.

-- 99.9% of the problems will be due bad data on the line below OR Windows permissions nonsense.

-- IMPORTANT!: Double-check the slashes (/) (they're NOT backslashes (\) ) and the LAST SLASH too!

-- IMPORTANT!: The path must be between quotation marks ("). Use the default value for reference.

local savepath = "C:/Users/Alan/Documents/Rockstar Games/"

 

-- CHOOSE A COOL TEXT TO APPEAR IN THE LICENSE PLATES OF YOUR SAVED VEHICLES! (Max. 8 dig.)

-- IMPORTANT!: The text must be between quotation marks ("). Use the default value for reference.

local platetext = "MYPLATE"

local useplates = true --change to false if you don't want the plates to change

KEY CODES:Space = 32            D4 = 52       O = 79             NumPad4 = 100         F9 = 120PageUp = 33           D5 = 53       P = 80             NumPad5 = 101         F10 = 121Next = 34             D6 = 54       Q = 81             NumPad6 = 102         F11 = 122End = 35              D7 = 55       R = 82             NumPad7 = 103         F12 = 123Home = 36             D8 = 56       S = 83             NumPad8 = 104         F13 = 124Left = 37             D9 = 57       T = 84             NumPad9 = 105         F14 = 125Up = 38               A = 65        U = 85             Multiply = 106        F15 = 126Right = 39            B = 66        V = 86             Add = 107             F16 = 127Down = 40             C = 67        W = 87             Separator = 108       F17 = 128Select = 41           D = 68        X = 88             Subtract = 109        F18 = 129Print = 42            E = 69        Y = 89             Decimal = 110         F19 = 130Execute = 43          F = 70        Z = 90             Divide = 111          F20 = 131PrintScreen = 44      G = 71        LWin = 91          F1 = 112              F21 = 132Insert = 45           H = 72        RWin = 92          F2 = 113              F22 = 133Delete = 46           I = 73        Apps = 93          F3 = 114              F23 = 134Help = 47             J = 74        Sleep = 95         F4 = 115              F24 = 135D0 = 48               K = 75        NumPad0 = 96       F5 = 116            D1 = 49               L = 76        NumPad1 = 97       F6 = 117            D2 = 50               M = 77        NumPad2 = 98       F7 = 118            D3 = 51               N = 78        NumPad3 = 99       F8 = 119            
How it works:

It manages the vehicles in three ways:

  • The saved vehicles that are spawned on the map (at the positions they were saved) will be marked in green on the radar and will despawn when you get far. This only affect the vehicles that you didn't drive (see below).

     

     

  • The saved vehicles that you drive will blink their marks and won't despawn, but after you have 3 of them, the former ones will revert back to their saved positions (and despawn if you're far from their saved positions). This is necessary to avoid over-usage of VRAM.

     

     

  • The random vehicles you entered will be marked in orange and won't despawn, but just as the above, after there are 3 of them on the map, the former ones will be allowed to 'despawn' (but won't necessarily despawn immediately).
The saved vehicles are saved to a file in the disk and will be there after you exit and relaunch the game.

 

----

 

This is my first script and so far it's working fine considering its limitations.

 

Please forgive any bad practices in the script because as a Python hobbyist programmer (pro wannabe), I hate lua and never used it before, but I hate C++ even more so lua was the way to go :p.

 

Regards.

 

 

FAQ:

 

Q:Some colours/modifications/customizations aren't being saved!

A:At the moment not all data from the vehicles are saved, but most of them are. I'm working on it though.

 

Q:Will the vehicles be persistent between saves?

A:Yes, the vehicles you save on the map (green marker) will be saved to disk

 

Q:Why some vehicles markers blink?

A:The blinking markers mark the vehicles that are saved and are being (/were) driven. These won't despawn when you get far.

 

Q:How many vehicles can I save?

A:That's a question I can't answer, what I can say is that, as long as you have distant garages with few vehicles (10-20), you're most likely good to go, because you will never have all of them loaded at once, so, if you follow that rule, you can have as many vehicles saved on the map as you want, but if you want to have a huge parking lot with hundreds of vehicles saved in it, then you're limited by your vram (mostly).

 

Q:Where should the savepath variable point to?

A:That's for YOU to decide, if in doubt just use your documents (C:/Users/YOUR_WINDOWS_USERNAME/Documents/ - NOTE: "C" may not be your main disk, and I'm not sure if that path is the same for other Windows versions (tested on Win 7)).

 

Q:HELP! It's not working!

A:Check your configuration. If in doubt, post it here (you can censor your name), and try disabling other mods.

My mod is not sophisticated, it has really simple and clean logic and do only simple things, if you're experiencing problems, perhaps it's a bug, in this case, if you want to help me fix it, you should describe what you were doing when the problem occurred. It's essential to post your game version, scripthook version, lua plugin version, and the version of the mod (and the configs in the mod file). The optimal scenario is if you identify in which situation the problem happens, then run the Lua Plugin SDK version, and paste the console output here.

It's possible however that other mods will interfere with this mod. Unfortunately I don't have the time nor resources to adapt my mod to work with all the other mods, and my mod is not doing anything that should conflict with them. Other mods can still manage the vehicles of this mod, and everything should work just fine since this mod is as 'passive' as it gets, for example, when checking if the vehicle you're driving is one that was saved and is requesting to spawn, the mod simply checks the vehicle in a list of 'driven_saved_vehicles', if it's there, then it won't spawn, so, even if other mods mess with the vehicle object, the worst that can happen is the vehicle spawning even though, or not spawning at all (which can be fixed by simply hitting the reload key). In other words, if this mod conflicts with other, I don't think it's my fault.

 

Q:Is this open-source?

A:Well... you can just browse the source directly from the file. If you're talking about the license, then no, not atm. Perhaps in the future I'm going to add it to github and release it under an open license, but that's after a code revamp (possibly 0.0.1 or something).

 

Q:Why so many zeroes?

A:It's just the versioning convention I'm used to (it sucks):

0.0.0.xxa - dev version

0.0.x - internal release feature testing

0.x.x - selected testing and last fixes

r.s.d.hotid - release and final convention

Edited by TJGM
Link to comment
Share on other sites

i always wanna save cars around the map and they spawn there forever, even when they are lost or destroyed.

it' exciting to park cars around the map and hide them from people and when need,

you just have to go there and 'find' them.

 

sorry for bein a toug gangsta grammarwarruor i typ liek sh*t on a dumbphone

Link to comment
Share on other sites

Thanks guys!

 

@SilverRST:

That's totally possible, only problem are the modifications, ATM I don't know how to 'save' them to disk in order to make them persistent.

 

#hristi:

Yeah, that's exactly the intention of this mod.

 

Just bear in mind guys that it's technically impossible to have an unlimited number of persistent cars on the map, although I plan to despawn and spawn them on-the-fly as development goes (so, when the player gets near to a point where a car should be, the car is spawned, and when it goes far it's despawned), so it's gonna be very efficient, but even though there's gonna be a limit, and the other cars will be on a list just like the impound where you can choose them.

 

Don't be sad though, the limit is gonna be configurable, and if you're running on the recommended requirements, you can expect dozens if not hundreds of cars persistent on the map :).

Edited by Szabo
Link to comment
Share on other sites

It's such a huge immersion killer in GTAV to turn around and have a car you just parked vanish. We definitely need a good solid script that does this.

Link to comment
Share on other sites

Awesome, thanks! I would love to have an option to save specific cars to their location, like Simple Trainer for GTA IV could do.

Edited by bio88
Link to comment
Share on other sites

Thank you guys.

 

Awesome, thanks! I would love to have an option to save specific cars to their location, like Simple Trainer for GTA IV could do.

That's what I'm doing at the moment. You just hit a key and then your car is 'saved' at that position. I'm even going to make the dirt persistent (optional) so you have an incentive to actually use the car washer now and then :).

 

The only problem I'm having is saving the modifications of the cars (custom parts). And I'm also trying to optimize the thing before going fully 'on-the-fly' (because that's gonna take time).

Link to comment
Share on other sites

I think it'd be cool to have a custom area that saves cars, Like the tenant only spaces in GTA:IV, Perhaps like, Anywhere on micheal's driveway.

Link to comment
Share on other sites

I just wanted to post here for the first time ever to say thanks for working on this, it is exactly what I've been hoping for from mods. :) I plan to start the singleplayer again, with a few convenience mods like this, for a more enjoyable experience.

 

Only question I have is, would it be possible to change the personal vehicles of the three characters? Or if that's not in the scope of what your planning, that's okay, just wondering. :)

Edited by ShidaPenns
Link to comment
Share on other sites

Thank you guys.

 

Awesome, thanks! I would love to have an option to save specific cars to their location, like Simple Trainer for GTA IV could do.

That's what I'm doing at the moment. You just hit a key and then your car is 'saved' at that position. I'm even going to make the dirt persistent (optional) so you have an incentive to actually use the car washer now and then :).

 

The only problem I'm having is saving the modifications of the cars (custom parts). And I'm also trying to optimize the thing before going fully 'on-the-fly' (because that's gonna take time).

 

Great! I cant wait.

Link to comment
Share on other sites

Great job!
Only one thing comes to my mind which could make this skript better. Is there any way to display a vehicle icon on the map? Does anyone know if there is a function for that, so that it can be added to the script?

  • Like 1
Link to comment
Share on other sites

alteredbeast

It doesn't work when you switch between the 3 main characters in story mode. The cars just disappear.

Link to comment
Share on other sites

dontfandango

Great mod! This was really needed. All I need now is to walk in first person, and a mod to reduce all vehicles top speed and I'm a happy camper :)

Link to comment
Share on other sites

nathanmaxtro

Is there any way to set it so that you can set a different car to be a main characters personal car?

 

That's all I really want. To be able to enter a car, open up a menu and choose, "Set as personal vehicle."

Link to comment
Share on other sites

Is there any way to set it so that you can set a different car to be a main characters personal car?

 

That's all I really want. To be able to enter a car, open up a menu and choose, "Set as personal vehicle."

This is the mod that I'm still waiting to be made..

Link to comment
Share on other sites

Thank you guys

 

I just released the beta version. (gimme a few mins to update the #1 post AND to upload it to my friend's website (ModMyPi).

 

It doesn't work when you switch between the 3 main characters in story mode. The cars just disappear.

For the 'temporary' vehicles, I don't know if it's worth the effort of saving and re-spawning them, but for the saved vehicles it definitely should work as they are independent from the 'character' being used. Perhaps it's going to be necessary to press the 'reload' key so the mod will respawn all the vehicles at their saved positions. I'm definitely going to investigate to make it seamless.

 

Great mod and all, but you must make it so it disables it self when you use the rockstar editor, or this will happen


http://images.akamai.steamusercontent.com/ugc/36370312381638294/4A3E0FE5BCF5921399E032A438C70AFB268D3D5B/

Hmm... I'm going to add this to the TODO list. Thanks for reporting.

 

Is there any way to set it so that you can set a different car to be a main characters personal car?

 

That's all I really want. To be able to enter a car, open up a menu and choose, "Set as personal vehicle."

I'd like that too... to tell the truth, that should be by default. I don't know of an easy way to do that with mods though, the 2 ways i can think of atm is either replacing the vehicles in the game files, what's a pain, OR making a mod that replaces the vehicles on-the-fly. It would be easy if there was a way to 'get' the vehicles, because looping all of them is definitely intensive.

Link to comment
Share on other sites

Hey guys, just bumping this to let you know that I just updated to 0.0.0.2b with a fix when unsaved vehicles were not despawning, it's highly recommended to update.

Link to comment
Share on other sites

nathanmaxtro

 

 

Is there any way to set it so that you can set a different car to be a main characters personal car?

 

That's all I really want. To be able to enter a car, open up a menu and choose, "Set as personal vehicle."

I'd like that too... to tell the truth, that should be by default. I don't know of an easy way to do that with mods though, the 2 ways i can think of atm is either replacing the vehicles in the game files, what's a pain, OR making a mod that replaces the vehicles on-the-fly. It would be easy if there was a way to 'get' the vehicles, because looping all of them is definitely intensive.

Thanks for replying to my post.

 

I know that this feature is built into the game because it's used for Online. I'm not even going to pretend to understand coding but I'm sure there is a way to mod the game to use Online's method of car management for single player.

 

I agree with you that is should have been that way by default.

Link to comment
Share on other sites

 

 

 

Is there any way to set it so that you can set a different car to be a main characters personal car?

 

That's all I really want. To be able to enter a car, open up a menu and choose, "Set as personal vehicle."

I'd like that too... to tell the truth, that should be by default. I don't know of an easy way to do that with mods though, the 2 ways i can think of atm is either replacing the vehicles in the game files, what's a pain, OR making a mod that replaces the vehicles on-the-fly. It would be easy if there was a way to 'get' the vehicles, because looping all of them is definitely intensive.

Thanks for replying to my post.

 

I know that this feature is built into the game because it's used for Online. I'm not even going to pretend to understand coding but I'm sure there is a way to mod the game to use Online's method of car management for single player.

 

I agree with you that is should have been that way by default.

 

You're welcome.

 

The problem with Online features is that some of them doesn't 'run' on the player computer, the computer acts just as a 'client' that communicates to the R*'s servers, so not all 'logic' that is seen on Online is 'acessible' locally. I think that's the case for custom vehicles and insurance. What modders can do is simply replicate that behaviour. The basic logic is easy enough, what is hard is dealing with the stuff you don't know how it works, that's why my mod doesn't save wheel colours for example. Eventually the community will document the whole api though.

 

It's frustrating how much stuff was left out of single player though. I mean, Online is great and stuff, but that's no excuse... some bugs on SP were not fixed since the first version on last-gen. An example is the broken impound.

Link to comment
Share on other sites

cheers Szabo, I will be trying this update in the morning.

 

Could I suggest, if it is possible, to include an activate / de-activate key for your mod? I know that it is inevitable that some mods will interfere with some SP missions and yours (v 0.1) introduces the occasional weird consequences - you can't save the getaway car for the blitz play mission. It's not a big deal really, I just quit the game & moved the script out of the addins folder to complete it, but being able to disable it from within the game would be more convenient. The other car persistence mods also have this issue, so it may well be more effort than it is worth.

 

I would rather you & all other modders prioritise working on being able to set any vehicle as the default player vehicle .:)

 

R* - so brilliant, but so exasperating at times!

 

Thanks for your efforts, it is much appreciated.

Edited by janimal
Link to comment
Share on other sites

cheers Szabo, I will be trying this update in the morning.

 

Could I suggest, if it is possible, to include an activate / de-activate key for your mod? I know that it is inevitable that some mods will interfere with some SP missions and yours (v 0.1) introduces the occasional weird consequences - you can't save the getaway car for the blitz play mission. It's not a big deal really, I just quit the game & moved the script out of the addins folder to complete it, but being able to disable it from within the game would be more convenient. The other car persistence mods also have this issue, so it may well be more effort than it is worth.

 

I would rather you & all other modders prioritise working on being able to set any vehicle as the default player vehicle . :)

 

R* - so brilliant, but so exasperating at times!

 

Thanks for your efforts, it is much appreciated.

 

Thank you.

 

Yes, it's possible to include a key to activate and de-activate the mod. I'm going to add that to the to-do list along with an option to disable the mod automatic load on startup.

 

The mod however is /more/ intended for using after the missions are complete (at least the main and weirdos), because it's inevitable that some problems will occur. Of course this is not mandatory because not even *I* finished the mains missions yet :p.

 

What are the "other car persistence mods"? I couldn't find any.

Link to comment
Share on other sites

 

cheers Szabo, I will be trying this update in the morning.

 

Could I suggest, if it is possible, to include an activate / de-activate key for your mod? I know that it is inevitable that some mods will interfere with some SP missions and yours (v 0.1) introduces the occasional weird consequences - you can't save the getaway car for the blitz play mission. It's not a big deal really, I just quit the game & moved the script out of the addins folder to complete it, but being able to disable it from within the game would be more convenient. The other car persistence mods also have this issue, so it may well be more effort than it is worth.

 

I would rather you & all other modders prioritise working on being able to set any vehicle as the default player vehicle . :)

 

R* - so brilliant, but so exasperating at times!

 

Thanks for your efforts, it is much appreciated.

 

Thank you.

 

Yes, it's possible to include a key to activate and de-activate the mod. I'm going to add that to the to-do list along with an option to disable the mod automatic load on startup.

 

The mod however is /more/ intended for using after the missions are complete (at least the main and weirdos), because it's inevitable that some problems will occur. Of course this is not mandatory because not even *I* finished the mains missions yet :p.

 

What are the "other car persistence mods"? I couldn't find any.

 

 

He's probably talking about http://gtaforums.com/topic/790398-vrel-no-remove-last-32-vehicles-of-player/

 

If possible, can you add a support for controllers ? :pp Great mod anyway!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 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.