ArmA 2 ACM

ArmA 2 Forum, ArmA 2 Home, ArmA 2 Config, ArmA 2 File Formats, ArmA 2 Missions, ArmA 2 3D Modeling, ArmA 2 Scripting, ArmA 2 Terrain, ArmA 2 Texturing, ArmA 2 Tools

ACM - Ambient Combat Module

It randomly spawns AI units, of all sides of the player, which then fight each other.

It can create a war of any size around you as you travel in the world. You can control whether it spawns enemies and friendlies, or just one or the other. You can set which types of units are spawned, so imagine only allowing small infantry groups to spawn in a smaller scenario. It's also important to mention that the ACM cleans up after itself. When you move too far away from dynamically created patrols, they are eventually removed (to prevent the world from being populated with millions of units).

You simply synchronize (F5) the ACM gamelogic with a unit and it will kick in. Do not group (F2) it, for that will not do anything.

ACM reference means either the module itself or one of the units in the group it's synchronized to:

//The intensity value should be a Number between 0.0 and 1.0.
[<intensity | Number>, <ACM reference | Object>] call BIS_ACM_setIntensityFunc;
 
//Distances with the value -1 will leave the distance as it was.
//Distances with a value below -1 will reset to their defaults.
[<ACM reference | Object>, <minimum | Number>, <maximum | Number>] call BIS_ACM_setSpawnDistanceFunc;
 
//The skill values should be Numbers between 0.0 and 1.0.
[<minimum | Number>, <maximum | Number>, <ACM reference | Object>] call BIS_ACM_setSkillFunc;
 
//The ammo values should be Numbers between 0.0 and 1.0.
[<minimum | Number>, <maximum | Number>, <ACM reference | Object>] call BIS_ACM_setAmmoFunc;
 
//You can pass both actual CfgGroups Config entries or class name Strings.
[<ACM reference | Object>, <types | Array of Configs and / or Strings>] call BIS_ACM_addGroupClassesFunc;
 
//Passing an empty types Array will completely disable the custom database and switch back to the default.
[<ACM reference | Object>, <types | Array of Configs and / or Strings>] call BIS_ACM_removeGroupClassesFunc;
 
//Pick from: USMC, CDF, RU, INS, GUE.
[<factions | Array of Strings>, <ACM reference | Object>] call BIS_ACM_setFactionsFunc;
 
//When passing Arrays, these should contain the top-left and bottom-right coordinates.
[<ACM reference | Object>, <types | Array of Arrays and / or Markers and / or triggers>] call BIS_ACM_blacklistAreaFunc;
 
/*type must be one of "", "ground_patrol", "air_patrol".
Passing an empty type will reset back to the default pool.
Weights should normally be between 0 and 1.
A weight of -1 will remove that patrol type from the pool.*/
[<type | String>, <weight / chance | Number>, <ACM reference | Object>] call BIS_ACM_setTypeChanceFunc;

Is it possible to activate the ACM at a certain point of time during a mission and not from the beginning?

Yes: either do not place the ACM in the mission and spawn it (createUnit) at some point. Or you can set the intensity to 0 at the beginning and raise to some value between 0 and 1 when you want to activate it.

Tips

Another hint for experienced scripters: modules need a little time to initialize (this can be super fast, but it's still several milliseconds after the mission starts). It is therefore wise to query whether the module is done initializing and then start changing settings in a script. You may check Boolean variable initDone in the ACM to do that.

waitUntil {!isNil {myFirstACM getVariable "initDone"}};
waitUntil {myFirstACM getVariable "initDone"};

Example

Use this example, put it on the mission's init.sqf file:

waitUntil {!isNil {BIS_ACM getVariable "initDone"}};
waitUntil {BIS_ACM getVariable "initDone"};
 
//Sets frequency and number of patrols (0-1). BIS_ACM is module name
[1, BIS_ACM] call BIS_ACM_setIntensityFunc;  
 
//min max spawn distance
[BIS_ACM, 300, 600] call BIS_ACM_setSpawnDistanceFunc;
 
//factions to be spawned
[["USMC", "RU"], BIS_ACM] call BIS_ACM_setFactionsFunc;
 
//Skill range for spawned units
[0, 0.6, BIS_ACM] call BIS_ACM_setSkillFunc;
 
//Amount of ammo spawned units possess
[0.2, 0.5, BIS_ACM] call BIS_ACM_setAmmoFunc;
 
//Type of patrol. 1- present, 0- absent
["ground_patrol", 1, BIS_ACM] call BIS_ACM_setTypeChanceFunc;
 
["air_patrol", 0, BIS_ACM] call BIS_ACM_setTypeChanceFunc;