Jump to content

[TUTORIAL][FIX] AI try kill traders


F507DMT

Recommended Posts

AI don`t try kill traders && weapon lowered

 

ccc57eb1d8cd1de5e500d961201d0fa0.jpg

 

Everyone knows about the problem when AI try kill traders. AI stay and shoot in traders long long time, or heli only fly over the traders. Its easy to fix!

 

 

Standart spawn AI trader:

_unit_32 = objNull;
if (true) then
{
  _this = createAgent ["Soldier_GL_PMC", [8266.668, 15482.221, 0.10264076], [], 0, "CAN_COLLIDE"];
  _unit_32 = _this;
  _this setDir -141.76392;
  _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0; this enableAI 'ANIM';  ";
  _this setUnitAbility 0.60000002;
_this allowDammage false; _this disableAI 'FSM'; _this disableAI 'MOVE'; _this disableAI 'AUTOTARGET'; _this disableAI 'TARGET'; _this setBehaviour 'CARELESS'; _this forceSpeed 0;_this enableSimulation true;
};

Change to:

  _unit = createAgent ["Soldier_GL_PMC", [8266.668, 15482.221, 0.10264076], [], 0, "CAN_COLLIDE"];
  _unit setDir -141.76392;
  _unit setcaptive true; //make frendly for AI
  _unit switchMove 'AmovPercMstpSlowWrflDnon'; //lower weapon (only if unit have weapon)
  _unit setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;  ";
  _unit allowDammage false; _unit disableAI 'FSM'; _unit disableAI 'MOVE'; _unit disableAI 'AUTOTARGET'; _unit disableAI 'TARGET'; _unit setBehaviour 'CARELESS'; _unit forceSpeed 0;_unit enableSimulation false;

add on top script:

private ["_unit"];
sleep 60; //add sleep 60, it`s wait load all traders.

Use _unit, not _unit_32, its good for server FPS.

if server (in server_functions.sqf) spawn AI traders, 50% unstable!!!

use 1 file wich all units, and add path in init.sqf in if (isServer) then:

if (isServer) then {
	call compile preprocessFileLineNumbers "\z\addons\dayz_server\scripts\dynamic_vehicle.sqf";
	_serverMonitor = 	[] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
	_nil = [] execVM "\z\addons\dayz_server\scripts\units.sqf"; //this
};

.

 

 

Thx for help:

Halvhjearne
BetterDeadThanZed
SchwEde

 

 

 

 

--

I will be happy if I helped someone!

Sorry for my bad english!   :P

 

 

 with: Losing connection, drop loot, Esc, exit yes and Esc + G, losing connection, drop loot, exit yes.

Edited by F507DMT
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...