Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: cant complete a task in editor

  1. #1

    cant complete a task in editor

    Ok I have set up a whole load of waypoints for my soldier to follow. Alough i don't know how to get the editor script/trigger to realise when you have completed a task in order to move on to the next waypoint. Here is what i need help with....

    One of the objectives is to destroy 2 plane targets using satchel charges. Please tell me what triggers/scripts i have to write in order to activate an objective complete.

    The final objective is to assassinate an officer. There are many soldiers in the base but i dont want to have to use the no presence of enemy left in order to complete this task. i just want it to recognise the officers death before i can move on to extract.

    I think if i can get the answers to these 2 problems i can probably handle a lot of the other stuff myself.

    Dave

  2. #2
    For the planes...

    Name your target planes, like plane1 & plane2...

    Make a trigger, it dont need to have any size (0x0) -> activation "NONE" -> "ONCE" -> condition:
    Code:
    !canmove plane1 AND !canmove plane2
    -> on act:
    Code:
    task1 settaskstate "succeeded"; task1done = true
    (that is if you have named the objective to destroy the planes as task1 in the briefing.sqf).

    IF you are NOT the leader of AI commanded group that is following those waypoints, then write on the waypoints condition (where is "true" by default) that is at the plane objective, then replace the "true" with "task1done". Now once the planes have been destroyed, the waypoint at the planes "unlocks" and AI commander will move to the next waypoint.

    As for the commander task...

    name the enemy commander, like officer...

    Make a trigger, same as the trigger used for planes,but on condition write:
    Code:
    !alive officer
    -> on act:
    Code:
    task2 settaskstate "succeeded"; task2done = true
    Use the same waypoint example as before

    ---------- Post added at 02:19 PM ---------- Previous post was at 02:17 PM ----------

    IF you are the "leader", i suggest you use markers instead of waypoint for yourself to follow, much easier =), and in the case that the waypoint are for you , then when you destroy the planes and task1 is succeeded, and task1done is TRUE, the waypoint should change for you
    Last edited by Carpaazi; Jul 20 2009 at 14:21.

  3. #3
    Gunnery Sergeant Archamedes's Avatar
    Join Date
    Jul 5 2009
    Location
    UK
    Posts
    542
    Author of the Thread
    Thank you very much you have been a great help

  4. #4

  5. #5
    Gunnery Sergeant Archamedes's Avatar
    Join Date
    Jul 5 2009
    Location
    UK
    Posts
    542
    Author of the Thread
    Right I have done what you asked but i am not sure how to set up a briefing I noticed you mentioned that about the tasks where do i do that?

  6. #6
    look for posts if you need to find something, for example there is many examples how to make a briefing.sqs =).

    But to save your time for now, make a new text file (with notepad etc) and name it briefing.sqf

    then copy past this inside of it

    Code:
    /*
    * Unofficial Zeus Briefing Template v0.01
    *
    *
    * Notes:
    * - Use the tsk prefix for any tasks you add. This way you know what the varname is for by just looking at it, and
    * aids you in preventing using duplicate varnames.
    * - To add a newline: <br/>
    * - To add a marker link: <marker name='mkrObj1'>attack this area!</marker>
    * - To add an image: <img image='somePic.jpg'/>
    *
    * Required briefing commands:
    * - Create Note: player createDiaryRecord ["Diary", ["*The Note Title*", "*The Note Message*"]];
    * - Create Task: tskExample = player createSimpleTask ["*The Task Title*"];
    * - Set Task Description: tskExample setSimpleTaskDescription ["*Task Message*", "*Task Title*", "*Task HUD Title*"];
    *
    * Optional briefing commands:
    * - Set Task Destination: tskExample setSimpleTaskDestination (getMarkerPos "obj1"); // use existing "empty marker"
    * - Set the Current Task: player setCurrentTask tskExample;
    *
    * Commands to use in-game:
    * - Set Task State: tskExample setTaskState "SUCCEEDED"; // states: "SUCCEEDED" "FAILED" "CANCELED"
    * - Get Task State: taskState tskExample;
    * - Get Task Description: taskDescription tskExample; // returns the *task title* as a string
    * - Show Task Hint: [tskExample] call mk_fTaskHint; // make sure you've set the taskState before using this function
    *
    *
    * Authors: Jinef & mikey
    */
    
    // since we're working with the player object here, make sure it exists
    waitUntil { !isNil {player} };
    waitUntil { player == player };
    
    
    switch (side player) do
    {
    
    case WEST: // BLUFOR briefing goes here
    {
    player createDiaryRecord["Diary", ["intel", "Intel about enemy or something else can be put here,or you can name the INTEL with something else and it will show in in the DIARY section."]];
    player createDiaryRecord["Diary", ["Briefing", "Mission briefing can be put here,or you can name the BRIEFING with something else and it will show in in the DIARY section. If you want to make that fancy green link that points to the mission, use this <marker name='obj1'>texthere</marker>,for this to work you need a marker named obj1 on map, and pressing the link will move the map above that marker."]];
    
    //>---------------------------------------------------------<
    // Secondary Objective
    task2 = player createsimpletask["taskname here"];
    task2 setSimpleTaskDescription["Task description here.", "ThisWillShowTheTaskNameOnTheTaskList", "thiswillshowonyourHUD"]; task2 setSimpleTaskDestination (getMarkerPos "markernamehere");
    
    //>---------------------------------------------------------<
    // Primary Objective
    task1 = player createsimpletask["taskname here"];
    task1 setSimpleTaskDescription["Task description here.", "thiswillshowasthetasknameonthetasklist", "thiswillshowonyourHUD"]; task1 setSimpleTaskDestination (getMarkerPos "markernamehere");
    };
    
    
    case EAST: // OPFOR briefing goes here
    {
    
    
    };
    
    
    case RESISTANCE: // RESISTANCE/INDEPENDENT briefing goes here
    {
    
    
    };
    
    
    case CIVILIAN: // CIVILIAN briefing goes here
    {
    
    
    };
    };
    
    
    
    // run this file again when respawning (only setup the killed EH once though)
    if ( isNil{player getVariable "mk_killedEHadded"} ) then
    {
    player addEventHandler ["killed",
    {
    [] spawn {
    waitUntil { alive player }; // waitUntil player has respawned
    execVM "briefing.sqf";
    };
    }];
    player setVariable ["mk_killedEHadded", true];
    };
    Note! That the 1st tasks goes at the bottom,and second above it etc, this way the tasks will show in right order ingame (task1 at the top of the list)
    Last edited by Carpaazi; Jul 20 2009 at 15:56.

  7. #7
    Quote Originally Posted by Carpaazi View Post
    For the planes...


    As for the commander task...

    name the enemy commander, like officer...

    Make a trigger, same as the trigger used for planes,but on condition write:
    Code:
    !alive officer
    -> on act:
    Code:
    task2 settaskstate "succeeded"; task2done = true
    Use the same waypoint example as before[COLOR="Silver"]

    ---------- Post added at 02:19 PM ---------- Previous post was at 02:17 PM ----------
    Waht would you put for all enemy dead?

  8. #8
    Quote Originally Posted by =SF=Hyrax View Post
    Waht would you put for all enemy dead?
    You could just make a giant trigger surrounding all enemies and put Opfor (or Blufor depending) "Not Present"

    Anyone know what to call the enemies that are not dead but wounded and sometimes crawling around? I've had some trigger ending problems with them because a lot of times my squaddies won't engage them and the mission won't end until I track them down.
    Last edited by froggyluv; Aug 3 2009 at 16:49.
    ~The bearly literate pugilist~

    Force AI to use their proper weapon! http://feedback.arma3.com/view.php?id=8829

    Stop discrimination! Fight for bot rights for them to thrive indoors! http://feedback.arma3.com/view.php?id=8671 -Please revote this! Previous one was mistakenly directed to DevHeaven only!

    Add Distance to Target/Gear Menus: http://feedback.arma3.com/view.php?id=8666

    Spoiler:

  9. #9
    i tried that but doesnt work. Im trying to set a trigger to complete the task when all enemy is killed or out of the sector

    On Activation i have this code: task1 settaskstate "succeeded"; task1done = true

    and the trigger set for opfor not present.

    what am i doing wrong?

    ---------- Post added at 12:39 PM ---------- Previous post was at 12:24 PM ----------

    note that nameing the units and/or groups would be next to impossible due to the use of UPS script of creating random groups.

    if there is a way to set !alive function to the russian faction like !alive russians that would get the trigger to kick on but other wise without a conditon code it doesnt seem to work. Any Ideas??

  10. #10
    It should work, what is in your Condition box?

    This is how I would use it

    Trigger size: All encompassing
    Opfor/ Not Present
    Condition:This

    Code:
     On Activation: tsk1 setTaskState "SUCCEEDED";nul = [objNull, ObjNull, tsk1, "SUCCEEDED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";
    With 'tsk1' being named in my briefing, you'll get that fancy Task Completed box once all Opfor are dead.

Page 1 of 2 12 LastLast

Posting Permissions

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