Jump to content
Sign in to follow this  
TraxusIV

HOW TO: Setting up a single patrol route for multiple squads

Recommended Posts

Ok, so this was going to be a question thread, but I managed to figure out how to do what I wanted before I posted, so now it's just a how to thread, so any other nubs like me won't have to spend a couple hours trying to figure out how to do this.

The goal is to set up multiple (two in this example) infantry squads patrolling the perimeter of the Stratis Air Base. They could be set up by making two squads, and a separate set of waypoints for each squad, but that seems like the wrong way to go about it. A better way is to make use of several scripting functions, namely copyWaypoints and setCurrentWaypoint.

Let's start out by creating two infantry squads on the airfield. Next, highlight the first squad leader, pull out your waypoint tool, and give him a circular path of waypoints to follow. Be sure that the last waypoint is set to CYCLE under the SELECT TYPE menu.

Next, double click on the first squad leader to open up his editing window. Assign him a name (SGTButters, for example), then in the initialization box, create a variable you can use to reference his group:

buttersGroup = group this;

buttersGroup is the variable name here, group is a scripting command, and this is a keyword that refers to the current object (SGTButters). Anyway, now we can refer back to SGTButters group. So now click ok, and open up your second squad leader. Assign him a name if you like (SGTChaos, perhaps?), then in the initialization box use the following:

(group this) copyWaypoints buttersGroup;
(group this) setCurrentWaypoint [(group this), 4];

Again, this time we refer to the squad leader's group by using the group function. Then we copy the set of waypoints from the first squad leader to our second one. Lastly, we set our second squad leader to start at waypoint 4 (in my test case, I had 8 total waypoints). You should now have two squads running in a big circle on the airfield.

I'm sure there are ways to improve this. If anyone has any suggestions, please comment.

Thanks,

Trax

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  

×