Jump to content
redarmy

Possible to repeat same task?

Recommended Posts

Rather than making 20 tasks is it possible to have one task repeat?

 

TASK: Pick up AI and drop them into an area.

This group if it dies will respawn,player should pic up same group again(group name remembered) and repeat the insert,but i would like the task to also pop up again.

 

The way im current activating task in first place,is that upon an even happening,the AI group needing transport spawn at a location,a trigger detects them and task is assigned to pick them up. Task completes when player s in the AO and an activation to get them out of my helo activates and they go on a scripted wp.

 

Looking around for solutions to this brought nothing and im sure there must be a way as im fairly sure i heard of repeating tasks before.

Share this post


Link to post
Share on other sites

As first attempt, you should delete/cancel the task when the group is dead, then create/assign task when respawned.

cancel/assign is simple. You just need a trigger along with the count of units in group as condition.

deleting/creating task is OK by script on activation/deactivation of the trigger.

  • Like 2

Share this post


Link to post
Share on other sites

Maybe you could save all the needed information for your task (for each task if you have more than one) and create it again and again.

 

You can check whether the task is active (if it is already assigned to the player but not necessarily their current task) with the BIS_fnc_taskExists function. If not you can create it. Or you can even set a timer at the task's completion to create it at some later point.

 

Pierremgi got me on this and as they suggest you could also create/assign the the task at their respawn. For that purpose you may be able to use the "Respawn" event handler, or even better use the "onPlayerRespawn.sqf" event script.

  • Like 1

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

×