How force car spawn with modkit/extras
-
Hi guys, I have a car and when I spawn it, the model come without some parts, but if I tuning or use the mechanic I can see all parts, so I need to define the parts to come as default when the car spawn, is it possible?
Before tuning:
After tuning
Parts within carcols.meta
Car Variation:
-
@monterade
If you use 'vehiclemodelsets.meta' to spawn it (rather than normal ambient spawning using 'popgroups.ymt' etc) it can be done...\Grand Theft Auto V\mods\update\update.rpf\common\data\ai\vehiclemodelsets.meta
Basically:
- Remove it from 'popgroups.ymt' (so it doesn't spawn broken etc)
- Add it to any section in 'vehiclemodelsets.meta' (different sections, 'MOTORBIKE_SPORT', 'ROCKFORD_CARS', 'LS_CUSTOMS_MODDED_SP', ... etc, spawn randomly in different locations around the map (spawn locations are defined in scenarios))
- Note: You can add it to more than one 'vehiclemodelsets.meta' section if you like.
- Add whatever upgrades you want it to spawn with (refer to this post here on that & also look at the 'LS_CUSTOMS_MODDED_SP' section in 'vehiclemodelsets.meta' to see examples of modded/upgraded vehicles)
-
Not sure if OP is talking about a car he is creating or one he downloaded and installed but either way @a63nt-5m1th has provided a solution - as expected.
Just to add to the discussion, another approach is for those who might want to use scripting to spawn their vehicles. This allows for customized spawns and removes the need for editing meta files and even the use of the Trainer for this purpose.
To stay specific to the topic, this is how "forcing the car to spawn with modkit/extras" can be done.
Mandatory:
MyVehicle.Mods.InstallModKit(); //SVHDN Or Function.Call(Hash.SET_VEHICLE_MOD_KIT, MyVehicle, 0); //Native for mod kits
Examples, which follow mandatory code above
Function.Call(Hash.SET_VEHICLE_MOD, MyVehicle, 48, 1, false); // livery as mod, not regular livery Function.Call(Hash.SET_VEHICLE_MOD, MyVehicle, 5, 0, false); //chassis, example motorcycle frame Function.Call(Hash.SET_VEHICLE_MOD, MyVehicle, 0, 0, false); //first zero is for spoilers Or for spoiler VehicleMod BikeMod = MyVehicle.Mods[VehicleModType.Spoilers]; BikeMod.Index = 0;
Values for the first argument:
#Mod Type Spoilers - 0 Front Bumper - 1 Rear Bumper - 2 Side Skirt - 3 Exhaust - 4 Frame - 5 Grille - 6 Hood - 7 Fender - 8 Right Fender - 9 Roof - 10 Engine - 11 Brakes - 12 Transmission - 13 Horns - 14 (modIndex from 0 to 51) Suspension - 15 Armor - 16 Front Wheels - 23 Back Wheels - 24 //only for motocycles Plate holders - 25 Trim Design - 27 Ornaments - 28 Dial Design - 30 Steering Wheel - 33 Shifter Leavers - 34 Plaques - 35 Hydraulics - 38 Livery - 48