This command adds a vehicle to a traffic group.
Context
This command should be called in a level's initialisation script (leveli.mfk).
Additionally, it must be called between calls to CreateTrafficGroup and CloseTrafficGroup.
Syntax
AddTrafficModel( car, amount, [no_park] );
Game.AddTrafficModel( car, amount, [no_park] )
- car: The name of the car to add.
- amount: How many instances of the car can appear at once.
- no_park: Prevent the vehicle from spawning idle on Type 3 Locators with the Parked Car flag.
- Optional, defaults to 0 (which allows it to be parked).
Examples
CreateTrafficGroup(0);
AddTrafficModel("minivanA", 2); // 2 instances, can appear parked
AddTrafficModel("glastruc", 1, 1); // 1 instance, cannot appear parked
AddTrafficModel("schoolbu", 1, 1);
AddTrafficModel("pickupA", 1);
CloseTrafficGroup();
Game.CreateTrafficGroup(0)
Game.AddTrafficModel("minivanA", 2) -- 2 instances, can appear parked
Game.AddTrafficModel("glastruc", 1, 1) -- 1 instance, cannot appear parked
Game.AddTrafficModel("schoolbu", 1, 1)
Game.AddTrafficModel("pickupA", 1)
Game.CloseTrafficGroup()
Notes
By default, the combined total of all the amount values for each call to this command must amount to 5 or the game will crash.
You can have more or less by using the Mod Launcher's Custom Traffic Support hack.