Ambient Combat Manager Module – Arma 2

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{Feature|Informative|" to "{{Feature|informative|")
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:ArmA_2:_Editor_Modules]]
{{TOC|side}}
'''See also:''' [[Ambient Combat Manager - Functions]] and [[Ambient Combat Manager - Group types]]
The '''Ambient Combat Manager''' (ACM) is a scripted module for Arma 2 which can dynamically generate a war around a unit.
== Introduction ==
It is meant to fill the gameworld with actual combat while moving through it and without having to place units manually.
The '''Ambient Combat Manager''' (ACM) is a scripted module for ArmA 2 which can dynamically generate a war around a unit. It is meant to fill the gameworld with actual combat while moving through it and without having to place units manually. The generated patrols are not faked: they will fight with and / or against you.
The generated patrols are not faked: they will fight with and / or against you.


Since no current computer would be able to handle an entire ArmA 2 gameworld full of AI units, the ACM cleans up after itself. It will remove dynamic content as the player moves away from it. After starting a mission with an ACM it may take some time for the patrols to appear, depending mostly on the ACM's intensity setting.
Since no current computer would be able to handle an entire Arma 2 gameworld full of AI units, the ACM cleans up after itself.
It will remove dynamic content as the player moves away from it.
After starting a mission with an ACM it may take some time for the patrols to appear, depending mostly on the ACM's intensity setting.




== Quickstart ==
== Quickstart ==
[[Image:ACM_Quickstart1.jpg|center]]
[[File:ACM_Quickstart1.jpg|center]]


# Place at least one unit in your mission.
# Place at least one unit in your mission.
Line 15: Line 17:
# Preview the mission and enjoy!
# Preview the mission and enjoy!


Notes:
{{Feature|informative|
* Only one ACM may be synchronized with a group (additional ACM's will be ignored). However, other ACM's may be synchronized to other groups.
* Only one ACM may be synchronized with a group (additional ACM's will be ignored). However, other ACM's may be synchronized to other groups.
* When synchronizing to a group with multiple units it does not matter which unit you synchronize to. Aesthetically it is recommend to sychronize to the group's leader.
* When synchronizing to a group with multiple units it does not matter which unit you synchronize to. Aesthetically it is recommend to sychronize to the group's leader.
* Do '''not''' join the unit and the ACM in a group (''F2'')!
* Do '''not''' join the unit and the ACM in a group (''F2'')!
* When all units in the group die, the ACM will clean up and terminate.
* When all units in the group die, the ACM will clean up and terminate.
* Ambient combat will not appear immediately. It may be around 15 minutes before you first encounter ambient combat. You can increase the chances and intensity by adding extra ACMs to other nearby groups.
* Ambient combat will not appear immediately. It may be around 15 minutes before you first encounter ambient combat. You can increase the chances and intensity by adding extra ACMs to other nearby groups.}}
 


== Configuration ==
== Configuration ==
You can manipulate several ACM settings by calling [[Ambient_Combat_Manager_-_Functions|pre-defined functions]]. The ACM needs a little time to initialize, so before calling these functions, please wait for initialization to complete. This can be achieved by looking at a variable stored inside the ACM itself: ''initDone''. Assuming you named your ACM ''myFirstACM'':


  {{codecomment|//Make a script wait for the ACM to initialize.}}
You can manipulate several ACM settings by calling [[Ambient Combat Manager - Functions|pre-defined functions]].
  waitUntil {!isNil {myFirstACM getVariable "initDone"}};
The ACM needs a little time to initialize, so before calling these functions, please wait for initialization to complete.
  waitUntil {myFirstACM getVariable "initDone"};
This can be achieved by looking at a variable stored inside the ACM itself: ''initDone''. Assuming you named your ACM ''myFirstACM'':
<sqf>
// Make a script wait for the ACM to initialize.
waitUntil {!isNil {myFirstACM getVariable "initDone"}};
waitUntil {myFirstACM getVariable "initDone"};
</sqf>
 


== Example ==
== Example ==
Here is a basic example of what you would put into your init file for your mission if you were to want specific units to spawn from your ACM. Assuming you named your ACM "BIS_ACM1", if you wanted a second ACM, copy and paste the below code beneath it renaming all the "1"s to 2s, with your second ACM named BIS_ACM2.


  {{codecomment|Put this near the bottom of your init, have a sleep command before this.}}
Here is a basic example of what you would put into your init file for your mission if you were to want specific units to spawn from your ACM.
Assuming you named your ACM "BIS_ACM1", if you wanted a second ACM, copy and paste the below code beneath it renaming all the "1"s to 2s, with your second ACM named BIS_ACM2.
<sqf>
// Put this near the bottom of your init, have a sleep command before this.
// ACM settings
waitUntil { !isNil {BIS_ACM1 getVariable "initDone"} };
waitUntil { BIS_ACM1 getVariable "initDone" };
[] spawn {
waitUntil { !isnil "BIS_fnc_init" };
[1, BIS_ACM1] call BIS_ACM_setIntensityFunc; // Sets the intensity of the ACM, in other words, determines how active it will be. Starts at 0 ends at 1.0, its been known to fail using 0.7 and 0.8
[BIS_ACM1, 400, 700] call BIS_ACM_setSpawnDistanceFunc; // This is the radius on where the units will spawn around the unit the module is sync'd to, 400m being the minimal distance and 700m being the maximum. Minimum is believed to be 1
[["BIS_TK_INS"], BIS_ACM1] call BIS_ACM_setFactionsFunc; // This tells the ACM which faction of units it will spawn. In this case it will spawn Takistani Insurgents
[0, 0.7, BIS_ACM1] call BIS_ACM_setSkillFunc; // This determines what the skill rating for the spawned units will be
[0.2, 0.5, BIS_ACM1] call BIS_ACM_setAmmoFunc; // This sets their amount of ammo they spawn with
["ground_patrol", 1, BIS_ACM1] call BIS_ACM_setTypeChanceFunc; // If you want ground patrols then leave it as a 1, if you don't put a 0. They will use random paths
["air_patrol", 0, BIS_ACM1] call BIS_ACM_setTypeChanceFunc; // Same thing for air patrols


//ACM settings   
// This should determine which exact units will spawn from the group **Citation needed**
        waitUntil {!isNil {BIS_ACM getVariable "initDone"}};
[BIS_ACM1, ["TK_INS_Group", "TK_INS_Patrol", "TK_INS_AATeam", "TK_INS_ATTeam", "TK_INS_Technicals", "TK_INS_MotorizedGroup"]] call BIS_ACM_addGroupClassesFunc;
        waitUntil {BIS_ACM getVariable "initDone"};
};
    [] spawn {
</sqf>
        waitUntil {!(isnil "BIS_fnc_init")};
        [1, BIS_ACM1] call BIS_ACM_setIntensityFunc;                //Sets the intensity of the ACM, in other words, determines how active it will be. Starts at 0 ends at 1.0, its been known to fail using 0.7 and 0.8
        [BIS_ACM1, 400, 700] call BIS_ACM_setSpawnDistanceFunc;      // This is the radius on where the units will spawn around the unit the module is sync'd to, 400m being the minimal distance and 700m being the maximum. Minimum is 1 I believe.
        [["BIS_TK_INS"], BIS_ACM1] call BIS_ACM_setFactionsFunc;    // This tells the ACM which faction of units it will spawn. In this case it will spawn Takistani Insurgents
        [0, 0.7, BIS_ACM1] call BIS_ACM_setSkillFunc;                // This determines what the skill rating for the spawned units will be
        [0.2, 0.5, BIS_ACM1] call BIS_ACM_setAmmoFunc;              // This sets their amount of ammo they spawn with
        ["ground_patrol", 1, BIS_ACM1] call BIS_ACM_setTypeChanceFunc; //If you want ground patrols then leave it as a 1, if you don't put a 0. They will use random paths
        ["air_patrol", 0, BIS_ACM1] call BIS_ACM_setTypeChanceFunc;    // Same thing for air patrols
        [BIS_ACM1, ["TK_INS_Group", "TK_INS_Patrol", "TK_INS_AATeam", "TK_INS_ATTeam", "TK_INS_Technicals", "TK_INS_MotorizedGroup"]] call BIS_ACM_addGroupClassesFunc;   // This determines which exact units will spawn from the group **Citation needed**
    };


You can get Factions and Units for Operation Arrowhead at this link [http://forums.bistudio.com/showpost.php?p=1667629&postcount=324 Operation Arrowhead Factions and Units]
You can get Factions and Units for Operation Arrowhead at this link {{Link|link= http://forums.bistudio.com/showpost.php?p=1667629&postcount=324|text= Operation Arrowhead Factions and Units (Forums)}}.


I hope this helps some of you guys.


== Advanced topics ==
== Advanced topics ==
=== Scripted ACM ===
=== Scripted ACM ===
You can also spawn an ACM by script via [[createUnit]]. You will then have to also script its synchronization to a unit via [[synchronizeObjectsAdd]]. This needs to be done within '''0.5''' seconds from the start of the mission, because after that synchronizations are processed and set in stone.
You can also spawn an ACM by script via [[createUnit]]. You will then have to also script its synchronization to a unit via [[synchronizeObjectsAdd]]. This needs to be done within '''0.5''' seconds from the start of the mission, because after that synchronizations are processed and set in stone.


=== Group types ===
=== Group types ===
By default the ACM spawns groups from the ''CfgGroups'' config. This means that when add-ons add new groups here, these will be automatically used. The groups also define a ''rarity'' value which determines how frequently a certain type of group should be used. Regular infantry is spawned more often than a sniper team for example.
 
By default the ACM spawns groups from the ''CfgGroups'' config. This means that when add-ons add new groups here, these will be automatically used.
The groups also define a ''rarity'' value which determines how frequently a certain type of group should be used. Regular infantry is spawned more often than a sniper team for example.
You can override the default group types with [[Ambient_Combat_Manager_-_Group_types|specific group types]].
You can override the default group types with [[Ambient_Combat_Manager_-_Group_types|specific group types]].


=== Patrol types ===
=== Patrol types ===
The ACM uses two types of patrols: air and ground. The differences are small and both will spawn units which patrol the area. The air patrol is designed to fly over or near the synchronized group specifically, while ground patrols are using truly random routes.
 
The ACM uses two types of patrols: air and ground. The differences are small and both will spawn units which patrol the area.
The air patrol is designed to fly over or near the synchronized group specifically, while ground patrols are using truly random routes.
 
 
== See Also ==
 
* [[Ambient Combat Manager - Functions]]
* [[Ambient Combat Manager - Group types]]
 
 
{{GameCategory|arma2|Editor Modules}}

Latest revision as of 00:24, 2 February 2024

The Ambient Combat Manager (ACM) is a scripted module for Arma 2 which can dynamically generate a war around a unit. It is meant to fill the gameworld with actual combat while moving through it and without having to place units manually. The generated patrols are not faked: they will fight with and / or against you.

Since no current computer would be able to handle an entire Arma 2 gameworld full of AI units, the ACM cleans up after itself. It will remove dynamic content as the player moves away from it. After starting a mission with an ACM it may take some time for the patrols to appear, depending mostly on the ACM's intensity setting.


Quickstart

ACM Quickstart1.jpg
  1. Place at least one unit in your mission.
  2. Place an ACM near this unit (Modules (F7) > Ambient Combat).
  3. Synchronize the unit with the ACM (F5 > drag a line between the two objects).
  4. Preview the mission and enjoy!
  • Only one ACM may be synchronized with a group (additional ACM's will be ignored). However, other ACM's may be synchronized to other groups.
  • When synchronizing to a group with multiple units it does not matter which unit you synchronize to. Aesthetically it is recommend to sychronize to the group's leader.
  • Do not join the unit and the ACM in a group (F2)!
  • When all units in the group die, the ACM will clean up and terminate.
  • Ambient combat will not appear immediately. It may be around 15 minutes before you first encounter ambient combat. You can increase the chances and intensity by adding extra ACMs to other nearby groups.


Configuration

You can manipulate several ACM settings by calling pre-defined functions. The ACM needs a little time to initialize, so before calling these functions, please wait for initialization to complete. This can be achieved by looking at a variable stored inside the ACM itself: initDone. Assuming you named your ACM myFirstACM:

// Make a script wait for the ACM to initialize. waitUntil {!isNil {myFirstACM getVariable "initDone"}}; waitUntil {myFirstACM getVariable "initDone"};


Example

Here is a basic example of what you would put into your init file for your mission if you were to want specific units to spawn from your ACM. Assuming you named your ACM "BIS_ACM1", if you wanted a second ACM, copy and paste the below code beneath it renaming all the "1"s to 2s, with your second ACM named BIS_ACM2.

// Put this near the bottom of your init, have a sleep command before this. // ACM settings waitUntil { !isNil {BIS_ACM1 getVariable "initDone"} }; waitUntil { BIS_ACM1 getVariable "initDone" }; [] spawn { waitUntil { !isnil "BIS_fnc_init" }; [1, BIS_ACM1] call BIS_ACM_setIntensityFunc; // Sets the intensity of the ACM, in other words, determines how active it will be. Starts at 0 ends at 1.0, its been known to fail using 0.7 and 0.8 [BIS_ACM1, 400, 700] call BIS_ACM_setSpawnDistanceFunc; // This is the radius on where the units will spawn around the unit the module is sync'd to, 400m being the minimal distance and 700m being the maximum. Minimum is believed to be 1 [["BIS_TK_INS"], BIS_ACM1] call BIS_ACM_setFactionsFunc; // This tells the ACM which faction of units it will spawn. In this case it will spawn Takistani Insurgents [0, 0.7, BIS_ACM1] call BIS_ACM_setSkillFunc; // This determines what the skill rating for the spawned units will be [0.2, 0.5, BIS_ACM1] call BIS_ACM_setAmmoFunc; // This sets their amount of ammo they spawn with ["ground_patrol", 1, BIS_ACM1] call BIS_ACM_setTypeChanceFunc; // If you want ground patrols then leave it as a 1, if you don't put a 0. They will use random paths ["air_patrol", 0, BIS_ACM1] call BIS_ACM_setTypeChanceFunc; // Same thing for air patrols // This should determine which exact units will spawn from the group **Citation needed** [BIS_ACM1, ["TK_INS_Group", "TK_INS_Patrol", "TK_INS_AATeam", "TK_INS_ATTeam", "TK_INS_Technicals", "TK_INS_MotorizedGroup"]] call BIS_ACM_addGroupClassesFunc; };

You can get Factions and Units for Operation Arrowhead at this link Operation Arrowhead Factions and Units (Forums).


Advanced topics

Scripted ACM

You can also spawn an ACM by script via createUnit. You will then have to also script its synchronization to a unit via synchronizeObjectsAdd. This needs to be done within 0.5 seconds from the start of the mission, because after that synchronizations are processed and set in stone.

Group types

By default the ACM spawns groups from the CfgGroups config. This means that when add-ons add new groups here, these will be automatically used. The groups also define a rarity value which determines how frequently a certain type of group should be used. Regular infantry is spawned more often than a sniper team for example. You can override the default group types with specific group types.

Patrol types

The ACM uses two types of patrols: air and ground. The differences are small and both will spawn units which patrol the area. The air patrol is designed to fly over or near the synchronized group specifically, while ground patrols are using truly random routes.


See Also