Jump to content
avibird 1

Is the seek and destroy with the cycle waypoint broken?

Recommended Posts

I thing I found a workable solution. It's not sexy kind of old school but I am old. 

 

1. Chopper on the ground a far distance away with a sentry waypoint right on the chopper. 3 seek and destroy way points covering the entire AO zone with a cycle attached to the first seek and destroy waypoint. Two other units are grouped to the chopper but they are inside the POW camp with a dostop command. Once the POW's start the prison break and after they get passed a few fences and a shitload of guards they will come into contact with the two units attached to the chopper. This will activate the chopper and it will move towards the AO and cycle through the seek and destroy way points. The chopper will continuously search the AO for the POW's and hopefully engage them at times. Now to the another issues getting the chopper to attack ground units who are just moving around in the line of sight. 

 

If anyone knows a better sexier coding way in doing this please share.

Share this post


Link to post
Share on other sites

@wogz187 what do you not understand about using seek and destroy and a cycle waypoint. 

 

I want to have a chopper moving around the AO that will engage POW soldiers on the ground who are attempting to escape a prison and rescue a resistant leader all in the AO. The reason why I'm want to seek and destroy there's a better chance for the chopper to engage basic foot soldiers who don't shoot at the helicopter but are engaging other ground soldiers. There are two helicopters in the mission with only two AA weapons available. 

 

So I really don't understand why you don't understand the concept of seek and destroy with a constant loop for the choppers. Please explain! And yes I am looking for a better solution and a more efficient way of doing this that's the whole point of this thread sir with no disrespect intended.

 

Share this post


Link to post
Share on other sites

@avibird 1,

Quote

"...with no disrespect intended."

I know.

I just opened this up in the Test Lab Workshop and it's all figured out. SAD waypoints are okay. We'll use that like you said. Gimme a few minutes and we'll have everything posted here.

Okay. This is how I spawned the helicopter. You probably don't need this because you have a helicopter,
 

Spoiler

heli1= createVehicle ["B_Heli_Light_01_dynamicLoadout_F", player getPos[ 100, getDir player ], [], 0, "FLY" ];

 


You do need to add this at the end of your helicopter create vehicle script, (or in the init file if your helo is a named editor object)
 

Spoiler

//createVehicleCrew heli1; //if editor
groupH = group driver heli1;
heloWPmark setpos (getpos heli1);

execVM "heloPATROL.sqf";

while {true} do {if(heli1 distance heloWPmark < 200) then {execVM "heloPATROL";};sleep 0.5;};

 


Also add to the init,

posID=0;


Create a helper (arrow) in the editor and name it posID1_1. Copy and paste that to make "posID1_2 and posID1_3". These are the patrol points. Place them where the helicopter will patrol between. Create one more arrow helper and name it heloWPmark. This will always be the way point destination for the helo (it's also the trigger). Create this script in your mission folder,

heloPatrol.sqf
 

Spoiler

        posID = posID + 1;
    currentID = [objNULL, posID1_1, posID1_2, posID1_3] select posID;

    heloWPmark setPos (getpos currentID);
    
groupH = group driver heli1;
deleteWaypoint [groupH, 0];
deleteWaypoint [groupH, 1];
groupH setBehaviour "CARELESS";
sleep 0.2;

    _wpb = groupH addwaypoint [position heloWPmark,0];
    _wpb setwaypointtype "move";

        if (posID == 3) then {
        posID = 0;
        };

 


Finally, create a trigger with condition present EAST or however you want to determine AO activity and ON ACTIVATION,

airSupport=[]execVM "heloSUPPORT.sqf";

heloSUPPORT.sqf
 

Spoiler

groupH = group driver heli1;
deleteWaypoint [groupH, 0];
deleteWaypoint [groupH, 1];
groupH setBehaviour "AWARE";
sleep 0.2;

    _wpb = groupH addwaypoint [position enemyMARK,0];
    _wpb setwaypointtype "SAD";

heloWPmark setpos (getpos objNULL);

 


oh, and be sure to make a marker at the center of the AO named enemyMARK, or replace that wp with something else.
and on DEACTIVATION,

airSupport=[]execVM "heloPATROL.sqf";

It works pretty good. A decent proof of concept. The helicopter does what it's told. We can refine it and make it apply to the two helicopters. A better script writer could make it a single function I'm sure.

Have fun!

  • Thanks 1

Share this post


Link to post
Share on other sites
Quote

I want to have a chopper moving around the AO that will engage POW soldiers on the ground who are attempting to escape a prison and rescue I resistant leader all in the AO.

 

The reason why I'm want to seek and destroy there's a better chance for the chopper to engage basic foot soldiers who don't shoot at the helicopter but are engaging other ground soldiers.

 

I have amended the search script so the helicopter(s) stay grounded until needed.

 

 

I imagine a helicopter orbiting a position and engaging enemies on the ground without deviating from the orbit.

This is similar to the LOITER waypoint, except that the helicopter engages enemy targets on the ground.

 

Spoiler

//	_go = [this, [1234,5678,0], 350, "ReinforceCamp"] execVM "helicopterSearch.sqf";
//	Now there's no need to use in a trigger, just paste the above in the helicopters init field.

COMMENT
"
	this			References the helicopter from its init field.
	[1234,5678,0]	Position to search.
	350				Radius from position to create waypoints.
	ReinforceCamp	Wait until condition is true.
					Set up your trigger condition and on that triggers On Activation field, use; ReinforceCamp = true;
";

params ["_grp", "_pos", "_rad", "_con"];

_posArr = [];

COMMENT " Plot waypoint every 45 degrees in a circle. 8 waypoints in total. ";

_stp = 360/8;	//	EDIT: Accidentally missed this out. Oops!

for "_dir" from 0 to (360 - _stp) step _stp do 
{
	_posArr pushBack (_pos getPos [_rad, _dir]);
};
	
systemChat "Positions ready. Waiting on condition.";
	
waitUntil { sleep 1; !isNil _con; };

{
	_wp = (group _grp) addWaypoint [_x, 0];
	_wp setWaypointType "MOVE";	//	I know you have your heart set on "SAD", but "MOVE" works best for orbiting helicopters. 
	_wp setWaypointBehaviour "CARELESS";	//	<- Not a typo.
	_wp setWaypointCombatMode "YELLOW";
	_wp setWaypointSpeed "LIMITED";
	
	COMMENT
	"
		Reveals nearEntities to helicopter group at each waypoint.
		Helicopter guns will engage enemies it can see.
	";
	_wp setWaypointStatements
	[
		"true",
		"
			{
				(group this) reveal [_x, 4];
			} count (this nearEntities 1500);
		"
	];	
} count _posArr;

	COMMENT " Add a CYCLE waypoint on the first waypoint. ";
	_wp = (group _grp) addWaypoint [_posArr #0, 0];
	_wp setWaypointType "CYCLE";
	
	systemChat "Reinforcing... Prepare to DIE!";

	

 

 

Or you can update the previous search .sqf with:

Spoiler

//	[heli_1, [3300,5800,0], 250, "ReinforceCamp"] execVM "search.sqf";

params ["_grp", "_pos", "_rad", "_con"];

waitUntil { sleep 1; !isNil _con; };

for "_r" from 1 to 3 do
{
	_wp = (group _grp) addWaypoint [_pos, _rad];
	_wp setWaypointType "SAD";
	_wp setWaypointBehaviour "COMBAT";
	_wp setWaypointCombatMode "RED";
	_wp setWaypointSpeed "LIMITED";
};

	_wp = (group _grp) addWaypoint [_pos, _rad];
	_wp setWaypointType "CYCLE";

 

 

 

 

Edited by Maff
Missed out important variable in first example.
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

@avibird 1,
See! I told you a better script writer could do it!

The big difference, perhaps for somebody "Old school" like you or just largely unskilled, like me, is that @Maff's script is completely abstract. You say, "I like to see things in the editor.", and for me I absolutely have to see it in the editor. However I can imagine abstracts (like helper arrows) in place of actual things in the editor.

Maff's script basically makes a real patrolling helicopter (cool sys chats, dude). My design makes it seem like the helicopter is patrolling.

  • Thanks 1

Share this post


Link to post
Share on other sites

Apologies @wogz187, I didn't mean to post over your suggestion.

 

I could have sworn your post ended with:

5 hours ago, wogz187 said:

Gimme a few minutes and we'll have everything posted here.

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Thank you both of you. I will fool around with both of your suggestions. 

 

I tested played the mission  it took me  almost 4 hrs and still one of the choppers with the seek and destroy cycle waypoints stop searching the AO. I do have a snippet inside the choppers init to refuel the choppers when fuel is running low so it was not the lack of gas during the 4 hr mission.

 

I greatly appreciate both your efforts and I'll do my best to implement what you guys suggest but I still may have some questions how to implement your suggestions and scripts. This is why I love this community because of people like you guys 😎

  • Like 1

Share this post


Link to post
Share on other sites

I worked on my script a bit more last night. I still suggest using Maff's solution because it's tight but you might see something useful here,
 

ON ACTIVATION,
currentID=goodyMARK;
airsupport= []execVM "heloSupport.sqf"

heloSupport.sqf

Spoiler

call {

if (currentID != goodymark) exitwith {

        posID = posID + 1;
    currentID = [objNULL, posID1_1, posID1_2, posID1_3] select posID;

    heloWPmark setPos (getpos currentID);
    
groupH = group driver heli1;
deleteWaypoint [groupH, 0];


    _wpb = groupH addwaypoint [position heloWPmark,0];
    _wpb setwaypointtype "move";
    _wpb setWaypointSpeed "LIMITED";
    groupH setBehaviour "careless";

heli1 flyInHeightASL [180, 180, 80];
heli1 flyinheight 80;

        if (posID == 3) then {
        posID = 0;
        };
};


if (currentID == goodyMARK) exitwith {

groupH = group driver heli1;
deleteWaypoint [groupH, 0];
sleep 0.2;

    _wpb = groupH addwaypoint [position goodyMARK,0];
    _wpb setwaypointtype "SAD";
    groupH setBehaviour "AWARE";

heli1 limitSpeed 60;
heli1 flyInHeightASL [60, 60, 30];
heli1 flyinheight 30;

heloWPmark setpos (getpos objNULL);
    };
};

 

 

ON DEACTIVATION,
currentID=posID1_1;
airsupport= []execVM "heloSupport.sqf"

Still not as cool as @Maff's real patrolling helicopter but at least it's all in one script now.

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Okay the take away from this whole thread which I greatly appreciate because they learned a lot.

 

1. You can"t use the cycle waypoint when you are using a trigger type skip waypoint and set waypoint activation (fairly new waypoint) the cycle waypoint will get delete it. It is not a continuous loop. I don't know if this was the design from bohemian or a bug and I'm not sure if they are aware because I've never seen any other thread about this.

 

2. Arma3  still has so many issues with the vanilla game and functions and if it was not for you guys the modders the coders this game would have a very short life span due to all the frustration with trying to use all the wonderful tools Bohemian gives us. I know I should be grateful no other game company gives it's community the tools and open source like bohemian but it's still frustrated when simple things don't work the way they should with the vanilla game. 

 

3. There are many ways to skin a cat ie code for arma3 you just need to know the right people. Once again thank you gentlemen for your assistance.

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×