Type of AI (Hero/Survivor/bandit)

Quasid

New Member
First of all, very sorry of this has been answered somewhere I missed.
But.. I am wondering if there is a way to set the AI to survivors (only returns fire), Bandits (shoots at everything) and Hero (shoots bandits on sight, only return fire on others)? Would be really nice to know, want to add some to some custom places on my Taviana server...
 
Fr1nk your wrong im on a epoch server with bandits that shoot on site and hero that shoot zombies and bandits, survivors that give you lifts or you can walk with them and they shoot zombies and bandits as well look for Dark crusade in dayz commander in search
 
That is side related, you can create Group of different sides, west, east, resistance. Players spawn as west, if the group of the AI is also west they are friendly to player.
 
sorry to necro this, but how would i go about doing that rockeumel? I'd like there to be a 50/50 chance of ai being either bandit or hero on spawn with DZAI. SargeAI is currently producing too many problems with my epoch origins server to be usable.
 
Yeah. I always used sarge but same lotsa errers
I was thinking of doing that with dzai this week and will report the changes.
It shouldnt be hard to add an additional parameter that is passed to the spawner for side probability. Would have to edit the killed eventhandler probably for humanity changes.

REMIND ME via pm if I forget
 
you have to change this part from the init/dzai_functions.sqf:

PHP:
//DZAI group side assignment function. Detects when East side has too many groups, then switches to Resistance side.
DZAI_createGroup = {
    private["_groupSide","_unitGroup"];
    _groupSide = (if (({(side _x) == east} count allGroups) < 141) then {
        east
    } else {
        //If there are 140 East groups, set West/Resistance hostility and assign a Resistance group instead.
        if ((resistance getFriend west) > 0) then {
            createCenter resistance;
            resistance setFriend [west,0];
            west setFriend [resistance,0];
            east setFriend [resistance, 1];
            resistance setFriend [east, 1];
            diag_log "DZAI Warning: Group maximum reached for East side! Modifying Resistance side for DZAI use.";
        };
        resistance
    });
    //diag_log format ["Assigned side %1 to AI group",_groupSide];
  
    _unitGroup = createGroup _groupSide;
    [_unitGroup,true] call DZAI_updGroupCount;
  
    _unitGroup
};

at the moment only the sides "east" and "resistance" are used, to spawn hostile AI.
you need the option for "west" (survivor) friendly AI
 
you have to change this part from the init/dzai_functions.sqf:

PHP:
//DZAI group side assignment function. Detects when East side has too many groups, then switches to Resistance side.
DZAI_createGroup = {
    private["_groupSide","_unitGroup"];
    _groupSide = (if (({(side _x) == east} count allGroups) < 141) then {
        east
    } else {
        //If there are 140 East groups, set West/Resistance hostility and assign a Resistance group instead.
        if ((resistance getFriend west) > 0) then {
            createCenter resistance;
            resistance setFriend [west,0];
            west setFriend [resistance,0];
            east setFriend [resistance, 1];
            resistance setFriend [east, 1];
            diag_log "DZAI Warning: Group maximum reached for East side! Modifying Resistance side for DZAI use.";
        };
        resistance
    });
    //diag_log format ["Assigned side %1 to AI group",_groupSide];
 
    _unitGroup = createGroup _groupSide;
    [_unitGroup,true] call DZAI_updGroupCount;
 
    _unitGroup
};

at the moment only the sides "east" and "resistance" are used, to spawn hostile AI.
you need the option for "west" (survivor) friendly AI
Just want to be sure, If I change this and it starts spawning Hero AI, will they be hostile to all? Will there be a way to make Hero AI not hostile to other heros? I'm assuming that this will also affect the heli and vehicle patrols as well?
 
Just to let you guys know, there will be some unsolvable* issues that will come up if you try to implement friendly AI.

If DZAI_useHealthSystem is enabled: The friendly AI will never be able to retaliate against player attackers.
If DZAI_useHealthSystem is disabled: Players who kill friendly AI won't be able to enter vehicles with other players.

* These issues are not 100% fixable according to my past research. Sarge AI does have a method of getting around this issue but it is far too kludgy/unreliable for my tastes. If you manage to find a way to implement completely bug-free friendly AI, you are a scripting god.
 
Just want to be sure, If I change this and it starts spawning Hero AI, will they be hostile to all? Will there be a way to make Hero AI not hostile to other heros? I'm assuming that this will also affect the heli and vehicle patrols as well?
It will affect the Patrols! We only can use what Arma is able to give, all hostile/friendly action is side/faction related, it only exist 3 (4) sides: west, east, resistance (civilian,enemy).
In default DayZ, Player always join a game of the side "West" (bandits and survivors/heros), so all AI of side/faction West will be friendly to players, they only shoot at players, if their rating is below -1999, then they are marked as "enemy".
Humanity is a custom made variable and has no relation to arma, so it is difficult to create hero and bandit AI that is hostile in reference to humanity of a player.

** i hope my written words are understandable, my english is not the best **

ps.: the only way to solve this, is to let player join faction east or west in reference of the players humanity, BUT what if the humanity changes during the gameplay from hero to bandit?
(Hostile Ai has to be resistance)
 
Last edited:
Just want to be sure, If I change this and it starts spawning Hero AI, will they be hostile to all? Will there be a way to make Hero AI not hostile to other heros? I'm assuming that this will also affect the heli and vehicle patrols as well?
when you create ai, it doesnt matter the skin. they will act according to the friend states of the factions as explained above. so we can create bandit skinned ai that are on west and therefore friendly to players.

(i think) .. buttface said somewhere that he doesnt believe friendly ai is belongs in the game, so there is no design in dzai for that possibility.
it might be easier to just create a simple spawn script for multiple side ai. use alongside dzai when you want west or resistance. I think I can do that this weekend, I have a custom mod that is basically waiting for this (i need friendly ai that the players can recruit). just keep in mind that I said SIMPLE.
 
If you wanted your AI to be hero's / Survivors and only shoot bandits I can think of something that would work.

If your friendly AI is on the resistence side. Friendly to West, Hates East. It will attack the bandit AI but not players.

The bandit AI is on East and set to attack West and Resistence.

Then, monitor for anyone that has the humanity of a bandit and drop their rating to below 2000.

Everything should go.

That being said, I haven't looked at DZAI's stuff enough yet to know what else that conflicts with, but I do have it working for some of the AI I created.

My Transport Crew is friendly to players till they get hurt and then the players raiting drops and its ON! They also attack DZAI's bandits.

I also have some AI manning my guns on helis in certain circumstances and they rip the hell out of the DZAI as I fly around. Its way OP but fun to watch with the tracer rounds.
 
@delpi Dropping players' ratings will instantly prevent them from entering vehicles with other players, which is just the tip of the iceberg of why friendly AI is a very tricky feature to implement flawlessly.
 
It is the same, if you let join Bandit player as faction east and survivors as west.
They can play well against each other, but not side by side.
It exist no solution for that, it is all arma related.
 
Back
Top