#Waypoints Test Mission
1 messages · Page 1 of 1 (latest)
Either works.
yeah
You have two addActions. One to bring the copper to the LZ and loiter. Another to make it land.
I haven't tried setCurrentWaypoint yet though.
As you suggested.
Just tried it. Same issue.
Well. Maybe not. Sometimes it lands sometimes not.
It really does have a bullshit waypoint from somewhere :P
When I saw this before, the extra waypoints were usually [0,0,0]
SO WEIRD
but this one is 400m down the runway.
well it is supposed to fly to the trigger zone.
its pretty far away if thats what you mean
hmm, what printed the "loiter" hint?
the trigger area near the lz marker
Its not needed.
I found this:
// for altitudes below 10m
_helicopter flyInHeight 5; // helicopter will land```
deleteWaypoint [_group, 0];
deleteWaypoint [_group, 1];
I've got it to work a couple time but the trick is the code needs to run when the heli is already below 10m and idk how it would know that.
what happens here is that the first deleteWaypoint shifts the loiter down to index 0, and then the second delete doesn't do anything.
You should do 1 before 0.
The reason I put 2 in there is cause of the one that sometimes gets created out of nowhere. I wanted to cover all bases.
Hmmm. So how to delete both then? I tried reversing as you said but it still takes off.
I haven't actually replicated it taking off anyway.
This does actually delete both waypoints at least:
deleteWaypoint [_group, 1];
deleteWaypoint [_group, 0];
Ah, maybe if you give it the land order before it reaches the loiter...
I haven't actually replicated it taking off anyway. You mean to say its stay on the ground for you?
Yeah, I think if you give the land order after it's into the circling phase then it stays landed even if the loiter WP is active?
but if it's in the travel phase then it takes off.
Normal waypoint bullshit. Complex waypoints are even less trustworthy than simple ones :P
If you delete both waypoints then hopefully it stays landed regardless.
I have been giving tha land order after it starts loitering and it still takes off.
hmm ok, it did take off that time even with the deletion.
I guess there's something even buggier in here.
I guess when you give the land command it doesn't clear the previous move state, so once that terminates it returns to that state.
Not sure what a good workaround would be.
I get a little closer
_group = HeliGroup2;
deleteWaypoint [_group, 1];
deleteWaypoint [_group, 0];
_markerName = "marker1_1";
_waypointPosition = getMarkerPos _markerName;
_waypoint = _group addWaypoint [_waypointPosition, 0];
_waypoint setWaypointType "MOVE";
if (heli_2 distance markerPos "marker1_1" < 200) then {
heli_2 land "LAND";
hint "Im here"};
One sec thats wrong
There we go.
Put that in the addAction with a second marker named marker1_1
That might work simply because it more or less guarantees that the heli will be within the waypoint completion radius when it lands.
One problem with it though.
For some reason you have to use the addaction TWICE.
So the FIRST time it gets really close to the marker but hover. The SECOND time you do the addAction it will land.
3d position is problematic there :P
I think maybe its just not getting to the marker close enough on the first one? idk how to make that happen.
Don't have any good ideas anyway. Ideally you'd clear the AI state somehow but Arma lacks commands for that.
If you knew where it was going to land you could give it a move waypoint there immediately before you gave the land command, and it'd probably stick.
but I'm not sure if that'll work if it lands too far from the waypoint.
Without the check. You just create the waypoint and then land regardless.
but this requires guessing roughly where it'll land.
I tried. It just lands immediatley in that case.
Oh I see what you are saying. Lemme try.
In that case just wait for the move waypoint to expire and give the land command then.
And then there shouldn't be any outstanding move state. Hopefully.
You can either use setWaypointStatements or a spawn to do the waiting.
Ok without the check it does the thing where it hovers and you need to run the addACtion twice to land it
Yeah you can't just put an if there. You need to watch.
The easy way would be _waypoint setWaypointStatements ["true", "heli_2 land 'LAND'"];
but I hate setWaypointStatements :P
idk what those are
It's just a code string that runs when the waypoint completes.
you could instead use a spawn that watches the value of currentWaypoint
What if I addwaypoint then setcurrentwaypoint one right after the other? Thus far I've tried only one or the other not both.