Cyberpunk 2077

File information

Last updated

Original upload

Created by

FlyingNanoPenguin

Uploaded by

FlyingNanoPenguin

Virus scan

Safe to use

Tags for this mod

About this mod

Prevents player vehicles parked in the world from being despawned after quests and races.

Requirements
Permissions and credits
Changelogs
Info
Attempts to stop player vehicles that are parked elsewhere on the map from being despawned during certain quests and gigs, as well as during races. This will not prevent player vehicles that are parked too close to quest trigger locations from being despawned; the game will still despawn your car if it thinks it is blocking a quest event that needs to happen (like a quest NPC driving a car, etc). However, cars that you park in completely separate locations (like a parking garage with your collection neatly parked in it) will not be despawned*. Basically, this allows you to have a "physical garage" of sorts without worrying about your cars all being blasted off the face of the earth because you started a gig on the opposite end of town.

This mod also includes the mod No Vehicle Despawn, which prevents player vehicles from being despawned when you move too far away from them. The combined effect should be as close as we've gotten to persistent player vehicles so far. Thanks to x1EGG for letting me include their mod!

* This is not a GUARANTEE; I have not tested all of the instances where the game tries to despawn all player vehicles, nor do I plan to. However, the quests and races that I have tested so far that did despawn all vehicles in vanilla have worked - even a couple where you ride with an NPC through town in their car. If you encounter a quest that does despawn all your vehicles even with this mod installed, please mention it in the comments! It is unlikely that I can fix it (it's probably just out of the capabilities of the approach that this mod takes), but it would be good for other players to know. 

Disclaimer
The way that this mod works does fundamentally hack a way around a core part of how the game's vehicle system works. I have done a good amount of testing to ensure the vehicle system functions as expected (see testing notes at the bottom of this description), but there's always the possibility that I missed a corner case somewhere. The good news is that even if it breaks your game (there is just one bad thing that can happen that I'm aware of), the issue should be simple to fix with CET commands, or the mod can be cleanly removed if you follow the uninstallation instructions below. 
That said, here are the bugs that could happen, and how to try and troubleshoot:

I can't open the vehicle call menu, when I am clearly in an area where I should be able to. This can be caused by two things:
  • The game thinks you have no vehicles (because it isn't checking your persistent vehicles) and disabling the call menu,  running Game.IVPUpdateVehicleGarageState() in the CET console should fix it. 
  • Your persistent vehicles have actually somehow been dropped by the system. I'm not actually aware of how this issue could happen, but I'm putting it here just in case - assuming that the cause of this is not some game update or mod conflict breaking this mod, your persistent vehicles are stored in your save file, so loading a save from before you see the problem should fix it. 

Virtual Car Dealer Compatibility

Please update to the latest version of VCD (at least 2.1.3) to use it with this mod. 

Installation
Install using a mod manager or download manually and unpack into game folder. 

Uninstallation
IMPORTANT! Not following these instructions will leave you with an empty garage upon uninstalling this mod. This is not irreversible - you could theoretically re-install the mod on a later save of the same playthrough and follow the proper uninstall steps to restore the vehicles, or just manually re-enable each car via CET code, but better to do it right the first time, yeah?

To uninstall:
  • Enter "Game.IVPRestoreAllVehicles()" without quotes into the CET console.
  • Enter "for i, v in ipairs(Game.GetVehicleSystem():GetPlayerUnlockedVehicles()) do print(i, GameDump(v)) end" without quotes into the CET console. Check that all your cars are listed.
  • Save the game immediately and exit. DO NOT OPEN THE VEHICLE CALL MENU.
  • Uninstall the mod.
  • Load that save back up and all your cars should be there!

Compatibility Notes For Mod Authors
This mod uses replaceMethod on VehicleSystem.IsSummoningVehiclesRestricted. In addition, usage of VehicleSystem.GetPlayerUnlockedVehicles and VehicleSystem.EnablePlayerVehicle(..., false) will not work properly without a compatibility patch, as GetPlayerUnlockedVehicles  will return an empty array, and EnablePlayerVehicle(..., false) will have no effect. EnablePlayerVehicle(..., true), however, will work with no problems (the mod will move the added car into the persistent system the next time the vehicle call menu is invoked).

Testing Notes
(in case you're interested for some reason)

Basic functionality that has been verified as still working:
- All previously owned vehicles show up in the call menu.
- Vehicles newly bought from Autofixer show up in the call menu.
    - KNOWN BUG: The first time the call menu is brought up after buying a vehicle through Autofixer, its entry will be duplicated
- Vehicles newly bought from VCD show up in the call menu.
- Vehicles can be toggled as favorites.
- Vehicles can be summoned, and display the proper summoning UI and honk and flash once summoned.
- Vehicle stash access works.
- Vehicles have icons in the world, minimap, and world map.
- Vehicle call menu is available/not available in the proper areas/at the proper times.
Verified mod can be uninstalled:
- Verified that after uninstalling (after calling Game.IVPRestoreAllVehicles() and immediately saving and exiting the game), all owned vehicles were present in the call menu & VCD.
Verified VCD behavior with the patch applied:
- With the patch, verified that owned vehicles are treated as such in VCD and cannot be bought again (unless they are sold).
- With the patch, verified that all owned cars show up in the sell list. Verified that once sold, they are removed from the call menu. Verified that they can be repurchased and spawned as well.
  - KNOWN BUG: if you have previously sold a vehicle through VCD, but it has remained in your game world, it will now have a map icon again. 

My Other Mods
Improved Vehicle Persistence
Alphabetically Sort Favorite Vehicles
Chevillon Emperor - ArchiveXL
Herrera Riptide GT2 - ArchiveXL
Mahir Supron - ArchiveXL
Makigai Tanishi - ArchiveXL
Mizutani Hozuki - ArchiveXL
Mizutani Shion - ArchiveXL
Quadra Sport R-7 - ArchiveXL
Thorton Merrimac MSL3 - ArchiveXL
Villefort Alvarado V4F Delegate and V4FC Playboy - ArchiveXL
Villefort Alvarado V4FH 570 Herman - ArchiveXL
Villefort Deleon Coupe - ArchiveXL


Thank You
To x1EGG for letting me include your mod, djkovrik for being willing to update VCD to work with this mod, and jekky for answering my redscript questions.