Home   Help Search Login Register  

Author Topic: Forcing all players to survive through the mission  (Read 1815 times)

0 Members and 1 Guest are viewing this topic.

Offline Jakro

  • Members
  • *
Forcing all players to survive through the mission
« on: 07 Mar 2010, 23:09:51 »
It's simple question and I've come up already with couple of alternatives to work around this, but there must be easier ways than what I've come up so here goes:

I want all of my players get through the mission alive. Mission will fail instantly if somebody dies. I just have end trigger with the conditions (not alive p1) or (not alive p2).. etc. It works fine when I test it in editor, and will work also if I fill every slot in multiplayer. But when playing little short ie. couple of empty slots it for some reasons stops working.

Offline RKurtzDmitriyev

  • Former Staff
  • ****
Re: Forcing all players to survive through the mission
« Reply #1 on: 08 Mar 2010, 00:43:06 »
I think this will work. Name your players' group by placing

Code: [Select]
groupname = group this
in each player's initialization. (It has to be in every player's initialization because, as you've discovered, some playable units may never initialize in the game). Run the following code anywhere at the start of the mission, and only at the start:

Code: [Select]
startingplayercount = count (units groupname)
Then make the conditions for your ending trigger like so:

Code: [Select]
"alive _x" count units groupname < startingplayercount
Will that work for you?  :)


Edit: Actually it's even easier than that. Just take your players group, and group to it an end trigger with a map-wide radius. Select conditions as "whole group--not present." The trigger will activate if it is not the case that every group member is present. If a group member dies, he will be considered not present.

(I know, it's confusing, but I'm 99% certain that you want "whole group--not present", not "any group member--not present").


Edit 2: Arrrgggggh but I forgot that won't work if the unit that you grouped it to is not taken by a player in multiplayer setup. The first method should work for sure.

Or, I think you could simply make the group leader placed in editor non-playable. Group him to the trigger and then give him an initialization of "deletevehicle this." Of course this may confuse players. :confused:
« Last Edit: 08 Mar 2010, 00:53:15 by RKurtzDmitriyev »
The OFP Editing Center wishes to remind you that the faithful COMREF will never threaten to stab you and, in fact, cannot speak.
However, in the event that it does speak, you are encouraged to heed its advice. ;)

Offline Jakro

  • Members
  • *
Re: Forcing all players to survive through the mission
« Reply #2 on: 08 Mar 2010, 16:36:30 »
Okay, that's similar to what I was thinking. Thanks.