Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
todayskiller

Objectives Question

Recommended Posts

Hello Everyone, I posted on another forum that had 35 pages worth of scripting info on it, but no one answered back within weeks...and I saw no other Forum that had the search results, that was the only one.

So, anyways, I'm sure this has been answered, but like I said my search results only pulled up that one 35 page scripting info one BUT...

How do I make objectives hidden but have the next one become "active" or shown up on the tasks list after the first objective is complete, then the second, etc?

Example: once tskobj_1 is complete, then tskobj_2 will show up, right now I have all the tasks listed, but they are all shown up...like you can complete them in any order, which I don't want.

Another Example: Once I blow up mig1, then it will say objective 1 complete, then objective 2 will list on the tasks list, and will tell me I need to blow up mig2, etc.

Share this post


Link to post
Share on other sites

do a trigger with :

condition :

time > 5

& on activation :

hint "First Objective Created, check your Briefing for more details";

_task = player createsimpletask ["Blow the Mig"];

_task setsimpletaskdescription ["Blow the Mig", "Blow the Mig", "Mig"];

_task setsimpletaskdestination (getmarkerpos "task");

_task settaskstate "Assigned";

then a second trigger with :

condition :

!alive mig1

& on activation :

_task settaskstate "Succeeded";

hint "Good Job, Second Objective is Created, check your briefing for more details";

_task2 = player createsimpletask ["Now go back home"];

_task2 setsimpletaskdescription ["Now go back home", "Now go back home", "Home"];

_task2 setsimpletaskdestination (getmarkerpos "home");

_task2 settaskstate "Assigned";

etc :)

Share this post


Link to post
Share on other sites

Thanks for the Reply...What if I don't have !alive mig1, but instead I have...After I reach a waypoint and wait for the countdown to end?...only then will it give me the next objective?

Share this post


Link to post
Share on other sites

you can replace

!alive mig1

by

(firstunit distance secondunit) < 10

objective 2, will be provide only when "firstunit" is less than ten meter to "secondunit"

Edited by Ios

Share this post


Link to post
Share on other sites
you can replace

!alive mig1

by

(firstunit distance secondunit) < 10

objective 2, will be provide only when "firstunit" is less than ten meter to "secondunit"

Not Quite what I'm looking for I don't think...unless that is how that works :D.

I meant, Once I reach a waypoint in game, and wait for the countdown to go down (it's on 5 minutes, or 300 seconds)...only then will it give me the next objective.

The next objective is also a waypoint, or trigger.

Share this post


Link to post
Share on other sites
Not Quite what I'm looking for I don't think...unless that is how that works :D.

I meant, Once I reach a waypoint in game, and wait for the countdown to go down (it's on 5 minutes, or 300 seconds)...only then will it give me the next objective.

The next objective is also a waypoint, or trigger.

simple:

your trigger and whatever conditions you have (lets say YOURGUY in thislist as condition)

type countdown 300 seconds

that means the trigger wont activate until 300 seconds from now, dont use timeout if you dont want the condition to wait to be true for 5 minutes.

then add your objectives in its activation. it will activate then 5 minutes from the condition being true, then add the objectives

Share this post


Link to post
Share on other sites

Thanks for that above :)...But I have another Question...

Here is what I have for my ACT:

"1" objStatus "DONE"; obj_1 setTaskState "SUCCEEDED"; player setCurrentTask obj_2; obj_1 = true; publicVariable "obj_1";

Now, Idk what to put in my Condition, (how can I make it to where My guy (Pilot1) enters the waypoint, to trigger the objective) because the First Objective is to move to the castle (which is a waypoint)...So how would I make the Objective show up on the tasks list?

Also, how do I hide other objectives on the task list?...All of them are shown up, I've tried "2" objStatus "HIDDEN" but it did nothing...I want the first objective to be "ACTIVE" or "DONE", but not have the others appear until I complete the first waypoint, (which needs to countdown 5 minutes)...then after that the other objective will appear, and give me the other waypoint.

Edited by todayskiller

Share this post


Link to post
Share on other sites
Thanks for that above :)...But I have another Question...

Here is what I have for my ACT:

"1" objStatus "DONE"; obj_1 setTaskState "SUCCEEDED"; player setCurrentTask obj_2; obj_1 = true; publicVariable "obj_1";

Now, Idk what to put in my Condition, (how can I make it to where My guy (Pilot1) enters the waypoint, to trigger the objective) because the First Objective is to move to the castle (which is a waypoint)...So how would I make the Objective show up on the tasks list?

Also, how do I hide other objectives on the task list?...All of them are shown up, I've tried "2" objStatus "HIDDEN" but it did nothing...I want the first objective to be "ACTIVE" or "DONE", but not have the others appear until I complete the first waypoint, (which needs to countdown 5 minutes)...then after that the other objective will appear, and give me the other waypoint.

im not sure why your using objstatus and taskstate at the same time?? they both do the same thing, no need to use both. I stick to settaskstate since its the 'newer' commands

for the first part:

if you have mapped your waypoints out for your guy already, then on the one you want it to activate, there is a condition box (leave this) and an on activated box. Copy all that up there into the activation box, and when you complete the waypoint, the objective will show up.

second :

if your objective isnt showing up, ill ask:

did you create it using createsimpletask and setsimpletaskdescription?

you need these two commands to create the objective and for it to show up in game. You can set this inside the init.sqf or in your briefing.sqf so its more organized.

Third:

if you want to hide your second objective, then you will have to create it when the first one completes. Meaning that in your activation of waypoint: after you set the first obj as completed, you then do:

obj2 = player createsimple task ["something"]; obj2 setsimpletaskdescription ["description here", "obj name here", "waypoint name"]

then it will show up.

Share this post


Link to post
Share on other sites

Dude, you're amazing...I got first and second part done.

Now, for the third...I don't put

obj_2 setTaskState "SUCCEEDED"; player setCurrentTask obj_3; obj_2 = true; publicVariable "obj_2";

I put

obj_2 = player createsimpletask ["something"]; obj_2 setsimpletaskdescription ["description here", "obj name here", "waypoint name"?

---------- Post added at 05:30 AM ---------- Previous post was at 05:00 AM ----------

Well, the tasks still aren't showing up...I made a mission before and it showed up then?

here is my Briefing.sqf

player createDiaryRecord ["Diary", ["Shot Down", "It came out of no where...Smoke Trails on our six, we couldn't shake them, first there was only one, then two, then three, it seemed like an unlimited supply of enemy AA Missles flying towards us. We made two of them miss, but the third one clipped our wing and we spun out of control, We ejected and landed in an open field, we are currently holed up in a nearby Forest...All of our equipment is gone, even our SideArm and Radio. I guess our next move is to move up to a nearby Castle to see if we can't find anything/Anyone...Wait a Minute, What's that Sound?...oh shit..."]]'

obj_4 = player createSimpleTask ["Go inside the Church"];

obj_4 setSimpleTaskDescription ["Go inside the Church and get some R&R", "Go inside the Church", "Church"];

obj_3 = player createSimpleTask ["Fall Back Get in the Truck"];

obj_3 setSimpleTaskDescription ["The Town has been overrun Get the hell out of dodge", "fall back get inside the truck", "Truck"];

obj_2 = player createSimpleTask ["Head to Grishino"];

obj_2 setSimpleTaskDescription ["Get Help from the Guerrillas", "Head to Grishino", "Town"];

obj_1 = player createSimpleTask ["Hide in the nearby Castle"];

obj_1 setSimpleTaskDescription ["Hide in the nearby Castle", "Hide in the nearby Castle", "Castle"];

The Diary shows up, but the tasks/Objectives don't.

here is my other things aswell

Init.sqf

//begin init.sqf

//Add briefing

execVM "briefing.sqf";

Description.ext

class header {

gametype = coop;

maxplayers = 4;

minplayers = 1;

};

if(true) exitWith {};

Edited by todayskiller

Share this post


Link to post
Share on other sites

ah your missing one thing:

obj_1 settaskstate "Created"

this lets the game know the task was created, and it should show up (however there have been times when an objective shows up even tho this line was not used)

that should do it for ya

Share this post


Link to post
Share on other sites

Dude, you're a beast...Thanks for the help :)

Btw, is that suppose to fix the Tasks, when you pull up the map?

Edited by todayskiller

Share this post


Link to post
Share on other sites

Well, I still can't get the tasks to pull up when I pull up the map?...Idk what I'm doing wrong :/

Share this post


Link to post
Share on other sites

hmm, im not sure what the problem might be here.

the way i have always run it is execVM the briefing sqf inside the init.

and in briefing i created all the diaries +

obj1 = player createsimpletask ["blah"];

obj1 setsimpletaskdescription ["blah", "blah", ""];

obj1 settaskstate "CREATED":

perhaps its the way your creating the task? are you using player createsimpletask (if its coop this might cause problems, if theres no player unit inside the editor, then it wont run for anyone, since there all playable type)

have you tried giving your guy a name? like pilot1, and using obj1 = pilot1 createsimpletask?

Share this post


Link to post
Share on other sites

UPDATE: I made a new mission just to test out putting the objectives in triggers, and it worked...but when I went to implement it into my main mission, it didn't work...could it be that I have pilot1 and all that?

UPDATE 2: I finally got it working!...Thanks for all the help :)...how do I put it into a PBO file? it wont do it when I export it

Edited by todayskiller

Share this post


Link to post
Share on other sites

Hi guys, I've got a similar question. I’ve got two separate objectives though they’re completely scripted. Is there a way I can run a script to check and see if obj_1 and obj_2 are complete, then create a new task? I’m thinking something along the lines of an if statement for it, but unsure how that would work?

Share this post


Link to post
Share on other sites
Sign in to follow this  

×