|
Post by islandjack on Nov 13, 2006 10:02:36 GMT -5
I remember a long time back someone attempting a gambling mini-game. I searched, I found the thread, but I'm so freaking rusty at RPGM2 not much of it made sense to me anymore. It might come back to me with time, but then again, it might not. I am getting older...
Anyway, did anyone ever try a gambling mini-game? How did it work out? What did you do?
I just want something rediculously simple, perhaps a game of "higher or lower," that's all I'm shooting for now.
I'm already getting the Fear, because I'm sure this is going to have something to do with variables.
Anyone with any advice/suggestions, or willing to help an old timer/absolute beginner?
Thanks in advance.
|
|
|
Post by NASH7777 on Nov 13, 2006 10:43:47 GMT -5
Well really it's endless in what you can do. Just generate random numebrs with x=1?100 or something, and then incorporate however.
I prefer more of the strategy ones. I had this game where there was a VFX thing XXX XOX XXX
You could choose anyone of the X's and then the two correlating triangle pieces and that one would be flipped. For example if I picked the top middle, the bottom left and right would flip. If I picked the the top right, the middle left and middle bottom would flip.
So you could choose which puzzle setup you wanted to do, then you kept flipping pieces until all of them matched the middle winning piece. Then you would win a prize.
Then I made a slot machine one where a wheel would scroll up and you hit X to stop it, did that 3 times and if they matched, you doubled your money you put in.Sadly all both these minigames were deleted a long time ago, I spent a long time making them look cool too... Was working on a game with all minigames and credits.....I should do this again.
Actually that would be a fun group project, we each keep passing a game file around and adding a mini game to it. And when we finish, have a game full of minigames... Let's get on that!!!
|
|
|
Post by Doan the Nado on Nov 14, 2006 13:08:02 GMT -5
That's a good idea, but to answer islandjack's question, a higher or lower game is actually pretty simple:
First decide how many numbers there should be. If you want to use playing cards, your numbers should be 2-14 (where 11 is J, 12 is Q, 13 is K, and 14 is A. If you want Aces to be low, you could make A 1 and change the code below a bit).
Okay, let's begin by doing this the simple but slightly incorrect way. With a real deck of cards, you can assume that the top two cards are simply random numbers between 2-14 (with 4 of each number in the deck: that is what we are going to ignore for now). So to implement this, we simply need to choose a random number between these two values to determine what the first card will be. You will need two variables: FirstCard and SecondCard (note that you could actually use TempVariables for this if you want, but writing them out here makes it easier to understand), and one flag: Higher. In RPGM2, the '?' operator chooses a random number in the given range. Here is the script:
Main script Data: Variable [FirstCard] = 2 ? 14 Screen: Message Window (close unchecked) "The first card was a " Call [DisplayFirstCard]
Screen: Message Window (close unchecked) "What is your selection?" Input: Multiple Choice 1. Higher 2. Lower Screen: Close Message Window Data: Flag [Higher] = Off SB: Condition Variable [User Input] = 1 Data: Flag [Higher] = On SB End
Data: Variable [SecondCard] = 2 ? 14 Screen: Message Window (unchecked) "The second card was a " Call [DisplaySecondCard]
SB: Condition Variable [SecondCard] > [FirstCard] SB: Condition Flag [Higher] = On Call [Win] SB End SB: Condition Flag [Higher] = Off Call [Lose] SB End SB End
SB: Condition Variable [SecondCard] < [FirstCard] SB: Condition Flag [Higher] = On Call [Lose] SB End SB: Condition Flag [Higher] = Off Call [Win] SB End SB End
SB: Condition Variable [SecondCard] = [FirstCard] Call [Lose] SB End
DisplayFirstCard Data: Variable [TempVar0] = [FirstCard] Call [DisplayCard]
DisplaySecondCard Data: Variable [TempVar0] = [SecondCard] Call [DisplayCard]
DisplayCard SB: Condition Variable [TempVar0] <= 10 Screen: Display Variable [TempVar0] SB End
SB: Condtion Variable [TempVar0] > 10 SB: Sort Variable [TempVar0] Apply If 11 Screen: Message Window (unchecked) "J" SB: To End Apply If 12 (as above) "Q" SB: To End Apply If 13 "K" SB: To End Apply If 14 "A" SB End SB End
I hope those scripts are clear. The Display scripts simply remove the clutter of displaying cards properly out of the main script. They could actually be used for many card games. For example, BlackJack also has two cards, so you could call the same thing for that game. Later on, if you wanted the cards to be displayed as an on-screen VFX, you would only have to change that in one place. But anyways:
The main script chooses a first card between 2 and 14. The player then guesses higher or lower, and this sets a flag. The second card is then chosen (again between 2 and 14) and compared to the first card, and if the player has guessed right, they win, and wrong they lose. I have elected to cause = cards to be an automatic loss here, but you could change that as desired.
I have left off the writing of Win and Lose to you because I'm not sure of what you would like your prizes to be. Any other questions, I would be happy to answer them.
|
|
|
Post by islandjack on Nov 14, 2006 13:41:49 GMT -5
Doan, you're amazing. Thanks so much! I'm going to fire up the PS2 and try this out right away. I'm pretty sure that I understood the script you gave me, but like I said, I'm going to try it out momentarily, so don't be surprised when I'm back here with more questions (probnabaly stupid ones, I like those best).
Also, thanks again for actually writing and posting the script for me. As I'm sure I've said, I was always too afraid to mess around with variables before, but I have a feeling once I start to try and get your script to work, I'll have a better, or at least a small understanding of what the heck they actually are, and I'll get over The Fear.
As for the Win/Lose, let me see if I can the basics to work first, and then I'll try and give writing that a shot (but I'm sure I'll need more help). All I'm going to need is a basic, one ammount bet (like 5GP), win you double your $, lose, you lose it all.
If I ever decide to get more advanced, I'll let you know, and I'll be ripping off some of Nash's ideas up there.
Thanks again, I'll be back.
|
|
|
Post by islandjack on Nov 15, 2006 10:39:20 GMT -5
All right, I'm back. And, I'm stumped. Feel free to have a good laugh at me because I have no idea what I'm doing with this one.
I started to write the script, but not even halfway through, I've already got some questions, so I'll get right to them, referencing the script Doan posted above.
1. 3rd line down under Main Scripot, there's Call [DisplayFirstCard] How do I do that in the script?
2. 5 lines down, I've got the Input: Multiple Choice (I understand this) but do I need to put anything in the actual MC script that apears once I select MC, or just leave what's there alone?
3. 10 lines down, there's SB End. I understand that SB means Script Branch, but how do I make the SB end?
Okay, now that you really know I don't know what I'm doing and if you still feel like helping me out, I'd appreciate it. I think answering those 3 questions for me should give me a better understanding of what the heck I'm trying to do. If my questions don't make any sense, let me know and I'll try to explain what I'm asking better.
Thanks in advance, and no hurry, I've got a lot of other stuff I can work on in this game.
|
|
|
Post by vespuleth on Nov 15, 2006 15:35:18 GMT -5
1. just under the menu for sorts and conditions and such is a group of script commands. In that group is call script. Sorry I don't remember the name.
2. Yes. Make two choices, and name them Higher and Lower. It will create two script branch conditions. in the first one, put the flag Higher = on, and delete the second.
3. SB end comes automatically when a condition is created. just make sure the data: flag... command is inside of the condition.
Hope that helps!
|
|