Jump to content

Recommended Posts

Thanks BlackAlpha!

Apart from the order each function is executed, our scripts are almost identical. Adding the "sleep 5" at the top may have helped too?

Very happy now :bounce3:

Share this post


Link to post
Share on other sites
Thanks BlackAlpha!

Apart from the order each function is executed, our scripts are almost identical. Adding the "sleep 5" at the top may have helped too?

Very happy now :bounce3:

I run my game using the "-showScriptErrors" commandline. That will show you all errors ingame, instead of just in the .rpt file. It will allow you to quickly find out what is wrong.

Basically, the above script without the sleep kept giving me errors. I figured it was because the module was not fully initialized at that point, even with the "waituntil" command. So, I added the sleep after the waituntil and then it worked.

I didn't really bother to check it out but I guess you could turn down the sleep to just 1 or two seconds. Not sure, though.

Share this post


Link to post
Share on other sites

I use the -showScriptErrors option and no errors where reported. It just didn't want to spawn any units. I'll try changing the order of the functions and adjust the wait time to try and find out the point at which it stops working. At least I've got a good starting point now :)

Thanks again for your help.

Share this post


Link to post
Share on other sites
I use the -showScriptErrors option and no errors where reported. It just didn't want to spawn any units. I'll try changing the order of the functions and adjust the wait time to try and find out the point at which it stops working. At least I've got a good starting point now :)

Thanks again for your help.

The quickest way to find out whether something is being spawned is by only spawning tank platoons at a distance of less then 500 meters, then fly around in a cobra and eventually (after 5 min) they will start popping up.

Share this post


Link to post
Share on other sites

There seems to be a bug in the Ambient Combat Module script returnRandomGroup.sqf:

_allGroups = _db select _sideSel;

the local variable _sideSel is not defined anywhere in the scope of the script.

When using the default database, no problems occur.

Maybe the array processing of the custom groups has a bug?

The custom group array is initialized in the following way (addGroupClasses.sqf) :

_dbCustom =

[

[

[], [], [], [], []

],

[

[], [], [], [], []

],

[

[], [], [], [], []

],

[

[], [], [], [], []

],

[

[], [], [], [], []

]

]

The selector-variable _sideSel is intended to select a group-subarray of a specific side out of the main array.

0 _cfgWest >> "USMC"

1 _cfgWest >> "CDF"

2 _cfgEast >> "RU"

3 _cfgEast >> "INS"

4 _cfgGuerilla >> "GUE"

There is 5 enclosed arrays which relate to the group classes:

0 ["Infantry"]

1 ["Motorized"]

2 ["Mechanized"]

3 ["Armored"]

4 ["Air"]

It is possible to address that global array directly to pass the desired

group types.

Attention has to be paid to the fact that the sub-array elements

are not the group name strings but their group-config entries !

This little test illustrates it:

_db = BIS_ACM getVariable "dbGroups";

hint format ["dbGroups default groups : %1",_db];

So if it is desired to just spawn infantry and no tanks etc. choosing the group "USMC_InfSquad",

then the proper syntax to address that directly in a script would be :

Example 1:

_groupname="USMC_InfSquad";

_configentry = [_groupname call BIS_ACM_convertGroupStringToConfigFunc];

_dbCustom=[

[

_configentry,[],[],[],[]

],

[

[],[],[],[],[]

],

[

[],[],[],[],[]

],

[

[],[],[],[],[]

],

[

[],[],[],[],[]

]

];

BIS_ACM setVariable ["dbGroupsCustom", _dbCustom];

To just spawn russian sniper teams and no tanks etc. (group name "ru_sniperteam"), the proper syntax would be :

Example 2:

_groupname="ru_sniperteam";

_configentry = [_groupname call BIS_ACM_convertGroupStringToConfigFunc];

_dbCustom=[

[

[],[],[],[],[]

],

[

[],[],[],[],[]

],

[

_configentry,[],[],[],[]

],

[

[],[],[],[],[]

],

[

[],[],[],[],[]

]

];

BIS_ACM setVariable ["dbGroupsCustom", _dbCustom];

I hope this helps some of you to make more selective use of the wonderful ambient combat module. :thumb:

Regards,

Charon

Edited by Charon Productions

Share this post


Link to post
Share on other sites

So here is what i did :

_LogicCenter = createCenter sideLogic;
_LogicGroup = createGroup _LogicCenter;

BIS_ACM = _LogicGroup createUnit ["AmbientCombatManager", [0, 0, 0], [], 0, ""];
BIS_ACM synchronizeObjectsAdd [player];

sleep 5;
[] spawn {
waitUntil {!(isnil "BIS_fnc_init")};
sleep 5;
[bIS_ACM, 200, 400] call BIS_ACM_setSpawnDistanceFunc;
[0.2, 0.8, BIS_ACM] call BIS_ACM_setAmmoFunc;
[0.2, 0.5, BIS_ACM] call BIS_ACM_setSkillFunc;
[["RU"], BIS_ACM] call BIS_ACM_setFactionsFunc;
[1, BIS_ACM] call BIS_ACM_setIntensityFunc;
[bIS_ACM,
[
"RU_InfSquad",
"RU_InfSection",
"RU_InfSection_AT",
"RU_InfSection_AA",
"RU_InfSection_MG",
"RU_SniperTeam",
"RUS_ReconTeam",
"MVD_AssaultTeam"
]
] call BIS_ACM_addGroupClassesFunc;
};

all you have todo is:

- place a FunctionModule

- place a player

- copy the code to "Init.sqf"

now the INIT will create a ACMModule, sync it to you an will start spawning only RU Inf Troops .

Hope I could help you out!!! :)

Edited by fbbull

Share this post


Link to post
Share on other sites

@fbbull:

Tested your approach.

Seems to work fine so far and is more user-friendly ;)

Cool, now that makes a couple of spawn-scripts obsolete from now on since the ACM is more lighter.

Share this post


Link to post
Share on other sites

I have one problem with the ACM:

WORKS:

If I create a lan multiplayer game to test it, no problem: the hostile invasion begin.

DOESN'T WORKS:

If I put the mission on the dedicated server or I create an internet multiplayer game.

And then I test with 2 testers or more...

Nothing append :eek::eek::eek:

ACM module is sync to an AI car.

and activated with a trigger:

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

Is it a bug? or the bug is me ? :butbut:

Edited by phrogz

Share this post


Link to post
Share on other sites

I just try to sync to the team leader, but it doesn't change anything :confused:

no luck ...........................

Share this post


Link to post
Share on other sites

Did you create a ACM Module with name "BIS_ACM1" ? thats the ModuleName you use in ["ground_patrol", 1, BIS_ACM1] call BIS_ACM_setTypeChanceFunc;

Share this post


Link to post
Share on other sites
There seems to be a bug in the Ambient Combat Module script

...

I hope this helps some of you to make more selective use of the wonderful ambient combat module. :thumb:

Regards,

Charon

Not sure what you are trying to say but I tested out that var and the var is defined just fine. As for spawning custom groups, did you try BIS_ACM_addGroupClassesFunc?

Share this post


Link to post
Share on other sites
Did you create a ACM Module with name "BIS_ACM1" ? thats the ModuleName you use in ["ground_patrol", 1, BIS_ACM1] call BIS_ACM_setTypeChanceFunc;

Sure ! it's works pretty good in lan game (alone).

Edited by phrogz

Share this post


Link to post
Share on other sites
Sure ! works pretty good in lan game.

You could try to sync it to a "man" (the leader of a group) instead of a vehicle.

Also, the AI car might be too far away from the players. With the default settings, the spawn distance is between 500 and 1000 meters. So, maybe things are spawning but they are just too far away from the players for them to notice it.

Finally, what do you mean with "activated with a trigger"? The code you posted does not activate the module, it simply changes two settings to different values but the module should already be active before you run those two line of codes.

Edited by BlackAlpha

Share this post


Link to post
Share on other sites

The init:

// ====================================================================================
//ACM1
player sidechat "ACM1 loading.";
waitUntil {!isNil {BIS_ACM1 getVariable "initDone"}};
player sidechat "ACM1 BIS not null.";
waitUntil {BIS_ACM1 getVariable "initDone"};
player sidechat "ACM1 Init Done.";

//Sets frequency and number of patrols (0-1). BIS_ACM is module name
[1, BIS_ACM1] call BIS_ACM_setIntensityFunc;  

//min max spawn distance
[bIS_ACM1, 300, 600] call BIS_ACM_setSpawnDistanceFunc;

//factions to be spawned
[["RU","GUE","INS"], BIS_ACM1] call BIS_ACM_setFactionsFunc;

//Skill range for spawned units
[0.8, 0.9, BIS_ACM1] call BIS_ACM_setSkillFunc;

//Amount of ammo spawned units possess
[0.8, 0.9, BIS_ACM1] 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", 0, BIS_ACM1] call BIS_ACM_setTypeChanceFunc;
["air_patrol", 0, BIS_ACM1] call BIS_ACM_setTypeChanceFunc;
// ====================================================================================

The trigger:

		class Item7
	{
		position[]={2897.0452,571.70068,15728.278};
		interruptable=1;
		age="UNKNOWN";
		expCond="Trigger100";
		expActiv="null0 = execVM ""acm1start.sqf"";";
		class Effects
		{
		};
	};

acm1start.sqf:

["ground_patrol", 1, BIS_ACM1] call BIS_ACM_setTypeChanceFunc;
["air_patrol", 1, BIS_ACM1] call BIS_ACM_setTypeChanceFunc;
MrBob sidechat "Be carrefull we just decipher enemy communications !";

I have already tried to sync it with the teamleader same issue.

Edited by phrogz

Share this post


Link to post
Share on other sites

After some test:

It's not a multiplayer issue!

If I play alone I can teleport directly near the ACM (to test it) ! So I don't see the problem...

---------------------------------

Explanations:

---------------------------------

The ACM module looks to be inactive after few time, even if an AI is sync to the ACM and is near it.

Situation:

ACM is sync to an ally car who is in the ally base near the acm, far from the human players.

1/ The players must wait that the helicopters land in.

2/ the players go in the helicopters and fly (12 kilometers) to the ally base.

3/ then (about 15 minutes after the begining of the mission) the trigger activate the ACM when helicopters land in the ally base.

If someone have a tip, he is welcome !!!!!

Edited by phrogz

Share this post


Link to post
Share on other sites

I have a question I think I already know is a no answer.

I have a few maps for the unit that I am that we use to do LANDNAV training.

Basically it spawns you randomly within a certain distance of where you start and the goal is to use the terrain and your compass and map to figure out where you are, and then meet up with your team mates someplace.

We want to add in the ACM to this so that players can practice evasion skills while they move to their rally point.

The issue I have run into is that it seems like the ACM just wants to spawn on one player. I have tried syncing the ACM to every member in the group, and I have also tried making each player their own group and syncing the ACM to each player-group. The ACM seems to work once again on just the unit marked as the player and not on any of the playable units.

Also, when I die and respawn it seems to break the ACM, it no longer registers the player it was syncing too and no more units are spawned...

Does anyone know if what I am trying is possible or if I am just SOL?

*edit*

I think it does work if it is synced to each user as a group, it just doesnt work when they respawn... Anyone know a way around this?

Edited by NouberNou

Share this post


Link to post
Share on other sites

Did anyone notice that there is an air_drop.sqf under the ACM Module? There is nothing in it, maybe something in the future.

Share this post


Link to post
Share on other sites
Did anyone notice that there is an air_drop.sqf under the ACM Module? There is nothing in it, maybe something in the future.

Functions module has the BIS_fnc_supplydrop that is used by SOM I think, or can be used separately.

Share this post


Link to post
Share on other sites

Kylania

I think there is a difference between the two (supply_drop and air_drop), it would be nice to have enemy helicopters flying in and enemy soldiers jumping out at random.

Edited by cobra4v320

Share this post


Link to post
Share on other sites
I have a question I think I already know is a no answer.

I have a few maps for the unit that I am that we use to do LANDNAV training.

Basically it spawns you randomly within a certain distance of where you start and the goal is to use the terrain and your compass and map to figure out where you are, and then meet up with your team mates someplace.

We want to add in the ACM to this so that players can practice evasion skills while they move to their rally point.

The issue I have run into is that it seems like the ACM just wants to spawn on one player. I have tried syncing the ACM to every member in the group, and I have also tried making each player their own group and syncing the ACM to each player-group. The ACM seems to work once again on just the unit marked as the player and not on any of the playable units.

Also, when I die and respawn it seems to break the ACM, it no longer registers the player it was syncing too and no more units are spawned...

Does anyone know if what I am trying is possible or if I am just SOL?

*edit*

I think it does work if it is synced to each user as a group, it just doesnt work when they respawn... Anyone know a way around this?

Sorry to bump my own post, but I'd really like to know if anyone has had any experience with this?

I think it mainly has to do with respawning during MP play.

Share this post


Link to post
Share on other sites

I believe the ACM module only works if you have more than one member in your group. How do you have your group setup?

Share this post


Link to post
Share on other sites
I believe the ACM module only works if you have more than one member in your group. How do you have your group setup?

No, it does work on a single unit.

The issue is that it only works on the lead unit. If the group is spread all over the map, which it is in my case then the units only spawn around the leader.

When I put each person in their own group I am pretty sure it worked right and spawned around everyone, but when we died we lost sync with the ACM and it no longer spawned units around us...

Share this post


Link to post
Share on other sites

Right out of the modules.pbo

//Shut down if the group does not contain at least one other unit.

if ((count _syncObjs) == 0) exitWith {debugLog "Log: [ACM] Shutting down. No units were synchronized to the ACM."};

//Only the first unit's group is checked. We only allow one group synchronized with the ACM.

Share this post


Link to post
Share on other sites

This module is good for easy fast action but is lacking for more complex MP missions. I cant finnish off my mission until DAC is released for arma2..

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

×