Ambient Civilian Vehicles – Arma 2

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " it's" to " it is")
m (Some wiki formatting)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Arma 2: Editor Modules]]
{{TOC|side}}
'''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.


'''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.


==  Initialization ==
==  Initialisation ==
 
=== Paths ===
=== Paths ===
Editor:
Editor:
  Modules (F7) > Ambient Civilian Vehicles
  Modules (F7) > Ambient Civilian Vehicles
Data:
Data:
  ca\modules\silvie
  ca\modules\silvie


=== Startup ===
=== Startup ===
Place SILVIE manager on map. No additional synchronizing needed.


=== Optional parameters ===
Place SILVIE manager on map. No additional synchronising needed.
Set variables to BIS_silvie_mainscope with desired values:
 
=== 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: <sqf inline>this setVariable ["townlist", [bis_loc_acityc_mogilevka, [position this, 3000], trigger1]];</sqf>
:: Default value: Whole island.


*'''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.
* '''blackList = <array>;''' - object classes which will be excluded from list of building around which cars are generated.
::Example: ''this setvariable ["townlist",[bis_loc_acityc_mogilevka,[position this,3000],trigger1]];''
:: Example: <sqf inline>BIS_silvie_mainScope setVariable ["blackList", ["house1", "house2"]];</sqf>
::Default value: Whole island.
:: Default value: not yet defined


*'''blackList = <array>;''' - object classes which will be excluded from list of building around which cars are generated.
* '''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 ["blackList",["house1","house2"]];''
:: Example: <sqf inline>BIS_silvie_mainScope setVariable ["vehicleRarity", ["skodaRed", 10, "skodaBlue", 0.8]];</sqf>
::Default value:  not yet defined
:: Default value:  empty array


*'''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)
* '''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 ["vehicleRarity",["skodaRed",10,"skodaBlue",0.8]];''
:: Example: <sqf inline>BIS_silvie_mainScope setVariable ["vehicleCount", "round (%1 / 10)"];</sqf>
::Default value:  empty array
:: Default value (and recommended)"round ((sqrt %1) * 1.5)"


*'''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.
* '''vehicleInit = <nowiki><code style="display: block"></nowiki>;''' - 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 ["vehicleCount","round (%1 / 10)"];''
:: Example: <sqf inline>BIS_silvie_mainScope setVariable ["vehicleInit", { _this lock true }];</sqf>
::Default value (and recommended): "round ((sqrt %1) * 1.5)"
:: Default value: {}


*'''vehicleInit = <nowiki><code></nowiki>;''' - 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.
* '''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 ["vehicleInit",{_this lock true}];''
:: Example: <sqf inline>BIS_silvie_mainScope setVariable ["roadDistance", 30];</sqf>
::Default value: {}
:: Default value: 25


*'''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.
* '''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 ["roadDistance",30];''
:: Example: <sqf inline>BIS_silvie_mainScope setVariable ["attempts", 20];</sqf>
::Default value: 25
:: Default value: 10


*'''attempts = <number>;''' - number of attempts to create vehicle (failed attempt is for instance when some road is detected near building, but it is crossroad).
=== Stored Variables ===
::Example: ''BIS_silvie_mainscope setvariable ["attempts",20];''
::Default value: 10


=== Stored variables ===
{{Feature|important|These variables are only to be read and must not be modified!}}
These variables are only for checking values. <span style="color:red;">Do not edit them!</span>


==== BIS_SILVIE_Mainscope ====
==== BIS_silvie_mainScope ====
*'''id''' = <number> - identification number of latest car.
* '''id''' = <number> - identification number of latest car.
*'''currentTown''' = <number> - town where last vehicle was created (or where is planned to, if player is nearby).
* '''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).
* '''carlist''' = <array> - list of all created cars (destroyed ones are removed).


==== Cars ====
==== Cars ====
*'''ALICE_id''' = <number> - identification number of vehicle.
* '''ALICE_id''' = <number> - identification number of vehicle.
*'''ALICE_obj''' = <object> - object on which vehicle was created (can be object or road).
* '''ALICE_obj''' = <object> - object on which vehicle was created (can be object or road).
*'''ALICE_twn''' = <location> - town where vehicle was created.
* '''ALICE_twn''' = <location> - town where vehicle was created.
 
 
{{GameCategory|arma2|Editor Modules}}

Latest revision as of 23:35, 28 August 2023

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.