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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top