Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
twiddlingthumbs

How do you group units in .sqf alone without use of editor?

Recommended Posts

Using the basic script below, I want Bob to be a Group Leader and have other units assigned to his group and follow his commands, like you would do in the editor by using the F2 group tool, but I only want to use sqf alone.

I don't understand how you use the Group command and how to apply it to an array.

_groupOne = Bob;

_groupOne setSpeedMode "LIMITED";

_groupOne doMove (getMarkerPos "Marker1");

waitUntil {

((_groupOne distance getMarkerPos "Marker1") < 0.5)

};

_groupOne doMove (getMarkerPos "Marker2");

waitUntil {

((_groupOne distance getMarkerPos "Marker2") < 0.5)

};

_groupOne doMove (getMarkerPos "Marker3");

waitUntil {

((_groupOne distance getMarkerPos "Marker3") < 0.5)

};

_groupOne doMove (getMarkerPos "Marker4");

waitUntil {

((_groupOne distance getMarkerPos "Marker4") < 0.5)

};

//So when Bob moves to the Markers he has is group follow him as well.

Thank you.

---------- Post added at 22:36 ---------- Previous post was at 21:31 ----------

I've found out a way on my own. Can someone please check this is the proper way to do it.

groupOne = group Bob, group Tom;

groupOne setSpeedMode "LIMITED";

sleep 5;

_wp = groupOne addWaypoint [getMarkerPos "marker1", 0];

Share this post


Link to post
Share on other sites

Ok, now I am facing another problem. The units move with their guns raised, (not across their chest pointing to the ground). I want them to walk around in a patrol like fashion.

groupOne = group Bob;

[Tom,Paul] join group Bob;

groupOne setSpeedMode "LIMITED";

groupOne setBehaviour "AWARE"; // I have tried "CARELESS" as well.

[groupOne, 2] setWaypointCombatMode "GREEN";

sleep 5;

_wp = groupOne addWaypoint [[5424,17892,76], 0];

_wp2 = groupOne addWaypoint [[5401,17893,76], 0];

_wp3 = groupOne addWaypoint [[5396,17927,76], 0];

_wp4 = groupOne addWaypoint [[5496,17927,76], 0];

_wp4 setWaypointType "CYCLE";

Share this post


Link to post
Share on other sites
Sign in to follow this  

×