Jump to content
Sign in to follow this  
frosties

Tasks to group?

Recommended Posts

I have a couple of objectives that the players need to complete.

However it seems that the objective comes to the player locally, instead of the group/team wich makes it hard to complete tasks as a group since if someone have completed a task, noone else on the team get it as completed.

Task example:

cond:

local player

on act:

tskKillCO = player createSimpleTask ["Kill the enemy colonel hiding in the town or the surrounding areas."];    
tskKillCO setSimpleTaskDescription ["Find and eliminate the enemy commander.", "Eliminate the commander", "CO"];  
tskKillCO setTaskState "Assigned";      
taskhint ["Eliminate the commander!"];

Share this post


Link to post
Share on other sites

Updating doesnt work with something like this?

cond: !alive commander

onact: tskKillCO settaskstate "succeeded"

Share this post


Link to post
Share on other sites

yes, that part is working, but the problem is that each player gets the objective personally i think.

So when one player in the group completes it, the rest of the squad still has it as uncompleted.

I would like it so that if a person in a squad/side completes it it should stay complete for the entire squad/side

Share this post


Link to post
Share on other sites

It will work fine as long as you make sure that the !alive or whatever information gets to each player.

Share this post


Link to post
Share on other sites

if i have an entire squad that needs to be dead?

!alive Squad1 isnt working.... Only if i name one of the soldiers Squad1

Share this post


Link to post
Share on other sites

thank you, will give that a go!

EDIT:

Cant get it to work, might be doing something wrong here.

Trigger -

cond:

{alive _x} count units Squad1 < 1

on act:

tskEliminateSquad1 setTaskState "Succeeded";

Im grouping Squad1 with two soldiers with:

Init:

this setGroupid ["Squad1"]

Am i missing something or doing it wrong?

Edited by Frosties

Share this post


Link to post
Share on other sites

So i dont have to put it in every unit, just the squad leader?

Does it work the same way with vehicles?

Thanks all for the help!

Share this post


Link to post
Share on other sites

With AIs you only need to do it in the leader's (or any squad member's) init field.

However, for players (playable units) you should do it in every field. That's because there might be time when that slot where it is doesn't get picked, and AI get's disabled. Thus, the command doesn't get run at all.

Share this post


Link to post
Share on other sites

Aah!

That explains alot, thank you!

EDIT:

Just tried it on both vehicles and infantry!, Really appreciate your help!

Edited by Frosties

Share this post


Link to post
Share on other sites

It works with all units, and it need only be in the squad leader's init field :)

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  

×