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

[制作教程] Password Locked Doors

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

    连续签到: 1 天

    [LV.7]常住居民III

    3122

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 昨天 21:00 | 显示全部楼层 |阅读模式
    There are many options to have your heroes open the door by using a password, and two very simple ones are using a switch that turns on once your party learnt about the password and the other one being a multiple choice answer, maybe several after each other to make it less likely to pass by guessing.

    But sometimes you want your player to really think, to actually solve a puzzle by themselves and enter the answer and therefore you need some freedom.
    I am pretty sure there are plugins out there, but you can actually realize such things with events without any issue.

    Let’s have a look at a possible situation first:



    Your heroes could come across a piece of paper, possibly by someone who tried to memorize the password and was not allowed to actually write it down. To make sure your player has something to do and not only loot that piece of paper, they need to do some more searching and/or thinking.
    In my example, they can come across a second handwritten note:



    With the combination of those two you can solve the puzzle, starting at the P, you need to do a certain route on the paper.



    Now of course, you can’t just have a multiple choice answer, that would be too easy and have your player guessing his way through instead of thinking.

    No, instead, we use a “dummy hero” here:



    We create a new hero in the database and give him nothing besides maybe an optional face image. I simply used a public domain lock here to symbolize the lock nature.

    Now we set up our event:



    The event consists of two things: the name input for our dummy hero which gives the player the whole range of things he could enter into the console and a conditional branch that checks, whether that was the intended input.




    In game, our “password input” will look like this.
    Watch out that the conditional branch is capital sensitive! So in case someone enters “password” or Password“, it will deny access. If you want those to trigger the event as well, you need to expand your else statements:



    Another important thing is that you need to reset your “dummy hero” in case you want to allow a retry or reuse the dummy for another lock because it would not make sense if the lock memorizes a wrong password or if a different lock knew the password you entered elsewhere!

    Now, let us think about a second way to implement a lock with a more flexible input system. The name hero is a very good solution, but it allows all kinds of different inputs and it has a certain layout, so it might not be the perfect solution for every kind of situation.

    For example you could want to have the player open a number lock by entering a specific number.



    So in this case, the solution is 13x13=169, and we need a handy way to enter that into a lock without being too obvious.

    Since this is a kinda custom scene, we will need some matching materials here.
    And I know not everyone can create them, so let me add some additional words here:
    There are plenty of images free to use and some even public domain out there. For this tutorial all images might look slightly wonky, but they were all made with very basic skill and materials from a trustworthy public domain image site that allowed me to achieve all the scenes I had in mind. I made that on purpose so i knew everyone of you with some focus can create the graphics for such a puzzle!

    So, what happens on interact with the locked door?

    The event does four things:

    • It disables the menu. Since the lock “menu” is a different map and our hero will have a different charset here, we just lock the menu to not have the player see that, also there is no reason to access the menu there.
    • Have your lead heroes graphic become an arrow:

    Since we will use the “hero” to navigate on the map, a simple charset with every frame being a simple (here: an adjusted random public domain) arrow or cursor does the job:





    • It sets the heroes position to looking up and fixed
    On the map we created the events that are interacted with lie above the character, so he is already pointed towards them for easy interaction

    • Teleport to the lock map

    For the “lock map” we will need a background image that is set as parallax for this map:




    It should be the minimum size of the map and be set up in a way that all interactable parts can be placed into the event grid without looking or feeling off.
    In this case I simply combined a public domain chain with the lock I had already used as a face graphic for the first possibility and added a small legend using my own icons that already show the possible interactions on this map.
    Always remember: Your player may not exactly think the same way you do and could be thrown off if the interactions are not intuitive enough.




    The player gets teleported somewhere into the red area - here a 5 tile wide strip. Since all the possible interactions are in one horizontal line, we block off all the tiles around that area by using invisible tiles that are set to non-passable and for the red strip invisible tiles that are set to passable.

    Now we have set up the first meachnic from our legend, the movement in a restricted area. The second one is a bit more work, but not that complicated.
    The turquoise area are three very similar events:





    As they are meant to be the adjustable digits, we need a matching character graphic. Here I simply used the rectangle selection and a bilinear gradient to give the area a curved look, added a darker rim (also rectangle selection) and used another rectangle around that with the darkest and the brightest shade of the lock to have the field look like it is embedded into it and then added the numbers. I also left a blank one in case you want to use this set and want to add other symbols or letters.

    Each of those three events looks roughly the the same, besides each of them using a different variable:



    On the first page you have the “0”, if interacted with, it ups the variable for that digit simply by one (or sets it to one, it does not matter).
    All the pages between 0 and 9 look about the same, with just the image and the values being one apart between two pages:



    The last page then resets the variable to 0 so the whole circle starts over:




    Now we have a functional lock that you could reuse like this by simply copying the map and even reusing the variables, but you need to set up the solution as well.

    You can do this in several ways:
    You can have parallel process running, that has three conditional branches that just check whether all the variables are the same as in the solution - 1, 6 and 9 and then reset all the specific things you made for this map:



    The hero image needs to be changed back, the direction fix needs to be off again and the menu accessible, and as the puzzle is solved, the hero needs to be brought back. I also added a switch that allows us to unlock the “puzzle solved” event pages on the map we are coming from.

    You could also “hardcode” the solution into the event pages, as for example here for the first digit:



    If you turn the switch from 0 to 1 AND the other two digits are correct, this step will solve the puzzle. Here you could e.g. use a switch that triggers a parallel event that has the same contents as above besides you don’t need the conditional branches. This switch is the same that was used in the alternate above and could also be used to unlock the “puzzle solved” event pages on the other map.
    If you go for this, you have to set up the conditional branches into each of the three digit events.

    Now there is only one thing left to do:



    Another parallel process checks whether the Cancel button is pressed and allows you to leave the scene without having the puzzle solved.

    Attention!
    If you aim for people playing the game without a keyboard, you should include another, easier to access way out for them.

    And we are done:



    Without any plugin, a fully functional numerical lock!


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-8 00:52 , Processed in 0.152651 second(s), 59 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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