guys, i have a challenge for you. i am creating a game of Poker at the moment, and obviously i need a way to randomize 54 cards for each player. there are 6 players in total, and each player recieves 2 cards per round. i want to keep the triggers to the minimum. no more than 100 triggers. any takers?
I'd suggest 1 switch randomization. A lot easier to organize than by doing 6 separate switches. Scroll down to it in this tutorial.
http://www.staredit.net/index.php?tutorial=61Just generate a number 1-64 (if it's higher just re-roll), and if it's 1-52, give them the associated card. Rinse and repeat
Here's one way of doing a deck of cards, that ensures that the same card is not dealt multiple times, and is fairly conservative of locations:
On the bottom of the map, place a line of 64 burrowed zerglings. Directly on top of each burrowed zergling, put 1-4 burrowed devouring ones (representing suit) and 1-13 burrowed hydralisks, representing rank. You should have 10 zerglings left uncovered.
1) Randomize 6 switches.
2) Using these 6 switches as binary digits (ex: switch 1 represents (1 or 0 for set or cleared)*2^0, switch 2 represents (1 or 0 for set or cleared)*2^1, convert the switches into a number between 1 and 64 by adding the appropriate number of deathcounts when each switch is cleared.
3) Subtract deathcounts down to 1, giving the burrowed zerglings one at a time to a different player.
4) Give the last zergling to yet another player.
5) Center a location on that zergling. That is the card being dealt.
6) If there is no card there (simply check for hydralisks), have the above process run again, giving the zerlings back to original player first.
7) If there is a card there, deal it to a player. (Move burrowed stack and give all zerglings back to original player)
8) Repeat as necessary.
Optional 9) When cards are discarded at the end of the hand, move stacks to a new area. You probably placed the cards in a certain order on the bottom. By moving hydralisks and devouring ones one at a time to a seperate place until the stack runs out of them, cycle through zerglings to the original place of the card, and return it.
thats of gr8 help to me, both of you. thanks very much.
I have been talked into informing you that there is someone else I know that is about 90% done with a texas hold-em game. However, I still encourage you to try out these methods, as I am sure you will learn a lot by trying them and end up creating a fun and unique map, since every map is different in its own way. Good luck.
6 switches applied to binary is actually a plausible idea in keeping it simpler than 1 switch doing the same thing.
I wish to inform you that the next stages in this map are only going to get harder to make.
I think you will need some way to represent the cards being dealt (obviously). The way would probably be with units. This may be an easier way to check to see if a card has been dealt yet or not (instead of the bring #suit/#rank system, how about a simpler bring unit).
thanks guys, but i understand what i am about to create. i successfully created a trivual pursuit map which randomly generates 1 of 256 questions for each player. the faster the players answer the questions, the more points they gain, and it is a battle to see who can reach the most points after 50 questions.
however, this situation is a little bit more difficult, because I need to generate the numbers for each player, therefore, i will have to recycle the 64 possibilities and have another set of triggers which direct the randomly generated numbers, and divert them to each player in a linear direction.