Jump to content
Sign in to follow this  
clydefrog

Alternate mission endings for one or two AI units

Recommended Posts

Hopefully this isn't a repost, this is something I'm finding it hard to find any results for when searching.

I am making a mission and at the end of it I want an ending to be activated by my AI hostage who has been rescued entering a trigger. I know how to do this (UnitName in thislist;) but now I want to have 2 AI hostages to rescue, and when one or both of them move to the trigger at the end (if they don't die first) I want to trigger 2 different endings/debriefings depending on if only one or both of them are there. How do I go about doing this?

example:

both hostages make it back alive and enter the trigger area = ending#1

only one of the hostages makes it back alive and enters the trigger area = ending#2

Also what is the correct way to list 2 units in an !alive end condition so it will only trigger the mission failed ending if both units are killed? I tried !alive [powpilot,powpilot_2] which doesn't work.

Thanks

Edited by clydefrog

Share this post


Link to post
Share on other sites

2 hostages, in trigger chose ending1 and in condition:

pow1 distance evac <50 and pow2 distance evac <50

1 hostage, chose ending2 in 2nd trigger and in condition:

pow1 distance evac <50 

pow1,2-hostages

evac-object on map where hostages must go to end mission, for example invisible airfield, car, unit etc.

In debriefing.html you make to sections for end1 and 2.

---------- Post added at 04:35 PM ---------- Previous post was at 04:29 PM ----------

Fail condition in trigger, you chose ending3 or fail and in condition in trigger:

not (alive pow1) and not (alive pow2)

you fail mission when both hostages are dead.

Share this post


Link to post
Share on other sites

Brilliant, thanks a lot for your quick help, much appreciated. Just tried them to see if they work and I had already made the briefing.html with my different debriefings in it, works perfect.

One question though, if I make another trigger for if there's only one hostage, what happens if there are actually 2 hostages but one of them enters the trigger for the ending with 1 hostage first. Won't it give me the ending that only 1 hostage made it even though both were there but both had not yet entered the trigger area?

Edited by clydefrog

Share this post


Link to post
Share on other sites

No problem :)

Ps:If you want to end mission if one of two hostages is in evac zone you can make 1 trigger with:

pow1 distance evac <50 or pow2 distance evac <50

Or you can create two triggers.

In 1st and in 2nd you write:

1st: pow1 distance evac <50

2nd: pow2 distance evac <50

Edited by tom3kb

Share this post


Link to post
Share on other sites

I also just thought of another thing, for the 1 hostage trigger you listed the hostages name, what if it's pow2 who is the sole hostage and not pow1?

Looks like you've already answered my above question in this post ^^ lol. To stop only one hostage activating the 1 hostage trigger first if there are 2 of the, I've put a 10 second countdown on the trigger to give the other ai unit chance to get there too. Is that a good way to do it or is there a better way?

Edited by clydefrog

Share this post


Link to post
Share on other sites

To be sure the best way is to use:

pow1 distance evac <50 or pow2 distance evac <50

In this case its not importend if unit pow1 or unit pow2 be first in evac zone. In this case mission ends if: one of them will be close to evac zone or if they both be in evac zone. So you have no problem. Even if one of them will be killed during mission, mission will end succes becose 2nd can activate trigger.

@up:

You can use 10 sec countdown, but if you want to be sure that two hostages must be close to evac zone to activate the trigger just use this:

pow1 distance evac <50 and pow2 distance evac <50

Edited by tom3kb

Share this post


Link to post
Share on other sites

Yes thanks I saw that bit, when I posted you had just posted before me already answering it before I has asked haha, I edited my last post again with another question:

"Looks like you've already answered my above question in this post ^^ lol. To stop only one hostage activating the 1 hostage trigger first if there are 2 of them, I've put a 10 second countdown on the trigger to give the other ai unit chance to get there too. Is that a good way to do it or is there a better way?".

Because if I had saved both hostages and got them to the evac, I wouldnt want one of them to run into the 2 triggers first and activate the trigger/ending for 1 or the other and not both.

Share this post


Link to post
Share on other sites

How would I now end the mission with either of these outcomes (1 hostage rescued or both hostages rescued) and then all of the other objectives complete too?

would e.g. pow1 distance evac <50 or pow2 distance evac <50 && obj1 && obj2 && obj3 be the right way to do it?

Edited by clydefrog

Share this post


Link to post
Share on other sites

Yes, you can do like you write (if rescue hostages is task 4, write obj4=true-in activation in 4task trigger. In ending trigger in condition window you write:

obj1 && obj2 && obj3 && obj4

Or you can in end trigger in condition write conditions from all task you have. For example:

pow1 distance evac<50 or pow2 distance <50 and (not (alive w1) and not (alive w2) and not (alive w3))

w1,w2,w3-units that must be killed in tasks 1,2,3.

Edited by tom3kb

Share this post


Link to post
Share on other sites

I tried what I said "pow1 distance evac <50 or pow2 distance evac <50 && obj1 && obj2 && obj3" and it didn't work, can't be the right way to do it. Also I can't do the one you said "obj1 && obj2 && obj3 && obj4" as remember I want 2 different mission success endings and debriefings depending on if you rescue 1 or 2 hostages, so my ending triggers need to be the:

pow1 distance evac <50 and pow2 distance evac <50 (ending1)

and

pow1 distance evac <50 or pow2 distance evac <50 (ending2)

These work ok at the end the way I have them set up, it's a shame I can't use them together for a none mission ending task though as whichever one was on a longer timeout still ends up being triggered after the first one.

Share this post


Link to post
Share on other sites

Ok, i understand what you want. I made a test mission for you with 7 tasks. With 2 endings (1st ending -1st or 2nd hostage is in evac zone and all other task are accomplished, you have accomplished 1 more task if two hostages are rescued, 2nd ending -only one hostage is in evac zone, 2nd is dead and all other task are finished. 1 failed mission ending (if both hostages are dead).

I did not know how to bypass a one problem if i use 2 ending triggers with conditions: 1st - pow1 distance evac <50 or pow2 distance evac <50 (ending2) and 2nd - pow1 distance evac <50 and pow2 distance evac <50 (ending1). First i have ending2 but if 2nd hostage come close to evac i have atomatically 1nd ending, i try few conditions if pow1 distance evac <50 and (pow2 distance evac >50) etc. But this will work only wenn 2nd hostage is far from evac zone and he dont have time to move to evac zone before ending2 is finnished. So i choose ending2, mission will end wenn 1 of hostages is close to evac zone but if there are two of them one more task is accomplished and second ending when one of hostages is in evac zone and other is dead.

You can check my test mission if you want (its not exactly what you want in your mission but its better then nothing) maybe you will think something else to baypass that one problem. Mission link in Spoiler you need Arma 2 CO v1.60 (A2 v1.11 and OA v1.60 no others addons needed):

Edited by tom3kb

Share this post


Link to post
Share on other sites

Thanks for that and your time helping me. I checked it before and will have another look but for now what you told me before works rather well as currently the 2 triggers will give 10 seconds before a check for both hostages and 20 seconds before a check for one, so both AI pow's have up to 20 seconds to be in the end zone before it only looks for one of them instead.

Share this post


Link to post
Share on other sites

No problem :), i hope i helped a little bit. And yes, probably that time delay in triggers is the best solution. You must only choose right delay values and all should be ok with your mission.

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  

×