Skip to content

Commit

Permalink
[MIL/CIV/CUSTOM PLACEMENT] Garrison Profile groups now spawn to clust…
Browse files Browse the repository at this point in the history
…er size.
  • Loading branch information
DarrellJMartin committed Oct 7, 2024
1 parent 8b1b888 commit 910f40b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
11 changes: 5 additions & 6 deletions addons/civ_placement/fnc_CP.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -1058,19 +1058,18 @@ switch(_operation) do {
// DEBUG -------------------------------------------------------------------------------------

private _guardRadius = parseNumber([_logic, "guardRadius"] call MAINCLASS);
private _guardPatrolPercentage = parseNumber([_logic, "guardPatrolPercentage"] call MAINCLASS);



private _guardPatrolPercentage = parseNumber([_logic, "guardPatrolPercentage"] call MAINCLASS);
private _guardDistance = _size;

if(count _infantryGroups > 0 && _guardProbabilityCount > 0) then {
for "_i" from 0 to _guardProbabilityCount -1 do {

_guardGroup = (selectRandom _infantryGroups);
_guards = [_guardGroup, [_center, 50] call CBA_fnc_RandPos, random(360), true, _faction] call ALIVE_fnc_createProfilesFromGroupConfig;
_guards = [_guardGroup, [_center, _guardDistance] call CBA_fnc_RandPos, random(360), true, _faction] call ALIVE_fnc_createProfilesFromGroupConfig;

// DEBUG -------------------------------------------------------------------------------------
if(_debug) then {
["CP [%1] - Placing Garrison Guards - %1", _faction, _guardGroup] call ALiVE_fnc_dump;
["CP [%1] - Placing Garrison Guards - %2", _faction, _guardGroup] call ALiVE_fnc_dump;
};
// DEBUG -------------------------------------------------------------------------------------

Expand Down
7 changes: 4 additions & 3 deletions addons/mil_placement/fnc_MP.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -1510,16 +1510,17 @@ switch(_operation) do {

private _guardRadius = parseNumber([_logic, "guardRadius"] call MAINCLASS);
private _guardPatrolPercentage = parseNumber([_logic, "guardPatrolPercentage"] call MAINCLASS);

private _guardDistance = _size;

if(count _infantryGroups > 0 && _guardProbabilityCount > 0) then {
for "_i" from 0 to _guardProbabilityCount -1 do {

_guardGroup = (selectRandom _infantryGroups);
_guards = [_guardGroup, [_center, 50] call CBA_fnc_RandPos, random(360), true, _faction] call ALIVE_fnc_createProfilesFromGroupConfig;
_guards = [_guardGroup, [_center, _guardDistance] call CBA_fnc_RandPos, random(360), true, _faction] call ALIVE_fnc_createProfilesFromGroupConfig;

// DEBUG -------------------------------------------------------------------------------------
if(_debug) then {
["MP [%1] - Placing Garrison Guards - %1", _faction, _guardGroup] call ALiVE_fnc_dump;
["MP [%1] - Placing Garrison Guards - %2", _faction, _guardGroup] call ALiVE_fnc_dump;
};
// DEBUG -------------------------------------------------------------------------------------

Expand Down
7 changes: 4 additions & 3 deletions addons/mil_placement_custom/fnc_CMP.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,8 @@ switch(_operation) do {

private _guardRadius = parseNumber([_logic, "guardRadius"] call MAINCLASS);
private _guardPatrolPercentage = parseNumber([_logic, "guardPatrolPercentage"] call MAINCLASS);

private _guardDistance = parseNumber([_logic, "size"] call MAINCLASS);

// Position and create groups
private _groupCount = count _groups;
private _totalCount = 0;
Expand All @@ -587,11 +588,11 @@ switch(_operation) do {
if (_i == 0 && {count _infantryGroups > 0} && _guardProbabilityCount > 0) then {

_guardGroup = (selectRandom _infantryGroups);
_guards = [_guardGroup, [_position, 50] call CBA_fnc_RandPos, random(360), true, _faction] call ALIVE_fnc_createProfilesFromGroupConfig;
_guards = [_guardGroup, [_position, _guardDistance] call CBA_fnc_RandPos, random(360), true, _faction] call ALIVE_fnc_createProfilesFromGroupConfig;

// DEBUG -------------------------------------------------------------------------------------
if(_debug) then {
["CMP [%1] - Placing Garrison Guards - %1", _faction, _guardGroup] call ALiVE_fnc_dump;
["CMP [%1] - Placing Garrison Guards - %2", _faction, _guardGroup] call ALiVE_fnc_dump;
};
// DEBUG -------------------------------------------------------------------------------------

Expand Down

0 comments on commit 910f40b

Please sign in to comment.