Jump to content
Sign in to follow this  
dragon01

Tripping a trigger on waypoint completion

Recommended Posts

I've been trying out mission layouts lately and I found that I'm stuck on what seems to be a rather frustratingly trivial matter. Is there any way to make a trigger trip when a given waypoint is completed? Biki has been of no help. For example, I want an insertion helo to fly off after the squad has boarded it. So, after the squad completes its "GET IN" waypoint I want to trip a trigger that skips the helo's "HOLD" waypoint and sends it on its way. Honestly, I thought it'd be an easily-accessed function in Eden, but not only it is not the case, the scripting command that checks for waypoint completion is nowhere to be seen (or at least I can't find it).

 

Another thing I'd like to ask is how to make AI fire their weapons from FFV positions (preferably on waypoint completion by their vehicle, of course). I assume that's a scripting command as well, but I wasn't able to find that one, either.

Share this post


Link to post
Share on other sites

You could skip the trigger all together and put this in the condition field of the helicopter's HOLD waypoint:

{alive _x && _x in insertHeli} count units infGrp1 == {alive _x} count units infGrp1

This condition will fire once all units that are still alive, are inside the helicopter.

Share this post


Link to post
Share on other sites

Why not use a "LOAD" waypoint synced with the "GET IN" for the chopper instead of a "HOLD" ?

Share this post


Link to post
Share on other sites

The above comments (synchronized load and get in waypoints) are the correct way to handle this situation.

 

In case someone else ends up here due to a Google search and has a somewhat different issue which really does need to run on waypoint completion, just be aware that waypoints have an "on activation" section which allows you to run commands just like in a trigger. That's the spot to place things that you'd like to run once the waypoint is complete.

Share this post


Link to post
Share on other sites

Why not use a "LOAD" waypoint synced with the "GET IN" for the chopper instead of a "HOLD" ?

Thanks, I didn't think of that (there should really be better documentation for what exactly various waypoint types do). However, this only covers the simplest situation in which this comes up. I was using a particularly trivial example, but I can think of something more complicated. 

 

I'm still looking for a solution in the more generic case. I am aware of situation-specific workarounds, but the question was, is there any way to check if a waypoint is completed? I know that I could probably modify a variable in the "on activation" field and have a trigger check the variable state, but I wonder if there's a single command with which I could do it (which would be much tidier than fooling about with variables).

 

For example, let's say we have three groups of infantry, each with their own waypoints. When all three have completed certain waypoints, a trigger trips (say, upon completing a "MOVE" waypoint, they get to "HOLD", which is then disabled once all three have moved into position). It could be easily done with a variable, but I think a more elegant solution would be a trigger activation condition checking for waypoints being completed.

Share this post


Link to post
Share on other sites

 (there should really be better documentation for what exactly various waypoint types do).

There is:

https://community.bistudio.com/wiki/Waypoint_types

 

 

As far as checking waypoint completion goes, the activation field is the default way to go.

Alternately if you want to check it directly, you can use the "currentWaypoint" command to see if the index of the current waypoint is higher than the one you want to check.

Share this post


Link to post
Share on other sites

Thanks. I suppose the index is the way to go, though it looks untidy and not very robust (say, a waypoint may get deleted, renumbering the whole shebang). I would think you could just name a waypoint and have something like "isWaypointComplete" that would return a boolean.

Share this post


Link to post
Share on other sites

Thing is, if you do name your waypoint then you could just as easily use the activation field instead, to set a variable.

myfunkywaypoint_complete = true;

Easy

Share this post


Link to post
Share on other sites

Yes, I know. Either that, or incrementing a numerical variable (good for situations in which you need a group of waypoints to have completed) would work in most cases, but neither of those method is universal, because it seems that you can't have an "on activation" command on a waypoint added by addWapoint (but you can give it a name). All in all, it's quite surprising that there's no command to check something this fundamental.

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  

×