Jump to content
Sign in to follow this  
BrashAdam

Update task when spawned group are Dead? NOOB

Recommended Posts

I'm making a mission where on a task completion, a group of OPFOR spawn at a marker and follow a series of waypoints to attack my location. I'm running a .sqf for the spawned  group and everything is going fine as far them spawning and moving goes.

 

The problem I'm having is that I want my new task to update when the group are dead.

Enemy group = enemy1

 

I have a new task and a task state module set up with a trigger, the new task module is linked to my player. the task is assigning and display correctly but not updating when enemy1 are all dead.

 

In the trigger condition line I have;

{alive _X} count units enemy1 == 0;

 

the trigger is linked to the task state module which is set to succeeded.

 

I've tried the above with a group I have placed on the map and it worked fine, just wondering if there is something different you need to do for a spawned group.

 

 

 

Share this post


Link to post
Share on other sites

Seems like you defined the group wrong.

Enemy group = enemy1 

Depends on how you spawn the group there's multiple ways to solve this.

Either you're using BIS_fnc_spawnGroup, or spawn multiple units into a custom group, no idea since you're not giving any info on that.

 

Cheers

Share this post


Link to post
Share on other sites

sorry I should of elaborated more, upon completion of my first task/obj, I have a trigger that calls for the following script;

 

enemy1 = [getMarkerPos "spawn", EAST, 5] call BIS_fnc_spawnGroup;

 

_wp1 = enemy1 addWaypoint [getMarkerPos "wp1", 0];
 _wp1 setWaypointType "MOVE";
 _wp1 setWaypointSpeed "FULL";
 _wp1 setWaypointBehaviour "AWARE";
 _wp1 setWaypointFormation "FILE";

 

_wp2 = enemy1 addWaypoint [getMarkerPos "wp2", 0];
 _wp2 setWaypointType "MOVE";
 _wp2 setWaypointSpeed "FULL";
 _wp2 setWaypointBehaviour "AWARE";
 _wp2 setWaypointFormation "FILE";

 

_wp3 = enemy1 addWaypoint [getMarkerPos "wp3", 0];
 _wp3 setWaypointType "MOVE";
 _wp3 setWaypointSpeed "FULL";
 _wp3 setWaypointBehaviour "AWARE";
 _wp3 setWaypointFormation "DIAMOND";

 

_wp4 = enemy1 addWaypoint [getMarkerPos "wp4", 0];
 _wp4 setWaypointType "SAD";
 _wp4 setWaypointSpeed "FULL";
 _wp4 setWaypointBehaviour "AWARE";
 _wp4 setWaypointFormation "DIAMOND";

 

 

this spawns the group in fine and has them navigate the waypoints.

 

I have a task linked to the player, the task activates on completion of the previous task.

 

I have a task state module set to succeeded that is synced to the task and to a trigger

 

In the trigger condition line I have;

{alive _X} count units enemy1 == 0;

 

As the trigger is linked to the task I thought it would end the task when enemy1 were all dead.

 

I hope this makes sense

 

Thanks in advance

 

 

Share this post


Link to post
Share on other sites

Sounds like a timing problem, since BIS_fnc_spawnGroup doesn't happen instantly enemy1 group is undefined and probably activates the trigger.

You could place a dummy unit somewhere off map, name it "dummy" and put this into its init field:
 

enemy1 = group this;
this hideObjectGlobal true;
this allowDamage false;

Now in the trigger spawning the actual group simply add this line:

deleteVehicle dummy;

Might resolve your issue.

 

Cheers

Share this post


Link to post
Share on other sites

Thanks for your help

 

I'm a total idiot, I had 2 groups named enemy1, one for my first obj and then the group I was spawning, it was looking for an event that had already happened.

 

Changed my spawned group to "wave1" and works perfectly. Noob error but I'm learning

 

Thanks again for your time

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  

×