Jump to content
  • 0

A3EAI Factions


Karmafied

Question

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!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

if you just want the ai to fight among themself, you wont need to change any friends settings like that.

the ai a3eai spawns are for resistance side and the code you show are making sure they are all set to unfriendly, so you just need to spawn some ai from east or west side and they will automatically start fighting (required that they have usable weapons and has discovered each other ofc).

this is not an impossible task, however it is not as easy to implement as you seem to think, you will need to change a "little" more than what you sugges here.

theres a few ways i can think of regarding how to achive this using a3eai, but they all require quite a bit of work(not to mention knowledge of arma coding), not something i can recommend for a beginner coder, unless you want a hard challenge.

 

asking someone to write it for you for money, might not be your best option either, as it will attract a lot of unwated elements ... had it not been for the fact that i currently feel kinda "burned out" on arma, i would have prob helped you.

personally i dont need or car about money either, but that boob pic does sound interesting tho ... :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...