mirror of
https://github.com/Teh-Dango/Sarge-AI.git
synced 2024-08-30 16:32:11 +00:00
Cleanup
Code cleanup, minor fixes...
This commit is contained in:
parent
c5e98f17e6
commit
4b8641b99c
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0+
|
Sarge AI System 2.0+
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
https://www.hod-servers.com
|
https://www.hod-servers.com
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0+
|
Sarge AI System 2.0+
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
https://www.hod-servers.com
|
https://www.hod-servers.com
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0+
|
Sarge AI System 2.0+
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
https://www.hod-servers.com
|
https://www.hod-servers.com
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0+
|
Sarge AI System 2.0+
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
https://www.hod-servers.com
|
https://www.hod-servers.com
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0+
|
Sarge AI System 2.0+
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
https://www.hod-servers.com
|
https://www.hod-servers.com
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0+
|
Sarge AI System 2.0+
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
https://www.hod-servers.com
|
https://www.hod-servers.com
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0+
|
Sarge AI System 2.0+
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
https://www.hod-servers.com
|
https://www.hod-servers.com
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0+
|
Sarge AI System 2.0+
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
https://www.hod-servers.com
|
https://www.hod-servers.com
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0+
|
Sarge AI System 2.0+
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
http://www.hod-servers.com
|
http://www.hod-servers.com
|
||||||
|
|
||||||
|
@ -7,25 +7,23 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0+
|
Sarge AI System 2.0+
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
http://www.hod-servers.com
|
http://www.hod-servers.com
|
||||||
|
|
||||||
*/
|
*/
|
||||||
private ["_ai","_entity_array","_sleeptime","_detectrange"];
|
private ["_ai","_entity_array","_sleeptime","_detectrange"];
|
||||||
|
|
||||||
if (isServer || !hasInterface) exitWith {}; // Do not execute on server or any headless client(s)
|
// Prevent execution on server or dedicated clients
|
||||||
|
if (isServer || !hasInterface) exitWith {};
|
||||||
|
|
||||||
_ai = _this select 0;
|
_ai = _this select 0;
|
||||||
|
|
||||||
_detectrange = SAR_DETECT_HOSTILE;
|
|
||||||
_respectlimit = SAR_RESPECT_HOSTILE_LIMIT;
|
|
||||||
_sleeptime = SAR_DETECT_INTERVAL;
|
|
||||||
|
|
||||||
while {alive _ai} do {
|
while {alive _ai} do {
|
||||||
_entity_array = (position _ai) nearEntities ["CAManBase",_detectrange];
|
_entity_array = (position _ai) nearEntities ["CAManBase",SAR_DETECT_HOSTILE];
|
||||||
{
|
{
|
||||||
if(vehicle _ai == _ai) then { // AI is not in a vehicle, so we trace Zeds
|
// Only do this for zombies (WIP)
|
||||||
|
/* if (vehicle _ai == _ai) then {
|
||||||
if (_x isKindof "civilclass") then {
|
if (_x isKindof "civilclass") then {
|
||||||
if(rating _x > -10000) then {
|
if(rating _x > -10000) then {
|
||||||
_x addrating -10000;
|
_x addrating -10000;
|
||||||
@ -34,16 +32,17 @@ while {alive _ai} do {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
}; */
|
||||||
if(isPlayer _x && {vehicle _x == _x}) then { // only do this for players not in vehicles
|
// Only do this for players not in vehicles
|
||||||
_respect = _x getVariable ["ExileScore",0];
|
if (isPlayer _x && (vehicle _x == _x)) then {
|
||||||
If (_respect < _respectlimit && {rating _x > -10000}) then {
|
//_respect = _x getVariable ["ExileScore",0];
|
||||||
if(SAR_EXTREME_DEBUG) then {
|
if (rating player < SAR_RESPECT_HOSTILE_LIMIT && (rating _x > -10000)) then {
|
||||||
|
if (SAR_EXTREME_DEBUG) then {
|
||||||
diag_log format["SAR EXTREME DEBUG: reducing rating (trace_entities) for player: %1", _x];
|
diag_log format["SAR EXTREME DEBUG: reducing rating (trace_entities) for player: %1", _x];
|
||||||
};
|
};
|
||||||
_x addrating -10000;
|
_x addrating -10000;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
} forEach _entity_array;
|
} forEach _entity_array;
|
||||||
sleep _sleeptime;
|
sleep SAR_DETECT_INTERVAL;
|
||||||
};
|
};
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0+
|
Sarge AI System 2.0+
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
https://www.hod-servers.com
|
https://www.hod-servers.com
|
||||||
|
|
||||||
|
@ -7,32 +7,28 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0+
|
Sarge AI System 2.0+
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
https://www.hod-servers.com
|
https://www.hod-servers.com
|
||||||
|
|
||||||
*/
|
*/
|
||||||
private ["_ai","_entity_array","_humanity","_humanitylimit","_sleeptime","_detectrange","_tracewhat","_player_rating","_clientmachine"];
|
private ["_ai","_entity_array","_tracewhat","_player_rating","_clientmachine"];
|
||||||
|
|
||||||
if (!isServer) exitWith {};
|
if (!isServer) exitWith {};
|
||||||
|
|
||||||
_ai = _this select 0;
|
_ai = _this select 0;
|
||||||
_tracewhat = "CAManBase";
|
_tracewhat = "CAManBase";
|
||||||
|
|
||||||
_detectrange = SAR_DETECT_HOSTILE_FROM_VEHICLE;
|
|
||||||
_respectlimit = SAR_RESPECT_HOSTILE_LIMIT;
|
|
||||||
_sleeptime = SAR_DETECT_FROM_VEHICLE_INTERVAL;
|
|
||||||
|
|
||||||
while {alive _ai} do {
|
while {alive _ai} do {
|
||||||
_entity_array = (position _ai) nearEntities [_tracewhat, _detectrange];
|
_entity_array = (position _ai) nearEntities [_tracewhat, SAR_DETECT_HOSTILE_FROM_VEHICLE];
|
||||||
{
|
{
|
||||||
if(isPlayer _x && {vehicle _x == _x}) then { // only do that for players that are not in a vehicle
|
if (isPlayer _x && {vehicle _x == _x}) then { // only do that for players that are not in a vehicle
|
||||||
|
|
||||||
_player_rating = rating _x;
|
_player_rating = rating _x;
|
||||||
_respect = _x getVariable ["ExileScore",0];
|
//_respect = _x getVariable ["ExileScore",0];
|
||||||
If (_respect < _respectlimit && {_player_rating > -10000}) then {
|
if (rating player < SAR_RESPECT_HOSTILE_LIMIT && (_player_rating > -10000)) then {
|
||||||
|
|
||||||
if(SAR_EXTREME_DEBUG) then {
|
if (SAR_EXTREME_DEBUG) then {
|
||||||
diag_log format["SAR EXTREME DEBUG: reducing rating (trace_from_vehicle) for player: %1", _x];
|
diag_log format["SAR EXTREME DEBUG: reducing rating (trace_from_vehicle) for player: %1", _x];
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -50,5 +46,5 @@ while {alive _ai} do {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
} forEach _entity_array;
|
} forEach _entity_array;
|
||||||
sleep _sleeptime;
|
sleep SAR_DETECT_FROM_VEHICLE_INTERVAL;
|
||||||
};
|
};
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0+
|
Sarge AI System 2.0+
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
http://www.hod-servers.com
|
http://www.hod-servers.com
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0+
|
Sarge AI System 2.0+
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
https://www.hod-servers.com
|
https://www.hod-servers.com
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# Fork #
|
# Fork #
|
||||||
Sarge AI System 2.0pushBack
|
Sarge AI System 2.0pushBack
|
||||||
Modded for Arma 3: Exile Mod
|
Modded for Arma 3: Epoch Mod
|
||||||
Changes: Dango
|
Changes: Dango
|
||||||
https://www.hod-servers.com
|
https://www.hod-servers.com
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user