Jump to content
Sign in to follow this  
Blakestophen

Spawned Group Waypoint, !alive, and Repeating Triggers

Recommended Posts

Hello,

I have a few problems with my mission. I have a trigger that needs to be set by the death of any civilian, or any created by the Ambient Civilians Expansion Module. Once the civilian dies he sets off a trigger that will use bis fnc spawnGroup to spawn a Takistani Militia Group outside of the town, which is the first wave. Now this just spawns a random group. Is there anyway to get this group to have a waypoint when they spawn in to move into the town? I also need this trigger to be repeating. I need infinite waves of militia that keep trying to move into town.

Any help is appreciated, thanks guys!

Share this post


Link to post
Share on other sites

Here's a cycling / wave script. Spawns a group(s) to attack a location. When said group is dead, it respawns a new random group.Place a functions module on the map and a gamelogic named server (standard shit for MP map, if that's what you're doing)

init.sqf

groundSpawnTK = compile preprocessFile "groundSpawnTK.sqf";

You can call as many groups as you like.Just use your own values for the call. ie; object names for both spawn and destination, and also the groups name. If you call the script from an external script, you'll have to define the groupname(s) as grpNull before you call the script. ie;groupName=grpNull; If you use trigger, then you can just simply call the script.

_handle=[spawnPointname,destinationName,grpName] spawn groundSpawnTK;

groupSpawnTK.sqf

if (!isServer) exitWith {};

waituntil {!isnil "bis_fnc_init"};  

 _spawnLocation = _this select 0;
 _destination = _this select 1;
 _group = _this select 2;

_groupArray = [
              ["Infantry", ["TK_InfantrySquad","TK_InfantrySection","TK_InfantrySectionAT","TK_InfantrySectionAA","TK_InfantrySectionMG","TK_SniperTeam","TK_SpecialPurposeSquad"]],
              ["Motorized", ["TK_MotorizedInfanterySquad","TK_MotorizedReconSection","TK_MotorizedPatrol"]],
              ["Mechanized", ["TK_MechanizedInfantrySquadBMP2","TK_MechanizedInfantrySquadBTR60","TK_MechanizedSpecialSquad","TK_MechanizedReconSection","TK_MechanizedReconSectionAT"]],
              ["Armored", ["TK_T72Platoon","TK_T55Platoon"]]
             ];

             _randomGroup = _groupArray call BIS_fnc_selectRandom;
             _type = _randomGroup select 0;
             _randomGroups = _randomGroup select 1;
             _randomGroupType = _randomGroups call BIS_fnc_selectRandom;

             _group = [getPos _spawnLocation, EAST, (configFile >> "CfgGroups" >> "East" >> "BIS_TK" >> _type >> _randomGroupType)] call BIS_fnc_spawnGroup;
             [_group,position _destination] call BIS_fnc_taskAttack;
             //[_group, position _destination, 100] call bis_fnc_taskPatrol //Patrol an area instead if you like

             waitUntil {({alive _x} count units _group) < 1};
             _handle=[_spawnlocation,_destination,_group] spawn groundSpawnTK



You can substitute the above group types to your own liking. If you don't want the script to respawn another random group after formentioned group is dead, just add // in front of the very last statement in the script.

example of calling a few random groups via external script:

someScript.sqf or init.sqf (at bottom)


if (!isServer) exitWith {};

alpha=grpNull;
bravo=grpNull;
charlie=grpNull;
delta=grpNull;
emo=grpNull;
foxtrot=grpNull;
geco=grpNull;
hoover=grpNull;
igneous=grpNull;
jackal=grpNull;

_handle=[pad1,defend,alpha] spawn groundSpawnTK;
_handle=[pad2,defend,bravo] spawn groundSpawnTK;
_handle=[pad3,defend,charlie] spawn groundSpawnTK;
_handle=[pad4,defend,delta] spawn groundSpawnTK;
_handle=[pad5,defend,emo] spawn groundSpawnTK; //Never use [b][u]echo[/u][/b] as a group name. You'll get an error. Try it out and see.
_handle=[pad6,defend,foxtrot] spawn groundSpawnTK;
_handle=[pad7,defend,geco] spawn groundSpawnTK;
_handle=[pad8,defend,hoover] spawn groundSpawnTK;
_handle=[pad9,defend,igneous] spawn groundSpawnTK;
_handle=[pad10,defend,jackal] spawn groundSpawnTK;

Edited by Iceman77

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  

×