engima 328 Posted May 23, 2011 (edited) Hi! I have almost finished my first co04 mission, but before release I must solve one last problem concerning the tasks. The tasks are initialized in init.sqf (task1 = player createSimpleTask ["xxx"]), and I use respawn "SIDE" in description.ext. Problem is that a player who dies, and by that respawn into another AI group member, lose all his tasks, and the task list ('J') appears blank for that player. I want each player to have their tasks with their current task states, regardless of how many times they respawn. How can I manage that? Thankful for any help! Edited May 24, 2011 by Engima Share this post Link to post Share on other sites
sxp2high 23 Posted May 23, 2011 (edited) Just wrap this around: [] spawn { if (!isDedicated) then { while {true} do { waitUntil {alive player}; // your task stuff here waitUntil {!alive player}; }; }; }; Edited May 23, 2011 by sxp2high Added isDedicated check Share this post Link to post Share on other sites
magicpanda 19 Posted May 25, 2011 How about if there are a series of tasks that trigger after each other? Share this post Link to post Share on other sites
engima 328 Posted May 27, 2011 (edited) Ok, now I do the task stuff in another way. I simply create all tasks for all players on all machines. And when I update a task state, I do it on all playable unit's on all machines. Everything works great, including team switching, but if I die and then team switch I get a blank task list (objectives) in the debriefing screen. Why? Before mission ends my tasks are perfectly updated. Isn't it the tasks referenced by my local variables that shows up in the debriefing task list? Edited May 27, 2011 by Engima To better express myself Share this post Link to post Share on other sites
sander 14 Posted May 27, 2011 Perhaps you could elaborate how you are creating the tasks for all players and how you are updating the task states, so people get a better understanding of what your problem might be. My own preference is to create individually named tasks for all named playable slots and then update each of those tasks. So for a playable unit named bravo1 I create task1a and task2a and for the next playable unit bravo2 I create task1b and task2b and so on, then on fulfilling the appropriate condition I have a publicVariable broadcast and I update the task state of the individually named tasks. The on activation line of a trigger would then be for example: VictoryCondition1 = 1; publicVariable "VictoryCondition1"; "1" ObjStatus "DONE"; task1a setTaskState "SUCCEEDED"; task1b setTaskState "SUCCEEDED"; task1c setTaskState "SUCCEEDED"; task1d setTaskState "SUCCEEDED" to update the first task for all four playable units in a mission. It is not an elegant solution, but it works. Regards, Sander Share this post Link to post Share on other sites
engima 328 Posted May 27, 2011 That's almost exactly how I do it too. Only difference is that I use arrays. But my problem is not during the mission. Everything works just fine until mission ends and I see the debriefing screen/dialog. If I don't die during the mission, I see all tasks/objectives, succeeded or failed or whatever and everything is fine. But if I die and team switch into an AI team member, and then finishes the mission, then all tasks seem ok *until* mission ends and the debriefing dialog shows up blank. Why is it blank? All tasks for the current unit is obviously there just a moment before...? Share this post Link to post Share on other sites