Jump to content
Sign in to follow this  
Melmarkian

Question about waypoints

Recommended Posts

Hi,

I got a question about creating waypoints: I wrote a script to let a unit circle around a position

this one

_target = _this select 0;
_offset = _this select 1;
_radius = _this select 2;
_group  = _this select 3;
_start = _this select 4;
hint format["Gruppe: %1", _start];

while {alive _target && alive _group} do
{


while {(count (waypoints _group)) > 0} do
{
deleteWaypoint ((waypoints _group) select 0);
};


switch (_start) do {

   	case "n":  {northp = 0; eastp = 1; southp = 2; westp = 3; hint "north"; };


case "e":  {northp = 1; eastp = 0; southp = 3; westp = 2; hint "east";};


case "s":  {northp = 2; eastp = 1; southp = 0; westp = 3; hint "south" };


case "w":  {northp = 3; eastp = 2; southp = 1; westp = 0; hint "west" };


   default {northp = 0; eastp = 1; southp = 2; westp =3; hint "default"; };
};

sleep 1;

_p1 = [(getposATL _target select 0) + _offset, (getposATL _target select 1), (getposATL _target select 2) ];
_p2 = [(getposATL _target select 0) , (getposATL _target select 1) + _offset, (getposATL _target select 2)];
_p3 = [(getposATL _target select 0) - _offset, (getposATL _target select 1), (getposATL _target select 2) ];
_p4 = [(getposATL _target select 0) , (getposATL _target select 1) - _offset, (getposATL _target select 2)];

sleep 1;

_wp1 = (group _group) addwaypoint [_p1, _radius, eastp];
_wp1 setWaypointType "MOVE";
_wp2 = (group _group) addwaypoint [_p2, _radius, northp];
_wp2 setWaypointType "MOVE";
_wp3 = (group _group) addWaypoint [_p3, _radius, westp];
_wp3 setWaypointType "MOVE";
_wp4 = (group _group) addWaypoint [_p4, _radius, southp];
_wp4 setWaypointType "MOVE";
_wp5 = (group _group) addwaypoint [_p2, _radius, 4];
_wp5 setWaypointType "CYCLE";

sleep 50;


};

hint "Over";

This one works for landbased units without a problem, but when i insert a heli as follower the waypoints are instantly completed. Could this be a problem with the height of the waypoints?

Thanks!

Share this post


Link to post
Share on other sites

land vehicles complete their wps at pretty close proximity to the wp.

Air vehicles may complete a wp at longer range.

try setting the wps further away from eachother.

i think your heli not following them is an error on your insertion in editor or creation of the heli if done in scripts.

when using BIS_fnc_spawnvehicle or insertion in editor.

created Air vehicle name is not the groupname.

this is group:

_group = (group (driver heli));

Also maybe airvehicles need to use a single domove command to start the wp run as ive seen that in my own scripts.

Edited by Demonized

Share this post


Link to post
Share on other sites

Thanks so far!

The Heli gets the waypoints and in case of the northern starting one it does a complete circle. But they popup every second. When i play the heli, the first one shows up normally. As soon as the distance is like 400m the waypoints start popping up endlessly.

edit:

But i noticed it does the same when i set the waypoints this way in the editor with cycle at the end. Is there a way to decrease the completionradius? When i set setWaypointCompletionRadius it doesn´t seem to change it for helis.

Edited by Melmarkian

Share this post


Link to post
Share on other sites

I think it has to do with a few things, such as combat mode, altitude, and skill. A smart pilot flying high enough in "Aware" combat mode will stay pretty far back from a waypoint, the idea being he is "close enough" to engage any targets in the area, he can see the waypoint itself, and if absolutely necessary he could fly to it, but otherwise the chopper considers looking at the target enough.

Pretty sure there are more detailed discussions of what exactly happens in these situations elsewhere on the forum. I also confess to being hopelessly confused about the way units execute their waypoint orders sometimes, even ones assigned from the editor.

Share this post


Link to post
Share on other sites

Hi everyone!

Melmarkian,

What is the exact purpose of this helo, just to circle around a position? Is it for immersion, defense, or what?

It's obvious you have a handle on scripting. However, maybe a Search and Destroy waypoint with a cycle would do what you want. Of course, the helo will not fly in a nice level, neat circle around the position, but even with scripting, good luck with that. I mean, it is AI.

And yes, for air units vs ground units, if you have the exact some waypoints, the air unit will complete the wp before a ground unit will. The game is designed that way.

Heh, I just thought of something. I wonder what would happen if you gave a helo pilot one S&D wp with a cycle, on a marker, then told the pilot to doWatch the marker. (I hardly mess with Arma anymore. I just come in to read once in awhile. If I had time, I would go try it.)

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  

×