Jump to content

[WIP][REVIVAL]SargeAI Genesys


ViktorReznov

Recommended Posts

So here I am going to post what I have been working on for quite a while now, well started some 4 months ago, and have nearly completely working. I am hoping that posting this here will inspire the community to assist in bringing back this absolute badass ai script to life.

This is the stock 1.5.2 SargeAI Framework that you can still download. Right out of the box it does "function" in Epoch 1.0.6.1 but with an extreme amount of errors. I have already modified this version to eliminate most errors, however, most of the Urban Patrol Script is broken. Here is where we begin to demolish the myth that Sarge is dead!

https://github.com/Arstan13/SargeAI-Genesys

for install...

Spoiler

in init.sqf

within the (isServer) block, underneath the execVM "\z\addons\dayz_server\traders\chernarus11.sqf"; //Add trader agents add call compile preprocessfile "addons\SHK_pos\shk_pos_init.sqf";

at the bottom add execVM "addons\UPSMON\scripts\Init_UPSMON.sqf"; [] execVM "addons\SARGE\SAR_AI_init.sqf";

in server.pbo\system\scheduler\sched_safetyVehicle.sqf line 4 add && (vehicle _x getVariable ["Sarge",0] != 1) to if (vehicle _x != _x && !(vehicle _x in dayz_serverObjectMonitor) && !((typeOf vehicle _x) in DZE_safeVehicle)) then { so it looks like if (vehicle _x != _x && !(vehicle _x in dayz_serverObjectMonitor) && !((typeOf vehicle _x) in DZE_safeVehicle) && (vehicle _x getVariable ["EAT_Veh",0] !=1) && (vehicle _x getVariable ["Sarge",0] != 1) && !((typeOf vehicle _x) in DZE_safeStatic)) then {

in server.pbo\system\scheduler\sched_corpses.sqf line 45 add && !(_x getVariable ["SAR_protect",false]) to if (_x getVariable["bodyName",""] != "") then { so it looks like if ((_x getVariable["bodyName",""] != "") && !(_x getVariable ["SAR_protect",false])) then {

this is nearly fully working. Ive had very limited number of errors to include

Spoiler

Error in expression <c getVariable ["UPSMON_grpid","0"]); if(_grpid==0) then{ KRON_UPS_Instances = KR> 1:01:48 Error position: <_grpid==0) then{ KRON_UPS_Instances = KR> 1:01:48 Error Undefined variable in expression: _grpid 1:01:48 File mpmissions\DayZ_Epoch_11.Chernarus\addons\UPSMON\scripts\upsmon.sqf, line 184

1:01:49 "Leader is still alive: SAR_leader_14" 1:01:50 "Assigned new leader: " Error in expression <R_AI_debug; };

_npc setVehicleVarname _leadername; _npc setVariable ["SAR_lea> 1:01:50 Error position: <_leadername; _npc setVariable ["SAR_lea> 1:01:50 Error Undefined variable in expression: _leadername 1:01:50 File mpmissions\DayZ_Epoch_11.Chernarus\addons\UPSMON\scripts\UPSMON\common\MON_functions.sqf, line 2071

Error in expression <,2] call MON_nearestSoldiers; if (count _vehicles>0) then { _npc = [_vehicles se> 1:01:54 Error position: <_vehicles>0) then { _npc = [_vehicles se> 1:01:54 Error Undefined variable in expression: _vehicles 1:01:54 File mpmissions\DayZ_Epoch_11.Chernarus\addons\UPSMON\scripts\upsmon.sqf, line 298

 

 3:58:34 "SAR_AI: Static Spawning for vehicle patrols finished"
 3:58:34 "SAR_AI: Dynamic and static spawning finished"
 3:58:34 "SAR_AI: applying vehicle fix ..."
 3:58:34 "Leader is still alive: SAR_leader_4"
 3:58:34 "Leader is still alive: SAR_leader_4"
 3:58:34 "Leader is still alive: SAR_leader_4"
 3:58:38 "Leader is still alive: SAR_leader_11"
 3:58:39 "Leader is still alive: SAR_leader_9"
 3:58:39 Warning: looped for animation: ca\anims\characters\data\anim\sdr\mov\erc\stp\non\non\amovpercmstpsnonwnondnon_amovpercmstpsraswpstdnon_end.rtm differs (looped now 0)! MoveName: amovpercmstpsnonwnondnon_amovpercmstpsraswpstdnon_end
 3:58:40 "Leader is still alive: SAR_leader_10"
 3:58:40 "Leader is still alive: SAR_leader_11"
 3:58:41 "Assigned new leader: SAR_leader_12"
 3:58:41 "Leader is still alive: SAR_leader_9"
 3:58:41 "Leader is still alive: SAR_leader_9"
 3:58:41 "Leader is still alive: R 1-1-I:2"
 3:58:41 "Leader is still alive: SAR_leader_5"
 3:58:41 Error in expression <KRON_UPS_CIV_SURRENDER>
 3:58:41   Error position: <KRON_UPS_CIV_SURRENDER>
 3:58:41   Error Undefined variable in expression: kron_ups_civ_surrender
 3:58:41 "Leader is still alive: SAR_leader_5"
 3:58:41 "Leader is still alive: SAR_leader_10"
 3:58:41 "Leader is still alive: SAR_leader_10"
 3:58:41 "Leader is still alive: SAR_leader_4"
 3:58:52 "Leader is still alive: SAR_leader_2"
 3:58:52 "Leader is still alive: SAR_leader_2"
 3:58:52 "Leader is still alive: R 1-1-I:2"
 3:58:52 "Leader is still alive: R 1-1-I:2"
 3:58:52 "Leader is still alive: SAR_leader_15"
 3:58:52 "Leader is still alive: SAR_leader_17"
 3:58:52 Error in expression <KRON_UPS_>
 3:58:52   Error position: <KRON_UPS_>
 3:58:52   Error Undefined variable in expression: kron_ups_
 3:58:53 "Leader is still alive: SAR_leader_8"
 3:58:53 "Leader is still alive: SAR_leader_18"
 3:58:53 "Leader is still alive: SAR_leader_15"
 3:58:53 "Leader is still alive: SAR_leader_2"
 3:58:53 "Leader is still alive: SAR_leader_15"

 

Link to comment
Share on other sites

  • 2 weeks later...

Here it is. Note the folder tips as they both are named addons. I have not shared this before so it is not in any sort of order. I just made it work and left it alone lol. There will be spam in the rpt about UPSMON stuff but that is due to the scripts being abandoned and not having the time to resolve each issue. From what I could tell it is something to do with the array it stores groups in. The first object is always null no matter what I do :/ but it does work and our server has no noticeable performance drain with lots of players even.

@ViktorReznov

https://github.com/Teh-Dango/A2-SargeAI

Link to comment
Share on other sites

With the last two instructions, where it says add to the two schedulers. It's a bit vague. Should I just place that snip of code in front of the code that's already on line 4 and 45 respectively? Or should I replace the code that is already on line 4 and 45 respectively?

Link to comment
Share on other sites

On 11/6/2017 at 11:16 AM, Runewulv said:

With the last two instructions, where it says add to the two schedulers. It's a bit vague. Should I just place that snip of code in front of the code that's already on line 4 and 45 respectively? Or should I replace the code that is already on line 4 and 45 respectively?

sched safety line should like this if you have not modified it (ie epoch admin tools)

if (vehicle _x != _x && !(vehicle _x in dayz_serverObjectMonitor) && !((typeOf vehicle _x) in DZE_safeVehicle) && (vehicle _x getVariable ["Sarge",0] != 1) && !((typeOf vehicle _x) in DZE_safeStatic)) then {

and sched corpses

if ((_x getVariable["bodyName",""] != "") && !(_x getVariable ["SAR_protect",false])) then {

Link to comment
Share on other sites

ah OK, I did test it out. It worked very well from what I could tell. But was not compatible with WAI. The missions wouldnt spawn. I'm super disappointed in that as I was excited to use it. I like DZAI but Sarge was always a lot more crafty and more versatile. It also cut about 10 FPS right off the top of all my players LOL. I run mission systems too which is why and Sarge is taxing obviously. Just too bad, was hoping to swap out DZAI for Sarge.

Link to comment
Share on other sites

  • 4 months later...

Anyone still working on SargeAI? Only just found this post after editing the original SargeAI to get it working on on DayZ mod 1.9.0 so far have it working ok but have trouble with some AI/groups of AI spawning with no leader so they do nothing but stand there unless fired upon etc, sometime can spawn lots before this happens other times can be in some of the first few spawned. From what i can tell it seems to be to do with an array or an error in the loop that happens sometimes where it cant find an AI to assign as a leader. I don't mind doing some sort of band-aid fix tho not ideal like use function try{ } cause i know every now and then it will throw an exception and then maybe have a script that looks for any AI or group without a leader and kills/removes them. But ideally would like to clean the code up and get it working right as I'm planning on slimming it down and removing some of the functions i don't need and maybe adding other player interaction functions to the survivor/solider factions I.E give supplies/help/directions to supplies etc. If anyone is still working on this and wants to share findings or if you are an exceptional script writer and want to be hired get in touch. Or maybe try convince me why i should use DZAI as a base and modify that (if possible) to get the same type of good and bad AI, just so far from what i have read/seen SargeAI is more inline with what i want.

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