World in Conflict Tool for ArmA2 Wiki
Register
Advertisement

Compatible with v7.0c (26/03/2011)

WICT v6.0 brings setting up tasks on Dedi server to a new level.

WICT_guide_part_2_-_storyline

WICT guide part 2 - storyline

Required readings :

  1. Multiplayer framework
  2. Double trigger method
  3. rEXECVM and Dedi

Recommended tool :

Briefing Manager by alimag

Thanx to mikey's taskHint.


Introduction[]

Assigning tasks to players is very important for keeping them (in)sane in a sandbox game. Each time I created a sandbox mission first comments were : "I don't know where to go? What I am supposed to do?". I simply didn't have time or knowledge to make something easy to use and Dedi friendly.

Now WICT v6.0 brings you useful scripts that you can call and do whatever you want with tasks!!!

So let us begin.

Sandbox_exe.sqf[]

You will frequently see this file mentioned.

Example: [nil,nil,rEXECVM,"WICT\sandbox\sandbox_exe.sqf","WICT\sandbox\","taskCreator","Airport base","mixedBase_1","yes","Primary: capture enemy base!","Intel: * Capture the enemy base at the airport. ** Background info:< br/ >put some text here -- use Briefing manager to easily write the text and of course Word Wrap in your text editor :) be creative :D","yes","all"] call RE;

where * are HTML command for break line < br/ >

What does it mean?

This is Multiplayer framework command, and in this example it executes script WICT\sandbox\sandbox_exe.sqf which then executes WICT\sandbox\taskCreator.sqf and creates a task from specified parameters.

Task parameters[]

1) this will be the location of the task (String - optional - default: blank "") -- you can make your own description that will appear in dynamic briefing e.g. "middle of nowhere..."

2) this will be marker of that location (String - optional - default: blank "") -- this marker will be associated with HUD marker and with coordinates in dynamic briefing

3) this will dynamic briefing about the task that was given (optional) -- "yes" if you want it, if not you can leave it blank "" (no need to write "no", but you can)

4) Enter task title

5) Enter task message

6) Assign this task uppon creation ("yes" or "no", default "no" or leave it blank "")

7) Write side, but in the for of string (with quotes) "west", "east", "civilian", "resistance" or "all" (default "all", or blank "").

Task status[]

To manage some task you simply make a trigger that publicVariable "task_report" with task title and task status.

Example:

task_report = ["Primary: capture enemy base!","s"]; publicVariable "task_report"; will make task with title Primary: capture enemy base! SUCCEEDED (s). You can also make it FAILED (f) or CANCELED (c).

How to use[]

  1. Create trigger
  2. Name the trigger (if you want to connect it with some other, see below)
  3. Activation : anybody + present + once
  4. Timeout : 2 + 2 + 2
  5. Condition: (vehicle player) in thislist
  6. on Act.: task_report = ["Primary: capture enemy base!","s"]; publicVariable "task_report";

Making story - linking tasks[]

You can link tasks with trigger names.

  1. Create trigger
  2. Name the trigger (trig1)
  3. Activation : anybody + present + once
  4. Timeout : 2 + 2 + 2
  5. Condition: (vehicle player) in thislist
  6. on Act.: task_report = ["Primary: capture enemy base!","s"]; publicVariable "task_report"; [nil,nil,rEXECVM,"WICT\sandbox\sandbox_exe.sqf","WICT\sandbox\","taskCreator","","hq_1","","Go here","Just go here, that will be your new HQ, nothing fancy...","yes","all"] call RE;

this will give another task after the first one is completed.

Next trigger that links to the first one should look like this :

  1. Create trigger
  2. Name the trigger (trig2)
  3. Activation : anybody + present + once
  4. Timeout : 2 + 2 + 2
  5. Condition: triggeractivated trig1 and (vehicle player) in thislist
  6. on Act.: task_report = ["Go here","s"]; publicVariable "task_report";

Removing tasks[]

Open WICT\sandbox\taskMonitor.sqf

At the end of the file, after task update add some lines, it should like this (YOU add bold lines):

if (_tsk_status == "s") then {call compile format ["tskObj%1 setTaskState ""SUCCEEDED""; [tskObj%1] execVM ""WICT\sandbox\fTaskHint.sqf"";",_tskNum];};
if (_tsk_status == "f") then {call compile format ["tskObj%1 setTaskState ""FAILED""; [tskObj%1] execVM ""WICT\sandbox\fTaskHint.sqf"";",_tskNum];};
if (_tsk_status == "c") then {call compile format ["tskObj%1 setTaskState ""CANCELED""; [tskObj%1] execVM ""WICT\sandbox\fTaskHint.sqf"";",_tskNum];};

sleep 20;
_null = call compile format ["player removeSimpleTask tskObj%1;",_tskNum];

Checking task status[]

You can always check a status of the task, because they are recorder in the list :

{
    if (((_x select 0) == "The longest vacation") and ((_x select 1) == "s")) then 
    {
         //something happens if that task is e.g. successful
    };
    
    if (((_x select 0) == "The longest vacation") and ((_x select 1) == "f")) then
    {
         //something happens if that task is e.g. failed
    };
} forEach WICT_tasks_list;
Advertisement