Math - random number (randoming a playing player)

Status
Not open for further replies.
Level 4
Joined
Jul 1, 2009
Messages
65
put each player that is equal to is playing into an array variable and random number between that......... but i could see some problems with that.... so maybe put each player equal to is playing into a group and im sure there is a trigger to get random player from group...
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
  • Setting Player
    • Events
      • -------- Make your events --------
    • Conditions
      • -------- Make your conditions --------
    • Actions
      • Set PlayerInt[1] = Player 1 (Red)
      • Set PlayerInt[2] = Player 4 (Purple)
      • Set PlayerInt[3] = Player 7 (Green)
      • Set PlayerInt[4] = Player 10 (Light Blue)
  • Choosing Randomly
    • Events
      • -------- Make your events --------
    • Conditions
      • -------- Make your conditions --------
    • Actions
      • Set RndmInt = (Random integer number between 1 and 4)
      • Player - Set PlayerInt[RndmInt] Current gold to ((PlayerInt[RndmInt] Current gold) + 1500)
I think that should do it.
 
Level 6
Joined
Apr 23, 2008
Messages
263
yep i thought that out right AFTER i posted this thread xD but the random player way is more smooth. that way is useful though when you want to randomize between some numbers for example 4 9 15 and 104
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
yep i thought that out right AFTER i posted this thread xD but the random player way is more smooth. that way is useful though when you want to randomize between some numbers for example 4 9 15 and 104

Then I think that you need to set every player to a variable first then use that variable later to set the random player variable i.e. setting a variable from another variable. If you can figure it out then so be it otherwise, I'll try and make it myself.
 
Level 6
Joined
Apr 23, 2008
Messages
263
i've figured out both the ways and are using them in my map, one for randoming between the playing players and one a lot more complex for randoming heroes for the players that hasnt chosen one in 20 seconds.
 
Status
Not open for further replies.
Top