Scope
Using "DEFAULT" Slot
This command should be called in a level's initialisation script.
Using "OTHER" Slot
This command should be called between calls to SelectMission and CloseMission in a mission's initialisation script.
Syntax
MFK
Lua
InitLevelPlayerVehicle( vehicle_name, locator_name, slot, [con_file] );Game.InitLevelPlayerVehicle( vehicle_name, locator_name, slot, [con_file] )- vehicle_name: The name of the vehicle to use.
- locator_name: The name of the CarStart Locator to spawn the vehicle at.
- slot: The slot to put the vehicle in.
- DEFAULT: Use this vehicle as the level's default car.
- OTHER: Use this vehicle as a forced car in a mission.
- con_file: A path to a CON file.
- Optional, defaults to the car's normal CON file in
scripts/cars.
- Optional, defaults to the car's normal CON file in
Examples
Level Default Car
Mission Forced Car
MFK
Lua
SelectMission("m3");
// ...
// This sets Comic Book Guy's vehicle as the starting vehicle for this mission.
InitLevelPlayerVehicle("comic_v", "m3_cbgcar_sd", "OTHER");
SetForcedCar();
AddStage();
// ...
CloseStage();
CloseMission();Game.SelectMission("m3")
-- ...
-- This sets Comic Book Guy's vehicle as the starting vehicle for this mission.
Game.InitLevelPlayerVehicle("comic_v", "m3_cbgcar_sd", "OTHER")
Game.SetForcedCar()
Game.AddStage()
-- ...
Game.CloseStage()
Game.CloseMission()