Announcement

Collapse
No announcement yet.

Create Tasks Server Side using BIS_fnc_TaskCreate

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [GUIDE] Create Tasks Server Side using BIS_fnc_TaskCreate

    Here are the scripts for the tutorial:

    initServer.sqf
    Code:
    _myTasks = []execVM "scripts\initTasks.sqf";
    scripts\initTasks.sqf
    Code:
    /*
    [owner, nameOrParent, details, destination, state, priority, showNotification, type, visibleIn3D] call BIS_fnc_taskCreate
    
    owner: Boolean, Object, Group, Side or Array - Task owner(s)
    nameOrParent: String or Array - Task name or array in the format [task name, parent task name]
    details: Array or String - Task description in the format ["description", "title", "marker"] or CfgTaskDescriptions classname as string
    destination: Object, Array or String (default: objNull) - Task destination (object, position or marker)
    state: Boolean, Number or String - Task state (or true to set as current)
    priority: Number - Task priority (when automatically selecting a new current task, higher priority is selected first)
    showNotification: Boolean (default: true) - Show notification
    type: String - Task type as defined in the CfgTaskTypes
    visibleIn3D: Boolean - (Optional, default false) always visible in 3D
    */
    //playerInProwler
    //prowerInGarage
    //lunchIsEaten
    
    [west, "tsk1", ["A player must get into the driver seat of the prowler.", "Get In", ""], targetProwler, true, 99, true, "GETIN", true] call BIS_fnc_taskCreate;
    
    [west, "tsk2", ["Take the prowler to the garage.", "Garage", ""], prowlerInGarage_server, "CREATED", 98, true, "MOVE", true] call BIS_fnc_taskCreate;
    
    [west, "tsk3", ["You need to eat lunch.", "Lunch", ""], tacticalBacon, "CREATED", 97, true, "E", true] call BIS_fnc_taskCreate;
    
    playerInProwler = false;
    prowlerInGarage = false;
    tacticalBacon setVariable ["lunchIsEaten", false, true];
    
    []execVM "scripts\taskMonitor.sqf";
    scripts\taskMonitor.sqf
    Code:
    _run = true;
    _notifyPlayerInProwler = true;
    _notifyProwlerInGarage = true;
    _notifyLunchIsEaten = true;
    
    while {_run} do {
    
        if (playerInProwler && _notifyPlayerInProwler) then {
            ["tsk1", "SUCCEEDED", true] call BIS_fnc_taskSetState;
            _notifyPlayerInProwler = false;
        };
    
        if (prowlerInGarage && _notifyProwlerInGarage) then {
            ["tsk2", "SUCCEEDED", true] call BIS_fnc_taskSetState;
            _notifyProwlerInGarage = false;
        };
    
        if (tacticalBacon getVariable "lunchIsEaten" && _notifyLunchIsEaten) then {
            ["tsk3", "SUCCEEDED", true] call BIS_fnc_taskSetState;
            _notifyLunchIsEaten = false;
        };    
    
        sleep 14;
    
        if (playerInProwler && prowlerInGarage && tacticalBacon getVariable "lunchIsEaten") then {
            "EVERYONEWON" call BIS_fnc_endMissionServer;
        };
    };


    Link to the mission on the Steam Workshop
    |TG-189th| Unkl
    ArmA 3 Game Officer
    Dean of Tactical Gamer University
    189th Infantry Brigade Member
    SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN
    "We quickly advance in the opposite direction and take cover in a house on the SW side of town." - BadStache

  • #2
    Thanks for the demonstration, templates and post.

    Current ARMA Development Project: No Current Project

    "An infantryman needs a leader to be the standard against which he can judge all soldiers."

    Friend of |TG| Chief

    Comment

    Connect

    Collapse

    TeamSpeak 3 Server

    Collapse

    Twitter Feed

    Collapse

    Working...
    X