Home
Help
Search
Calendar
Login
Register
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Click here to join us on IRC (#charas on irc.freenode.net)!
Charas-Project
»
Game Creation
»
Requests
»
RPG Maker Programming
»
Blackjack question
« previous
next »
Print
Pages: [
1
]
Author
Topic: Blackjack question (Read 1720 times)
Phayre
Exemplar
Posts: 1,089
Blackjack question
«
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?
Logged
DragonBlaze
A Wild DB Appeared!
Royal
Posts: 3,329
(No subject)
«
Reply #1 on:
June 18, 2007, 07:41:42 PM »
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.
Logged
Hell Yeah! Just recovered all my old rm2k/3 games from my 10 year old, broken laptop hard drive that had been formatted and had a new OS installed on it. Oh, and I did all of this from my phone. WIN
Osmose
So freakin' inactive
Royal
Posts: 3,041
(No subject)
«
Reply #2 on:
June 18, 2007, 08:23:53 PM »
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.
Logged
Hrm.
game_maniac
Member
Acolyte
Posts: 350
(No subject)
«
Reply #3 on:
June 18, 2007, 08:43:46 PM »
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.
Logged
Um, not to sound stupid or anything but what's castration? Is it like a food or something?" -vannypegasus, Pokémon board (6/14/05)
BlackRose203: There are only 21 hours in a day. Go to school more. -_-
Phayre
Exemplar
Posts: 1,089
(No subject)
«
Reply #4 on:
June 18, 2007, 11:36:42 PM »
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.
Logged
Print
Pages: [
1
]
« previous
next »
Charas-Project
»
Game Creation
»
Requests
»
RPG Maker Programming
»
Blackjack question