Jump to content
Sign in to follow this  
james mckenzie-smith

Branching waypoints?

Recommended Posts

Is there a way to make branching waypoints? Let's say you have a normal linear waypoint system. Would it be possible at one waypoint to have TWO possible options, where one option is taken if a trigger is activated, while the other is taken if the trigger is not activated?

Share this post


Link to post
Share on other sites

Toasted Duckie, I tried that out. Here's what I did.

1. I made a vehicle with grp1 = groupthis in its init field.

2. I made it one waypoint.

3. I made a trigger, that was activated by the presense of a civilian. I placed the civilian in the trigger's radius, and made a text event so that I could verify that the trigger had been activated.

4. In the trigger's On Act. field, I placed the following: [grp1, 1] setWaypointPosition [getPos AAA, 0]

5. I placed an invisible H on the position where I wanted the WP to go and gave it the name AAA

On starting the missing, nothing happened that was supposed to happen. The vehicle steadfastly moved to the waypoint's original position and nowhere near the invisible H. I also tried naming my own character as AAA; nothing.

Will this be a case of needing to type in the XYZ coords and forgetting the whole getPos thing?

Share this post


Link to post
Share on other sites

If the unit only has one single waypoint I believe that one is indexed as waypoint 0, so it should look like:

[grp1, 0] setWaypointPosition [getPos AAA, 0]

Share this post


Link to post
Share on other sites

You can also create several waypoint paths, each ending with a HOLD or CYCLE waypoint, and use switch triggers to move between them.

ie:

Path 1: MOVE > MOVE > CYCLE > Path 2: MOVE > MOVE > CYCLE

If left untouched, the group will follow path one, with the cycle waypoint (correctly positioned) to send it back to the start. To move the unit / group onto Path 2, you would create a switch trigger and sync it to the final waypoint of path 1 (the CYCLE waypoint), (When a switch trigger is synced to a waypoint, and the trigger fires, the waypoint is considered complete and moves to the next one, if one exists.)

Using multiple paths and repeatable triggers, you can make something quite complicated without touching scripting in any form. The only disadvantage is the confusion thousands of waypoints could cause in a large scale mission, which is the point where scripting becomes useful.

Edited by bhaz

Share this post


Link to post
Share on other sites

Inlompetent, I understood waypoint 0 to be the starting location of the unit. Regardless, I did as you suggested, and once again, no positive result.

Bhaz, I know of that particular use of waypoints, and while it is most useful, it is not quite what I am looking for.

Thanks both of you for your input, notwithstanding that I am still foiled by this issue.

Share this post


Link to post
Share on other sites

I uh made a system for branching waypoints, by using Location objects and the synchronization tool to create a directed graph :P

I'll share it one day, after I polish it. It's script-heavy, and pretty useless if you're the kind of person who can accomplish 90% of what you want through the in-game editor.

Share this post


Link to post
Share on other sites

Does the Arma scripting language have conditional statements (if-then-else)?

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  

×