Jump to content
Sign in to follow this  
clydefrog

Task completes only if other task complete

Recommended Posts

Hello, I have a question about making a task non-completable until you have finished the task before it in the list. From what I've seen apparently to get a task to be complete by checking if other tasks are also complete you list the already completed tasks:

example to make obj4 complete through a trigger, you'd do something like this this:

obj1 && obj2 && obj3

My condition on a trigger for task7 being completed is:

{_x in thisList} count units alpha > 0 and {_x in thisList} count units bravo > 0

which means at least 1 unit from both alpha and bravo have to be there in the triggers radius, but I don't want that trigger to be fired until a task before it is complete, otherwise players could maybe walk through there at some other point and complete the task. How do you do this? Thanks.

Share this post


Link to post
Share on other sites

Add to condition in task 7 all what you have in trigger for task 6. In this case task seven will be accomplished only if task 6 is accomplished.

For example if in task 6 you have to kill enemy officer (in trigger for task 6 you write: not (alive officer1), officer1 is name of unit in editor that you must kill.

So now your condition for task7:

{_x in thisList} count units alpha > 0 and {_x in thisList} count units bravo > 0 and not (alive officer1)

Or if you use in all task obj1, obj2 etc (in triggers on act. window) also should work:

{_x in thisList} count units alpha > 0 and {_x in thisList} count units bravo > && obj6

Edited by tom3kb

Share this post


Link to post
Share on other sites
Add to condition in task 7 all what you have in trigger for task 6. In this case task seven will be accomplished only if task 6 is accomplished.

For example if in task 6 you have to kill enemy officer (in trigger for task 6 you write: not (alive officer1), officer1 is unit that you must kill.

So now your condition for task7:

{_x in thisList} count units alpha > 0 and {_x in thisList} count units bravo > 0 and not (alive officer1)

Or if you use in all task obj1, obj2 etc also should work:

{_x in thisList} count units alpha > 0 and {_x in thisList} count units bravo > && obj6

Ok thanks, I'll give this a try in a bit and let you know what happens. The thing that will happen before it I think will be a trigger detecting the POW's have got far enough away from the base so that will be:

pow1 distance base <50 or pow2 distance base <50

or it could be that an ammo cache is destroyed (which happens by 1 object in the cache being dead (e.g. !alive ammobox).

I tried adding the && "previous objective name" already but it didn't work. That's why I came here to find out how to do it.

Edited by clydefrog

Share this post


Link to post
Share on other sites

About that obj1 && obj2 etc not working. do you write in trigger for task 1 in on act only obj1, becose it should be 0bj1=true, in trigger for task 2 in on activation window obj2=true etc. And now in end trigger in winow CONDITION, not in on activation you write:

obj1 && obj2 etc. Now that method with obj1 && will work. I just checked in editor with simple mission and all was working great.

Edited by tom3kb

Share this post


Link to post
Share on other sites
About that obj1 && obj2 etc not working. do you write in trigger for task 1 in on act only obj1, becose it should be 0bj1=true, in trigger for task 2 in on activation window obj2=true etc. And now in end trigger in winow CONDITION, not in on activation you write:

obj1 && obj2 etc. Now that method with obj1 && should work.

At the start objective 1 is set as current task (I haven't named them obj1, obj2 etc., I've named them e.g. deploy, rescue etc. but for the purposes of this post I'll call them obj).

When objective 1 is complete in the on act box I have settaskstate "succeeded" whatever and then I have obj2=true etc. for every task.

and yes I was putting it in the condition box when I tried it, I put in the box

destroy && {_x in thisList} count units alpha > 0 and {_x in thisList} count units bravo > 0

and then in the on act box for that I had task7 settaskstate "succeeded" etc.

Share this post


Link to post
Share on other sites

No, no,no you dont have to name task obj1 etc. You must in Trigger for task1 in on act write For example: obj1=true; tskobj1 setTaskState "SUCCEEDED".

In few minutes i give you simple mission for test.

Share this post


Link to post
Share on other sites
You must in Trigger for task1 in on act write For example: obj1=true; tskobj1 setTaskState "SUCCEEDED".

That's what I've done. Except objective 1 is called deploy not obj1 and it is the first task so on the trigger to complete it I believe it says Task1 setTaskState "SUCCEEDED"; setcurrenttask Task2; camp=true;

(something like that)

in my briefing file it says:

task1 = player createSimpleTask ["Redeployment"];

task1 setSimpleTaskDescription ["Redeploy to the USMC FOB on Ilmarinen for staging", "Redeploy to the FOB", "Redeploy"];

task1 setSimpleTaskDestination (getMarkerPos "deploy");

task1 setTaskState "Created";

it works and triggers the next task.

Share this post


Link to post
Share on other sites

Yes i know its work and it will trigger next task but here you have mission with obj1 && obj2 in end trigger working version.

Ps: mission on desert island for arma 2 CO v1.60

Edited by tom3kb

Share this post


Link to post
Share on other sites

Ok I'll check it out now

---------- Post added at 15:08 ---------- Previous post was at 14:59 ----------

Ok I looked and I see, but I already know you can just put ob1 && obj2 in a trigger with Type: End to end a mission. I'm trying to get a task completion not to be triggered until the task before it is completed.

---------- Post added at 15:19 ---------- Previous post was at 15:08 ----------

I tried what you said in my mission, condition is

{_x in thisList} count units alpha > 0 and {_x in thisList} count units bravo > 0 && destroy;

on act is

task7 settaskstate "SUCCEEDED"; [task7] call mk_fTaskHint; player setcurrenttask task8; extract=true;

i destroyed the cache to complete the "destroy" objective which then starts the next objective with the condition code at the top, and it doesn't work.

Share this post


Link to post
Share on other sites

Let say we have 2 task in 1st you have to kill officer1, in 2nd task you have kill officer2 but this task will be accomplished only wen you first kill officer 1 (lets say he have info about officer2).

In trigger1 you write: not alive officer1 and in trigger for task2 you write: not (alive officer1) and not (alive officer2). Now if you first kill officer1 and later officer2 you will first accomplish task1 and later task2. But if you shot first officer2 task2 will not be accomplished becose in trigger you have to kill also officer1 to accomplis task2. Maybe not the best example for mission tasks but you should now have idea how to make something what you want.

Edited by tom3kb

Share this post


Link to post
Share on other sites

Yes I tried

{_x in thisList} count units alpha > 0 and {_x in thisList} count units bravo > 0 and !alive cache;

instead of

{_x in thisList} count units alpha > 0 and {_x in thisList} count units bravo > 0 && destroy;

That worked, now I can only complete the task if the condition to complete the previous task (which is destroy the cache - an ammo boxed named "cache") has been met.

I wonder why I can't get it working with && destroy though? Have you actually tried doing that yourself and know it should work? For some tasks it would be a lot easier to just say the condition && TaskName instead of saying condition and condition of other task.

Edited by clydefrog

Share this post


Link to post
Share on other sites

Becose that destroy should be in if i remember task6 but in on act:

in condition: not alive cache

on act: destroy=true

Share this post


Link to post
Share on other sites

I thought saying destroy=true meant that destroy is now the current task, that's what I was told.

so in my destroy objective complete trigger, it says rv=true meaning rv is now the current task

ahhh that is probably where i was going wrong, I've now tried it with:

{_x in thisList} count units alpha > 0 and {_x in thisList} count units bravo > 0 && destroy;

after setting the destroy cache trigger to condition: !alive cache and on act: destroy=true; task6 settaskstate "SUCCEEDED"; [task6] call mk_fTaskHint; player setcurrenttask task7;

and it works

Edited by clydefrog

Share this post


Link to post
Share on other sites

Thats way its better to use for that obj1=true, obj2=true for that in task1, task2 etc its all clear and you should not make any mistakes when you use names like this :)

Share this post


Link to post
Share on other sites

So obj=true definitely means objective is complete? I must have remembered something wrong from the tutorials I used.

I just rechecked the example mission for the tutorial i used and it is from somebody good at mission making, and on the trigger to complete the objective it says next objective=true in the on act

e.g. for obj1, in the trigger it says obj2=true, not obj1=true.

---------- Post added at 17:17 ---------- Previous post was at 16:05 ----------

Ok new problem with this lol

now that i use =true this way, my task hint thing comes up twice saying the task is accomplished

task6 settaskstate "SUCCEEDED"; [task6] call mk_fTaskHint; player setcurrenttask task7; destroy=true;

task7 settaskstate "SUCCEEDED"; [task7] call mk_fTaskHint; player setcurrenttask task8; rv=true;

both make the task accomplished hint show up twice for each one.

Edited by clydefrog

Share this post


Link to post
Share on other sites

You dont have to use words obj1=true or obj2=true in on act window. You can use whatever word you likie for all tasks: cat=true, frog=true that is not importent, You only must remember to use correct words if you use them leter in triggers (cat && frog etc).

Ps: can you write code from your conditions from both triggers (task6 and 7), maybe there uis something wrong?

Share this post


Link to post
Share on other sites
You dont have to use words obj1=true or obj2=true in on act window. You can use whatever word you likie for all tasks: cat=true, frog=true that is not importent, You only must remember to use correct words if you use them leter in triggers (cat && frog etc).

Ps: can you write code from your conditions from both triggers (task6 and 7), maybe there uis something wrong?

Yeah I know that, I'm not using ojb1, obj2 etc. i'm using words that describe the task e.g. rescue, destroy, rv etc.

here's the code that I'm using since you said to put the =true thing for the completed objective and not the next one.

task6 destroy cache trigger:

condition: !alive cache

on act: task6 settaskstate "SUCCEEDED"; [task6] call mk_fTaskHint; player setcurrenttask task7; destroy=true;

task7 rendezvous trigger

condition: {_x in thisList} count units alpha > 0 and {_x in thisList} count units bravo > 0 && destroy

on act: task7 settaskstate "SUCCEEDED"; [task7] call mk_fTaskHint; player setcurrenttask task8; rv=true;

and I also have a trigger to call up those taskhints e.g for rendezvous.

condition: rv

on act: [task7] call mk_fTaskHint;

As I said the guy who's tutorials I saw would have say objective 1 called obj1, and then in the trigger for completing objective 1 he would put "obj2=true" which is not the way you are using it.

Edited by clydefrog

Share this post


Link to post
Share on other sites

I checked your conditions etc, and this script pack for Taskhints that you use, and all look good. Sorry but now i dont know whats wrong :(. Maybe later i find something.

Maybe you dont ned that rv=true and rv trigger i dont know really.

Edited by tom3kb

Share this post


Link to post
Share on other sites
I checked your conditions etc, and this script pack for Taskhints that you use, and all look good. Sorry but now i dont know whats wrong :(. Maybe later i find something.

Maybe you dont ned that rv=true and rv trigger i dont know really.

Seems I have it working now, the those extra task hint trigger things i have e.g.

condition: rv

on act: [task7] call mk_fTaskHint;

it's actually meant to show the next task's taskhint so I've put them all up one, so now it would read (as i haven't done it for this task yet because i don't have task8 yet):

condition: rv

on act: [task8] call mk_fTaskHint;

I've done this for all other tasks and now they work. Hopefully no more problems with that stuff now heh. Btw is there a way to do Not in thisList as well as in thisList? I'd like a different way to detect when units are out of an area other than the distance thing. And it has to be 2 named units so I can't use blufor not present or anything like that. Or can you use not present together with thisList so that when they move out of the trigger area the trigger is fired? I'll give that a try.

Edited by clydefrog

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  

×