Jump to content
BetterDeadThanZed

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];

Share this post


Link to post
Share on other sites

 

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".

Share this post


Link to post
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

Share this post


Link to post
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? 

Share this post


Link to post
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 {

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
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

 

Share this post


Link to post
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";

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...