Hi.
I am trying to find a way to define dominant faction while mission is running.
For now i have this:
fnc_getdominant = {
private ["_objectivePosW", "_aliveunitsW", "_entitiesCountW", "_objectivePosE", "_aliveunitsE", "_entitiesCountE", "_w", "_profiledEntCountW", "_profiledVehCountW", "_e", "_profiledEntCountE", "_profiledVehCountE", "_return"];
_objectivePosW = [];
_aliveunitsW = [];
_entitiesCountW = 0;
_objectivePosE = [];
_aliveunitsE = [];
_entitiesCountE = 0;
for "_w" from 0 to count ([OPCOM_instances select 0,"objectives",[]] call ALiVE_fnc_hashGet) -1 do {
_objectivePosW pushback (((([OPCOM_instances select 0,"objectives",[]] call ALiVE_fnc_hashGet) select _w ) select 2) select 1);
_profiledEntCountW = count ([_objectivePosW select _w, 500, ["WEST","entity"]] call ALIVE_fnc_getNearProfiles);
_profiledVehCountW = count ([_objectivePosW select _w, 500, ["WEST","vehicle"]] call ALIVE_fnc_getNearProfiles);
_entitiesCountW = _entitiesCountW + (_profiledEntCountW + _profiledVehCountW);
};
{
if (side _x == West) then {
_aliveunitsW pushBack _x;
}
} forEach allunits;
for "_e" from 0 to count ([OPCOM_instances select 1,"objectives",[]] call ALiVE_fnc_hashGet) -1 do {
_objectivePosE pushback (((([OPCOM_instances select 1,"objectives",[]] call ALiVE_fnc_hashGet) select _e ) select 2) select 1);
_profiledEntCountE = count ([_objectivePosE select _e, 500, ["EAST","entity"]] call ALIVE_fnc_getNearProfiles);
_profiledVehCountE = count ([_objectivePosE select _e, 500, ["EAST","vehicle"]] call ALIVE_fnc_getNearProfiles);
_entitiesCountE = _entitiesCountE + (_profiledEntCountE + _profiledVehCountE);
};
{
if (side _x == East) then {
_aliveunitsE pushBack _x;
}
} forEach allunits;
_return = [_entitiesCountW + (count _aliveunitsW), _entitiesCountE + (count _aliveunitsE)];
_return
};
This is returning count of alive units + profiled for each side in format :
[west, east]
example:
[145,193]
Is that anyway useful to define dominant faction couple times under game play and even end the mission on some big difference between this two indexes?