Jump to content
Sign in to follow this  
jakkob4682

creates waypoints inside a loop

Recommended Posts

how do I create waypoints from a count to eliminate redundancy?

i.e.

for "_i" from 1 to _wpCount do
{
_wp = _grp addWaypoint [_somePos,_someArea,(currentWaypoint _grp) + 1];
}

tried that but doesnt work

I have a seperate code that spawns a defined number of groups, I want those groups to patrol in a certain pattern around a position. i.e.

how would I create a square shaped, octagon shaped, pentagon shaped patrol without having to use the addWaypoint command over and over.

Edited by jakkob4682
clarification

Share this post


Link to post
Share on other sites

All that would do is create the same waypoint multiple times even if it worked.

For it to be any use you would need to read _somepos from an array.

The array would need the locations using markers,objects or actual coords.

example using markers

{
_ind=1;
_wp = grp addWaypoint [getmarkerpos _x,20,_ind];
_ind+_ind+1;
} foreach ["mk4","mk3","mk2","mk1"];

For some reason they work in reverse though, "mk1" will execute first at least when tested in A3

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  

×