Changing The Settings For The Arma2 ACM Module.

arma2OA ACM Editor Module

ACM Editor Module

Changing The Settings For The Ambient Combat Manager Module.

The Arma 2 Ambient Combat Manager (ACM) editor module spawns random patrols in the area around the player to simulate a larger conflict. The ACM module handles the random generation, waypoints and cleanup of the AI squads without having to insert the units manually into the mission editor.

While the default values of the ACM are well suited for infantry missions, I wanted to change them for the A-10 mission I’ve been working on. Like the SOM module, I wanted to increase the default settings for spawn distance and increase the combat intensity generated by the ACM.  To do this required a bit of scripting in addition to placing the ACM module in the editor.

arma2OA inserting ACM module

Inserting ACM module

Inserting the ACM Module Into The Editor

In opened up my existing A-10 mission in the mission editor and pressed on Modules (F7) . I then clicked on the map to insert a module and chose Unit: Ambiant Combat from the drop down list of available editor modules. I named the module myACM so I could refference the module in my scripts later. See Figure to the right.

Once the ACM is inserted into the mission you have to synchronize the module to the Player so the ACM knows where to generate the random AI. To do this I selected Synchronize (F5) then clicked on the ACM module, and dragged the synchronize line to the Player (A-10 in my example).

Changing The ACM Settings

Now that the ACM module is inserted into the mission and synchronized to the Player, scripts are needed to change the ACM‘s default settings. I could insert the code into the ACM‘s Initialization field, but the number of lines of code would make that cumbersome. A better way is to insert the required code into the mission’s Init.sqf file.

Creating An Init.sqf

Whenever a mission is started Arma will check to see if init.sqf exists in your mission folder and run this script file first.  Now the mission editor doesn’t automatically create an init.sqf, so you have to fire up Notepad and create one yourself. To do this open up Notepad and copy paste the following script into the blank document:

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

[1, myACM] call BIS_ACM_setIntensityFunc;
[myACM, 1500, 3000] call BIS_ACM_setSpawnDistanceFunc;
[["USMC","RU","INS"], myACM] call BIS_ACM_setFactionsFunc;
["ground_patrol", 1, myACM] call BIS_ACM_setTypeChanceFunc;
["air_patrol", 1, myACM] call BIS_ACM_setTypeChanceFunc;

Then save the file in your mission folder (Documents\ Arma2\ Missions\ Your Mission name) with the File Name: Init.sqf and Save As Type: All Files (*.*)

What The Script Does

The first two lines of my sample script

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

cause Arma to pause executing the Init.sqf script until the ACM module I inserted in the editor (called myACM) is done initializing.

The next line:

[1, myACM] call BIS_ACM_setIntensityFunc;

sets the intensity of the ambient combat to 1. Valid values for intensity are from 0 (no ambiant combat) to 1 (max).

The Next line:

[myACM, 1500, 3000] call BIS_ACM_setSpawnDistanceFunc;

sets the distance that the ACM module spawns AI from the synchronized unit. myACM will now spawn AI 1500m to 3000m away from my A-10.

The line:

[["USMC","RU","INS"], myACM] call BIS_ACM_setFactionsFunc;

sets which factions myACM module will spawn. My mission didn’t really require this as the defaults would have been fine, but I wanted to try it anyway.

The Next lines:

["ground_patrol", 1, myACM] call BIS_ACM_setTypeChanceFunc;
["air_patrol", 1, myACM] call BIS_ACM_setTypeChanceFunc;

set the percentage chance of generating ground patrols or air patrols. Values range from 0 (no chance) to 1 (100 percent)

Once I had saved my Init.sqf I went back into Arma2 and previewed my mission in the mission editor. The first time I played the mission two random Hinds generated by the ACM nailed me before I got my A-10 off the runway. More tweaking required next week.

Reference

Biki Ambiant Combat Reference

Biki Ambiant Combat Function Reference

Operation Arrowhead Factions and Units

My Sample A-10 Mission a10Practice.Chernarus