Jump to content
Sign in to follow this  
Archamedes

cant complete a task in editor

Recommended Posts

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

Share this post


Link to post
Share on other sites

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:

!canmove plane1 AND !canmove plane2

-> on act:

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:

!alive officer

-> on act:

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

Edited by Carpaazi

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

/*
* 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)

Edited by Carpaazi

Share this post


Link to post
Share on other sites
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:

!alive officer

-> on act:

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 ----------

Waht would you put for all enemy dead?

Share this post


Link to post
Share on other sites
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.

Edited by froggyluv

Share this post


Link to post
Share on other sites

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??

Share this post


Link to post
Share on other sites

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

 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.

Share this post


Link to post
Share on other sites

thanks a million

---------- Post added at 06:24 PM ---------- Previous post was at 06:23 PM ----------

one mroe question froggy. on the taskhit thing how do i change the text instead of it saying any

Share this post


Link to post
Share on other sites

Yeah sure. Here's a copy of one of my briefing from one of my missions which you can freely change and use.

 // diary entries
_diary = player createDiaryRecord ["Diary", ["Diary", "This is a suicide mission.How the hell are we gonna scale that rock...."]];
_log_briefing = player createDiaryRecord ["Diary", ["Briefing", "We've got multiple operational difficulties here. There are a large group of enemy tanks heading toward Chernogorsk from the East with intentions on eradicating the civilian population so this is a time sensitive mission gentlemen. We need to get our gunships here but there is a large AA battery atop of Pik Kozlova, aka Devil's Peak. The area is extremely well fortified from the beach all the way to the peak. This is our largest amphibious assault to date but we have little choice but to take a full frontal assault -casualties are expected to be severe. Once these AA units are eradicated, air support will engage the tank column and we then need you to infiltrate the Church in Elektrozavodsk, and kill a high ranking enemy believed to be in the vicinty of the church. Meet Bravo3 who will join you SW of the city by the docks to help you in this last endevour.  "]];

tsk3 = player createSimpleTask["Assassinate the Officer"]; // adds a task w/o desc or marker
tsk3 setSimpleTaskDescription["High Level enemy officer believed to be meeting with insurgents at the Church in Elektrozavod", "Assassinate", "Ass"];
tsk3 setSimpleTaskDestination (getMarkerPos "obj3");


tsk2 = player createSimpleTask["Take the Mountain"]; // adds a task w/o desc or marker
tsk2 setSimpleTaskDescription["Flank and Assault the Mountain Top", "Mountain Top", "Mtn"];
tsk2 setSimpleTaskDestination (getMarkerPos "obj2");

tsk1 = player createSimpleTask["Clear the Beach"]; // adds a task w/o desc or marker
tsk1 setSimpleTaskDescription["Clear the Beach Head", "Clear Beach", "Beach"];

tsk1 setSimpleTaskDestination (getMarkerPos "obj1");

So you'll want to copy and paste this to a text editor ie, Notebook 2, then change the text objectives such as "Clear the beach" into your own objectives. Use a marker named "Obj1", "Obj2"; "Obj3" respectively at your objective sites so that when you click on your objective, the map will move to those spots. Obviously if you only have 1 or 2 objectives, delete the rest.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×