How do you make a win condition for this? (+REP)

JeveKnight

New Member
Reaction score
2
In my map, each person has a castle.
I wanna make it a competition, and if all other players castles are dead and say player ones castle is still standing, then player one will win.
Or if all castles other than player two are destroyed, then player two wins.
Ive tried and tried but I cant find it, can someone tell me how?
+Rep & Thanks :thup:
 

Draphoelix

It's not the wintercold that's killing me
Reaction score
132
Create a player group for every player that are playing and the slot is user.

Everytime a castle is destroyed, remove the owning player from the group.

Use a periodic timer to check for numbers of players in the group, if equal to 1, victory.
 

JeveKnight

New Member
Reaction score
2
Create a player group for every player that are playing and the slot is user.

Everytime a castle is destroyed, remove the owning player from the group.

Use a periodic timer to check for numbers of players in the group, if equal to 1, victory.

create a player group for each individual player?
or make a player group with every playable player in it?
thanks
 

JeveKnight

New Member
Reaction score
2
Create a player group for every player that are playing and the slot is user.

Everytime a castle is destroyed, remove the owning player from the group.

Use a periodic timer to check for numbers of players in the group, if equal to 1, victory.

also, what do you mean the 'slot is user'?
cause i ran into problems when im making the periodic event, where every .01 seconds of the game if player group contains one player then victory for that player, but i cant figure out how to get that down.
 

CaptDeath

New Member
Reaction score
103
A player
the peridoc checks to see if the exact number of players in the group[still alive is 1]
--off topic
thx for repin me :)
 

Draphoelix

It's not the wintercold that's killing me
Reaction score
132
set PG = All Players matching Matching player controller equal to user and Matching Player slot status equal to Playing


A unit dies
Unit type equal to castle
Remove owner of triggeinrg unit from PG


Every 1 second
Pick every unit in PG
If Number of units in PG equal to 1
Victory Picked Unit
 

JeveKnight

New Member
Reaction score
2
set PG = All Players matching Matching player controller equal to user and Matching Player slot status equal to Playing


A unit dies
Unit type equal to castle
Remove owner of triggeinrg unit from PG


Every 1 second
Pick every unit in PG
If Number of units in PG equal to 1
Victory Picked Unit

first you say PG is a player group
set PG = All Players matching Matching player controller equal to user and Matching Player slot status equal to Playing

Then you say it's a unit group
Every 1 second
Pick every unit in PG
If Number of units in PG equal to 1
Victory Picked Unit

I tried to make a unit group to accompany it but the trigger failed.
Any flaws in this?
 

vypur85

Hibernate
Reaction score
803
This may work:

Code:
Castle
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Castle
    Actions
        Set UnitGroupVariable = (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to (Unit-type of (Triggering unit))) and (((Matching unit) is alive) Equal to True)))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in UnitGroupVariable) Equal to 1
            Then - Actions
                Game - Victory (Owner of (Random unit from UnitGroupVariable)) (Show dialogs, Show scores)
            Else - Actions
 

JeveKnight

New Member
Reaction score
2
thank you all for your posts, i just figured it out and put all your requests together and it works amazingly.
+rep :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top