MFK Command: AddStageVehicle

Synopsis

Adds an instance of a loaded vehicle in a mission stage.

Syntax

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 scripts\cars 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 CON file sets a driver).

Examples

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();
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();

Notes

Vehicles with "NULL" behaviour will stick around until the end of the mission or until a stage that activates them ends.

 

Back to top