じ☆ve冰风 发表于 3 天前

How to Add a Poker Mini Card Game (Demo)

Poker Mini Game Script and Demo
RPG Maker VX Ace

Original Script by CACAO
http://cacaosoft.web.fc2.com/

CACAO's TOS:

http://cacaosoft.webcrow.jp/rule.html

English Translation by Carrigon
http://www.sims2workshop.com

Difficulty Level:  This is more for Beginners.  If you want more of a plug n play easy to add mini game, this is geared toward you. 
 

This is a working English translation of CACAO's Poker Mini Game Script for RPG Maker VX ACE.

The script has been attached to this post as a txt file you can download.  Turn off wordwrap in your text editor, that's usually what messes up any code you try to paste.  Just use notepad with wordwrap off and copy and paste the script.  If you have a problem with it, get it from the demo and copy and paste it from there.  The script goes in the same place you paste all your scripts, under Materials, but above Main.

How to use this script:

Copy the PokerTrump.png file to Graphics/System

PokerTrump file here:



Paste the script under Materials, but above Main.

Make an event.  Insert Script:
start_poker

See the demo for how to make a switch in game if you win.  I just made it based on how much more gold you have after playing.  If you have more gold, then you won, so the switch turns something on.  I'm sure there are other ways of doing it.

Demo here:

https://mega.co.nz/#!tZg0WT6D!f72oB0t6NghUmRVImd0bDG6bSRw050DG1xmN2PFk57M

Screenshots:

Spoiler




 







If you have any problems with it, try copying the script from the demo.  And test it with a new project.  Make sure you have the Poker pic in Graphics/System.  I've also attached a copy of the script in a txt file to this post if you need it.

NOTES:  No known bugs that I've found.  I think it's working okay.  CACAO had put this up in Russian and Japanese but those versions weren't working properly for some versions of VX ACE.  This version includes his fix for that.  Mouse support is included if you have a mouse script in your game.  You will still need to use arrow keys to move side to side when choosing cards.

Here is my permission letter from CACAO that I am allowed to translate and teach with his script.



English Translation of CACAO's letter for those who don't speak Japanese. 

Spoiler



Second Part of Poker Demo Tutorial
by Carrigon
sims2Workshop.com

Scripts and Graphics by
CACAO
http://cacaosoft.webcrow.jp/
http://cacaosoft.webcrow.jp/rule.html

This second part of the Poker Demo Tutorial teaches the Art of Duel Coding, and how to make the cards into an inventory item you can play poker from whenever you want to.

The Art of Duel Coding is used whenever you need to add a function to an existing script, but you don't want to alter that script.  Sometimes it's much easier and faster to make a Duel Script and call on it in your event.

So for this demo, I'm using Duel Coding to have one script turn on a game switch when the player wins a hand of Poker.  Then I call on the second script, my Duel Script, and I give the player the option of playing again unlimited for fun.  When you are eventing a game, this is a great way to do it.  If you have a door or something else you want the player to unlock, have them play poker till they win, the switch gets turned on.  Then they have the option of playing again for fun as much as they want to.  You don't have to stick with one script.  You can make as many duel coding scripts as you want to when working with Ruby and this game engine.  The trick is to make sure you renamed everything in the second script so that the game thinks you have a whole new script.  it's very easy.  And in your event, you call on both when you need them.  Remember to make a copy of your picture files and rename it, too.  The card pictures here go into Graphics/System.  Just see my screenshots.

Making the deck of cards a playable inventory item is very easy.  You make a common event with your script call.  See my screen shots.  Make an inventory item for the cards and call on the common event for its effects.

Common Event:



Item:


 

Event:



See my screenshots for what lines to edit for the switch number.  They are in the plain Poker script, that's your switch script.  PokerB script is for unlimited hands.  





Reminder:  When copying and pasting scripts using a text editor like Notepad, always turn off wordwrap.  Wordwrap breaks your codes.  It will break code no matter what code language you are scripting.  Turn it off before copying and pasting.

Download Demo here:
https://mega.co.nz/#!AdphDJJD!Zh3a2ZFB2MenhzUXE3xYJV2hrPAjTGsMYnPoFOw8QYI

Duel Scripts without demo here:
https://mega.co.nz/#!ocoHkQIT!dcdKd3w2bxICBTw5DjW0nQsyyHHCvsbGWxcRLd6Tze0
Includes pictures, put them in Graphics/System

Screenshots for Poker Demo2:

Spoiler




 



Poker_RPG Maker VX Ace Script.txt


本贴来自国际rpgmaker官方论坛作者:Carri处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/how-to-add-a-poker-mini-card-game-demo.34123/
页: [1]
查看完整版本: How to Add a Poker Mini Card Game (Demo)