#Waypoints Test Mission

1 messages · Page 1 of 1 (latest)

spice citrus
#

I can sen either

sour apex
#

Either works.

spice citrus
#

One moment.

#

Do you have SOGPF? Its on cam lao nam

sour apex
#

yeah

spice citrus
#

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.

sour apex
#

It really does have a bullshit waypoint from somewhere :P

#

When I saw this before, the extra waypoints were usually [0,0,0]

spice citrus
#

SO WEIRD

sour apex
#

but this one is 400m down the runway.

spice citrus
#

well it is supposed to fly to the trigger zone.

#

its pretty far away if thats what you mean

sour apex
#

hmm, what printed the "loiter" hint?

spice citrus
#

the trigger area near the lz marker

#

Its not needed.

#

I found this:

// for altitudes below 10m
_helicopter flyInHeight 5; // helicopter will land```
sour apex
#
deleteWaypoint [_group, 0];
deleteWaypoint [_group, 1];
spice citrus
#

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.

sour apex
#

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.

spice citrus
#

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.

sour apex
#

yes, but you made a logic error :P

#

So you're actually only deleting the one waypoint.

spice citrus
#

Hmmm. So how to delete both then? I tried reversing as you said but it still takes off.

sour apex
#

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...

spice citrus
#

I haven't actually replicated it taking off anyway. You mean to say its stay on the ground for you?

sour apex
#

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.

spice citrus
sour apex
#

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.

spice citrus
#

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

sour apex
#

That might work simply because it more or less guarantees that the heli will be within the waypoint completion radius when it lands.

spice citrus
#

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.

sour apex
#

3d position is problematic there :P

spice citrus
#

I think maybe its just not getting to the marker close enough on the first one? idk how to make that happen.

sour apex
#

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.

spice citrus
#

That's what I did in the above example no?

#

I gave it a move waypoint to a marker.

sour apex
#

Without the check. You just create the waypoint and then land regardless.

#

but this requires guessing roughly where it'll land.

spice citrus
#

I tried. It just lands immediatley in that case.

sour apex
#

Oh, was that not the idea?

#

In that case fair enough.

spice citrus
#

Oh I see what you are saying. Lemme try.

sour apex
#

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.

spice citrus
#

Ok without the check it does the thing where it hovers and you need to run the addACtion twice to land it

sour apex
#

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

spice citrus
#

idk what those are

sour apex
#

It's just a code string that runs when the waypoint completes.

#

you could instead use a spawn that watches the value of currentWaypoint

spice citrus
#

What if I addwaypoint then setcurrentwaypoint one right after the other? Thus far I've tried only one or the other not both.