Jump to content
Pba (DayZ)

AI shoot only if attaced.

Recommended Posts

Background:

My unit - BLUFOR stop in front of OPFOR  roadblock, and they want to controll our car ( by walking around car ). They don't know we are BLUFOR, because we wear OPFOR clothes. 

 

Problem:

How to make OPFOR units in every roadblock  don't shoot me until I don't shoot to them?

Share this post


Link to post
Share on other sites

Have your tried setCaptive?

 

4 hours ago, Pba (DayZ) said:

They don't know we are BLUFOR, because we wear OPFOR clothes.

Den Haag wants to know your location 😜

  • Like 2

Share this post


Link to post
Share on other sites

Barebones solution:

//initPlayerLocal.sqf
TAG_fnc_captiveCheck = {
	params ["_unit"];
	_unit setCaptive true;

	waitUntil {currentWeapon _unit != ""};

	_unit setCaptive false;
	{_x reveal [_unit,4]} forEach (_unit nearEntities 25);
};

player spawn TAG_fnc_captiveCheck;

If the player starts out unarmed, enemy AI will not engage.

As soon as the player equips a weapon this will be seen as a hostile action and enemies will immediately engage if present.

 

Cheers

  • Like 4

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×