AI Air Patrols

Oh snap. I tested the one from yesterday, for w.e reason 2 helis still spawn with their squads - but they spawned more spaced out so they had no problems taking off.

I'll give the new one whirl right now.
 
in the chopper patrol.sqf it asks for this and you didn't provide it?

IntMedWP = compile preprocessFile "units\IntermediateWaypoint.sqf";

Also - in the mission's init do we just need

[] execVM "units\init.sqf"; ?
 
in the chopper patrol.sqf it asks for this and you didn't provide it?

IntMedWP = compile preprocessFile "units\IntermediateWaypoint.sqf";

Also - in the mission's init do we just need

[] execVM "units\init.sqf"; ?
Yeah, sorry. I made the IntermediateWaypoint to do a bit of trig and calculate positions of intermediate waypoints; needed to try and use the Osprey, which didn't really work that well.

You can remove any reference to it if you'd like. If you're running Chernarus, all you have to do is add what you have above in the mission init.
 
Alright so I can just put the [] execVM "units\init.sqf"; at the very bottom of the mission's init.sqf?

ALSO what about this line below, it's found twice in the units/init.sqf (I'm a total noob, just curious)

zombie_generate = compile preprocessFileLineNumbers "units\zombie_generate.sqf";
 
Alright so I can just put the [] execVM "units\init.sqf"; at the very bottom of the mission's init.sqf?

ALSO what about this line below, it's found twice in the units/init.sqf (I'm a total noob, just curious)

zombie_generate = compile preprocessFileLineNumbers "units\zombie_generate.sqf";
Yeah, you can blow away one of those - I haven't fixed the error in mine and it hasn't caused any major issues. But it doesn't need to be there twice.

I'd put the []execVM "units\init.sqf"; in the If (Server) { loop, like so

Code:
// Run the server monitor
if (isServer) then {
_serverMonitor = [] execVM "\z\addons\dayz_server\system\server_monitor.sqf";
[] ExecVM "units\init.sqf";
};
 
Alright I will give that a shot.

Also the server_Objectupdate.sqf you have uploaded, that's supposed to named (and replace) the server_updateobject.sqf?


Tested - They spawn in briefly after I log in. Going to check out their travel path and interactions next, is there anything I need to be made aware of such as:

Do they circle back to where they spawn at? Do they respawn @ their start locations again?
 
V1.0 was 2 helis, 2 crew.

Yesterday was I think 1 heli 1 crew.

Today is 2 heli, 1 crew. I took the second heli and chased after them... umm... randomly their heli started acting like tumble weed in high winds... it was hilarious but it crashed/disappeared.

Also - at one point, when it respawned with the crew and ... well 2 helis... Baasically what'll end up happening I assume is we'll have like... SHITLOADS of secondary helis all in 1 area if the first one gets destroyed repeatedly...
 
V1.0 was 2 helis, 2 crew.

Yesterday was I think 1 heli 1 crew.

Today is 2 heli, 1 crew. I took the second heli and chased after them... umm... randomly their heli started acting like tumble weed in high winds... it was hilarious but it crashed/disappeared.

Also - at one point, when it respawned with the crew and ... well 2 helis... Baasically what'll end up happening I assume is we'll have like... SHITLOADS of secondary helis all in 1 area if the first one gets destroyed repeatedly...
Can you post your PBO?
 
V1.0 was 2 helis, 2 crew.

Yesterday was I think 1 heli 1 crew.

Today is 2 heli, 1 crew. I took the second heli and chased after them... umm... randomly their heli started acting like tumble weed in high winds... it was hilarious but it crashed/disappeared.

Also - at one point, when it respawned with the crew and ... well 2 helis... Baasically what'll end up happening I assume is we'll have like... SHITLOADS of secondary helis all in 1 area if the first one gets destroyed repeatedly...

Try the new chopper patrol - I did see some issues with it on our loaded server; I didn't change the logic, but I added a bunch of generous delays. Seemed to fix the issue on his server.
 
I can do most of this but it seems like there is a large amount of instruction missing... Am the only one?
How do I call from INIT? and where do I put these files in the PBO?
 
IT WORKS! I FUCKING DID IT!

I ended up having to use public variables to pass information to the waypoint conditions.

Choose how many soldiers you want to spawn with the chopper (8 - 10 seems about right).

Chopper goes to waypoint, lands and unloads, soldiers bail out and shoot zeds for ~ 30 - 40 seconds. You can change that by changing how often the VehicleRearm script sleeps.

The soldiers pile back into the chopper and take off.

Right now it goes Balota > Cherno > electro > NEAF > NWAF

I broke the code into descreet blocks, so if you want to add /remove a destination, just find and replace the location with what you want it to do.

There are still some bugs - for instance, if you assign soldiers to gun, they'll shoot zeds THROUGH the guys getting out, so I have them load as cargo, not as gunner. For some reason, rather than going back to spawn and hitting balota on the cycle, they go to 0,0 - which isn't that far from Balota anyway, so who cares.

Change the FlyIn height to lower if you want it to go faster, but if you go lower you run the risk of hitting shit, or people using the choppers to scout the entire map. I want to set it high enough that you can't really see the ground from the chopper between WPs.

YMMV.

just call it from your init like such:
Code:
//[[Position], Number of Soldiers, Flying Height]
[[32.562645, 1589.6631, 0],6,85] ExecVM "units\Chopper Patrol.sqf"; //Patroling Chopper


You need to add change your server_update.sqf in the DayZ_Server.PBO file

Code:
if ((typeName _objectID != "string") || (typeName _uid != "string")) then {
    diag_log format ["DEBUG: Non string object: ID %1, UID %2", _objectID, _uid];
    _objectID = "0";
    _uid = "0";
};
if (!_parachuteWest) then
{
if (_objectID == "0" && _uid == "0") then
{
_object_position = getPosATL _object;
_ApproveState = _Object GetVariable "ApprovedVeh";
//diag_log format ["DEBUG: Object %1 Approve State", _ApproveState];
 
If (_ApproveState == 1) Then
{
_isNotOk = false;
diag_log format ["DEBUG: Object %1 detected at [%2,%3,%4], and classified as approved", typeOf _Object, _object_position select 0, _object_position select 1, _object_position select 2]];
 
} else {
diag_log format ["DEBUG: Deleting object %1 with invalid ID at [%2,%3,%4]", typeOf _object, _object_position select 0, _object_position select 1, _object_position select 2];
_isNotOk = true;
};
 
};
};


It should be right near the top of the list.

Also, look for the part of your server_cleanup.fsm file in the DayZ_Server.PBO and get rid of the hacker check - it will blow the vehicle up. It should look somewhat like this:

Code:
init = /*%FSM<STATEINIT""">*/"//Check for hackers" \n
      " {" \n
      "//if(vehicle _x != _x) then {" \n
      "//if  (!(vehicle _x in _safety) && ((typeOf vehicle _x) != ""ParachuteWest"")) then {" \n
      "//diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
      "//(vehicle _x) setDamage 1;" \n
      "//_x setDamage 1;" \n
      "//};" \n
      "//};" \n
      " } forEach allUnits;" \n
      ""/*%FSM</STATEINIT""">*/;


Code:
//[[Position], Number of soldiers]
ChopperPatrol1 = [[32.562645, 1589.6631, 0],10] ExecVM "units\Chopper Patrol.sqf"; //Patroling Chopper

Edit - v1.0 (2013-03-12)

Added respawn ability, checking for the chopper stuck on the ground, and stuck hovering. Killing/shooting the chopper or any of the troops will instantly agro them, and will lower the attackers humanity. All weapons are removed from the AI on death, and their bodies are deleted 30 seconds after being killed.


FAQ:

Q: My chopper explodes when I climb in it!
A: Make sure you get rid of the hacker check in the fsm file!

Q: My chopper just disappears right after it spawns!
A: Make sure you make the changes to your server_objectupdate.sqf!

Q: I'm getting more than one chopper at a time!
A: This is a bit more tricky - clear out your scripts.log and see if you're getting battleye errors - oddly enough, I've seen battleye scripts.txt make the thing spawn multiple choppers. Crazy!

Q: The AI crashes the chopper!
A: Yeah, I've seen it happen too. The AI is fucking dumb. You can try playing with the height variable; too high seems to cause issues, and too low does too. The latest version contains a respawn provision that will restart the taxi if it asplodes.

Q: People are shooting my troops, they're bitches!
A: You can try adding more soldiers; they're already set to max AI intelligence (without using 3rd party AI addons, like SARGE's excellent framework here - http://opendayz.net/index.php?threads/sarge-ai-framework-public-release.8391/
I'm also thinking about a script that will send in reinforcements when the chopper is attacked, but that hasn't happened yet.

Orcthrasher would you please look at my files for me and see if these are correct?? // I try loading my game and it tells me unit zombie_generate.sqf is missing?
 

Attachments

  • dayz_chopper.pbo
    100.3 KB · Views: 15
  • dayz_chopper_server.pbo
    77.1 KB · Views: 15
Amazing work but i need help plz.
I did all by the numbers but heli spawn west of kamenka but no NPC spawn nor i can enter the heli because it explodes.

I changed the anti hack and the object update in dayz_server.pbo

Yet the heli explodes and no NPC spawn to the helicopter

after sometime it spawn 4-5 heli there but no crew around and none i can enter without exploding

help plz
 
sorry orcthrasher...can u explain more details how can i make zeds chase AI players in Sarge AI script file such as...wt should i put and wt thing i need to add into a specific sqf. Thank you
 
I have managed to get this script loaded and I can see in the logs that it is spawning a chopper and some NPC with it, but shortly after it has spawned I'm getting the following messages which I think means it has crashed then it respawns I think. Unfortunately I haven't seen it in-game so I can't confirm where or what is spawning.
Can anyone help?

11:58:28 "Flying String: PatrolChopper1 FlyinHeight 85"
11:58:28 "ChopperPatrol: Chopper Spawn initiated: Centre: [32.5626,1589.66,0] Soldiers: 6 Flying Height: 85 "

Then shortly after:
11:59:54 "Patrol: Detected Living Crew!"
11:59:54 "Patrol: Chopper has been disabled, respawning any"
 
Amazing work but i need help plz.
I did all by the numbers but heli spawn west of kamenka but no NPC spawn nor i can enter the heli because it explodes.

I changed the anti hack and the object update in dayz_server.pbo

Yet the heli explodes and no NPC spawn to the helicopter

after sometime it spawn 4-5 heli there but no crew around and none i can enter without exploding

help plz

I'm having this same issue, except I can get in the helis and fly them without them exploding. However, no AI spawn and there are like 6 MV22s west of Kamenka.
 
Just looked through my rpt log and found this.

Code:
9:30:32 "ChopperPatrol: Chopper Spawn initiated: Centre: [32.5626,1490.66,0] Soldiers: 8 Flying Height: 50 "
9:30:43 "ChopperPatrol: Creating Chopper Crewman any number 1 at [34.5626,1490.66,0]"
9:30:46 "ChopperPatrol: Creating Event Handlers for any "
9:30:47 "ChopperPatrol: Creating Chopper Crewman any number 2 at [36.5626,1490.66,0]"
9:30:50 "ChopperPatrol: Creating Event Handlers for any "
9:30:51 "ChopperPatrol: Creating Chopper Crewman any number 3 at [38.5626,1490.66,0]"
9:30:54 "ChopperPatrol: Creating Event Handlers for any "
9:30:55 "ChopperPatrol: Creating Chopper Crewman any number 4 at [40.5626,1490.66,0]"
9:30:58 "ChopperPatrol: Creating Event Handlers for any "
9:30:59 "ChopperPatrol: Creating Chopper Crewman any number 5 at [42.5626,1490.66,0]"
9:31:02 "ChopperPatrol: Creating Event Handlers for any "
9:31:03 "ChopperPatrol: Creating Chopper Crewman any number 6 at [44.5626,1490.66,0]"
9:31:06 "ChopperPatrol: Creating Event Handlers for any "
9:31:07 "ChopperPatrol: Creating Chopper Crewman any number 7 at [46.5626,1490.66,0]"
9:31:10 "ChopperPatrol: Creating Event Handlers for any "
9:31:11 "ChopperPatrol: Creating Chopper Crewman any number 8 at [48.5626,1490.66,0]"
9:31:14 "ChopperPatrol: Creating Event Handlers for any "
9:31:15 "ChopperPatrol: Chopper Spawn Completed - beginning waypoints"
9:31:15 "Patrol: 10f210c0# 1055748: mv22.p3d Altitude is 0.318663 meters, DT is 1, AT is 0"
9:31:25 "Patrol: 10f210c0# 1055748: mv22.p3d Altitude is 0.318663 meters, DT is 2, AT is 0"
9:31:35 "Initial WP pos is [0,0,0]"
9:31:35 "Patrol: 10f210c0# 1055748: mv22.p3d Altitude is 0.318663 meters, DT is 3, AT is 0"
9:31:42 Warning: z\addons\dayz_communityassets\models\razor.p3d:0 Error while trying to generate ST for points: 214, 349, 208
9:31:45 "Patrol: 10f210c0# 1055748: mv22.p3d Altitude is 0.318663 meters, DT is 4, AT is 0"
9:31:55 "Patrol: 10f210c0# 1055748: mv22.p3d Altitude is 0.318663 meters, DT is 5, AT is 0"
9:32:06 "Patrol: Detected Living Crew!"
9:32:06 "Patrol: Chopper has been disabled, respawning any"

Is that saying that the chopper has been destroyed? After this it just keep creating choppers west of Kamenka with no AI. What would be causing this?
 
Back
Top