Hi,
Here's the task tracker I wrote to do multiplayer compatible briefings. There's a comment block at the beginning that explains it soms, but here's a quick run-down:
In the init.sqf file, just execute the script:
This will create a bunch of variables that contain the appropriate code.
Adding briefing text is done by calling FHQ_TT_addBriefing. Here's an example:
Tasks are added in a similar fashion:
Note that these will only really execute on the server, so you don't actually need to execute this on the client.
Common examples of task tracking:
Hope it's somewhat clear... I need to write real documentation for it at one point :|
Here's the task tracker I wrote to do multiplayer compatible briefings. There's a comment block at the beginning that explains it soms, but here's a quick run-down:
In the init.sqf file, just execute the script:
Code:
call compile preProcessFileLineNumbers "fhqtt.sqf";
This will create a bunch of variables that contain the appropriate code.
Adding briefing text is done by calling FHQ_TT_addBriefing. Here's an example:
Code:
/* Briefing
* The briefing can be defined by calling FHQ_TT_addBriefing.
* The array is built like this.
* The first element should be a filter (side, group, faction, or a piece of script). All units matching the
* filter will see the briefing
* This is followed by pairs of strings, a head line, and an actual text.
* Briefings are added in the order in which they appear for any unit that matches
* the last filter.
*/
[
 west,
   ["Mission",
    "*** Describe the player's mission in few words ***"],
   Â
   ["Situation",
    "*** Describe the situation, what lead to the current mission, and the current theatre of war ***"],
   Â
   ["Execution",
    "*** Describe the intended way the mission should be carried out ***"],
   Â
   ["Allied forces",
    "*** Describe additional stuff, like allied forces, intel, etc ***"],
   Â
   ["Weather",
    "*** Describe the current and expected weather ***"],
   Â
   ["Credits",
    "Mission by  <br/>"],
  "BIS_BAF",
       ["Mission", "Drink some tea"],
 Â
] call FHQ_TT_addBriefing;
Tasks are added in a similar fashion:
Code:
[
 FHQ_playerGroup,                             // Filter
   ["taskPlayer1",             // Task name
    "Task for the main player group",         // Task text in briefing
    "Some player task",          // Task title in briefing
    "!",                // Waypoint text
                     // Optional: Position or object
    "assigned"             // Optional: Initial state
    ]
] call FHQ_TT_addTasks;
Note that these will only really execute on the server, so you don't actually need to execute this on the client.
Common examples of task tracking:
Code:
1. Assign a task as current task:
["taskDestroy", "assigned"] call FHQ_TT_setTaskState;
2. Check if a task is completed (Note, might be successful, failed or cancelled)
if (["taskInsert"] call FHQ_TT_isTaskCompleted) then {hint "yes";};
3. Check if a task is successful
if (["taskDestroy"] call FHQ_TT_isTaskSuccessful) then {hint "yay";};
4. Mark a task and select another task that is not completed yet.
["taskDestroySecondary", "succeeded", "taskDestroyPrimary", "taskDestroySecondary", "taskExfiltrate"]
     call FHQ_TT_markTaskAndNext;
Hope it's somewhat clear... I need to write real documentation for it at one point :|