设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 60|回复: 0

[制作教程] shunroid - Dice Game Event

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    慵懒
    3 天前
  • 签到天数: 207 天

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    21262
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    25800

    灌水之王

    发表于 昨天 22:09 | 显示全部楼层 |阅读模式
    With permission from shunroid, I'm sharing minigame tutorial in English here.

    I thought I'd come up with this event where some middle-aged dude challenges people randomly all around town to a duel of dices, so here it is.


    || Stuff I want to do with the dice duel

    There's this middle aged dude who randomly appears in town and challenges people to a duel of dices.

    When you accept the duel, you pay.

    If you win, you get rewarded with the double amount of money you paid.

    If you lose, you don't get your money back.

    That's it.


    || Preparing of dice pictures

    We'll use dice images from [wpclipart] https://wpclipart.com/recreation/games/dice/

    Note: I used an alternate website instead of Japanese tutorial to skip registration step.

    Download "transparent png" (below download png) for each 'die face 1-6' to complete six dice set.





    File names can be named die1.png to die6.png respectively.

    Images should be inside img/pictures folder of your RPG Maker MV project.


    || Event contents

    The contents of the events are shown below.

    Edit: For version with showing 2 dices at once, scroll down to || Extra event contents are in the spoiler.

    ◆If:Gold ≥ 500
      ◆Text:None, Window, Bottom
      :Text:Say, you there.
      :Text:Why don't you accept my challenge?
      :Text:Just toss your dice and if your roll is bigger than mine
      :Text:You win!
      ◆Text:None, Window, Bottom
      :Text:The bet will be 500G.
      :Text:If you win, I shall pay you twice as much!
      :Text:If you lose though, you will not get your money back.
      :Text:So what do you say?
      ◆Show Choices:I accept!, Nah, no thanks... (Window, Right, #1, #2)
      :When I accept!
        ◆Text:None, Window, Bottom
        :Text:Alright!
        :Text:Hand over your 500G then.
        ◆Change Gold:- 500
        ◆Text:None, Window, Bottom
        :Text:You paid 500G.
        ◆Label:start
        ◆Text:None, Window, Bottom
        :Text:It is my turn!
        :Text:Go!
        ◆Play SE:Absorb2 (90, 150, 0)
        ◆Control Variables:#0003 dice duelist = Random 1..6
        ◆If:dice duelist = 1
          ◆Show Picture:#1, die1, Upper Left (248,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:The opponent's dice rolls
          :Text:\{\V[3]
          ◆
        :End
        ◆If:dice duelist = 2
          ◆Show Picture:#1, die2, Upper Left (248,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:The opponent's dice rolls
          :Text:\{\V[3]
          ◆
        :End
        ◆If:dice duelist = 3
          ◆Show Picture:#1, die3, Upper Left (248,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:The opponent's dice rolls
          :Text:\{\V[3]
          ◆
        :End
        ◆If:dice duelist = 4
          ◆Show Picture:#1, die4, Upper Left (248,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:The opponent's dice rolls
          :Text:\{\V[3]
          ◆
        :End
        ◆If:dice duelist = 5
          ◆Show Picture:#1, die5, Upper Left (248,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:The opponent's dice rolls
          :Text:\{\V[3]
          ◆
        :End
        ◆If:dice duelist = 6
          ◆Show Picture:#1, die6, Upper Left (248,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:The opponent's dice rolls
          :Text:\{\V[3]
          ◆
        :End
        ◆Erase Picture:#1
        ◆Text:None, Window, Bottom
        :Text:It is your turn now!
        ◆Play SE:Absorb2 (90, 150, 0)
        ◆Control Variables:#0004 your dice = Random 1..6
        ◆If:your dice = 1
          ◆Show Picture:#1, die1, Upper Left (248,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:Your dice rolls
          :Text:\{\V[4]
          ◆
        :End
        ◆If:your dice = 2
          ◆Show Picture:#1, die2, Upper Left (248,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:Your dice rolls
          :Text:\{\V[4]
          ◆
        :End
        ◆If:your dice = 3
          ◆Show Picture:#1, die3, Upper Left (248,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:Your dice rolls
          :Text:\{\V[4]
          ◆
        :End
        ◆If:your dice = 4
          ◆Show Picture:#1, die4, Upper Left (248,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:Your dice rolls
          :Text:\{\V[4]
          ◆
        :End
        ◆If:your dice = 5
          ◆Show Picture:#1, die5, Upper Left (248,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:Your dice rolls
          :Text:\{\V[4]
          ◆
        :End
        ◆If:your dice = 6
          ◆Show Picture:#1, die6, Upper Left (248,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:Your dice rolls
          :Text:\{\V[4]
          ◆
        :End
        ◆If:dice duelist = your dice
          ◆Erase Picture:#1
          ◆Text:None, Window, Bottom
          :Text:It is a draw!
          :Text:One more time then!
          ◆Jump to Label:start
          ◆
        :End
        ◆If:dice duelist > your dice
          ◆Erase Picture:#1
          ◆Play SE:Buzzer1 (90, 100, 0)
          ◆Text:None, Window, Bottom
          :Text:I wiiiiiiiiin!
          :Text:Muwahahahahahaha!
          :Text:I win! I win!
          ◆Text:None, Window, Bottom
          :Text:Let's do this again!
          ◆Control Switches:#0043 dice duel = ON
          ◆
        :End
        ◆If:dice duelist < your dice
          ◆Erase Picture:#1
          ◆Play SE:Applause1 (90, 100, 0)
          ◆Text:None, Window, Bottom
          :Text:You win.......
          :Text:I shall pay you double then......
          ◆Change Gold:+ 1000
          ◆Text:None, Window, Bottom
          :Text:You received 1000G.
          ◆Text:None, Window, Bottom
          :Text:Let's do this again!
          ◆Control Switches:#0043 dice duel = ON
          ◆
        :End
        ◆
      :When Nah, no thanks...
        ◆Text:None, Window, Bottom
        :Text:You scaredy cat!!
        :Text:Scaredy cat!! Scaredy cat!!
        ◆
      :End
      ◆
    :Else
      ◆Text:None, Window, Bottom
      :Text:You don't have money do you, you petty one.
      :Text:You are not worth my time if you don't even have 500G.
      :Text:Get lost.
      ◆
    :End

    I decided to add the conditional branch based on whether you have more than 500G or not.

    Otherwise you won't be able to accept the challenge if you don't have the money.

    I decided to show the numbers along with the image of the dice and the text.

    I included the “#00043  dice duel = ON”  so you will not be able to play back to back.

    It will turn OFF once the dude leaves the town.


    || Preview






    || Video


    https://www.youtube.com/embed/2R28rbeRTwI


    || Afterword

    There's one thing I actually realized while I was making this thing ; you can save it before you accept the challenge, then reset it again afterward if you lose, then keep redoing it until you win.

    So I decided not to add the setting where you can specify how much to pay from your pocket money.

    Otherwise it will turn into an event where you can simply double your money! LOL


    || Extra

    For showing 2 dices at once

    Spoiler: Contents
    ◆If:Gold ≥ 500
      ◆Text:None, Window, Bottom
      :Text:Say, you there.
      :Text:Why don't you accept my challenge?
      :Text:Just toss your dice and if your roll is bigger than mine
      :Text:You win!
      ◆Text:None, Window, Bottom
      :Text:The bet will be 500G.
      :Text:If you win, I shall pay you twice as much!
      :Text:If you lose though, you will not get your money back.
      :Text:So what do you say?
      ◆Show Choices:I accept!, Nah, no thanks... (Window, Right, #1, #2)
      :When I accept!
        ◆Text:None, Window, Bottom
        :Text:Alright!
        :Text:Hand over your 500G then.
        ◆Change Gold:- 500
        ◆Text:None, Window, Bottom
        :Text:You paid 500G.
        ◆Label:start
        ◆Text:None, Window, Bottom
        :Text:It is my turn!
        :Text:Go!
        ◆Play SE:Absorb2 (90, 150, 0)
        ◆Control Variables:#0003 dice duelist = Random 1..6
        ◆If:dice duelist = 1
          ◆Show Picture:#1, die1, Upper Left (44,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:The opponent's dice rolls
          :Text:\{\V[3]
          ◆
        :End
        ◆If:dice duelist = 2
          ◆Show Picture:#1, die2, Upper Left (44,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:The opponent's dice rolls
          :Text:\{\V[3]
          ◆
        :End
        ◆If:dice duelist = 3
          ◆Show Picture:#1, die3, Upper Left (44,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:The opponent's dice rolls
          :Text:\{\V[3]
          ◆
        :End
        ◆If:dice duelist = 4
          ◆Show Picture:#1, die4, Upper Left (44,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:The opponent's dice rolls
          :Text:\{\V[3]
          ◆
        :End
        ◆If:dice duelist = 5
          ◆Show Picture:#1, die5, Upper Left (44,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:The opponent's dice rolls
          :Text:\{\V[3]
          ◆
        :End
        ◆If:dice duelist = 6
          ◆Show Picture:#1, die6, Upper Left (44,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:The opponent's dice rolls
          :Text:\{\V[3]
          ◆
        :End
        ◆Text:None, Window, Bottom
        :Text:It is your turn now!
        ◆Play SE:Absorb2 (90, 150, 0)
        ◆Control Variables:#0004 your dice = Random 1..6
        ◆If:your dice = 1
          ◆Show Picture:#2, die1, Upper Left (452,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:Your dice rolls
          :Text:\{\V[4]
          ◆
        :End
        ◆If:your dice = 2
          ◆Show Picture:#2, die2, Upper Left (452,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:Your dice rolls
          :Text:\{\V[4]
          ◆
        :End
        ◆If:your dice = 3
          ◆Show Picture:#2, die3, Upper Left (452,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:Your dice rolls
          :Text:\{\V[4]
          ◆
        :End
        ◆If:your dice = 4
          ◆Show Picture:#2, die4, Upper Left (452,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:Your dice rolls
          :Text:\{\V[4]
          ◆
        :End
        ◆If:your dice = 5
          ◆Show Picture:#2, die5, Upper Left (452,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:Your dice rolls
          :Text:\{\V[4]
          ◆
        :End
        ◆If:your dice = 6
          ◆Show Picture:#2, die6, Upper Left (452,80), (100%,100%), 255, Normal
          ◆Text:None, Window, Bottom
          :Text:Your dice rolls
          :Text:\{\V[4]
          ◆
        :End
        ◆If:dice duelist = your dice
          ◆Text:None, Window, Bottom
          :Text:It is a draw!
          :Text:One more time then!
          ◆Erase Picture:#1
          ◆Erase Picture:#2
          ◆Jump to Label:start
          ◆
        :End
        ◆If:dice duelist > your dice
          ◆Play SE:Buzzer1 (90, 100, 0)
          ◆Text:None, Window, Bottom
          :Text:I wiiiiiiiiin!
          :Text:Muwahahahahahaha!
          :Text:I win! I win!
          ◆Erase Picture:#1
          ◆Erase Picture:#2
          ◆Text:None, Window, Bottom
          :Text:Let's do this again!
          ◆
        :End
        ◆If:dice duelist < your dice
          ◆Play SE:Applause1 (90, 100, 0)
          ◆Text:None, Window, Bottom
          :Text:You win.......
          :Text:I shall pay you double then......
          ◆Erase Picture:#1
          ◆Erase Picture:#2
          ◆Change Gold:+ 1000
          ◆Text:None, Window, Bottom
          :Text:You received 1000G.
          ◆Text:None, Window, Bottom
          :Text:Let's do this again!
          ◆
        :End
        ◆
      :When Nah, no thanks...
        ◆Text:None, Window, Bottom
        :Text:You scaredy cat!!
        :Text:Scaredy cat!! Scaredy cat!!
        ◆
      :End
      ◆
    :Else
      ◆Text:None, Window, Bottom
      :Text:You don't have money do you, you petty one.
      :Text:You are not worth my time if you don't even have 500G.
      :Text:Get lost.
      ◆
    :End
    Preview
    Spoiler






    Tip:
    Use Script call to run two commands as they were shown here.

                    Code:       
    $gameSystem.onBeforeSave();DataManager.saveGame(DataManager.latestSavefileId());



    It will save it to last save file you used and if you don't have any save file it will save it to 1.

    You can place Script call on where you want autosave to take place.


    本贴来自国际rpgmaker官方论坛作者:ovate处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/shunroid-dice-game-event.130167/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-10 01:13 , Processed in 0.143252 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表