PDA

View Full Version : Spawning task for flight mission



finkdean
Aug 20 2011, 15:56
hia, here goes.
Ive made a non combat Flight multiplayer mission which i thinks going to be fun, its based around a small airline company with a fleet of 7 planes (all players), and 1 Air traffic controller (player), i have the individual missions down pat and working.

my problem is this. i dont want all the missions to show up at one time. i want them to spawn in over time or after another mission is completed, e.g how the side missions work in domination or the main missions in tfor, along with this i want to add a new task for each mission stating how many people need pickups from where and going where. possably a time limit on these would be fun 2.

if anyone can help me with this it would be awsome. thanks
DirtDiver

Demonized
Aug 20 2011, 16:20
More info on tasks here: (http://community.bistudio.com/wiki/Tasks)

You can use taskState to determine if a task is succeded or something.


_task1 = player createSimpleTask ["task1"];

waitUntil {sleep 1; (taskState (http://community.bistudio.com/wiki/taskState)_task1) in ["Succeeded","Failed"]};

_task2 = player createSimpleTask ["task2"];
_sub2 = player createSimpleTask ["subtask2", _task2];

waitUntil {sleep 1; (taskState _taks2) in ["Succeeded","Failed"]};
hint "all tasks finished.";

but the best way would be to create the new task where you make the old one failed or succeded..

to make it a limit, have a trigger or script with the amount of timer you wish, and then check if the task is completed, else set it to failed.