Ambient Civilian Vehicles – Arma 2

From Bohemia Interactive Community
(Redirected from Ambient Civilian Vehicles)
Jump to navigation Jump to search

System for Including Land Vehicles Into Environment (SILVIE) is, as said in title, system for spawning empty cars in villages and towns. All vehicles are created on mission start and are constantly replaced when some of them are destroyed.


Initialisation

Paths

Editor:

Modules (F7) > Ambient Civilian Vehicles

Data:

ca\modules\silvie

Startup

Place SILVIE manager on map. No additional synchronising needed.

Optional Parameters

Set variables to BIS_silvie_mainScope with desired values:

  • townlist = <array>; - list of places where vehicles will be spawned. Can be location logic (created by BIS_fnc_locations), array in format [center,distance] or trigger.
Example: this setVariable ["townlist", [bis_loc_acityc_mogilevka, [position this, 3000], trigger1]];
Default value: Whole island.
  • blackList = <array>; - object classes which will be excluded from list of building around which cars are generated.
Example: BIS_silvie_mainScope setVariable ["blackList", ["house1", "house2"]];
Default value: not yet defined
  • vehicleRarity = <array>; - Changing vehicle rarity numbers (e.g. to have village cars spawned in cities, or to disable spawning of given class completely with unusual number like 10). Default rarity numbers are set in config under rarityUrban value (in range from 0/village to 1/city)
Example: BIS_silvie_mainScope setVariable ["vehicleRarity", ["skodaRed", 10, "skodaBlue", 0.8]];
Default value: empty array
  • vehicleCount = <string>; - formula on which basis system calculates number of vehicles for location. %1 is number of buildings (blacklisted objects are excluded) in 500 metres from location.
Example: BIS_silvie_mainScope setVariable ["vehicleCount", "round (%1 / 10)"];
Default value (and recommended): "round ((sqrt %1) * 1.5)"
  • vehicleInit = <code style="display: block">; - custom init which is executed on every car. Vehicle can be accessed using _this variable. Init is executed as separate script, so sleep or waituntil commands can be used without limitations.
Example: BIS_silvie_mainScope setVariable ["vehicleInit", { _this lock true }];
Default value: {}
  • roadDistance = <number>; - when creating car around building, if there is some road closer than this value, vehicle will be attached to this road instead of to building.
Example: BIS_silvie_mainScope setVariable ["roadDistance", 30];
Default value: 25
  • attempts = <number>; - number of attempts to create vehicle (failed attempt is for instance when some road is detected near building, but it is crossroad).
Example: BIS_silvie_mainScope setVariable ["attempts", 20];
Default value: 10

Stored Variables

These variables are only to be read and must not be modified!

BIS_silvie_mainScope

  • id = <number> - identification number of latest car.
  • currentTown = <number> - town where last vehicle was created (or where is planned to, if player is nearby).
  • carlist = <array> - list of all created cars (destroyed ones are removed).

Cars

  • ALICE_id = <number> - identification number of vehicle.
  • ALICE_obj = <object> - object on which vehicle was created (can be object or road).
  • ALICE_twn = <location> - town where vehicle was created.