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

[制作教程] Make a Dynamic Inn

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

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 前天 20:22 | 显示全部楼层 |阅读模式
    Today we will go over making a dynamic inn for your player’s party to rest in. The cost can be changed dynamically with variables and the inn is easily extendable.


            For this you will need one Common Event, 2 Variables, and an Event for the Innkeeper.


            First we will want to make a loop, this will repeat the inn choice display after each option is finished.


            Use the Show Text command to display the Innkeeper’s greeting, something like: “How may I help you?”


            Then comes the choices for the player to decide what they want. This could be as simple as asking for a room or exiting the dialog, but that would not be that interesting. In my game there is a Mercenary system and you can ask Innkeepers for work, so I add the options. (Both Future Tutorials)


            Within our Room Choice we want to set a variable to what the inn will cost for one night using the Control Variables command. Name the variable something recognizable like “Inn Room Cost”


            In your Exit Choice we will want to place a Break Loop command to close out the Inn event.


            Your Innkeeper should look something like this:

    Spoiler[/url]




            ◆Loop
              ◆Text:None, Window, Bottom
              :Text:How may I help you?
              ◆Show Choices:Room, Mercenaries, Work, Never mind. (Window, Right, #1, #4)
              :When Room
                ◆Control Variables:#0008 Room Inn Cost = 100
                ◆
              :When Mercenaries
                ◆
              :When Work
                ◆
              :When Never mind.
                ◆Break Loop
                ◆
              :End
              ◆
            :Repeat Above


            In this example we are using Variable 8 for our Room Inn Cost and we are setting it to 100, but you could set this elsewhere or make something more complicated by multiplying it by an economy variable.


            Now we want to open the database and create a new Common Event named Inn. The reason we are using a Common Event is so we can use it in every inn we make, saving time.


            Within our Common Event we will want to show some text telling the player how much the room costs for one knight and asking them if they would like to stay.


    ◆Text:None, Window, Bottom
    :Text:\V[8]\G for one night. Would you like to stay?\$



            We will be using some text commands for this \V[8] will display the value of Variable 8, our inn’s cost. \G displays the symbol used for currency within the game. \$ displays the gold window, showing the player how much currency they have.


            We will want to give the player the option of Yes or No. Within the yes branch you will want to set a variable to the Gold (Under Game Data within the Set Variables command). In this example we will be using Variable 9.


            After setting the variable, we want to use a Conditional Branch to see if the Party Gold Variable is greater than or equal to the Inn Room Cost variable. Check the Create Else Branch before hitting okay.


            Within the If branch we want to use Change Gold to Decrease using the Inn Room Cost variable. This will subtract the party’s gold by the variable.


            Next is cosmetic, but good feedback for players. We want to use Fadeout Screen, Play a ME sound effect for the inn, and Wait 300 frames.


            Use the Recover All command for the Entire Party and then Fadein Screen.


            In the Else branch we will want some text to tell the players they do not have enough money.


            Leave the No branch empty.


            Your Inn Common Event should look something like this:


            ◆Text:None, Window, Bottom
            :Text:\V[8]\G for one night. Would you like to stay?\$
            ◆Show Choices:Yes, No (Window, Right, #1, #2)
            :When Yes
              ◆Control Variables:#0009 Party Gold = Gold
              ◆If:Party Gold ≥ Inn Room Cost
                ◆Change Gold:- {Inn Room Cost}
                ◆Fadeout Screen
                ◆Play ME:Inn (100, 100, 0)
                ◆Wait:300 frames
                ◆Recover All:Entire Party
                ◆Fadein Screen
                ◆
              :Else
                ◆Text:None, Window, Bottom
                :Text:\n<Innkeeper>You don't have enough money.
                ◆
              :End
              ◆
            :When No
              ◆
            :End

    Spoiler[url=https://forums.rpgmakerweb.com/attachments/inntest_3-jpg.47635/]





            Within our original Inn Event we will want to use the Call Common Event command to call our Inn event after setting the variable for cost. This will bring up the inn sequence we just wrote. Thanks to the Loop players will be brought back to the start of this event after staying the night so they can use other commands.


            Our final inn will look something like:

    Spoiler[url=https://forums.rpgmakerweb.com/attachments/inntest_2-jpg.47633/][/url]




    ◆Text:None, Window, Bottom
    :Text:\V[8]\G for one night. Would you like to stay?\$
    ◆Show Choices:Yes, No (Window, Right, #1, #2)
    :When Yes
      ◆Control Variables:#0009 Party Gold = Gold
      ◆If:Party Gold ≥ Inn Room Cost
        ◆Change Gold:- {Inn Room Cost}
        ◆Fadeout Screen
        ◆Play ME:Inn (100, 100, 0)
        ◆Wait:300 frames
        ◆Recover All:Entire Party
        ◆Fadein Screen
        ◆
      :Else
        ◆Text:None, Window, Bottom
        :Text:\n<Innkeeper>You don't have enough money.
        ◆
      :End
      ◆
    :When No
      ◆
    :End



            Using plugins it is possible to gain more control over what options are available to the player at any given time, but this makes a good framework.


            If you found this helpful please share with me the projects that you use this in. Also if you find any mistakes or have any improvements please share them. Thank you.


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-10 02:11 , Processed in 0.092502 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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