Community Forum

Function to add a new trafficvehicle

Forum Overview >> Farming Simulator 2009

CategoryFarming Simulator 2009
Created22.11.2009 11:49

Heady Planet-ls (Headshot XXL) 22.11.2009 11:50

how is the function to add a new trafficvehicle?

Manuel Leithner - GIANTS Software 22.11.2009 13:49
The function:

TrafficVehicleUtil.registerTrafficVehicle(filename, probability);

filename: complete path to the xmlfile (relativepath)
probability: the spawn probability

mfg Face

Heady Planet-ls (Headshot XXL) 22.11.2009 20:21
it works, thank you.

Shawn Cowman (Unknown) 06.03.2012 00:08
I've been adding some new trafficVehicles to FS2011 and I have a couple of questions.

1) The probability....Is this the probability that the vehicle is loaded or the probability that it gets spawned when the game creates a new trafficVehicle? Reason for question: I have five mods that are setup as trafficVehicles with probability settings of 60, 20, 5, 5, 5....My thinking was that the one set to 60 would get spawned 60 percent of the time when the game spawns a new trafficVehicle and so with the other this correct? I have now noticed that not all five mods are loaded every time I start the game, so is the probability a setting used to determine if the file gets loaded at game start?

2) Is there a way to remove some of the default cars that get spawned as traffic? If I just remove the folder I get many errors trying to load them.

Thanks in advance for any help.....

Note: Log in to post. Create a new account here.