Icyculyr
I'm a Mac
- Reaction score
- 68
Firstly, jass is caps sensitive if you didn't know, make sure PlayerIsles has those exact letters/caps. Try renaming it if still unsuccessful call it anything simple all lower case.
This is how I would do it. (Assuming islands are all assigned in one trigger)
Then the island for each player should be stored in iSelectedIsland. Note, player twelves island is selected first, just because i Starts at 11 - if you don't want that, create a new variable for the indexes for iSelectedIsland, and increment it and the end of each loop
This is how I would do it. (Assuming islands are all assigned in one trigger)
Code:
local integer i = 11
local integer iRandom = 0
local integer array iSelectedIsland[11] // I think the syntax for the array is wrong, but you get the picture
Loop
Set iRandom = GetRandomInt(0, i)
iSelectedIsland[i] = iPlayerIsles[iRandom]
Set iPlayerIsles[iRandom] = iPlayerIsles[i]
Set i = i - 1
Exitwhen i < 1
End Loop
Then the island for each player should be stored in iSelectedIsland. Note, player twelves island is selected first, just because i Starts at 11 - if you don't want that, create a new variable for the indexes for iSelectedIsland, and increment it and the end of each loop