Jump to content
Sign in to follow this  
Pundaria

Continuous spawning?

Recommended Posts

I know how to spawn a group using BIS_fnc_spawnGroup

_grp = [position spawngroup, side player, (configFile >> "CfgGroups" >> "West" >> "USMC" >> "Infantry" >> "USMC_InfSquad")] call BIS_fnc_spawnGroup

_wp = _grp addWaypoint [getpos guy, 0];

_wp setWaypointType "MOVE";

_wp setWaypointSpeed "FULL";

Using this kind of script, I need to have different name for group and waypoint. Which I find it extremely tidious to make for say like 3 groups each side.

Is there a better way to spawn a group with a way point over a period of time unlimitedly at a marker without the need to name each group and way point?

I am trying to play sector control with AI~

Edited by Pundaria

Share this post


Link to post
Share on other sites

while {true} do {
  _grp = [position spawngroup, side player, (configFile >> "CfgGroups" >> "West" >> "USMC" >> "Infantry" >> "USMC_InfSquad")] call BIS_fnc_spawnGroup;
  _wp = _grp addWaypoint [getpos guy, 0];
  _wp setWaypointType "MOVE";
  _wp setWaypointSpeed "FULL";
  sleep 60;
};

above will spawn a new group using same type and location of wps after 60 seconds, forever, you can also replace sleep 60; with

waitUntil {({alive _x} count units _grp) == 0};

now it will spawn a group, and wait until all is dead in group then repeat it again, forever.

you can also replace true with a number variable or something to limit amount of times etc..

Share this post


Link to post
Share on other sites
while {true} do {
  _grp = [position spawngroup, side player, (configFile >> "CfgGroups" >> "West" >> "USMC" >> "Infantry" >> "USMC_InfSquad")] call BIS_fnc_spawnGroup;
  _wp = _grp addWaypoint [getpos guy, 0];
  _wp setWaypointType "MOVE";
  _wp setWaypointSpeed "FULL";
  sleep 60;
};

above will spawn a new group using same type and location of wps after 60 seconds, forever, you can also replace sleep 60; with

waitUntil {({alive _x} count units _grp) == 0};

now it will spawn a group, and wait until all is dead in group then repeat it again, forever.

you can also replace true with a number variable or something to limit amount of times etc..

Dunno how to thank you =)

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  

×