Warcraft III resources & community, 2003–2006 · archived

Randomizing

4 posts
#1

Randomizing

Im currently making a chinese card game. When the map starts, 52 cards will be divided to 4 players evenly. So in the trigger i did.

For each (Interger A from 1 to 13, do (Actions)
Loop-Actions
Set Game_Card =(Random unit from Game_Card_Group)
Set Game_Card_Int = (Game_Card_Int + 1).
Create floating txt that reads((string Game_Card_Int))+ Diamond)at(Position of Game_Card_Unit).
Remove Game_Card from Game_Card_Group.
Remove Game_Card from the game.

And the trigger will be same to create Club,Heart and Spade cards.I got everything done...the only problem is that everytime i restart the game, i get the same game card. >.<"
#2
Perhaps you have wrong defined unit group, it is difficult to say from this point
#3
There's an option in the editor to use the same random seed each time you test the map, or to generate a new one each time.
File, Preferences, Test Map, Use Fixed Random Seed
#4
ooo..its working now, thx ^_^