Jump to content

Make AI at missions shoot at zedz


Recommended Posts

 

If you have DZMS using its own relations, it already does this, otherwise you need to turn it on for your own AI system like DZAI if you are using their relations.

// Make AI Hostile to Zeds
EAST setFriend [CIVILIAN,0];
CIVILIAN setFriend [EAST,0];

 

I have DZMS, as per my original post, but the AI in DZAI seem to be killing each other since I turned on free for all in DZAI. I'm not really sure what you mean about the "relations".

Link to comment
Share on other sites

I have DZMS, as per my original post, but the AI in DZAI seem to be killing each other since I turned on free for all in DZAI. I'm not really sure what you mean about the "relations".

 

DZMS spawns in its own AI, but it uses the relations from other AI mods if you have them. Relations are how each side likes the other side.

There are 4 sides. Blufor (WEST), Opfor (EAST), Independent (Guerrilla), and Civilian.

If your DZAI are set to FreeForAll, it changes the relations, and therefor DZMS is set to FreeForAll.

 

If this case if you have DZAI installed, DZMS is using DZAI relations. This means if you turn on the setting to make DZAI shoot zombies, DZMS AI will also be hostile to zombies.

 

If you don't have DZAI, SargeAI, or WickedAI installed, DZMS uses its own relations from the DZMSInit.sqf

Link to comment
Share on other sites

DZMS spawns in its own AI, but it uses the relations from other AI mods if you have them. Relations are how each side likes the other side.

There are 4 sides. Blufor (WEST), Opfor (EAST), Independent (Guerrilla), and Civilian.

If your DZAI are set to FreeForAll, it changes the relations, and therefor DZMS is set to FreeForAll.

 

If this case if you have DZAI installed, DZMS is using DZAI relations. This means if you turn on the setting to make DZAI shoot zombies, DZMS AI will also be hostile to zombies.

 

If you don't have DZAI, SargeAI, or WickedAI installed, DZMS uses its own relations from the DZMSInit.sqf

 

Ok, so at the missions I found a few AI still alive. Obviously they are all part of the same group since they didn't kill each other. What is the limitation on the group sizes with DZMS? Is there a way to get all AI in DZMS to spawn in the same group? 

Link to comment
Share on other sites

Ok, so at the missions I found a few AI still alive. Obviously they are all part of the same group since they didn't kill each other. What is the limitation on the group sizes with DZMS? Is there a way to get all AI in DZMS to spawn in the same group? 

 

Each spawn line in DZMS puts all the AI in one group, this is why there are normally multiple spawn lines in each file.

If you only had one spawn line, they all spawned in the same group.

for "_x" from 1 to _unitcount do {
Link to comment
Share on other sites

I got confused with two threads going on. Thought I was in the other thread about AI killing each other. I kinda went the wrong way a couple replies back. :)

 

So, since I'm using DZAI, I don't need to do anything special to make the mission AI from DZMS attack zedz?

 

Nope, as long as you have the option turned on for DZAI to attack zeds, then DZMS should be set to do the same.

Link to comment
Share on other sites

It seems the AI in DZMS won't attack zeds. The AI in DZAI are set to attack them. DZAI is enabled. Zeds walk right up to the AI and they don't shoot.

 

Since that didn't work, under _unitGroup = createGroup east; in DZMSAISpawn.sqf, I addded this: EAST setFriend [civilian, 0]; and it made no difference. 

 

I'm trying to make a mission where bandits are on a mission to clear out the zeds in an area, but if they don't shoot, it'll ruin it.

 

dygb.jpg

 
Link to comment
Share on other sites

could be like how the ai companions are made to attack the zombies

 

Now if you want the zeds to be killed by the survivors you will need to create a custom zombie_generate.sqf file and
add a single line to it near the very end of the script, there are plenty of examples of how to edit your compiles script to point to a new file
This is the compiles.sqf line you need to make point to your new file
zombie_generate
= compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf";
 
At the bottom of zombie_generate.sqf right above
//Start behavior
_id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
 
add
this
_agent addRating -1000000;

 

and another version

 

 

zombie_generate.sqf taken from pbo and put into custom folder in root of mission

 

 

//Add some loot
_rnd = random 1;
if (_rnd > 0.3) then {
    _lootType =         configFile >> "CfgVehicles" >> _type >> "zombieLoot";
    if (isText _lootType) then {

        _array = [];
        if (DZE_MissionLootTable) then {
            _array = getArray (missionConfigFile >> "cfgLoot" >> getText(_lootType));
        } else {
            _array = getArray (configFile >> "cfgLoot" >> getText(_lootType));
        };
        if (count _array > 0) then {
            _loot = _array call BIS_fnc_selectRandomWeighted;
            if(!isNil "_array") then {
                _agent addMagazine _loot;
            };
        };
    };
};

_agent addRating -1000000;


//Start behavior
_id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";

 

 

 

 

 

Called zombie_generate.sqf file from the bottom of my init.sqf:

 

call compile preprocessFileLineNumbers "custom\zombie_generate.sqf";

Link to comment
Share on other sites

  • 1 year later...

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
  • Advertisement
  • Discord

×
×
  • Create New...