Greetings all! I have a private server for only my family to play on. We are playing on Arma 3 Epoch (Australia) and use Face's A3EAI addon. I am trying to figure out how to make the AI have 2 different factions. I don't care if they are friendly towards players or not, I just want gunfights happening randomly instead of ONLY with the players; the AI should be shooting at each other sometimes, too.
I've spoken with Face and he has set me on the right direction, but he is very busy and has been more than kind in getting me started; so now I come to the family for help.
First, how do I set this code in A3EAI_initserver.sqf to make two factions? I know it's only a matter of 1 and 0 switches, I am just not sure which way.
//Set side relations only if needed
_allUnits = +allUnits;
if (({if ((side _x) isEqualTo east) exitWith {1}} count _allUnits) isEqualTo 0) then {createCenter east};
if (({if ((side _x) isEqualTo west) exitWith {1}} count _allUnits) isEqualTo 0) then {createCenter west};
if (({if ((side _x) isEqualTo resistance) exitWith {1}} count _allUnits) isEqualTo 0) then {createCenter resistance};
if ((resistance getFriend west) > 0) then {resistance setFriend [west, 0]};
if ((resistance getFriend east) > 0) then {resistance setFriend [east, 0]};
if ((east getFriend resistance) > 0) then {east setFriend [resistance, 0]};
if ((west getFriend resistance) > 0) then {west setFriend [resistance, 0]};
Second, once that is complete, would I just change this code in A3EAI_servermonitor.sqf to match it?
//Check for unwanted side modifications
if ((_currentTime - _sideCheck) > SIDECHECK_TIME) then {
if !((resistance getFriend west) isEqualTo 0) then {resistance setFriend [west, 0]};
if !((resistance getFriend east) isEqualTo 0) then {resistance setFriend [east, 0]};
if !((east getFriend resistance) isEqualTo 0) then {east setFriend [resistance, 0]};
if !((west getFriend resistance) isEqualTo 0) then {west setFriend [resistance, 0]};
if !((resistance getFriend resistance) isEqualTo 1) then {resistance setFriend [resistance, 1]};
_sideCheck = _currentTime;
};
And finally, how do I make a case switch that makes the addon spawn either a West group or East group? I feel like it would be here (A3EAI_createUnit.sqf), but I don't know for sure. I am still very new at this.
private ["_unit", "_unitGroup", "_spawnPos", "_unitLevel", "_type"];
_unitGroup = _this select 0;
_unitLevel = _this select 1;
_spawnPos = _this select 2;
_antistuck = if ((count _this) > 3) then {_this select 3} else {false};_unit = _unitGroup createUnit ["i_survivor_F",_spawnPos,[],0,"FORM"];
[_unit] joinSilent _unitGroup;
0 = _unit call A3EAI_addUnitEH;
0 = [_unit, _unitLevel] call A3EAI_generateLoadout; // Assign unit loadout
0 = [_unit, _unitLevel] call A3EAI_setSkills; // Set AI skill
Any and all help is VERY appreciated. Arma 2 and 3 have proven wonderful for my family in terms of spending time together and enjoying each other's company. I am trying to do everything I can to keep it interesting and fun for everyone. Thanks, everybody!