Games > The Simpsons Hit & Run > Console File Commands > MFK Commands > Stages > AddStageVehicle

AddStageVehicle

This command adds a loaded vehicle to the world in a mission.

Context

This command should be called between calls to AddStage and CloseStage.

Syntax

AddStageVehicle( car, locator, behaviour, [con_file, driver] );

Game.AddStageVehicle( car, locator, behaviour, [con_file, driver] )

  • car: The name of the car to add.
  • locator: The name of the Locator Type 3 to place the car on.
  • behaviour: The type of Vehicle Behaviour to give the car.
  • con_file: The CON file to use on the car.
    • Optional, defaults to the car's CON file in the scripts\cars folder if omitted.
  • driver: The driver of the vehicle. This only works if the con_file does not call SetDriver.
    • Optional, defaults to no driver if omitted (unless the specified con_file sets a driver).

Examples

This example adds Skinner's car and activates it immediately with Chase AI.

SelectMission("m1");
	...

	AddStage();
		// Add Skinner with chase AI right away.
		AddStageVehicle("skinn_v","m1_skinner_car","chase","missions\\l1m0\\skinner.con","skinner");

		AddObjective("dummy");
		
		CloseObjective();
	CloseStage();
CloseMission();

This example adds Skinner's car with no AI and then activates it in the following stage with ActivateVehicle.

SelectMission("m1");
	...

	AddStage();
		// Add Skinner with no AI right away.
		AddStageVehicle("skinn_v","m1_skinner_car","NULL","missions\\l1m0\\skinner.con","skinner");

		AddObjective("dummy");
		
		CloseObjective();
	CloseStage();

	AddStage();
		// Then use ActivateVehicle in the next stage to activate him.
		ActivateVehicle("skinn_v","NULL","chase");

		AddObjective("dummy");
		
		CloseObjective();
	CloseStage();
CloseMission();

This example adds Skinner's car and activates it immediately with Chase AI.

Game.SelectMission("m1")
	...

	Game.AddStage()
		-- Add Skinner with chase AI right away.
		Game.AddStageVehicle("skinn_v","m1_skinner_car","chase","missions\\l1m0\\skinner.con","skinner")

		Game.AddObjective("dummy")
		
		Game.CloseObjective()
	Game.CloseStage()
Game.CloseMission()

This example adds Skinner's car with no AI and then activates it in the following stage with ActivateVehicle.

Game.SelectMission("m1")
	...

	Game.AddStage()
		-- Add Skinner with no AI right away.
		Game.AddStageVehicle("skinn_v","m1_skinner_car","NULL","missions\\l1m0\\skinner.con","skinner")

		Game.AddObjective("dummy")
		
		Game.CloseObjective()
	Game.CloseStage()

	Game.AddStage()
		-- Then use ActivateVehicle in the next stage to activate him.
		Game.ActivateVehicle("skinn_v","NULL","chase")

		Game.AddObjective("dummy")
		
		Game.CloseObjective()
	Game.CloseStage()
Game.CloseMission()

Notes

No additional notes.

Donut Team © 2024 · v4.0