Comrades in Arms Discussion Board

Full Version: FHQ Task Tracker (Obsolete)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
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:

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 :|
If I ever gonna get back to mission making, this will be my choice. Thanks Varanon!
*The newbie lifts his hand somewhere in the class room*


But... If I make a normal briefing... wouldn't it work on MP? Or is this mainly for tasks that get added later into the mission?


I'm so jealous to people who understand this stuff. Big Grin I've never quite gotten the hang of it. I guess it's just that I'm not able to focus on something like this long enough to start learning it properly!  ;D
(03-12-2013, 05:02 PM)Bubba link Wrote: [ -> ]But... If I make a normal briefing... wouldn't it work on MP? Or is this mainly for tasks that get added later into the mission?

The problem is that briefing texts must be set on each client, and on JIP clients as well. So, you can createDiaryRecord manually, of course, but if you want dynamic adding of briefing text, it will become difficult to maintain.

Plus, for tasks, the same rules apply, tasks have to be marked as succeeded on all clients, and incoming JIP clients need to update their stuff afterwards as well...

That's why I use a script for that sutff...
hey, indeed, very cool stuff. I bow my head, for extraordinary creativity. I´m no expert myself, but as far as i see it, it really joins the advantages of the arma2 briefings with a "simple to use" workflow.


From my small knowledge, i assume, that it would be wise,  to let it start from the init.sqf? Doing so, will run the scritp for all players, no matter when they join and keep the missin lean (no repeated trigger or something). EDIT: Ok, already mentioned above  :Smile


I will immeditaley try that out :-). I think it would be a great help for newbies if this good work is refined with a small tutorial and a sample mission!


Have to try it for arma3 aswell i think :-)! Or did anyone already?
ok, made a quick test, but i got an error message:
Code:
Error in expression <IS_BAF",
["Mission", "Drink some tea"],
]

call FHQ_TT_addBriefing;
>
  Error position: <]

call FHQ_TT_addBriefing;
>
  Error Missing [


in the rpt file. I guess did something wrong, but cant see what... Is there any typo in the code maybe?

If you have a example file and willing to provide it here, it will maybe sort it out aswell!
(03-13-2013, 11:49 PM)Fat Tony link Wrote: [ -> ]If you have a example file and willing to provide it here, it will maybe sort it out aswell!
Here's a snippet from a mission I made:
Code:
private ["_currentMissionSettings", "_count", "_i"];

_currentMissionSettings = "";
_count = count (missionConfigFile >> "Params");
for [ {_i = 0}, {_i < _count }, {_i = _i + 1} ] do
{
    private ["_pname", "_title", "_text"];
    _pname = configName ((missionConfigFile >> "Params") select _i);
    _title = missionNamespace getVariable [format["%1_Title", _pname], ""];
    _text = missionNamespace getVariable [format["%1_Value", _pname], ""];
   
    _currentMissionSettings = _currentMissionSettings + format["%1: %2", _title, _text] + "<br/>";
};

[
    FHQ_playerGroup,
        ["Mission", "US Ranger team 'Raven' is sent to a <marker name=""markJazar"">nearby village</marker> to investigate potential insurgent activity"],
        ["Background",
        "The 75th Ranger Batallion is currently setting up shop at the <marker name=""markAirfield"">South Airfield</marker> " +
        "in response to the start of Operation Righteous Cause. We're here as part of an international peacekeeping force " +
        "in northern Takistan under United Nations Security Council Resolution #2423.<br/><br/>" +
        "British, Czech and German forces are expected to arrive tomorrow or the day after at latest. until that time, " +
        "we're on our own.<br/><br/>" +
        "Reshmaan Province is one of the nothernmost provinces of Takistan. <marker name=""labelArdistan"">Ardistan</marker> lies directly to "+
        "the west. About 100 kilometer further north is the border of Russia. It goes without saying that " +
        "you are to respect these borders at all costs, anything else might cause an international incident " +
        "and might give Ardistan a reason to throw their weight into the insurgency publically."
        ],
        ["Situation",
          "Fifteen minutes ago we have received a cell phone call from a nearby village. The call was in " +
          "broken English, and apparently tried to explain that the village is or was terrorized by a " +
          "group of insurgents.<br/><br/>" +
          "The village of <marker name=""markJazar"">Ghufran</marker> " +
          "is rather insignificant, but this is our first chance to convince the locals that we're on their side. " +
          "Your team is sent out to investigate, and, if necessary, intervene. <br/><br/>" +
          "Be advised, though, that the area outside the airfield should be considered hostile. Security is low, we have a " +
          "couple of patrols in the area but nothing solid"
        ],
        ["Execution",
             "We have an SOV on standby to take you to the village. Ghufran is located about 1.5 klicks " +
            "to the north west of the airfield, along the road leading north. Investigate the " +
            "situation, and report back to HQ.<br/><br/>" +
            "Your team will be fielding the new ACR (designated Mk 22 Mod 0) during this operation. The " +
            "ACR uses a 6.8 SPC round, so its lethality should be better than that of the M4 or Mk16. " +
            "Please file regular reports about the performance of the weapon."
        ],
        ["Opposing forces",
            "The local insurgents know these hills very well. Chances of ambushes along the road are " +
            "high. For the time being, however, a clear picture of the local insurgent forces is not available. " +
            "Be on your guard."
        ],
        ["Allied forces",
            "Occasional foot patrols are operating in the area, however, they are ordered " +
             "to stay <marker name=""labelPatrol"">within half a klick</marker> of the airbase. "
        ]
] call FHQ_TT_addBriefing;

[
    FHQ_playerGroup,
        ["taskInvestigate",                                    // Task name
         "Investigate Ghulfran. A villager has notified command of potential insurgent activity. Drive to the village and investigate.",                // Task text in briefing
         "Investigate",                            // Task title in briefing
         "Investigate",                                            // Waypoint text
         getMarkerPos "markJazar",                                        // position of task, or object task is tied to
         "assigned"                                        // Optional: Initial state
        ]
] call FHQ_TT_addTasks;

I think you problem is

[quote]["Mission", "Drink some tea"] >>,<<
]

call FHQ_TT_addBriefing;[/qiote]

that comma over there.

EDIT: LOL I just saw it was Varanon's fault Smile
Damn, that comma was my mistake... sorry 'bout that
ok, i remved the kmma, but it still doesnt wrk fr me. No Breifing etc showing up, even when using the attached zip file script. I guess noone tried it r have a working example file? I teid t golgel it, but there no reasonable hits for me aswell... Wuld be cool, if we could work it out!
I think the error is in your keyboard Tony  ;D
(03-14-2013, 10:45 PM)Fat Tony link Wrote: [ -> ]ok, i remved the kmma, but it still doesnt wrk fr me. No Breifing etc showing up, even when using the attached zip file script. I guess noone tried it r have a working example file? I teid t golgel it, but there no reasonable hits for me aswell... Wuld be cool, if we could work it out!

Make sure that the group you specify exists. For example, there is an FHQ_playerGroup in front. This is basically who the briefing applies to, so you either have to define that before the briefing,or you put

FHQ_playerGroup = group this;

in the group leader's init field.
the big problem is in front of the keyboard ;-).


But yeah, my microsoft keyboard sucks... I have to open it and fix it some time...


Another line, i cant work out is :
call FHQ_TT_addBriefing
This call another script right?

(03-15-2013, 10:41 AM)Fat Tony link Wrote: [ -> ]Another line, i cant work out is :
call FHQ_TT_addBriefing
This call another script right?

This calls the content of the variable FHQ_TT_addBriefing, which is code in this case. It's basically the same thing as calling another script, yeah.
Yeah, everything FQH_TT_ is functions.. this line:
Code:
call compile preProcessFileLineNumbers "library\fhqtt.sqf";
basically executes the script which initializes the whole system and sets up a lot of variables...

Agterwards, everything is controlled by calling the functions... I find that easier than executing the script every time...
Pages: 1 2 3 4 5 6