BIS Ambient Civilians, Custom CityCenters and HouseEffects hack

Some other work I've recently done is trying to get custom CityCenters to work. These are useful if you're trying to populate "empty" towns when using ALICE2.


To use these, first you need to patches, found in the CA folder in the demo missions. Just copy the CA folder to your mission directory.


To place a custom CityCenter, use the GameLogic/Location objects in the editor, name the object (eg loc_1) and place the following in the INIT:
this setVariable ["name", "Lighthouse"];
this setVariable ["demography", ["CIV",0,"CIV_RU",1]];


You only need the Demography setting, if its anything other than Takistan Civilians.


Then in your ALICE2 and Ambient Civilian Vehicles modules inthe Editor, place the following in their INIT:
this setVariable ["townlist",[[],loc_1,loc_2,loc_3]];
this setvariable ["debug",true];


Use the Debug flag if you want to see markers of all the civilians and vehicles.


Lastly, you will need to override the BIS_fnc_locations function with my patched version. In the Functions module, add the following to the INIT:
BIS_fnc_locations = compile preprocessFileLineNumbers "CA\modules\functions\systems\fn_locations.sqf";


 The HouseEffects hack basically lights up windows in houses at night and chimney smoke, when playing on Utes or Chernarus.


Changes made:



  • Fixed a number of syntax bugs in ALICE2 and SYLVIE

  • Added ability for ALICE2 to spawn units in ALICE1 buildings (AIDoors on Utes/Chernarus)

  • Added debug on ALICE2 Traffic

  • Fixed ALICE2 Traffic despawn only when players are not around

  • Fixed debug markers of custom locations in BIS_fnc_locations

Posted:


AttachmentSize
Ambient_Civilians_Test.zip54.04 KB

Whether they hide in their

Whether they hide in their houses or run around is dependent on the town's respect for your faction. If someone died, you'll notice everyone will hide in their houses. Enable the debug markers and you'll see what I mean.

All those settings can be found here:
http://community.bistudio.com/wiki/Ambient_Civilians
http://community.bistudio.com/wiki/A...ilian_Vehicles

Here are my personal preferences:

Code:// See http://community.bistudio.com/wiki/Ambient_Civilians

// Enables debug markers
BIS_alice_mainscope setvariable ["debug",true, true];

// Increase spawn distance for ALICE2 traffic
BIS_alice_mainscope setvariable ["trafficDistance",1000, true];

// Reduce unit count formula to try to reduce number of civilian units
BIS_alice_mainscope setvariable ["civilianCount","round (3 * (sqrt %1))", true];

// Dumb down civilian units to use less CPU (see http://creobellum.org/node/175)
[BIS_alice_mainscope,"ALICE_civilianinit",[{_this setSkill 0},{{_this disableAI _x} count ["AUTOTARGET","TARGET"]},{_this allowFleeing 1;},{removeAllWeapons _this;},{removeAllItems _this;}]] call BIS_fnc_variableSpaceAdd;

// Add some rare english speaking civilians to the mix for intelligence gathering
BIS_alice_mainscope setVariable ["townsFaction",["BIS_TK_CIV","BIS_CIV_special"], true];
[BIS_alice_mainscope, "civilianRarity",["CIV_EuroWoman01_EP1", 0.05, "CIV_EuroWoman02_EP1", 0.05, "Dr_Annie_Baker_EP1", 0, "Rita_Ensler_EP1", 0, "CIV_EuroMan01_EP1", 0.05, "CIV_EuroMan02_EP1", 0.05, "Haris_Press_EP1", 0, "Dr_Hladik_EP1", 0, "Citizen2_EP1", 0.05, "Citizen3_EP1", 0.05, "Profiteer2_EP1", 0.05, "Functionary1_EP1", 0.05, "Functionary2_EP1", 0.05]] call BIS_fnc_variableSpaceAdd;

// These last two change the behaviour of the civvies. If you kill one, you'll notice they'll all go hide in their houses.
// Artificial coeficient to set how much will be town's respect decreased once some civilian is hit or killed.
// The higher the number is, the more is respect towards killer's faction decreased.
BIS_alice_mainscope setvariable ["respectModifyCoef", 0.7, true];

// Value which is removed from town threat every 5 seconds (until threat reaches 0)
BIS_alice_mainscope setvariable ["threatDecay", 0.000005, true];

Code:// http://community.bistudio.com/wiki/Ambient_Civilian_Vehicles

// Enables debug markers
BIS_silvie_mainscope setvariable ["debug",true, true];

// Reduce vehicle count formula to try to reduce number of civilian vehicles
BIS_silvie_mainscope setvariable ["vehicleCount","round ((sqrt %1) * 0.5)", true];

// adds OA motorbikes and bicycles to Ambient Vehicles
BIS_silvie_mainscope setvariable ["vehicleRarity",["TT650_TK_CIV_EP1",0,"Old_bike_TK_CIV_EP1",0,"Old_moto_TK_Civ_EP1",0], true];

// randomly lock and vary fuel
BIS_silvie_mainscope setvariable ["vehicleInit",{if (random 1>0.2) then {_this lock true} else {_this setfuel (random 1)}}, true];

 
Original Design by Gary Storey