Charas-Project
Game Creation => Requests => RPG Maker Programming => Topic started by: Phayre on June 18, 2007, 03:40:09 PM
-
I'm working on a blackjack minigame for ES, loosely based on a tutorial from GW. I want to use pictures of actual playing cards, but I want it so you can't draw two of the exact same card, to make it more realistic.
1. What format should I save the cards in? It keeps saying invalid color depth when I try to load them into pictures.
2. Is there a way to eliminate a number from a random variable thing? Like, if I had just drawn the ace of spades. That card's ID is 1. Can I eliminate the number 1 so you can't draw another ace of spades?
-
Hmm the easiest way to do it would be to generate the random number from 1-52 like normal. Then after a number is picked, check to see if that card has been picked. If not, draw that card, if so, generate another random number and repeat the process until a new card is picked.
-
But how long do you think that will run when every card but one is drawn? It could potentially run forever.
A better method is that, if it doesn't find the card, either keep adding or subtracting from that number until it finds an available card. Randomize it between adding or subtracting to increase the randomness.
-
This reminds me when I used a script to make a roulette game for XP. Sometimes scripting does make things easier. Erm, but I digress.
As for your image troubles, you need to save the pictures as 256 colors, but don't use Paint to do it. Use Photoshop or Ultimate Paint.
-
I used idraw to convert the colors. I'll try again, but it was enough of a pain in the arse to do the cropping.....
How exactly, in coding, would I do this subtraction thing? I don't follow.