OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Cool Hand on 24 Jan 2003, 17:38:43
-
Im having a problem right now. mission almost done but I cant figure out this problem:
I want to make a trigger which will end the mission when all PLAYERS are dead. right now I am using not alive player1 and not alive player2... etc
but it wont work when there are free slots which arent used by either a human player or an AI. the mission wont end even if all players are dead, because the trigger looks for the other slots too, which arent played...
is there a solution available for this?
-
Try doing the following things:
1. Name the group that contains the players. To name a group, put the following code in the initialization field of the group's leader:
squad1 = group this
2. In your trigger's Condition field, put the following code:
west countSide (units squad1) < 1
Change west to whatever side the units are on if they aren't on west.
This code will count how many units in the group "squad1" are alive on the west side. If there is less than 1 (i.e., 0) alive, then the trigger will activate.
If you want specifically to check if a unit is human controlled vs. AI controlled, you'll have to use a script for that. Let me know if that's what you want instead.
-
no, this is working well for me. thanks a lot!