About Victory Condition

merlinds

Member
Reaction score
15
Hi, i have a big headache about this.
In my map, the victory condition is defined by a score. This score is an integer variable for every team.
The thin is, that in the map can be up to 5 teams. And a maximum of 8 points of score.
I have defined the conditions to set the victory team in case there is only one victory.
But if there is a draw, like for example there is 2 teams and each one get 4 points.
I can make a trigger for that!!
I store the score in an array variable named Score. each team has is own number.
I need a way to compare this variables in order to define, if there is only one victory team or if there is a draw.
Can some one help me to make this in a GUI trigger???
Thanks in advance.
 

-OverpoweR-

Member
Reaction score
13
You know you can Compare Two Integers right? for example, you can make a condition to see if Your Team1 Score is Equal to Team2 Score and so on? Look it up under the conditions box ;)

Ps. Team1 Score = Your Score Integer Variable for Team1 , Team2 Score = Your Score Integer Variable For Team2 .
 

merlinds

Member
Reaction score
15
Yeah, i knew that. But i cant figure out how to make the entire trigger.
Is very simple to make it only for Victory, but when i take in consideration the draw posivility mi mind exploded.
I need that some one help to make the trigger.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
do this...

Trigger:
  • Highest Score
    • Events
      • (whatever event adds your score or run this after any score was added)
    • Conditions
    • Actions
      • For each Integer A from 1 to (Max non-computer players) do actions
        • Loop actions
          • For each Integer B from 1 to (max non-computer players) do actions
            • Loop actions
              • If Then Else
                • B is equal to 1
              • Then
                • If Then Else
                  • If
                    • Player_Scores[Int A] is greater than Players_Sorted[Int B]
                  • Then
                    • Set Players_Sorted[1] = Player_Scores[Int A]
                    • Set Scores_Sorted[1] = Int A
                    • Set Player_Tied[Int A] = False
                  • Else
                    • If then else
                      • Player_Scores[Int A] is equal to Players_Sorted[Int B]
                    • Then
                      • Set Player_Tied[Int A] = True
                      • Set Player_Tied_Position[Int A] = 1
                    • Else
              • Else
                • If Then Else
                  • If
                    • Player_Scores[Int A] is greater than Players_Sorted[Int B]
                    • Player_Scores[Int A] is less than players_sorted[Int B - 1]
                  • Then
                    • Set Players_Sorted[Int B] = Player_Scores[Int A]
                    • Set Scores_Sorted[Int B] = Int A
                    • Set Player_Tied[Int A] = False
                  • Else
                    • If Then Else
                      • If
                        • Player_Scores[Int A] is equal to Players_Sorted[Int B]
                      • Then
                        • Set Player_Tied[Int A] = True
                        • Set Player_Tied_Position[Int A] = Int B
                      • Else


Then this is what each variable is:
Player_Scores[player number] = the scores of the player
Players_Sorted[Position] = the score of the position
Scores_Sorted[Position] = this returns the player number in the position (IE: Scores_Sorted[3] is the persons number in 3rd place)
Player_Tied[Player number] = a boolean whether each player is tied with someone for a position
Player_Tied_Position[Player number] = the position they are tied for
 

merlinds

Member
Reaction score
15
i have triggers much more complicated that this one, but i dont know why i have some much problem to understand other peoples triggers.
I have been reading your triger for 15 minuts and only now i understand it.
Thank you so much gfreak
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
NP
btw you can use this event to trigger it whenever you want...

Trigger:
  • Events
    • XIntegerVar becomes equal to 0


then you add this line to the system

Trigger:
  • Actions
    • Set XIntegerVar = 1


then whenver you want to refresh it you can add this line to your trigger

Trigger:
  • Set XIntegerVar = 0
 

merlinds

Member
Reaction score
15
mmm i have a question. QFreak45:
Im just interested to check if the 3 first positions are tied or not. Based on the fact that there are only 3 players, and a maximun of 8 points to share, the maximun tie can be betwen the first 3 players.
I need to know, i can compare the 3 positiones, if 1 and 3 area equal, i know that the 3 first players are tied, if not, i check if the 1 and 2 positions are equal i know there is a tie betwen thes two players, and if not, i know that the player in the first position is the winner.
Im right??
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
if player_tied[player number] = true
then player_tied_position[player number] = the position they are in
 

merlinds

Member
Reaction score
15
Yes, i know. But for iner reasons of my map, i need to do it on my way. Can be done as i said?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
yes just pick all the players and check if they are tied in first, simple as that... thats what i was hinting at, and you can integrate this into any of your games variables with a few simple adjustments or a simple trigger
 
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