Jump to content
Sign in to follow this  
avibird 1

Can you limited the engagement distance of planes during combat to a set Radius!

Recommended Posts

Is there a way to set the distance that a plane will not target enemy units on the map. For example 2500 meters from the players position and no more. I am working on a mission that is using the whole map for the mission with dynamic enemy patrol units and enemy HQ's throughout the map. You must liberate each city on the map. The issue is when I call in my air support script the planes will take out a few units at my location but then will engage units all over the map. Even if you set a small waypoint to your location when you call the script. Here is the script

if (!((player getVariable "JsupportAvailable") == "JSupportAvailable")) exitWith {hint "Fighter Squadron not available for Support"};
player setVariable ["JsupportAvailable", "JsupportUNAvailable"]; 

jet = false;
publicVariable "jet";
[] exec "AISUPPORT\menu\close_menu.sqf";

player sideChat "We need Fighter support in our AO, Over";
sleep 5;
PAPABEAR=[West,"HQ"];

GroupJET = CreateGroup West;
JetA = createVehicle ["A10", [(getpos  player) select 0,(getpos  player) select 1, 0], [], 2000, "FLY"];
JetAPilot1 = GroupJET createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
JetAPilot1 moveInDriver JETA;
JetA FlyInHeight 625;


JetB = createVehicle ["AV8B2", [(getpos  player) select 0,(getpos  player) select 1, 0], [], 2000, "FLY"];
JetBPilot1 = GroupJET createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
JetBPilot1 moveInDriver JETB;
JetB FlyInHeight 575;


JetC = createVehicle ["A10", [(getpos  player) select 0,(getpos  player) select 1, 0], [], 2000, "FLY"];
JetCPilot1 = GroupJET createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
JetCPilot1 moveInDriver JETC;
JetC FlyInHeight 525;


JetD = createVehicle ["AV8B2", [(getpos  player) select 0,(getpos  player) select 1, 0], [], 2000, "FLY"];
JetDPilot1 = GroupJET createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
JetDPilot1 moveInDriver JETD;
JetD FlyInHeight 475;

player sideChat "HQ Confirms: Squadron Eagle is airborne and moving towards our location over";
sleep 5;

wp1 = GroupJET addwaypoint [position player, 0];
wp1 setwaypointtype "SAD";
wp1 setWaypointFormation "COLUMN";
wp1 setWaypointCompletionRadius 0;

{_x setSkill 1} foreach units GroupCAS1;

jetcas = createTrigger ["EmptyDetector",getPos player]; 
jetcas setTriggerArea [500, 500, 0, false];
jetcas setTriggerActivation ["EAST", "NOT PRESENT", false];
jetcas setTriggerTimeout [300, 300, 300, false ];
jetcas setTriggerStatements ["this","player sideChat ""Eagle Squadron leader : Enemy Armor Targets have been Neutralized, OVER""; [] execVM ""AISUPPORT\support-req\movejet.sqf""" , ""];

jetcas2 = createTrigger ["EmptyDetector",getPos player]; 
jetcas2 setTriggerArea [10000, 10000, 0, false];
jetcas2 setTriggerActivation ["WEST", "PRESENT", false];
jetcas2 setTriggerTimeout [480, 480, 480, false ];
jetcas2 setTriggerStatements ["this", "player sideChat ""Squadron Eagle: Returning back to airfield to rearm and refuel, over""; [] execvm ""AISUPPORT\support-req\donejet.sqf""" , ""];

jetcas3 = createTrigger ["EmptyDetector", getPos player]; 
jetcas3 setTriggerArea [0, 0, 0, false];
jetcas3 setTriggerActivation ["NONE", "NOT PRESENT", false];
jetcas3 setTriggerStatements ["!(alive JetAPilot1) && !(alive JetBPilot1) && !(alive JetCPilot1) && !(alive JetDPilot1)", "PAPABEAR SideChat ""Fighter Squadron Eagle has been destroyed""; [] execvm ""AISUPPORT\support-req\donejet.sqf""" , ""];
sleep 500; 
player setVariable ["JsupportAvailable", "JsupportAvailable"];
hint "Fighter Squadron Falcon on Carrier deck and ready for support if needed!"; 

I have tryed multiple different waypoints,formations and radius

wp1 = GroupJET addwaypoint [position player, 0];

wp1 setwaypointtype "HOLD";

wp1 setWaypointFormation "COLUMN";

wp1 setWaypointCompletionRadius 0;

Any Ideas on this! HELICOPTERS work fine and stay in a limited area of engagement during combat.

Share this post


Link to post
Share on other sites

Does anyone know what is the real differance between the placement radius vs the completion rdaius waypoint in the editor and why no placement radius command in the Scripting Commands from BIS. Still looking for some direction on this one Thanks AVIBIRD.

Share this post


Link to post
Share on other sites

Placement radius sets a random spot inside of the radius that the waypoint will be placed. Completion radius is how far from the waypoint you have to be to complete the waypoint.

Share this post


Link to post
Share on other sites

ice BIS has no command for Placement radius, only inside the editor! Do you have any clue what I can do to stop the planes from engaging units all over the map. My script will work for non dynamic missions with only one AO setup at a time but with multiple AO the planes will target 10000 meters away from the call spot. ): so if you need air support with planes they may not come to support your AO.

Share this post


Link to post
Share on other sites

_Wp = Alpha AddWayPoint [GetPosATL Player, [color=#ff0000]0[/color]] // Placement Radius In [color=#ff0000]Red[/color]

---------- Post added at 08:47 ---------- Previous post was at 08:35 ----------

As far as engagement range, you may want to look into the Mando System. I'm not sure if it works with Ai or not, but does have limited missile range.

Share this post


Link to post
Share on other sites

Are you saying add this to my code line. how do I add the Placement Radius In Red

Were do I add this in _Wp = Alpha AddWayPoint [GetPosATL Player, 0]

Do i need to add the 1 _WP

I don't understad the Alpha what about my GroupJet

Thanks.

wp1 = GroupJET addwaypoint [position player, 0];

wp1 setwaypointtype "HOLD";

wp1 setWaypointFormation "COLUMN";

wp1 setWaypointCompletionRadius 0;

Share this post


Link to post
Share on other sites

Yes it was only an example I copy & pasted. Also, I only highlighted the value in red so it was easy to identify.It isn't necessary.

 wp1 = GroupJET addwaypoint [position player, 1000]; // Okay I set the placement radius of your waypoint to 1000
wp1 setwaypointtype "HOLD";
wp1 setWaypointFormation "COLUMN";
wp1 setWaypointCompletionRadius 0;

Share this post


Link to post
Share on other sites

Hey ice I don't understand what you are saying with this wp1 = GroupJET addwaypoint [position player, 1000];

This is makes the hold waypoint 1000 meters away from the player who call it in.

are you saying use GetPosATL Player vs position player.

Can you get it to work because I can't. Planes still target and move all over the map.

Share this post


Link to post
Share on other sites
Does anyone know what is the real differance between the placement radius vs the completion rdaius waypoint in the editor and why no placement radius command in the Scripting Commands from BIS. Still looking for some direction on this one Thanks AVIBIRD.
Placement radius sets a random spot inside of the radius that the waypoint will be placed. Completion radius is how far from the waypoint you have to be to complete the waypoint.
ice BIS has no command for Placement radius, only inside the editor!
_Wp = Alpha AddWayPoint [GetPosATL Player, 0] // Placement Radius In Red

---------- Post added at 08:47 ---------- Previous post was at 08:35 ----------

As far as engagement range, you may want to look into the Mando System. I'm not sure if it works with Ai or not, but does have limited missile range.

I'm just going off of what's at hand. You were talking about placement radius of a waypoint?

---------- Post added at 10:18 ---------- Previous post was at 10:17 ----------

Also, did you check into mando missiles like I suggested for engagement range? Read post number 5.

Edited by Iceman77

Share this post


Link to post
Share on other sites

i don't think you can set them to only engage targets in a specific area.

Your best be might be to:

Add some code to your air support script that checks for enemies within 2500 meters of players position in a while (count _enemies > 0) do loop. _enemies is an array you define previously.

Once none are found, then the script checks for any remaining air units left in the air.

Any air units have their magazines removed, their waypoints removed and then are assigned a WP to land back at base.

Once you call in more planes, as it is part of your air support script, this additional code is ran again.

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
Sign in to follow this  

×