Page 1 of 19 1234511 ... LastLast
Results 1 to 10 of 181

Thread: Taskmaster 2

  1. #1

    Taskmaster 2

    Features:
    - The script is server driven; all task additions and updates are called on server side. All changes are broadcasted to players in one array variable. This enables more work to be done only on server, since most of AI-related things happen there anyway. This way the number of triggers placed goes down, as they are unnecessary for clients (players). Number of publicvariabled variables goes down also.
    - Only one eventhandler is created instead of one per task.
    - As tasks are kept in an array, no global variable is created for each task.
    - No "call compile format" type of coding.
    - Variables used to check for task states and statuses are replaced with functions, cutting down number of global variables.
    - Usage simplified; briefings are easier to create, some parameters are made optional.


    Creating a briefing in init.sqf
    Code:
    [[
      ["Task1","Task1Title","Task1Desc"],
      ["Task2","Task2Title","Task2Desc",true,["markerTask2",getpos obj2]]
    ],[
      ["Note1","Hello West",WEST],
      ["Note2","Hello East",EAST],
      ["Credits","Made by: Shuko of LDD Kyllikki<br />www.kyllikki.fi"]
    ]] execvm "shk_taskmaster.sqf";
    Task Data
    Code:
    ["TaskName","Title","Description",Condition,[Marker],"State",Destination]
        
    Required parameters:
    TaskName      string     Name used to refer to the task
    Title         string     Task name shown in the in/game task list
    Description   string     Task description, the actual text body
        
    Optional parameters:
    Condition     boolean/side/faction/unit/group/string   Units the task is added to. Default is everyone
    Marker        array     Marker related to the task. It will be created only for the units who have the task. Marker will be hidden after task is completed. Can be an array of marker arrays, if you want to create multiple markers.
      Name        string    Name of the marker to create.
      Position    string    Position of the marker.
      Type        string    Marker type. Optional, default is "selector_selectedMission".
      Color       string    Marker color. Optional, default is red.
    State         string    Task state of the newly created task. Default is "created".
    Destination   object/position/marker   Place to create task destination (game's built-in waypoint/marker). If an object is given, setSimpleTaskTarget command is used, attaching the destination to it.
    Condition (limiting the units to who the tasks and notes are created)
    Code:
    Examples:
      [...,WEST]               All playable units on BLUFOR (WEST)
      [...,"USMC"]             Faction USMC
      [...,grpMarine1]         Units that belong to group named grpMarine1
      [...,myDude]             Unit named myDude
    Then there is the IF syntax, so you can create a condition anyway you want, where _x is the unit (=player).

    Code:
    Examples:
      "((group _x == grpScouts) OR (_x == pilot1))"     Members of grpScouts and unit named pilot1
      "(typeof _x == ""CDF_Soldier_Sniper"")"           All CDF snipers
    TaskState
    The task state of the newly created task. Valid states are succeeded, failed, canceled and assigned. Default is assigned.


    Note Data
    Code:
    [NoteTitle,NoteText,Condition]
        
    Required parameters:
      NoteTitle     string     Text shown in the list
      NoteText      string     The actual note text body
          
    Optional parameters:
      Condition    boolean/side/faction/unit/group/string   Units the note is added to. Default is everyone.


    Updating tasks
    Task states are updated by calling a function. Possible states are: succeeded/failed/assigned/canceled.
    Code:
    Example: ["Task1","succeeded"] call SHK_Taskmaster_upd;
    It's possible to set state of one task and set another as assigned using an optional 3rd parameter.
    Code:
    Example: ["Task1","succeeded","Task2"] call SHK_Taskmaster_upd;
    This will make task state of task Task1 to succeeded and the state of the task Task2 as current.

    Another optional 3rd parameter can be used to add a new task after updating another task.
    Code:
    Example: ["Task1","succeeded",["Task2","Title","Desc"]] call SHK_Taskmaster_upd;
    This will make task Task1 as succeeded and create a new task Task2. Same set of parameters is used for the creation as in init.sqf or SHK_Taskmaster_add.



    Creating tasks during a mission

    Tasks can be added after briefing with the add function. Same set of parameters is used as in creating a briefing. The new task is set as current task automatically.

    Code:
    Example: ["Task2","Extraction","Get to teh choppa!"] call SHK_Taskmaster_add;

    Functions

    SHK_Taskmaster_isCompleted
    This function can be used to check if a task is completed. Task is considered completed with states succeeded, failed and canceled. Function returns a boolean (true/false) value.

    Code:
    Example: "Task1" call SHK_Taskmaster_isCompleted
    SHK_Taskmaster_getAssigned
    Returns list of tasks which have "assigned" as their state.

    Code:
    Example: call SHK_Taskmaster_getAssigned
    Example result: ["Task1","Task4"]
    SHK_Taskmaster_getState
    Returns the task state (succeeded/failed/canceled/assigned/created).

    Code:
    Example: "Task1" call SHK_Taskmaster_getState
    SHK_Taskmaster_hasState
    Checks if a task's state matches the given state. Function returns a boolean value.

    Code:
    Example: ["Task1","succeeded"] call SHK_Taskmaster_hasState
    SHK_Taskmaster_hasTask
    Checks if a task with the given name has been created. Returns boolean.

    Code:
    Example: "Task1" call SHK_Taskmaster_hasTask
    SHK_Taskmaster_addNote (client side only)
    Creates a briefing note. This can only be used on client side, and it's not boardcasted for other players.

    Parameters: ["Title","TextBody",Condition], Condition is optional.

    Code:
    Example: ["Enemy forces","Oh noes, there will be enemy soldiers in the area of operation."] call SHK_Taskmaster_addNote


    Files

    shk_taskmaster.sqf
    Example mission

    I'm sure there are something to fix, add and change. Don't be afraid to ask for instructions, give feedback or report bugs.
    Last edited by Shuko; Mar 12 2011 at 05:27.

  2. #2
    I appreciate your effort and hope more people having problems with tasks/notes will use this.

    I think you may want to re-consider dropping support for single player and hosted servers, as many of the mission makers that would need this sort of script pack are also those that would be playing hosted small coops.

    If you use addPublicVariableEventHandler for the clients to update the tasks, then it shouldn't be very hard to update the tasks on the server as well every time the server runs a the appropriate publicVariable command.

    Another thing you may want to consider is recommending (and making it possible to) call compile preprocessFile the script from init.sqf or even a game logic so that adding tasks/notes by a script is possible even right off the bat, rather than getting an error that the functions are not yet defined. Or at least have some kind of initDone variable that you need to wait for before you try to use any functions.

  3. #3
    Quote Originally Posted by galzohar View Post

    I think you may want to re-consider dropping support for single player and hosted servers, as many of the mission makers that would need this sort of script pack are also those that would be playing hosted small coops.
    I second that. This would be so priceless to me if it was not restricted to dedicated servers.

    Anyways. Great initiative with the rewrite. Grats.
    I only wish it was the script for me.

    Regards,

  4. #4
    nice script however i am having a slight problem

    here is my init.sqf for the briefing:

    Code:
    //briefings:
    [[
      ["Task1","Scuttle the Terrorist ship.","Locate and destroy the ship.",true, "x1", "assigned"]
    ],[
      ["Mission Briefing","blah blah blah.",WEST],
      ["Note2","Hello East",EAST],
      ["Credits","Made by: Me!"]
    ]] execvm "shk_taskmaster.sqf";
    Now everything works...almost. It assigns the mission but there is no waypoint. I have a few add in tasks after this one and they all work as well...but no waypoints. (x1 is my marker btw).

    Also if possible, I would like a pause between finishing a mission and receiving the next one...any way to do that?
    Last edited by Lexxer; Jun 26 2010 at 17:07.

  5. #5
    Sergeant Major Shuko's Avatar
    Join Date
    Jun 19 2004
    Location
    Finland
    Posts
    1,944
    Author of the Thread
    It doesn't create a task marker/waypoint (settaskdestination). It only shows/hides a marker (using setmarkeralphalocal) you have placed yourself.

    As for the pause, just use sleep between _upd and _add;

  6. #6
    Master Gunnery Sergeant Imutep's Avatar
    Join Date
    Feb 7 2006
    Location
    Where am i ?
    Posts
    1,359
    Thx for the next taskmaster!
    Put it on our editing section at Assault Mission Studio.

    Taskmaster 2 by shk

    Assault Mission Studio - German Mission Editing && Scripting Website

  7. #7
    Nice to see you have a new version ready. But yes, please do not restrict it for dedicated server use only. If I play then on LAN with friends and for that we don't run a dedicated server. SP support would be nice but not really needed but Client/Server support is a must.

  8. #8
    If a script supports both dedicated and hosted then it automatically supports SP as well in most cases anyway (since isServer always returns true both in single player and for the host in a hosted game). That is, as long as you make it teamswitch-compatible (aka create and update tasks and notes for all relevant playable units rather than just for the player unit).

  9. #9
    Ok very wierd situation here.

    Ive placed a marker on the map called "x1".

    ive hidden it using your suggested method in the init fields of the units:

    Code:
    "x1" setMarkerAlpha 0;
    It shows up fine when the maps starts using:

    in init.sqf:
    Code:
    [[
      ["Task1","blah.","blah",true, "x1", "created"]
    ],[
      ["Mission Briefing","blah blah.",WEST],
      ["Note2","Hello East",EAST],
      ["Credits","Made by: me"]
    ]] execvm "shk_taskmaster.sqf";
    However as soon as someone JIP's the marker disappears for anyone already connected and doesnt show for those JIP'ing.

  10. #10
    uhm! how the hell will i be able to test my missions? i don't have access to the dedi server 24/7

Page 1 of 19 1234511 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •