Kael
Deity
Im banging my head into a wall in what I would think should be an easy function. I just need to select a random player. This is what I'm trying to do now:
My function is dying on this, saying that Im trying to pass 1, 1, 0 to the random function. As far as I can tell the countCivPlayersAlive call isn't returning a simple int like I would expect, and the api reference would suggest.
Anyone have any ideas for a working way to get a random player?
Thanks,
Kael
ps Yes I know declaring 3 variables to step through picking a random player is messy, but I did it that way just to simplify it for troubleshooting.
iNumPlayers = gc.getGame().countCivPlayersAlive()
numPlayer2 = random.randint(1, iNumPlayers)
rndPlayer = gc.getPlayer(numPlayer2)
My function is dying on this, saying that Im trying to pass 1, 1, 0 to the random function. As far as I can tell the countCivPlayersAlive call isn't returning a simple int like I would expect, and the api reference would suggest.
Anyone have any ideas for a working way to get a random player?
Thanks,
Kael
ps Yes I know declaring 3 variables to step through picking a random player is messy, but I did it that way just to simplify it for troubleshooting.