Jump to content
Sign in to follow this  
Devil Dogs SF

Objectives won't work :'(

Recommended Posts

I am having issues with creating a mission. I am new to actually adding objectives to missions as usually I just used Triggers. Now I don't know what I'm doing wrong as I have my briefing.sqf:

// A2BM W    110
// DO NOT EDIT THIS FILE

waitUntil {!(isNull player)};
waitUntil {player==player};
switch (side player) do
{
case WEST:
{
player createDiaryRecord ["Diary",["Intel","Your objective is to spearhead the assault on the Iraqi occupied city of Avgani. While the highway is still under USMC control you and your team along with the other Force Recon squads need to take out the <marker name='Iraqi AA'>Iraqi AA</marker> so the AH-1W cover you from the air. Next you'll need to find the <marker name='Police Station'>Police Station</marker> and take out the Iraqi OIC leading the defensive operations. After you have completed these two objectives the main USMC forces can push into the city and clear out any resistance."]];
MAG_tskObj1=player createSimpleTask ["Eliminate the Iraqi OIC"];
MAG_tskObj1 setSimpleTaskDescription ["Find the <marker name='Police Station'>Police Station</marker> and take out the Iraqi OIC of defensive operations.","Eliminate the Iraqi OIC","Eliminate the Iraqi OIC"];
MAG_tskObj0=player createSimpleTask ["Eliminate Iraqi AA"];
MAG_tskObj0 setSimpleTaskDescription ["Eliminate the <marker name='Iraqi AA'>Iraqi AA</marker>, from any armor to any ground units capable of taking down the air support.","Eliminate Iraqi AA","Eliminate Iraqi AA"];
player setCurrentTask MAG_tskObj0;
};
case EAST:
{
};
case RESISTANCE:
{
};
case CIVILIAN:
{
};
};

And my init.sqf:

//begin init.sqf

//Add briefing
execVM "briefing.sqf";

if(true) exitWith {};

The Notes show up in game and so do the Tasks, but whenever I kill the units at the first objective (This is the trigger):

Condition: !alive IraqiAA && IraqiAA2 && IraqiAA3 && IraqiAA4 && IraqiAA5 && IraqiAA6;

On Act: "1" objstatus "DONE"; tskobj_1 settaskstate "SUCCEEDED"; player setcurrenttask tskobj_2; obj_1=true; publicvariable "obj_1";

Nothing happens....Ok, so I go on to the second objective:

Condition: !alive OIC;

On Act: "2" objstatus "DONE"; tskobj_2 settaskstate "SUCCEEDED";

It says Objective Complete, but looking at tasks it still says the task is active.

I created my briefing.sqf using this:

http://www.armaholic.com/page.php?id=6797

If someone could please help I'd appreciate it.:o

Share this post


Link to post
Share on other sites

I'm just starting out on objectives too. I have compared yours to my working code..

Try adding the following:

tskobj_2 = true; publicVariable "obj_2";

Straight after this part:

On Act: "2" objstatus "DONE"; tskobj_2 settaskstate "SUCCEEDED";

And do the same for all other objectives changing the name obviously.

As for the first one not working, you need to put "!alive" before each name like this:

!alive IraqiAA && !alive IraqiAA2 && !alive IraqiAA3... etc

Share this post


Link to post
Share on other sites

Thanks, I'll try it and see if it works.

EDIT: It fixed the problem with the killed units not being recognized, but it still doesn't set the Objective in Tasks to complete, for either task. I also noticed upon getting both 'Objective Complete' messages, my mission doesn't end, even though I have the trigger set up for it:

Condition: obj_1 && obj_2;

On Act: ForceEnd;

Edited by Devil Dogs SF

Share this post


Link to post
Share on other sites

Just had another look...

Think you need to remove:

MAG_

From all your objectives in your briefing file.

...or rename them all in game adding the "MAG_".

Share this post


Link to post
Share on other sites

Ok, I removed 'MAG_' from the objectives in the briefing file and even changed the numbers from "1" and "2" to "0" and "1" since that is how it is numbered in the briefing, and it still did the same thing, and mission didn't end. I'm going to change the briefing numbers from 0 and 1 to 1 and 2 to see if that makes it work.

Share this post


Link to post
Share on other sites

Oh just noticed the names also wrong again, you have "tskObj1" when its "tskObj_1" in editor. Notice the "_". I would decide what you want to use as names in breifing file then c&p the name into editor just changing the number so you know for sure they are 100% correct.

Share this post


Link to post
Share on other sites

Ah thanks, that seemed to do the trick. Thanks. Also, do the two objective triggers need to be synched with the end trigger, as it doesn't seem to want to end after the objectives have been completed.

Share this post


Link to post
Share on other sites

There is no automatic ending (apart from all players getting killed). You need to end the mission yourself. Using an END1 etc type of trigger is the most common way.

Share this post


Link to post
Share on other sites

Just expanding on what shk said, in your trigger make sure the activation side is set to the side you are playing and select "END #1" from the type.

Edited by 0ps

Share this post


Link to post
Share on other sites

I just tried that and it had no effect, and I tried it with the code being tskobj_1 instead of obj_1 and it still didn't work, also tried it without the ForceEnd but nothing still. :confused:

Share this post


Link to post
Share on other sites

I'm afraid its blind leading the blind for me now. lol. I tried it, didn't work and have no idea. :D

Luckily for me I'm no where near finishing my mission so I don't need this yet. :p

Hopefully someone else will come along soon and help you.

Share this post


Link to post
Share on other sites

No problem, you've helped me a ton. I'd still probably be sitting there like I was earlier wondering wtf was going on. Thanks.

Share this post


Link to post
Share on other sites

INIT.SQF

execVM "briefing.sqf";

BRIEFING.SQF

waitUntil {!(isNull player)};

player createDiaryRecord ["Diary",["Intel","Your objective is to spearhead the assault on the Iraqi occupied city of Avgani. While the highway is still under USMC control you and your team along with the other Force Recon squads need to take out the <marker name=Iraqi AA'>Iraqi AA</marker> so the AH-1W cover you from the air. Next you'll need to find the <marker name='Police Station'>Police Station</marker> and take out the Iraqi OIC leading the defensive operations. After you have completed these two objectives the main USMC forces can push into the city and clear out any resistance.]];

tskObj0=player createSimpleTask ["Eliminate the Iraqi OIC"];

tskObj0 setSimpleTaskDescription ["Find the <marker name=Police Station'>Police Station</marker> and take out the Iraqi OIC of defensive operations.","Eliminate the Iraqi OIC","Eliminate the Iraqi OIC];

tskObj1=player createSimpleTask ["Eliminate Iraqi AA"];

tskObj1 setSimpleTaskDescription ["Eliminate the <marker name=Iraqi AA'>Iraqi AA</marker>, from any armor to any ground units capable of taking down the air support.","Eliminate Iraqi AA","Eliminate Iraqi AA];

player setCurrentTask tskObj0;

OIC TRIGGER

Condition: !alive OIC

On Act: tskObj0 settaskstate "SUCCEEDED"; player setcurrenttask tskObj1; obj0 = true; publicvariable "obj0"

AA TRIGGER

Condition: ({alive _x} count [iraqiAA,IraqiAA2,IraqiAA3,IraqiAA4,IraqiAA5,IraqiAA6]) == 0

On Act: tskObj1 settaskstate "SUCCEEDED"; player setcurrenttask tskObj0; obj1 = true; publicvariable "obj1"

END TRIGGER

Condition: obj0 && obj1

Type: END1

Share this post


Link to post
Share on other sites

So I have to change something in each file and trigger just to get the ending to work?

Share this post


Link to post
Share on other sites

Ok, I'm about to give up. I've tried everything and it still won't end, I edit the briefing to what shk said (only just a little, tiny bit different) and now the notes and tasks don't even show up in the dairy.

EDIT: Deleting this makes the tasks and note appear again for some odd reason, but the mission still doesn't end, and I honestly can't understand why....

waitUntil {player==player};
switch (side player) do
{
case WEST:
{

Edited by Devil Dogs SF

Share this post


Link to post
Share on other sites

I tested my example, it worked. Shouldnt be too hard to use it as reference.

Share this post


Link to post
Share on other sites

EDIT: I just recreated it all and now it works, no idea what was messing it up. Thanks to all of you for your help.

Edited by Devil Dogs SF

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  

×