Jump to content

Recommended Posts

From the wiki:

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.

Anyone know?

1) If I have two players and they each have their own ACM can one ACM's units be deleted when they are visible to the other player, or does the routine only cleanup units if they not with range of any player?

2) Can the range of units being cleaned up be changed, I'd like to make it quite large.

Edited by FifthColumnist

Share this post


Link to post
Share on other sites

Hey everyone I am looking for some help here:

I was looking for a way to allow this module to work with respawning. I've got a trigger that runs this whenever the player I want this to work with respawns:

sleep 5;
BIS_ACM synchronizeObjectsAdd [P2];
[1, P2] call BIS_ACM_setIntensityFunc;  
[P2, 100, 1000] call BIS_ACM_setSpawnDistanceFunc;
[["USMC", "INS", "CDF", "RU", "GUE"], BIS_ACM] call BIS_ACM_setFactionsFunc;
[0, 1, BIS_ACM] call BIS_ACM_setSkillFunc;
[0.2, 0.5, BIS_ACM] call BIS_ACM_setAmmoFunc;
["ground_patrol", 1, BIS_ACM] call BIS_ACM_setTypeChanceFunc;
["air_patrol", 1, BIS_ACM] call BIS_ACM_setTypeChanceFunc;

It doesn't work though. After the player respawns the script runs but stuff doesn't spawn anymore.

Help :(

Share this post


Link to post
Share on other sites

Just to add some more info to this thread, I've been tinkering with this ACM for a few day now trying every method listed and some new ones I've thought of to try to limit factions and/or units and I am pretty sure that it just isn't reliably getting initialization parameters passed on to it or it doesn't process them correctly. Sometimes it does, sometimes not. I can waitUntil dozens of different things and sleep for 10 minutes but it doesn't change a thing.

Also, someone asked earlier about multiple ACMs and getting more spawns. Ya - pretty much that seems to be the case, but again it's not as should be expected. I can sync 20 ACMS to different squads and I don't get a massive system crashing battle. Maybe the 2-3 times more units.

I have two things I've learned. If you don't want the ACM to die with the player try syncing the high command module to the squad with the ACM. That seems to keep it going past deaths. Seems to be is all I can say because the ACM is so unpredictable.

I also have an idea I thought of earlier if the ACM can be made to to work right. Use it as an efficient spawn multiplier for enemy units. Say for example you have an enemy officer running an ACM that only spawns units of his own side around him. Kill the officer and the resistance starts dying out.

Share this post


Link to post
Share on other sites
Just to add some more info to this thread, I've been tinkering with this ACM for a few day now trying every method listed and some new ones I've thought of to try to limit factions and/or units and I am pretty sure that it just isn't reliably getting initialization parameters passed on to it or it doesn't process them correctly. Sometimes it does, sometimes not. I can waitUntil dozens of different things and sleep for 10 minutes but it doesn't change a thing.

Also, someone asked earlier about multiple ACMs and getting more spawns. Ya - pretty much that seems to be the case, but again it's not as should be expected. I can sync 20 ACMS to different squads and I don't get a massive system crashing battle. Maybe the 2-3 times more units.

I have two things I've learned. If you don't want the ACM to die with the player try syncing the high command module to the squad with the ACM. That seems to keep it going past deaths. Seems to be is all I can say because the ACM is so unpredictable.

I also have an idea I thought of earlier if the ACM can be made to to work right. Use it as an efficient spawn multiplier for enemy units. Say for example you have an enemy officer running an ACM that only spawns units of his own side around him. Kill the officer and the resistance starts dying out.

Hmm, that seems to work for me, bear in mind that you cannot do wait or sleep or anything directly in an init block, I use this peice of code in an sqf that I call with execVM from init block on the ACM and as various groups enter triggers (each group has their own personal ACM):

if (!isServer) exitWith {};

_acm = _this select 0;
_factions = _this select 1;
_intensity = if (count _this > 2) then {_this select 2} else { 1 };

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


[_factions, _acm] call BIS_ACM_setFactionsFunc;
[_intensity, _acm] call BIS_ACM_setIntensityFunc;

Share this post


Link to post
Share on other sites

Ok, I started working with the ACM again. The suggestion to use an execVM in the init works, and so does the below code to make it purely scripted.

if (!isServer) exitWith {};

private ["_grpLogic"];
createCenter sideLogic;
_grpLogic = createGroup sideLogic;

private ["_array"];
_array = [RU_COMMANDER, RU_SF]; // Group leaders assigned an ACM

private ["_acm"];
while {true} do {
for [{_i=0}, {_i < count _array}, {_i=_i+1}] do {
	if (!(isNull (_array select _i))) then {
		_cnt = {!isNil {_x getVariable "acm"}} count (units group (_array select _i));
		if (_cnt == 0) then {
			_acm = _grpLogic createUnit ["AmbientCombatManager", [0, 0, 0], [], 0, "NONE"];
			_acm synchronizeObjectsAdd [(_array select _i)];
			waitUntil {!isNil {_acm getVariable "initDone"}};
			waitUntil {_acm getVariable "initDone"};
			[1, _acm] call BIS_ACM_setIntensityFunc;
			[["USMC"], _acm] call BIS_ACM_setFactionsFunc;
			[1, _acm] call BIS_ACM_setIntensityFunc;
			["ground_patrol", -1, _acm] call BIS_ACM_setTypeChanceFunc;
			["air_patrol", 1, _acm] call BIS_ACM_setTypeChanceFunc;
		};
	};
};
sleep 10;
};

This code will proceed to rain a parade of USMC air patrols on my two unfortunate Russian group leaders. So that part is working - up until when they die (I used air patrols as they are easy to spot). For some reason the above code is not restarting the ACM though. Any ideas?

*UPDATE*

Actually, I think this code may be working fine as long as you don't kill the associated group leaders too fast. When I was testing I headshotted the both of them straight away and this breaks the script. If I wait a while for the ACM to start and then kill them it appears to be working and the ACM get synchronized again, so far that I have tested.

Edited by Binesi

Share this post


Link to post
Share on other sites
I've placed my ACM (nomin_acm1) on the map, synched it with a playable group and given it the following command in ininit.sqf:

[0, nomin_acm1] call BIS_ACM_setIntensityFunc;

Hence no unit will spawn around my group until I raise the value 0. I only want the action to start when the players group enters a certain trigger area. Thus I feed my ACM the following line of code when the player enter the trigger:

[1, nomin_acm1] call BIS_ACM_setIntensityFunc;

That should work, right? And now some questions.

1) Can I execute the code [1, nomin_acm1] call BIS_ACM_setIntensityFunc; directly from the triggers activation field? I cannot see any reason why not, so...

2) What happens if a player Joins in Progress after the change is made. Will this init-launch revert the ACM to it's zero setting again?

3) Is it possible to make all changes of the ACM values from a script that is only running on the server in a MP game? Or does the ACM values also need to be changed on all clients in a network game.

Did you have any luck with this working? trying to set something similar myself but reversed with the ACM only working in a certain area and then disabling when my team gets to a certain objective. This didnt seem to do the trick any other way around it?

Edited by MagicDerek

Share this post


Link to post
Share on other sites
Did you have any luck with this working? trying to set something similar myself but reversed with the ACM only working in a certain area and then disabling when my team gets to a certain objective. This didnt seem to do the trick any other way around it?

You could inhibit the ACM using the blacklisted areas perhaps

I had issues with triggers and the ACM functions, the problem seemed to be caused by the trigger activating before the ACM had initialised properly (the player started in one of my trigger areas).

Share this post


Link to post
Share on other sites

Can de ACM parameters be updated during mission. As i have created a mission generator instead of a static one i need to wait for the ingame mission maker to decide on what enemy faction and side are being used as enemy.

As i also only ingame know the total player pool (coop missions only)(going from 1 to 132) i also need to ingame adjust the sort of stuff that is spawned.

My main interest is random patrol's and not huge firefights all over.

Is that in anyway possible to achieve in MP ?

Share this post


Link to post
Share on other sites
Did you have any luck with this working? trying to set something similar myself but reversed with the ACM only working in a certain area and then disabling when my team gets to a certain objective. This didnt seem to do the trick any other way around it?

Same experience here, unfortunately. Intensity doesn't work for reasons beyond my comprehension. I just posted this at Ofpec to get some expert answers. Can't hurt to ask for the same advice in here I suppose...

[0.0, BIS_ACM] call BIS_ACM_setIntensityFunc;

According to the Biki the quoted code will: "in effect pause the ACM". This much I've figured out and to switch it back on again I must use

[1.0, BIS_ACM] call BIS_ACM_setIntensityFunc;

or any scalar number greater than 0. But my limited testing (three hours) implies that it doesn't work more than once. I wan't a mission that starts with no intensity and then gradually builds up towards heavy fighting around the player. No matter how high I raise the intensity value, no ambient units show up in game if the ACM has been paused once.

If I do it the other way around (start with a high intensity number) I can force it into hiatus by setting intensity to 0. At least I assume it works, since no units showed up for one hour. I was moving at slow pace across the map (walking with shift locked). Hence I assume the syntax is correct. But why can't I start with low intensity and gradually raise it during the mission?

Edited by nominesine

Share this post


Link to post
Share on other sites

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, 200, 600] call BIS_ACM_setSpawnDistanceFunc;

//factions to be spawned

[["USMC", "RU"], BIS_ACM] call BIS_ACM_setFactionsFunc;

//Skill range for spawned units

[0, 0.5, 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. With 0 meaning no chance of appearing, and 1 meaning 100% chance. -1 removes patrol type completely.

["ground_patrol", 1, BIS_ACM] call BIS_ACM_setTypeChanceFunc;

["air_patrol", 1, BIS_ACM] call BIS_ACM_setTypeChanceFunc;

I used this and after 2 minutes i was killed by T-90

Share this post


Link to post
Share on other sites

pssst.....how do u make an SQF file *looks around awkwardly*

Share this post


Link to post
Share on other sites

Finaly scripts that work...

:D

Was waiting for a long time for this...

And its very very intens battles...

Share this post


Link to post
Share on other sites
Finaly scripts that work...

:D

Was waiting for a long time for this...

And its very very intens battles...

Which script worked for you? I'm still haveing trouble getting the settings to change.

Share this post


Link to post
Share on other sites
I used this and after 2 minutes i was killed by T-90

Hardly suprising since you set the intensity to maximum and specifically instructed all ground troops to appear at extremely close range. But it seems to be a good example of a working code for anyone who's still struggling to get it right.

Share this post


Link to post
Share on other sites

OK 22 pages later and still confused: I discovered that sometimes ACM doesn't work and sometimes it does. I can not see the pattern.

It always works during those quick-made custom scenarios (war is all over the place) but when I create the mission in the editor it seems to have an intensity of 0.01 :S. But that's the thing, I created a mission with a civ once and ACM did work there.

Also, this comes with a very strange Secop fenomena - I called for a UAV and the UAV stayed a good 500 meters away from me and from the location I called it to. The same was the case with the airstrike - I thought I heard a jet but it never even approached the location I was at.

It's almost like there is an invisible trigger around me which tells all units from Secops and ACM to stay as far away from me as possible

I already tried creating the init.sqf with:

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

waitUntil {BIS_ACM getVariable "initDone"};

and all those other options

WTF is going on, guys? BIS?

Edited by Jedo

Share this post


Link to post
Share on other sites
It's almost like there is an invisible trigger around me which tells all units from Secops and ACM to stay as far away from me as possible

Perhaps they ran into something a bit stronger than they and got shot down. Or maybe they decided to chase after something else.

Share this post


Link to post
Share on other sites

Kartamm script in the end of page 21...

I tried it with different factions, intansety etc...

And it worked very well. Got some good firefights.

But for some reason its not workin if my unit is in a group. :(

Share this post


Link to post
Share on other sites

I would like to know if there's anyway to synchronize this module to a trigger instead of a player...? - it's kind of acward when your preparing an attack and the the enemy spawn behind you an take out your whole unit from behind before you got to react... :|

- any suggestions appreciated.. :)

Share this post


Link to post
Share on other sites

Arg, I feel stupid now.

Just in case anyone else makes the same mistake: where it says BIS_ACM in the code that people have been posting, you have to enter the name that you give to your ACM module. Thus, if you make an ACM module with the name BOB, the code would be:

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

waitUntil {BOB getVariable "initDone"};

[1, BOB] call BIS_ACM_setIntensityFunc;

[bOB, 200, 600] call BIS_ACM_setSpawnDistanceFunc;

[["USMC", "RU"], BOB] call BIS_ACM_setFactionsFunc;

[0, 0.5, BOB] call BIS_ACM_setSkillFunc;

[0.2, 0.5, BOB] call BIS_ACM_setAmmoFunc;

["ground_patrol", 1, BOB] call BIS_ACM_setTypeChanceFunc;

["air_patrol", 1, BOB] call BIS_ACM_setTypeChanceFunc;

Share this post


Link to post
Share on other sites

I didnt see anywhere on this thread how to blacklist areas. I pulled this out of the wiki but Im not sure how to utilize it.

  [<ACM reference | Object>, <types | Array of Arrays and / or Markers and / or triggers>] call BIS_ACM_blacklistAreaFunc;

You may place markers with a special naming pattern BIS_ACM_X (where X has to start at 1 and may not skip any numbers). The areas defined by these markers are automatically blacklisted and the markers deleted.
I have placed BIS_ACM_1 into a marker name, will that be enought to blacklist an area?

Share this post


Link to post
Share on other sites
Arg, I feel stupid now.

Just in case anyone else makes the same mistake: where it says BIS_ACM in the code that people have been posting, you have to enter the name that you give to your ACM module. Thus, if you make an ACM module with the name BOB, the code would be:

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

waitUntil {BOB getVariable "initDone"};

[1, BOB] call BIS_ACM_setIntensityFunc;

[bOB, 200, 600] call BIS_ACM_setSpawnDistanceFunc;

[["USMC", "RU"], BOB] call BIS_ACM_setFactionsFunc;

[0, 0.5, BOB] call BIS_ACM_setSkillFunc;

[0.2, 0.5, BOB] call BIS_ACM_setAmmoFunc;

["ground_patrol", 1, BOB] call BIS_ACM_setTypeChanceFunc;

["air_patrol", 1, BOB] call BIS_ACM_setTypeChanceFunc;

Wow, naming the module and using the above with a trigger actually seems to have fixed my troubles with acm, at least so it seems now.

Share this post


Link to post
Share on other sites

Got the module working fiine, but as soon as I try to define groups using BIS_ACM_addGroupClassesFunc, I get nothing!

The syntax is correct, but no units ever show up. However, as an experiment, I setup a radio trigger to display the names of all units on the map. When the mission starts, there's just me, the ACM and a Game Logic (which seems to get spawned as part of the ACM). After a few seconds of running around, more GLs start turning up. Still no sign of any actual units, just a map filled with invisible GLs. I assume the GLs are used as spawn locations for the soon to appear units? If I comment out BIS_ACM_addGroupClassesFunc, everything works fine, but every class turns up... not quite what I'm after.

Has anyone cracked this yet? The idea of only being able to use custom groups renders the module rather inflexible in my opinion.

Share this post


Link to post
Share on other sites

cobra4v320 you're mission actualy requires multiple addons , you should edit with vanila game.

Edited by luckyhendrix

Share this post


Link to post
Share on other sites
Got the module working fiine, but as soon as I try to define groups using BIS_ACM_addGroupClassesFunc, I get nothing!

The syntax is correct, but no units ever show up. However, as an experiment, I setup a radio trigger to display the names of all units on the map. When the mission starts, there's just me, the ACM and a Game Logic (which seems to get spawned as part of the ACM). After a few seconds of running around, more GLs start turning up. Still no sign of any actual units, just a map filled with invisible GLs. I assume the GLs are used as spawn locations for the soon to appear units? If I comment out BIS_ACM_addGroupClassesFunc, everything works fine, but every class turns up... not quite what I'm after.

Has anyone cracked this yet? The idea of only being able to use custom groups renders the module rather inflexible in my opinion.

Here's what I use in one of my inits. It's a bunch of stuff I found on the internet and a bunch of comments I added to make it easier to edit. Hope it helps.

Init.sqf

// BIS_ACM is module name.

waitUntil {!isNil {BIS_ACM getVariable "initDone"}};
waitUntil {BIS_ACM getVariable "initDone"};
sleep 5;

// Sets frequency and number of patrols (between 0 and 1. 0 is lowest and 1 is highest).
// Default: 0.5
//
[1, BIS_ACM] call BIS_ACM_setIntensityFunc;

// Min/max spawn distance.
// Default: 500, 1000
//
[bIS_ACM, 400, 600] call BIS_ACM_setSpawnDistanceFunc;

// Factions to be spawned. Pick from: USMC, CDF, RU, INS, GUE.
// Default: "USMC", "CDF", "RU", "INS", "GUE"
//
[["USMC", "RU", "INS", "GUE"], BIS_ACM] call BIS_ACM_setFactionsFunc;

// Min/max skill range for spawned units (from 0 to 1. 0 is lowest and 1 is highest).
// Default skill levels are based on difficulty setting.
// cadet mode: 0, 0.5
// Other difficulty settings: 0.3, 0.9
//
[0.1, 0.2, BIS_ACM] call BIS_ACM_setSkillFunc;

// Min/max amount of ammo that units will possess (From 0 to 1. 0 is lowest and 1 is highest).
// Default 1, 1
//
[0.5, 0.95, BIS_ACM] call BIS_ACM_setAmmoFunc;

// Type of patrol. With 0 meaning no chance of appearing, and 1 meaning 100% chance. -1 removes patrol type completely.
// Default: 0.75
//
["ground_patrol", 1, BIS_ACM] call BIS_ACM_setTypeChanceFunc;

// Type of patrol. With 0 meaning no chance of appearing, and 1 meaning 100% chance. -1 removes patrol type completely.
// Default: 0.25
//
["air_patrol", 1, BIS_ACM] call BIS_ACM_setTypeChanceFunc;

// Add classes to a custom database and use that instead.
// You can pass both actual CfgGroups Config entries or class name Strings.
// [(Module name), (Array of classes)] call BIS_ACM_addGroupClassesFunc;
// Default: Not configured, which means all classes will be used.
//
[bIS_ACM, ["USMC_TankPlatoon", "INS_TankSection", "RU_TankPlatoon", "GUE_TankSection"]] call BIS_ACM_addGroupClassesFunc;

// Remove classes from the custom class database during a mission.
// Example: [bIS_ACM, ["USMC_TankPlatoon", "INS_TankSection"]] call BIS_ACM_removeGroupClassesFunc;
//
// Leave array empty to switch back to all classes:
// Example: [bIS_ACM, []] call BIS_ACM_removeGroupClassesFunc;


// All classes are shown below.
/*
// USMC
USMC_InfSquad
USMC_FireTeam
USMC_FireTeam_MG
USMC_FireTeam_AT
USMC_FireTeam_Support
USMC_HeavyATTeam
USMC_SniperTeam
USMC_FRTeam
USMC_FRTeam_Razor

USMC_MotInfSection
USMC_MotInfSection_AT

USMC_MechInfSquad
USMC_MechReconSection

USMC_TankPlatoon

USMC_AH1ZSquadron
USMC_UH1YSquadron
USMC_MV22Squadron
USMC_MQ9Squadron
USMC_F35Squadron
USMC_AV8BFighterSquadron
USMC_AV8BBomberSquadron


// CDF
CDF_InfSquad
CDF_InfSquad_Weapons
CDF_InfSection_AT
CDF_InfSection_AA
CDF_InfSection_MG
CDF_InfSection_Patrol
CDF_SniperTeam

CDF_MotInfSquad
CDF_MotInfSection
CDF_MotInfSection_Weapons

CDF_MechInfSquad
CDF_MechReconSection
CDF_MechATSection

CDF_TankPlatoon

CDF_Mi24DSquadron
CDF_Mi8Squadron


// RU
RU_InfSquad
RU_InfSection
RU_InfSection_AT
RU_InfSection_AA
RU_InfSection_MG
RU_SniperTeam
RUS_ReconTeam
MVD_AssaultTeam

RU_MotInfSquad
RU_MotInfSection_Recon
RU_MotInfSection_Patrol

RU_MechInfSquad_1
RU_MechInfSquad_2

RU_TankPlatoon

RU_Mi24VSquadron
RU_Mi24PSquadron
RU_Pchela1TSquadron
RU_Ka52Squadron
RU_Mi8Squadron
RU_Su34FighterSquadron


// INS
INS_InfSquad
INS_InfSquad_Weapons
INS_InfSection_AT
INS_InfSection_AA
INS_SniperTeam
INS_MilitiaSquad

INS_MotInfSquad
INS_MotInfSection

INS_MechInfSquad
INS_MechInfSection
INS_MechInfSection_AT

INS_TankSection

INS_Mi8Squadron


// GUE
GUE_InfSquad
GUE_InfSquad_Assault
GUE_InfSquad_Weapons
GUE_InfTeam_1
GUE_InfTeam_2
GUE_InfTeam_AT
GUE_GrpInf_TeamAA
GUE_GrpInf_TeamSniper
GUE_MilitiaSquad

GUE_MotInfSection
GUE_MotInfSquad

GUE_MechInfSection
GUE_MechInfSquad

GUE_TankSection


// CIV (Not supported with ACM)
CIV_Crowd
CIV_City_1
CIV_City_2
CIV_Village_1
CIV_Village_2
*/

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×