Detect longest spree

The-Shadows

New Member
Reaction score
12
Ok, as the title, how can i do that?
each player kill will gain 1 spree integer, and will be turned to 0 if die.

but how can i detect the longest spree integer from all players?

this is similar to dota, which at the end of the game will be shown the longest spree on multiboard.
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
example:

Trigger:
  • actions
    • set spree[1] = 3
    • set spree[2] = 6
    • set spree[3] = 4
    • set spree[4] = 7
    • set spree[5] = 5
    • For each (Integer A) from 1 to 5
      • loop
        • if max < spree[Integer A]
          • then
            • set max = spree[Integer A]
            • set PlayerValue = Integer A
    • game - Display to All Players the message: Player[PlayerValue] is the winner with a spree of max!


so in this case the message will be: Player 4 is the winner with a spree of 7!
 

The-Shadows

New Member
Reaction score
12
example:

Trigger:
  • actions
    • set spree[1] = 3
    • set spree[2] = 6
    • set spree[3] = 4
    • set spree[4] = 7
    • set spree[5] = 5
Trigger:
  • not exactly what i want, sorry for that.
    • my main problem to make spree integer as the given above.
    • if kill spree+1 then die spree-1 after a few minutes the game end, that will showing total spree that players have at that time and calculate for the longest spree?
    • ok example what i mean about is:
    • player1 =spree 0
    • player2 =spree 0
    • player3 =spree 0
    • player4 =spree 0
    • after a few minutes fights(they are killing, +1 spree for each kill)
    • player1 =spree 4
    • <u>player2</u> =spree <u>12</u>
    • player3 =spree 2
    • player4 =spree 1
    • at the end of game
    • player1 =spree 2
    • player2 =spree 1(die, spree =0 and kill, spree+1)
    • player3 =spree 4
    • player4 =spree 9
    • but at my overview score at the end of game, i want to detect that <u>player2</u> has collected the longest spree, although player2 at the end of the game only has spree 1.
    • please help me! +rep
 

dragonhord

Knowledge is true opinion. - Plato
Reaction score
82
You could always make another integer variable, call it *BestSpree*, and when the unit dies set their spree to bestspree, then the next time they die, check if their current spree is greater than the bestspree variable, and if it is set bestspree to the value of their current spree and so on and so forth, then just check which bestspree is highest at the end of the game...
 

The-Shadows

New Member
Reaction score
12
sorry for double posts, but there is 1 more thing..
how can i detect two or more players that has same highest integer?
such as

example:

Trigger:
  • actions
    • set spree[1] = 7
    • set spree[2] = 6
    • set spree[3] = 4
    • set spree[4] = 7
    • set spree[5] = 5
    • For each (Integer A) from 1 to 5
      • loop
        • if max &lt; spree[Integer A]
          • then
            • set max = spree[Integer A]
            • set PlayerValue = Integer A
Trigger:
  • will be
    • <blockquote data-attributes="" data-quote="" data-source=""
      • class="bbCodeBlock bbCodeBlock--expandable bbCodeBlock--quote js-expandWatch">
      • <div class="bbCodeBlock-content">
        • <div class="bbCodeBlock-expandContent js-expandContent ">
          • game - Display to All Players the message: Player1/Player4 are the winners with a spree of max!
        • </div>
        • <div class="bbCodeBlock-expandLink js-expandLink"><a role="button" tabindex="0">Click to expand...</a></div>
      • </div>
    • </blockquote>
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top