OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: marcinko on 17 Feb 2004, 15:18:02

Title: multiple endings
Post by: marcinko on 17 Feb 2004, 15:18:02
I'm making a regular rescue prisoners mission and I want to have a few different endings. Ending #1 all prisoners rescued successfully, Ending#2 some prisoners rescued some killed, ending#3 all prisoners die but military team escapes, ending #4 I die.  Ending #'s 1 and 4 are easy but i'm having a problem with ending #2.  Right now i've created a trigger that when rescue team and prisoners are present in it (friendly bases) it sets the two groups activations to safe.  i.e. rescuesafe=true and prisonersafe=true.  I've got both of those triggers synched to the corresponding groups that they belong to and i've selected the "whole group".  There is also a third trigger triggering ending #1 when rescuesafe and prisonersafe.  How do i end mission successfully even though some prisoners were killed? Do I do the same as above but insead of picking whole group, pick anyone in group? I hope this isn't too confusing.
Title: Re:multiple endings
Post by: Loup-Garou on 17 Feb 2004, 15:36:33
I understand the problem, but I don't have a solution now... . Sorry.  :-\
Title: Re:multiple endings
Post by: h- on 17 Feb 2004, 16:12:10
You can put something like
this and count units yourPrisonerGroup < theOriginalAmountOfPrisoners
in the 2nd end triggers condition field...

This should work... It counts if there's less prisoners in the trigger than there were at the beginning...
So you need to name your prisoner group (in the leaders init: myPrisGrp=group this) and know the amount of prisoners you have at the start of the mission...

No guarantees on any syntaxes :P
Title: Re:multiple endings
Post by: macguba on 17 Feb 2004, 17:20:03
HateR_Kint is right.    The secret is to use a count command.    When you are counting alive/dead units, its usually better to combine it with an alive command.    If you just use count there is sometimes a delay before the trigger activates.    So, again, syntax not guaranteed but your condition line might look something like this

this and rescuesafe and prisonersafe and ("alive _x" count [loon1, loon2, loon3, loon4] < 4)