Forum Jump :

Author Message


Posts: 27
Rank:


Level: Member

Country: nl
Location: Warzone
Occupation:
Age:
In-game name: Dutchy_Appie

 
#1 Posted at 2014-09-17 13:17        
     
Hi guys,

Can you please help me on the following:
I'm making a mission where a team (S1-S4) have to complete 3 tasks (tsk 1 destroy ammo1, tsk2 destroy H1-H6 and tsk 3 destroy F1-F10).

When all tasks are completed and they get in helo (Evac) for extract the mission should end (Mission accomplished). If any of these 3 tasks are not completed and they get in helo (Evac), the mission fails.

I'm using this in my Trigger:

Activation: Blufor, Present

Condition:
if ({alive _x && _x in Evac} count [S1, S2, S3, S4] == {alive _x} count [S1, S2, S3, S4] and !alive H1 and !alive H2 and !alive H3 and !alive H4 and !alive H5 and !alive H6 and !alive ammo1 and !alive F1 and !alive F2 and !alive F3 and !alive F4 and !alive F5 and !alive F6 and !alive F7 and !alive F8 and !alive F9 and !alive F10) then  {      ["Mission Complete",True] call BIS_fnc_endMission;    }  else    {      ["Mission Failed",false,2] call BIS_fnc_endMission;  };

Can anyone please help me?

This post was edited by Tombabr (2014-09-17 13:42, ago)


Author Message

Tajin  



Posts: 433
Rank:


Level: Member

Country: de
Location: Bavaria
Occupation: Communications Designer
Age: 33
In-game name: Tajin

 
#2 Posted at 2014-09-17 16:29        
     
You'd probably be better of to make one trigger for each task, that tells the player about its completion and then simply check against those.

Like so:
Trigger(task1)
cnd: {alive _x} count [ammo1] < 1
act: task1 = true;

Trigger(task2)
cnd: {alive _x} count [H1,H2,H3,H4,H5,H6] < 1
act: task2 = true;

Trigger(task3)
cnd: {alive _x} count [F1,F2,F3,F4,F5,F6,F7,F8,F9,F10] < 1
act: task3 = true;

Trigger(complete)
cnd: ({alive _x && _x in Evac} count [S1, S2, S3, S4] == {alive _x} count [S1, S2, S3, S4]) && task1 && task2 && task3
act: ["Mission Complete",True] call BIS_fnc_endMission;

Trigger(evac)
cnd: ({alive _x && _x in Evac} count [S1, S2, S3, S4] == {alive _x} count [S1, S2, S3, S4]) && (!task1 || !task2 || !task3)
act: ["Mission Failed",false,2] call BIS_fnc_endMission;

There are a lot of very capable people on this forum, willing to spend some of their time to help you out. So if you have a problem, it surely isn't too much to ask that you atleast take the time to describe it properly. Thanks.

Advertisement


Author Message


Posts: 27
Rank:


Level: Member

Country: nl
Location: Warzone
Occupation:
Age:
In-game name: Dutchy_Appie

 
#3 Posted at 2014-09-17 17:04        
     
Thanks Tajin for your fast response! I will try that. Let you know...

Added 22 minutes later:

Hi Tajin.

Copied your scripts to the triggers, made 2 new ones with your suggestion
Doesn't work *HELP*

Tried both with and without blufor present trigger...
Triggers are synched with task module. Should I make new triggers perhaps???

BTW: What did you do to get your code so nicely outlined? *THUMBS UP*
(mine is just one long blablabla...) :-[

Added 3 minutes later:

...oh almost forgot. Didn't play entire mission. Just the last part entering the evac helo. (so objectives failed. mission failed).
Helo just takes off and keeps flying. no end...

Added 15 hours 8 minutes later:

Still won't work...

Tried some other things:
Grouping the 'Check all aboard' with the teamleader (set to Any group member, Once, Present, with ellipse shape of 40x40 at the LZ)

Tried it without the On Act. code and used the Trigger Type field (End #1 and Lose). No success...

Tried it with just the 'Check all aboard' condition (notching in On Act,) and a "Hint". This works fine.
So something in the task check still doesn't work.

I named the corresponding triggers ('task1', 'task2' and 'task3' (triggers are synched with Task State Module).
I don't know how I can check wether or not the task# = true in the On Act field is working, but I'm guessing that should work fine.

This post was edited by Tombabr (2014-09-18 08:38, ago)


Author Message

Tajin  



Posts: 433
Rank:


Level: Member

Country: de
Location: Bavaria
Occupation: Communications Designer
Age: 33
In-game name: Tajin

 
#4 Posted at 2014-09-18 09:23        
     
Hmm dunno, it looks right.
You'll probably have to try those triggers one by one to see what went wrong.

The debug window can be quite useful to check if conditions are working.




ps.: I always use the javascript-codetags when I post sqf. JS has a rather similiar syntax, so that works well.

There are a lot of very capable people on this forum, willing to spend some of their time to help you out. So if you have a problem, it surely isn't too much to ask that you atleast take the time to describe it properly. Thanks.

Author Message


Posts: 27
Rank:


Level: Member

Country: nl
Location: Warzone
Occupation:
Age:
In-game name: Dutchy_Appie

 
#5 Posted at 2014-09-18 10:29        
     
Thanks a lot Tajin! I 'll keep trying...

Added 1 hour 30 minutes later:

Almost there I think. I got the Mission Success trigger to work.

I tried the following:

    Checking surviving teammembers in vehicle works
    Checking if task1 is done works
    Calling end mission functions works.

But the check on !task1 (task not done) doesn't seem to work.

I tried task1 <1. Not working. Is there another way to check on the trigger state (task1 = true;)?

Added 1 hour 19 minutes later:

Got it to work! *BRAVO*

Guess what, I searched some more and found the following:
Declare a false task state in somethings init.

So I dropped a trash container, put "task1 = false"; in its init and.... tada!

Thanks again for your help Tajin! Code looks a lot 'cleaner' now. *YAHOO*

This post was edited by Tombabr (2014-09-18 13:19, ago)