[SCRIPT][REL] Add-on spawner
Hullo! I've been messing around this afternoon to make an add-on vehicle spawner.
This wouldn't have been possible without SHVDN code to find all vehicle hashes in the game pool, by zorg93/drp4lyf.
No configuration needed, just load it up, press the hotkey (F5) and spawn your add-on vehicle. They are separated by vehicle class, but all vehicles should be present. All base game + official DLC have been filtered out. This does not find any "replace" vehicle mods, just add-ons.
Full credits to the ScriptHookVDotNet team for this one wherever applicable
No config changes.
- Use formatted vehicle names
- Persistent "Spawn in car" option
- Fix cinematic cam not showing after menu exit
Fixed a couple of things that bugged me.
- Fix spawn by name not accepting underscores (type "-" for "_" now)
- Calculate spawn positions with vehicle width
I haven't had any issues with disappearing vehicles or vehicles not showing up properly (after 1.0.3), though some people had. If anybody's suffering from this, can they get back or post here? I've asked in the mod page if the car is spawnable at all, or if it's installed right, but I never got an answer.
Does anybody even read these things?
Anyway - rant time!
Right, so you've probably come across a bunch of weird add-on vehicles if you used this mod (or Mafin's Menyoo), with the names not showing up right.
Note that you need to spawn it with "modelName" manually in trainers, since that thing is hashed by the game and used for spawning. Turns out modelName can't be simply restored from any data. What the game does return is the Display Name, which is what's in
Sadly, many add-ons have mangled or non-edited lines here. Case in point, here's my collection of add-ons:
[01:23:32.213] GTAVAddonSpawner v1.0.5 [01:23:32.213] Game version VER_1_0_1032_1_STEAM [01:23:32.213] Script registered [01:23:32.213] dlcpacks scan success: 52 folders [01:23:33.193] Script started [01:23:33.193] Loading D:\Games\Steam\steamapps\common\Grand Theft Auto V\AddonSpawner\settings_general.ini [01:23:33.193] Loading D:\Games\Steam\steamapps\common\Grand Theft Auto V\AddonSpawner\settings_menu.ini [01:23:33.194] Settings read [01:23:33.194] Initialization finished [01:23:33.907] Hash Class Display name Model name GXT name [01:23:33.907] 0x8DACA422 Sports BN240 NOTFOUND 240sx BN Sports III [01:23:33.907] 0xEEE9B463 Sports SCHWARZER2 NOTFOUND 6STR Benefactor Schwartzer Custom [01:23:33.908] 0xA6297CC8 Sports FUTO2 NOTFOUND 6STR Karin Futo GT Custom [01:23:33.908] 0xD5DAD042 Compacts AE86 ae86 AE86 [01:23:33.908] 0x3187A42A Military BARRACKS2 NOTFOUND Barracks Semi [01:23:33.908] 0xFE3BDF84 Emergency BARRACKS2 tfft Barracks Semi [01:23:33.908] 0xC413493F Military BARRACKS2 NOTFOUND Barracks Semi [01:23:33.908] 0x8B5A3CF2 Commercial BIFF biff2 Biff [01:23:33.908] 0x40E88DBB Super BLISTATA blistata Blista Compact TA [01:23:33.908] 0xCB1681D5 Vans BURRITO burrito6 Burrito [01:23:33.908] 0xDE6377E1 Compacts CIVIC TYPE- hctr CIVIC TYPE- [01:23:33.908] 0x5D1903F9 Sports COMET4 NOTFOUND Comet Retro Standard [01:23:33.909] 0xD20E6960 Super DIABLO NOTFOUND DIABLO [01:23:33.909] 0xDAD3BE71 Compacts EP3 ep3 EP3 [01:23:33.909] 0xCCD6FA55 Sports ELEGY3 NOTFOUND Elegy Drift Missile [01:23:33.909] 0x699DB3F0 Emergency ELEGYP elegyp Elegy Retro TMPD Special [01:23:33.909] 0x90775164 Sports FUTO3 futo3 Futo JTCC [01:23:33.909] 0xC6304A9C Sports INTEGRA dc2 Honda Integra Type-R [01:23:33.909] 0x90AA42F8 Planes JET NOTFOUND Jet [01:23:33.909] 0x91A6E9DA Emergency LGUARD2 NOTFOUND LGUARD2 [01:23:33.909] 0x39C9FE08 Super EVO6 evo6 Lancer Evo VI [01:23:33.909] 0xA44047E5 Sports na6 na6 Mazda Miata MX-5(NA6C) [01:23:33.909] 0xA147CFAE Sports FD fd Mazda RX-7(FD3S) [01:23:33.910] 0xB278252B Planes LAZER fa18d P-996 LAZER [01:23:33.910] 0xF58FC67 Sports Peugeot 205 ypg205t16a Peugeot 205 [01:23:33.910] 0xFF0A5BCA Sports Peugeot 205 ypg205t16b Peugeot 205 [01:23:33.910] 0x75627C64 Super LE7B imsa90 RE-7B [01:23:33.910] 0x6CF5072F Commercial ROADKILLER roadkiller Roadkiller [01:23:33.910] 0xA1DE038A Coupes SENTINEL r33 Sentinel XS [01:23:33.910] 0xF0DFD0A3 Emergency sheriff NOTFOUND Sheriff Cruiser [01:23:33.910] 0x5F6CD46D Sedans r30rsx NOTFOUND Skyline RS-X R30 [01:23:33.910] 0x7E39B694 Sports SkylineGTR skyline SkylineGTR [01:23:33.911] 0xA9DA270B Sedans STANIER stanier2 Stanier [01:23:33.911] 0x827AD84D Sedans STANIER stanier3 Stanier [01:23:33.911] 0xF942F377 Super SULTANRS2 NOTFOUND Sultan RS Ute [01:23:33.911] 0xB677829F Muscle THUNDER thunder THUNDER [01:23:33.911] 0x2B7009AC Off-Road TROPHY3 trophy3 TROPHY3 [01:23:33.911] 0x2F216956 Sedans TAXI NOTFOUND Taxi [01:23:33.911] 0xFD5E05D0 Compacts TAXI NOTFOUND Taxi [01:23:33.911] 0x1EA6C630 Off-Road UPARMORHMVD uparmorhmvdes UPARMORHMVD [01:23:33.912] 0x5C72AE24 Off-Road UPARMORWL NOTFOUND UPARMORWL [01:23:33.912] 0xC12E09FF Planes Vestra me262 Vestra [01:23:33.912] 0x29BD942 Planes ZEKE NOTFOUND ZEKE [01:23:33.912] 0x45B98A03 Military abrams NOTFOUND abrams [01:23:33.912] 0xA21FB36A Off-Road asrad asrad asrad [01:23:33.912] 0xFFE4453 Sports e36 bmwe36 e36 [01:23:33.912] 0x34E7C2 Super fc3s fc3s fc3s [01:23:33.912] 0x137C47B4 Off-Road hmmwv hmmwv hmmwv [01:23:33.912] 0x25D45CB7 Military l2a7custom NOTFOUND l2a7custom [01:23:33.912] 0x1AA338C9 Military l2a7german3 NOTFOUND l2a7german3 [01:23:33.913] 0x43870AC4 Military l2a7germand NOTFOUND l2a7germand [01:23:33.913] 0x743F6C30 Military l2a7germanw NOTFOUND l2a7germanw [01:23:33.913] 0x34ADC304 Military l2a7green NOTFOUND l2a7green [01:23:33.913] 0x9ECAD6EE Military l2a7khaki NOTFOUND l2a7khaki [01:23:33.913] 0xB65BB446 Military l2a7red NOTFOUND l2a7red [01:23:33.913] 0xE000BB07 Military l2a7winter NOTFOUND l2a7winter [01:23:33.913] 0xD9D05A1F Sports mlex mlex mlex [01:23:33.913] 0xC8C3F39F Cycles policebicyc NOTFOUND policebicyc [01:23:33.913] 0x58EF21FE Helicopters shemav NOTFOUND shemav [01:23:33.914] 0x4086C3D9 SUVs lc100 lc100 toyota lc100
Model nameis actually a workaround and is resolved from matching the folder name (with up to 1 extra alphanumeric character added to the end) with the game hash, but it's obviously a dirty as hell workaround.
What's extra bothersome is that this correct info is RIGHT below where the model name is. Take the Audi 90 quattro IMSA GTO. Here's an excerpt from the vehicles.meta in its archive:
<modelName>imsa90</modelName> <txdName>imsa90</txdName> <handlingId>IMSA90</handlingId> <gameName>LE7B</gameName> <vehicleMakeName>OBEY</vehicleMakeName>
Note how gameName is LE7B, which is from an original car. It's just one extra line to edit, so I can't really understand why this wasn't updated when modelName, txdName and handlingId was added. At the very least it helps so much with native functions to get the display name. With some extra effort, the GXT can also be updated, but that hasn't got as much consequence as this one, where it's simply confusing after the modelName has been hashed away. So please, people, take the minimal effort to also paste your model name inside gameName.
Anyway, here's a build that lists things so it can help with spawning things manually and backtrack your add-on mods. Because hell, I sure as hell can't know that the
Vestraactually is a Messerschmitt Me 262 which is spawned with
Obviously it doesn't resolve model names with the dlcpacks name being different, but it's better than nothing at all.