Pushing this due to the greatly improved HC logic compared to the
current logic. This minor update includes a new variable to control kill
messages and track AI kills.
This commit is contained in:
Teh Dango 2016-04-02 12:18:10 -04:00
parent 4c97b939d7
commit 1218f04f15
318 changed files with 553 additions and 183 deletions

View File

@ -0,0 +1,31 @@
//Debugstuff to let u know that it work
playerunits = 0;
hcunits = 0;
svunits = 0;
//PAPABEAR=[West,"airbase"];
while{true}do{
/* if(hasinterface) then {
_unitss = {local _x}count allUnits;
_jochen = "LOCALunits: ";
_zeige = _jochen + str(_unitss);
//[PAPABEAR,nil,rsideChat,_zeige] call RE;
systemChat format ["%1",_zeige];
}; */
if(!hasinterface && !isServer) then {
_unitss = {local _x}count allUnits;
_jochen = "HEADLESSunits: ";
_zeige = _jochen + str(_unitss);
//[PAPABEAR,nil,rsideChat,_zeige] call RE;
systemChat format ["%1",_zeige];
};
/* if(isServer) then {
_unitss = {local _x}count allUnits;
_jochen = "SERVERunits: ";
_zeige = _jochen + str(_unitss);
//[PAPABEAR,nil,rsideChat,_zeige] call RE;
systemChat format ["%1",_zeige];
}; */
sleep 5;
};

View File

@ -0,0 +1,74 @@
//=========================================================================================================
// HEADLESS CLIENT AUTO DETECTOR by elec v 1.0b
// needs Arma 2 OA beta v101032 or higher
//
// Copy the script in your mission folder and add this code in the !! FIRST !! line of your init.sqf:
// --------------------------------------------------------------------------------------------------------
// elec_HC_detect = ["auto"] execVM "elec_HC_detect.sqf"; waitUntil {scriptDone elec_HC_detect};
// --------------------------------------------------------------------------------------------------------
//
// ========SWITCH========
// Use "auto" to autodetect if a headless client is connected and force execution on it.
// Use "on" to force the execution of your scripts on the HC, even he is not connected to the server.
// (so your scripts won't execute if no HC is connected to the server)
// Use "off" to force server execution.
// --------------------------------------------------------------------------------------------------------
// Replace your
// --- if(!isserver)exitWith{}; ---
// line with
// --- if(elec_stop_exec == 1) exitWith{}; ---
// in your scripts, that you want to execute on the HC.
// --------------------------------------------------------------------------------------------------------
//=========================================================================================================
// ----------------------DONT EDIT BELOW THIS LINE----------------------//
elec_stop_exec = 0;
elec_hc_connected = 0;
_elec_hc_manual = _this select 0;
//Check if switch is set
if ((_elec_hc_manual != "on") && (_elec_hc_manual != "off")) then {
if (!(isServer) && !(hasInterface)) then {
elec_hc_connected = 1;
publicVariable "elec_hc_connected";
} else {
if (!isServer) then{
elec_stop_exec = 1;
};
sleep 3;
if(elec_hc_connected == 0) then {
_elec_hc_manual = "off";
} else {
_elec_hc_manual = "on";
};
};
//IF SET TO "on"
if (_elec_hc_manual == "on") then {
if ((isServer) OR (hasInterface)) then{
elec_stop_exec = 1;
};
};
//IF SET TO "off"
if (_elec_hc_manual == "off") then {
if (!isServer) then{
elec_stop_exec = 1;
};
};
} else {
//IF SET TO "on"
if (_elec_hc_manual == "on") then {
if ((isServer) OR (hasInterface)) then{
elec_stop_exec = 1;
};
};
//IF SET TO "off"
if (_elec_hc_manual == "off") then {
if (!isServer) then{
elec_stop_exec = 1;
};
};
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

View File

@ -0,0 +1,129 @@
// https://community.bistudio.com/wiki/Description.ext#forceRotorLibSimulation
forceRotorLibSimulation = 2;
// https://community.bistudio.com/wiki/Description.ext#disableChannels
disableChannels[] = {0, 2};
author = "Exile Mod Team";
loadScreen = "exile_assets\texture\mod\logo.paa";
onLoadMission= "www.exilemod.com";
OnLoadIntro = "";
OnLoadIntroTime = false;
OnLoadMissionTime = false;
onLoadName = "Exile Mod";
class Header
{
gameType = Sandbox;
minPlayers = 1;
maxPlayers = 100;
};
// DO NOT CHANGE THIS! +
showHUD[] =
{
true, // Scripted HUD (same as showHUD command)
true, // Vehicle + soldier info
true, // Vehicle radar
true, // Vehicle compass
true, // Tank direction indicator
true, // Commanding menu
false, // Group Bar
true // HUD Weapon Cursors
};
respawn = "BASE";
respawnDelay = 120;
respawnDialog = 0;
respawnOnStart = 0;
respawnButton = 1;
respawnTemplates[] = {"Exile"};
// These are broken as fuck, do not use them!
corpseManagerMode = 0;
corpseLimit = 20;
corpseRemovalMinTime = 1800;
corpseRemovalMaxTime = 3600;
wreckManagerMode = 0;
wreckLimit = 2;
wreckRemovalMinTime = 60;
wreckRemovalMaxTime = 360;
// DO NOT CHANGE THIS! -
// When scripted player is enabled, game no longer shows "No player select" error message upon mission start when no player unit is present.
scriptedPlayer = 1;
// Automatically take a free slot in lobby
joinUnassigned = 0;
// Removes all playable units which do not have a human player.
disabledAI = true;
// Disable dropping items while swimming
enableItemsDropping = 0;
// Briefing will still be displayed until all clients are connected and done loading :(
briefing = 0;
// Defines if the debriefing is shown or not at the end of the mission.
debriefing = 0;
// Allow RPT loging
allowFunctionsLog = 1;
// Allows access to the Debug Console outside of the editor during normal gameplay.
// 0 = Default behavior, available only in editor
// 1 = Available in SP and for hosts / logged in admins
// 2 = Available for everyone
enableDebugConsole = 0; // 2 = dangerous in MP
// NO NO NO
allowFunctionsRecompile = 0;
#include "sarge\SAR_define.hpp"
#include "config.cpp"
#include "CfgRemoteExec.hpp"
#include "infiSTAR_Exile_AdminMenu.hpp"
class CfgSounds
{
sounds[] = {bark, growl, whistleFollow, whistleStay, whistleFind, whistleNon};
class bark
{
name="bark";
sound[]={addin\fx\bark.ogg,0.1,1};
titles[] = {};
};
class growl
{
name="growl";
sound[]={addin\fx\growl.ogg,0.1,1};
titles[] = {};
};
class whistleFollow
{
name="whistleFollow";
sound[]={addin\fx\whistleFollow.ogg,0.8,1};
titles[] = {};
};
class whistleStay
{
name="whistleStay";
sound[]={addin\fx\whistleStay.ogg,0.8,1};
titles[] = {};
};
class WhistleFind
{
name="WhistleFind";
sound[]={addin\fx\whistleFind.ogg,0.8,1};
titles[] = {};
};
class whistleNon
{
name="whistleNon";
sound[]={addin\fx\whistleNon.ogg,0.9,1};
titles[] = {};
};
};

View File

@ -0,0 +1,18 @@
elec_HC_detect = ["on"] execVM "elec_HC_detect.sqf"; waitUntil {scriptDone elec_HC_detect};
call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf";
[] execVM "sarge\SAR_AI_init.sqf";
[] execVM "ZOM\init.sqf";
if (isServer) then {
//dogOwner = [];
//[] execVM "addin\dogInit.sqf";
//[] execVM "exile_server\init\server_functions.sqf";
};
if (!isDedicated) then {
[] execVM "rules.sqf";
//_nul = [] execVM "addin\plrInit.sqf";
};
_nul = [] execVM "debug_hint.sqf";

View File

@ -14,7 +14,7 @@
*/
private ["_timeout","_triggername","_tmparr","_markername","_valuearray","_grps_band","_grps_sold","_grps_surv","_trigger"];
if (!isServer) exitWith {};
if (elec_stop_exec == 1) exitWith {};
_timeout = SAR_DESPAWN_TIMEOUT;

View File

@ -14,7 +14,11 @@
*/
private ["_worldname","_startx","_starty","_gridsize_x","_gridsize_y","_gridwidth","_markername","_triggername","_trig_act_stmnt","_trig_deact_stmnt","_trig_cond","_check","_script_handler","_legendname"];
if (!isServer) exitWith {};
if (!isServer && hasInterface) then {
"adjustrating" addPublicVariableEventHandler {((_this select 1) select 0) addRating ((_this select 1) select 1);};
};
if (elec_stop_exec == 1) exitWith {};
if (!isNil "A3XAI_isActive") exitWith {diag_log format ["Sarge's AI System: A3XAI has been detected. Sarge AI is not compatibale with A3XAI. Sarge AI is now exiting!"];};
@ -22,10 +26,6 @@ call compile preprocessFileLineNumbers "sarge\SAR_config.sqf";
diag_log format["Sarge's AI System: Starting Sarge AI version %1",SAR_version];
if (!isServer && hasInterface) then {
"adjustrating" addPublicVariableEventHandler {((_this select 1) select 0) addRating ((_this select 1) select 1);};
};
SAR_AI_hit = compile preprocessFileLineNumbers "sarge\SAR_aihit.sqf";
SAR_AI_killed = compile preprocessFileLineNumbers "sarge\SAR_aikilled.sqf";
SAR_AI_trace = compile preprocessFileLineNumbers "sarge\SAR_trace_entities.sqf";
@ -69,7 +69,7 @@ WEST setFriend [RESISTANCE, 1];
_worldname = toLower worldName;
diag_log format["Sarge's AI System: Setting up SAR_AI for %1",_worldname];
// Lets hope this helps with the AI's view of buildings locality
// Lets hope this helps with the AI's view of object locality
waituntil {PublicServerIsLoaded};
if (SAR_dynamic_spawning) then {

View File

@ -14,7 +14,7 @@
*/
private ["_snipers","_soldiers","_group","_check","_probability","_chance","_playerlist","_triggername","_tmparr","_markername","_player","_valuearray","_max_grps","_rnd_grps","_max_p_grp","_grps_band","_grps_sold","_grps_surv","_grps_upd","_respawn"];
if (!isServer) exitWith {};
if (elec_stop_exec == 1) exitWith {};
_playerlist = _this select 0;
_triggername = _this select 1;

View File

@ -14,7 +14,7 @@
*/
private ["_ai_veh_dmg","_ai_veh","_ai_veh_hitsource","_ai_veh_type","_ai_veh_side","_ai_veh_group_side","_ai_veh_hitsource_group_side","_ai_veh_hitsource_type","_ai_veh_hitsource_name","_ai_veh_hitsource_side","_clientmachine","_player_rating","_shot_veh","_ai_part","_ai_veh_projectile","_message"];
if (!isServer) exitWith {};
if (elec_stop_exec == 1) exitWith {};
_ai_veh = _this select 0;
_ai_part = _this select 1;

View File

@ -0,0 +1,190 @@
/*
# Original #
Sarge AI System 1.5
Created for Arma 2: DayZ Mod
Author: Sarge
https://github.com/Swiss-Sarge
# Fork #
Sarge AI System 2.0+
Modded for Arma 3: Exile Mod
Changes: Dango
http://www.hod-servers.com
*/
private ["_ai","_aikiller","_aikilled_type","_aikilled_side","_aikilled_group_side","_aikiller_group_side","_aikiller_type","_aikiller_name","_aikiller_side","_respect","_message"];
if (elec_stop_exec == 1) exitWith {};
_ai = _this select 0;
_aikiller = _this select 1;
_aikilled_type = typeof _ai;
_aikilled_side = side _ai;
_aikilled_group_side = side (group _ai);
_aikiller_type = typeof _aikiller;
if (!(_aikiller_type in SAR_heli_type) && !("LandVehicle" countType [vehicle _aikiller] > 0)) then {
_aikiller_name = name _aikiller;
} else {
_aikiller_name = _aikiller_type;
};
_aikiller_side = side _aikiller;
_aikiller_group_side = side (group _aikiller);
if (SAR_HITKILL_DEBUG) then {
switch (elec_hc_connected) do {
case 0: {
if (isServer) then {
diag_log format["SAR_HITKILL_DEBUG: AI hit - %2 - Type: %1 Side: %3 Group Side: %4",_aikilled_type,_ai,_aikilled_side,_aikilled_group_side];
diag_log format["SAR_HITKILL_DEBUG: AI attacker - Type: %1 Name: %2 Side: %3 Group Side: %4",_aikiller_type,_aikiller_name, _aikiller_side,_aikiller_group_side];
};
};
case 1: {
if (!isServer && !hasInterface) then {
diag_log format["SAR_HITKILL_DEBUG: AI hit - %2 - Type: %1 Side: %3 Group Side: %4",_aikilled_type,_ai,_aikilled_side,_aikilled_group_side];
diag_log format["SAR_HITKILL_DEBUG: AI attacker - Type: %1 Name: %2 Side: %3 Group Side: %4",_aikiller_type,_aikiller_name, _aikiller_side,_aikiller_group_side];
};
};
};
};
_playerUID = getPlayerUID _aikiller;
if ((!isNull _aikiller) && {(_playerUID != "") && {_aikiller isKindOf "Exile_Unit_Player"}}) then {
if (_aikilled_group_side == SAR_AI_friendly_side) then { // hit a friendly AI
if (SAR_HITKILL_DEBUG) then {
switch (elec_hc_connected) do {
case 0: {
if (isServer) then {
diag_log format["SAR_HITKILL_DEBUG: friendly AI was hit by Player %1",_aikiller];
};
};
case 1: {
if (!isServer && !hasInterface) then {
diag_log format["SAR_HITKILL_DEBUG: friendly AI was hit by Player %1",_aikiller];
};
};
};
};
if ((random 100) < 3) then {
if (SAR_KILL_MSG) then {
_message = format["Sarge AI: Dammit %1! You are firing on a friendly group check your fire!",_aikiller_name];
_message remoteExec ["systemChat",0];
};
} else {
if ((random 100) < 3) then {
if (SAR_KILL_MSG) then {
_message = format["Sarge AI: %1, this was the last time you shot one of our team! We are coming for you!",_aikiller_name];
_message remoteExec ["systemChat",0];
};
};
};
_playerRespect = _aikiller getVariable ["ExileScore", 0];
_playerMoney = _aikiller getVariable ["ExileMoney", 0];
_repChange = SAR_surv_kill_value / 10;
_playerRespect = _playerRespect - _repChange;
_aikiller setVariable ["ExileScore",_playerRespect];
ExileClientPlayerScore = _playerRespect;
(owner _aikiller) publicVariableClient "ExileClientPlayerScore";
ExileClientPlayerScore = nil;
format ["setAccountMoneyAndRespect:%1:%2:%3", _playerMoney, _playerRespect, _playerUID] call ExileServer_system_database_query_fireAndForget;
if (SAR_HITKILL_DEBUG) then {
switch (elec_hc_connected) do {
case 0: {
if (isServer) then {
diag_log format["SAR_HITKILL_DEBUG: Adjusting respect for survivor hit by %2 for %1",_aikiller,(SAR_surv_kill_value/10)];
};
};
case 1: {
if (!isServer && !hasInterface) then {
diag_log format["SAR_HITKILL_DEBUG: Adjusting respect for survivor hit by %2 for %1",_aikiller,(SAR_surv_kill_value/10)];
};
};
};
};
if (rating _aikiller > -10000) then { //check if shooter is not already marked as enemy
if (SAR_HITKILL_DEBUG) then {
switch (elec_hc_connected) do {
case 0: {
if (isServer) then {
diag_log format["SAR_HITKILL_DEBUG: Marking Player %1 as an enemy for a friendly AI hit!",_aikiller];
};
};
case 1: {
if (!isServer && !hasInterface) then {
diag_log format["SAR_HITKILL_DEBUG: Marking Player %1 as an enemy for a friendly AI hit!",_aikiller];
};
};
};
};
_aikiller addRating -10000;
};
group _ai reveal _aikiller;
{
_x doTarget _aikiller;
_x doFire _aikiller;
} foreach units group _ai;
};
if (_aikilled_group_side == SAR_AI_unfriendly_side) then { // hit an unfriendly AI
if (SAR_HITKILL_DEBUG) then {
switch (elec_hc_connected) do {
case 0: {
if (isServer) then {
diag_log format["SAR_HITKILL_DEBUG: unfriendly AI was hit by Player %1",_aikiller];
};
};
case 1: {
if (!isServer && !hasInterface) then {
diag_log format["SAR_HITKILL_DEBUG: unfriendly AI was hit by Player %1",_aikiller];
};
};
};
};
_playerRespect = _aikiller getVariable ["ExileScore", 0];
_playerMoney = _aikiller getVariable ["ExileMoney", 0];
_repChange = SAR_surv_kill_value / 10;
_playerRespect = _playerRespect + _repChange;
_aikiller setVariable ["ExileScore",_playerRespect];
ExileClientPlayerScore = _playerRespect;
(owner _aikiller) publicVariableClient "ExileClientPlayerScore";
ExileClientPlayerScore = nil;
format ["setAccountMoneyAndRespect:%1:%2:%3", _playerMoney, _playerRespect, _playerUID] call ExileServer_system_database_query_fireAndForget;
if (SAR_HITKILL_DEBUG) then {
switch (elec_hc_connected) do {
case 0: {
if (isServer) then {
diag_log format["SAR_HITKILL_DEBUG: Adjusting respect for bandit hit by %2 for %1",_aikiller,(SAR_band_kill_value/10)];
};
};
case 1: {
if (!isServer && !hasInterface) then {
diag_log format["SAR_HITKILL_DEBUG: Adjusting respect for bandit hit by %2 for %1",_aikiller,(SAR_band_kill_value/10)];
};
};
};
};
};
};

View File

@ -14,7 +14,7 @@
*/
private ["_message","_ai","_aikiller","_aikilled_type","_aikilled_side","_aikilled_group_side","_aikiller_group_side","_aikiller_type","_aikiller_name","_aikiller_side","_respect","_humankills","_banditkills","_tmp","_sphere_alpha","_sphere_red","_sphere_green","_sphere_blue","_obj_text_string","_ai_type","_ai_killer_type"];
if (!isServer) exitWith {};
if (elec_stop_exec == 1) exitWith {};
_ai = _this select 0;
_aikiller = _this select 1;
@ -25,32 +25,44 @@ _aikilled_group_side = side (group _ai);
_aikiller_type = typeof _aikiller;
if (!(_aikiller_type in SAR_heli_type) && !("LandVehicle" countType [vehicle _aikiller]>0)) then {
if (!(_aikiller_type in SAR_heli_type) && !("LandVehicle" countType [vehicle _aikiller] > 0)) then {
_aikiller_name = name _aikiller;
} else {
_aikiller_name = _aikiller_type;
};
_aikiller_side = side _aikiller;
_aikiller_group_side = side (group _aikiller);
// retrieve AI type from the killed AI
_ai_type = _ai getVariable ["SAR_AI_type",""];
// retrieve AI type from the killer AI
_ai_killer_type = _aikiller getVariable ["SAR_AI_type",""];
_aikiller_side = side _aikiller;
_aikiller_group_side = side (group _aikiller);
_ai_type = _ai getVariable ["SAR_AI_type",""];
_ai_killer_type = _aikiller getVariable ["SAR_AI_type",""];
if (SAR_KILL_MSG) then {
if(isPlayer _aikiller) then {
if (isPlayer _aikiller) then {
_message = format["A %2 was killed by Player: %1",_aikiller_name,_ai_type];
//[nil, nil, rspawn, [[West,"airbase"], _message], { (_this select 0) sideChat (_this select 1) }] call RE;
_message remoteExec ["systemChat",0];
};
if(!isPlayer _aikiller && !(isNull _aikiller)) then {
_message = format["A %1 was killed by a %2!",_ai_type,_ai_killer_type];
diag_log _message;
_message remoteExec ["systemChat",0];
};
};
if (SAR_HITKILL_DEBUG) then {
diag_log format["SAR_HITKILL_DEBUG: AI killed - Type: %1 Side: %2 Group Side: %3",_aikilled_type, _aikilled_side,_aikilled_group_side];
diag_log format["SAR_HITKILL_DEBUG: AI Killer - Type: %1 Name: %2 Side: %3 Group Side: %4",_aikiller_type,_aikiller_name, _aikiller_side,_aikiller_group_side];
switch (elec_hc_connected) do {
case 0: {
if (isServer) then {
diag_log format["SAR_HITKILL_DEBUG: AI killed - Type: %1 Side: %2 Group Side: %3",_aikilled_type, _aikilled_side,_aikilled_group_side];
diag_log format["SAR_HITKILL_DEBUG: AI Killer - Type: %1 Name: %2 Side: %3 Group Side: %4",_aikiller_type,_aikiller_name, _aikiller_side,_aikiller_group_side];
};
};
case 1: {
if (!isServer && !hasInterface) then {
diag_log format["SAR_HITKILL_DEBUG: AI killed - Type: %1 Side: %2 Group Side: %3",_aikilled_type, _aikilled_side,_aikilled_group_side];
diag_log format["SAR_HITKILL_DEBUG: AI Killer - Type: %1 Name: %2 Side: %3 Group Side: %4",_aikiller_type,_aikiller_name, _aikiller_side,_aikiller_group_side];
};
};
};
};
_playerUID = getPlayerUID _aikiller;
@ -59,7 +71,20 @@ if ((!isNull _aikiller) && {(_playerUID != "") && {_aikiller isKindOf "Exile_Uni
if (_aikilled_group_side == SAR_AI_friendly_side) then {
if (SAR_DEBUG) then {diag_log format ["Sarge's AI System: Adjusting respect for survivor or soldier kill by %2 for %1",_aikiller,SAR_surv_kill_value];};
if (SAR_DEBUG) then {
switch (elec_hc_connected) do {
case 0: {
if (isServer) then {
diag_log format ["Sarge's AI System: Adjusting respect for survivor or soldier kill by %2 for %1",_aikiller,SAR_surv_kill_value];
};
};
case 1: {
if (!isServer && !hasInterface) then {
diag_log format ["Sarge's AI System: Adjusting respect for survivor or soldier kill by %2 for %1",_aikiller,SAR_surv_kill_value];
};
};
};
};
_playerRespect = _aikiller getVariable ["ExileScore", 0];
_playerMoney = _aikiller getVariable ["ExileMoney", 0];
@ -79,24 +104,35 @@ if ((!isNull _aikiller) && {(_playerUID != "") && {_aikiller isKindOf "Exile_Uni
format ["setAccountMoneyAndRespect:%1:%2:%3", _playerMoney, _playerRespect, _playerUID] call ExileServer_system_database_query_fireAndForget;
if (SAR_log_AI_kills) then {
_humankills = _aikiller getVariable["humanKills",0];
_aikiller setVariable["humanKills",_humankills+1,true];
_friendlyCount = profileNamespace getVariable["SAR_FRIENDLY_KILLS",0];
_aikiller setVariable ["SAR_FRIENDLY_KILLS",(_friendlyCount + 1),true];
};
if ((random 100) < 3) then {
_message = format["Sarge AI: %1 killed a friendly AI - sending reinforcements!",_aikiller_name];
//[nil, nil, rspawn, [[West,"airbase"], _message], { (_this select 0) sideChat (_this select 1) }] call RE;
_message remoteExec ["systemChat",0];
} else {
if ((random 100) < 3) then {
_message = format["Sarge AI: Tango down ... we offer a decent reward for the head of %1!",_aikiller_name];
//[nil, nil, rspawn, [[West,"airbase"], _message], { (_this select 0) sideChat (_this select 1) }] call RE;
_message remoteExec ["systemChat",0];
};
};
};
if (_aikilled_group_side == SAR_AI_unfriendly_side) then {
if (SAR_DEBUG) then {diag_log format ["Sarge's AI System: Adjusting respect for bandit kill by %2 for %1",_aikiller,SAR_band_kill_value];};
if (SAR_DEBUG) then {
switch (elec_hc_connected) do {
case 0: {
if (isServer) then {
diag_log format ["Sarge's AI System: Adjusting respect for bandit kill by %2 for %1",_aikiller,SAR_band_kill_value];
};
};
case 1: {
if (!isServer && !hasInterface) then {
diag_log format ["Sarge's AI System: Adjusting respect for bandit kill by %2 for %1",_aikiller,SAR_band_kill_value];
};
};
};
};
_playerRespect = _aikiller getVariable ["ExileScore", 0];
_playerMoney = _aikiller getVariable ["ExileMoney", 0];
@ -116,18 +152,16 @@ if ((!isNull _aikiller) && {(_playerUID != "") && {_aikiller isKindOf "Exile_Uni
format ["setAccountMoneyAndRespect:%1:%2:%3", _playerMoney, _playerRespect, _playerUID] call ExileServer_system_database_query_fireAndForget;
if(SAR_log_AI_kills) then {
_banditkills = _aikiller getVariable["banditKills",0];
_aikiller setVariable["banditKills",_banditkills+1,true];
_hostileCount = profileNamespace getVariable["SAR_HOSTILE_KILLS",0];
_aikiller setVariable ["SAR_HOSTILE_KILLS",(_hostileCount + 1),true];
};
if ((random 100) < 3) then {
_message = format["Sarge AI: Nice bandit kill %1!",_aikiller_name];
//[nil, nil, rspawn, [[West,"airbase"], _message], { (_this select 0) sideChat (_this select 1) }] call RE;
_message remoteExec ["systemChat",0];
} else {
if ((random 100) < 3) then {
_message = format["Sarge AI: Another bandit down ... %1 is going to be the root cause of bandit extinction :]",_aikiller_name];
//[nil, nil, rspawn, [[West,"airbase"], _message], { (_this select 0) sideChat (_this select 1) }] call RE;
_message remoteExec ["systemChat",0];
};
};

View File

@ -16,11 +16,11 @@
SAR_version = "2.1.0";
/* Debug & RPT Settings */
SAR_DEBUG = false; // Set to true for RPT info on AI
SAR_DEBUG = true; // Set to true for RPT info on AI
SAR_EXTREME_DEBUG = false; // Set to true for RPT info on damn near everything
SAR_HITKILL_DEBUG = false; // Set to true for RPT info on AI shooting and killing
SAR_log_AI_kills = false; // Set to true for kill logging by variable. *These variables do not save to the database currently*
SAR_KILL_MSG = false; // Set to true for announcing AI kills to the server *This is still in development*
SAR_HITKILL_DEBUG = true; // Set to true for RPT info on AI shooting and killing
SAR_log_AI_kills = true; // Set to true for kill logging by variable. *These variables do not save to the database currently*
SAR_KILL_MSG = true; // Set to true for announcing AI kills to the server *This is still in development*
/* Dynamic AI Settings */
SAR_dynamic_spawning = true; // Turn dynamic grid spawns on or off
@ -44,7 +44,7 @@ SAR_DETECT_FROM_VEHICLE_INTERVAL = 5; // How often AI can detect hostile AI &
SAR_chance_bandits = 75; // Chance to spawn 1-100%
SAR_chance_soldiers = 25; // Chance to spawn 1-100%
SAR_chance_survivors = 50; // Chance to spawn 1-100%
SAR_max_grps_bandits = 4; // Total groups per grid
SAR_max_grps_bandits = 2; // Total groups per grid
SAR_max_grps_soldiers = 2; // Total groups per grid
SAR_max_grps_survivors = 2; // Total groups per grid
SAR_max_grpsize_bandits = 2; // Size of the group
@ -130,7 +130,9 @@ SAR_heli_type = ["B_Heli_Light_01_stripped_F"];
/* -------------------------------- Do Not Edit Below. If you do the AI will not work properly. -------------------------------- */
SAR_HC = true;
/* -------------------------------- Do Not Edit Below. If you do the AI will not work properly. -------------------------------- */
/* -------------------------------- Do Not Edit Below. If you do the AI will not work properly. -------------------------------- */
SAR_HC = false;
SAR_AI_friendly_side = RESISTANCE;
SAR_AI_unfriendly_side = EAST;
SAR_leader_number = 0;

View File

@ -14,7 +14,7 @@
*/
private["_sizeX","_sizeY","_snipers","_rifleMen","_sizeOfBase","_marker","_markername","_tMark","_flagPoles","_baseLevel","_baseName"];
if (!isServer) exitWith {};
if (elec_stop_exec == 1) exitWith {};
_flagPoles = nearestObjects [getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition"), ["Exile_Construction_Flag_Static"], 25000];

View File

@ -14,7 +14,7 @@
*/
private ["_ai","_sleeptime","_veh_weapons","_vehicle","_weapons","_reloadmag","_magazintypes","_legit_weapon","_weap_obj"];
if (!isServer) exitWith {};
if (elec_stop_exec == 1) exitWith {};
_ai = _this select 0;

View File

@ -14,7 +14,7 @@
*/
private ["_leadername","_type","_patrol_area_name","_grouptype","_snipers","_riflemen","_action","_side","_leaderList","_riflemenlist","_sniperlist","_rndpos","_group","_leader","_cond","_respawn","_leader_weapon_names","_leader_items","_leader_tools","_soldier_weapon_names","_soldier_items","_soldier_tools","_sniper_weapon_names","_sniper_items","_sniper_tools","_leaderskills","_riflemanskills","_sniperskills","_ups_para_list","_respawn_time","_argc","_ai_type"];
if (!isServer) exitWith {};
if (elec_stop_exec == 1) exitWith {};
_patrol_area_name = _this select 0;
_grouptype = _this select 1;

View File

@ -14,7 +14,7 @@
*/
private ["_sizeOfBase","_authorizedGateCodes","_authorizedUID","_flagPole","_leadername","_type","_patrol_area_name","_grouptype","_snipers","_riflemen","_action","_side","_leaderList","_riflemenlist","_sniperlist","_rndpos","_group","_leader","_cond","_respawn","_leader_weapon_names","_leader_items","_leader_tools","_soldier_weapon_names","_soldier_items","_soldier_tools","_sniper_weapon_names","_sniper_items","_sniper_tools","_leaderskills","_riflemanskills","_sniperskills","_ups_para_list","_respawn_time","_argc","_ai_type"];
if (!isServer) exitWith {};
if (elec_stop_exec == 1) exitWith {};
diag_log "Sarge AI System: Territory gaurds are initializing now.";

View File

@ -14,7 +14,7 @@
*/
private ["_ai_type","_riflemenlist","_side","_leader_group","_patrol_area_name","_rndpos","_groupheli","_heli","_leader","_man2heli","_man3heli","_argc","_grouptype","_respawn","_leader_weapon_names","_leader_items","_leader_tools","_soldier_weapon_names","_soldier_items","_soldier_tools","_leaderskills","_sniperskills","_ups_para_list","_type","_error","_respawn_time","_leadername"];
if (!isServer) exitWith {};
if (elec_stop_exec == 1) exitWith {};
_patrol_area_name = _this select 0;
_argc = count _this;

View File

@ -14,7 +14,7 @@
*/
private ["_riflemenlist","_side","_leader_group","_patrol_area_name","_rndpos","_argc","_grouptype","_respawn","_leader_weapon_names","_leader_items","_leader_tools","_soldier_weapon_names","_soldier_items","_soldier_tools","_leaderskills","_sniperskills","_ups_para_list","_sniperlist","_riflemanskills","_vehicles","_error","_vehicles_crews","_leader","_leadername","_snipers","_riflemen","_veh","_veh_setup","_forEachIndex","_groupvehicles","_sniper_weapon_names","_sniper_items","_sniper_tools","_leader_veh_crew","_type","_respawn_time","_ai_type"];
if (!isServer) exitWith {};
if (elec_stop_exec == 1) exitWith {};
_patrol_area_name = _this select 0;

View File

@ -14,7 +14,7 @@
*/
private ["_baseOwner","_attackAll","_friendlyPlayers","_ai","_entity_array"];
if (isServer || !hasInterface) exitWith {}; // Do not execute on server or any headless client(s)
if (isServer OR !hasInterface) exitWith {}; // Do not execute on server or any headless client(s)
_ai = _this select 0;

View File

@ -14,7 +14,7 @@
*/
private ["_ai","_entity_array","_humanity","_humanitylimit","_sleeptime","_detectrange","_tracewhat","_player_rating","_clientmachine"];
if (!isServer) exitWith {};
if (elec_stop_exec == 1) exitWith {};
_ai = _this select 0;
_tracewhat = "CAManBase";

View File

@ -42,7 +42,7 @@ this number is randomized
_type = _this select 0;
// grid definition for the automatic spawn system
if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
if ((_type == "dynamic") && SAR_dynamic_spawning) then {
diag_log format["SAR_AI: Dynamic spawning definition / adjustments started"];
@ -61,7 +61,7 @@ if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
diag_log format["SAR_AI: Dynamic spawning definition / adjustments finished"];
};
if (_type isEqualTo "static") then {
if (_type == "static") then {
// Definition of area markers for static spawns
diag_log format["SAR_AI: Static spawning area definition started"];

View File

@ -45,7 +45,7 @@ this number is randomized
_type = _this select 0;
// grid definition for the automatic spawn system
if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
if ((_type == "dynamic") && SAR_dynamic_spawning) then {
@ -117,7 +117,7 @@ if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
};
if (_type isEqualTo "static") then {
if (_type == "static") then {
//
// Definition of area markers for static spawns
//

View File

@ -46,13 +46,13 @@ this number is randomized
_type = _this select 0;
// grid definition for the automatic spawn system
if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
if ((_type == "dynamic") && SAR_dynamic_spawning) then {
// add entries here ...
};
if (_type isEqualTo "static") then {
if (_type == "static") then {
// ---------------------------------------------------------------
// Definition of area markers for static spawns
// ---------------------------------------------------------------

View File

@ -47,7 +47,7 @@ this number is randomized
_type = _this select 0;
// grid definition for the automatic spawn system
if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
if ((_type == "dynamic") && SAR_dynamic_spawning) then {
_check = [["max_grps","rnd_grps","max_p_grp"],[[1,0,2],[45,0,45],[0,0,0]],"SAR_area_0_0"] call SAR_AI_mon_upd; //Pintosa, Alma, Corda, Mercadio
_check = [["max_grps","rnd_grps","max_p_grp"],[[1,0,2],[45,0,45],[0,0,0]],"SAR_area_1_0"] call SAR_AI_mon_upd; //Verto, Medlina
@ -92,7 +92,7 @@ if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
_check = [["max_grps","rnd_grps","max_p_grp"],[[2,1,1],[45,40,35],[2,1,0]],"SAR_area_5_5"] call SAR_AI_mon_upd; //NE Island (north)
};
if (_type isEqualTo "static") then {
if (_type == "static") then {
_this = createMarker ["SAR_patrol_prison", [3024.6147, 7969.0239]];
_this setMarkerShape "RECTANGLE";

View File

@ -46,7 +46,7 @@ this number is randomized
_type = _this select 0;
// grid definition for the automatic spawn system
if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
if ((_type == "dynamic") && SAR_dynamic_spawning) then {
// Lindwedel & mellendorf
_check = [["max_grps","rnd_grps","max_p_grp"],[[1,1,1],[3,1,1],[3,3,3]],"SAR_area_0_0"] call SAR_AI_mon_upd;
@ -112,7 +112,7 @@ if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
_check = [["max_grps","rnd_grps","max_p_grp"],[[1,1,1],[9,3,3],[4,4,4]],"SAR_area_4_4"] call SAR_AI_mon_upd;
};
if (_type isEqualTo "static") then {
if (_type == "static") then {
// ---------------------------------------------------------------
// Definition of area markers for static spawns
// ---------------------------------------------------------------

View File

@ -44,7 +44,7 @@ this number is randomized
_type = _this select 0;
// grid definition for the automatic spawn system
if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
if ((_type == "dynamic") && SAR_dynamic_spawning) then {
// West Point, 2 bandit groups, 1 soldier groups, 2 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
_check = [["max_grps","rnd_grps","max_p_grp"],[[2,1,2],[50,75,100],[2,3,3]],"SAR_area_0_0"] call SAR_AI_mon_upd;
@ -80,7 +80,7 @@ if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
_check = [["max_grps","rnd_grps","max_p_grp"],[[2,0,2],[75,0,75],[3,0,3]],"SAR_area_2_1"] call SAR_AI_mon_upd;
};
if (_type isEqualTo "static") then {
if (_type == "static") then {
// ---------------------------------------------------------------
// Definition of area markers for static spawns
// ---------------------------------------------------------------

View File

@ -46,13 +46,13 @@ this number is randomized
_type = _this select 0;
// grid definition for the automatic spawn system
if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
if ((_type == "dynamic") && SAR_dynamic_spawning) then {
// add entries here ...
};
if (_type isEqualTo "static") then {
if (_type == "static") then {
// ---------------------------------------------------------------
// Definition of area markers for static spawns
// ---------------------------------------------------------------

View File

@ -47,12 +47,12 @@ this number is randomized
_type = _this select 0;
// grid definition for the automatic spawn system
if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
if ((_type == "dynamic") && SAR_dynamic_spawning) then {
// add entries here ...
};
if (_type isEqualTo "static") then {
if (_type == "static") then {
// ---------------------------------------------------------------
// Definition of area markers for static spawns
// ---------------------------------------------------------------

View File

@ -47,7 +47,7 @@ this number is randomized
_type = _this select 0;
// grid definition for the automatic spawn system
if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
if ((_type == "dynamic") && SAR_dynamic_spawning) then {
// KNIN, 0 bandit groups, 2 soldier groups, 1 survivor groups - spawn probability ba,so,su - maximum group members ba,so,su
_check = [["max_grps","rnd_grps","max_p_grp"],[[0,2,1],[0,75,100],[0,4,3]],"SAR_area_0_0"] call SAR_AI_mon_upd;
@ -178,7 +178,7 @@ if ((_type isEqualTo "dynamic") && SAR_dynamic_spawning) then {
};
if (_type isEqualTo "static") then {
if (_type == "static") then {
// ---------------------------------------------------------------
// Definition of area markers for static spawns
// ---------------------------------------------------------------

Some files were not shown because too many files have changed in this diff Show More