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

[制作教程] [Intermediate and Scriptless] How to make an inventory/menu with events only

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    前天 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    4446

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 前天 10:14 | 显示全部楼层 |阅读模式
    This tutorial will show you how to make event based interface without requiring any scripting.

    Disclamer: Will  not provide any graphic to base on.

    Requirements: Paint.net (or any other image editor that supports transparency).

    1. Preparations.
    First before starting, you will need to have an idea of what you want in your inventory/menu, if your game is multi-language hardcoded, don't forget to take this into consideration. Also don't forget to disable the default menus via an event at fist occasion.

    2. Interaction allowance.
    You might want to prevent the player to accessing the menu during a specific moment during your game. Create a switch that if enabled, will prevent the menu to open, I personally called it 'menu_lock'. Create another one called 'inv_is_open'. Go in common event create one named 'menu.aviability' and insert the following and create empty common event if needed:
    Spoiler                 Code:        
    1. Triggered by: None
    2. if B key is pressed
    3.   if switch 'inv_is_open' = off
    4.    PlaySE {sound effect name here, if none ignore}
    5.    Common event: 'inv.handler.open'
    6.    Common event: 'inv.handler.cursor'
    7.    Common event: 'inv.handler'
    8.    Wait 10 frame
    9.    Switch 'inv_is_open' = true
    10. else
    11. Common event: 'inv.handler.close'
    12. end
    复制代码






    Now create an event on any of your game map that you want and do the following:
    Spoiler                 Code:        
    1. Type: Parallel process
    2. Content:
    3. Call Common Event 'menu.aviability'
    4. Note: Place the event either in void, in a collision or above
    5. the player, also don't give it any charset.
    复制代码






    Once done, copy the event to all maps that you want your menu to be accesible.

    3. Menu background and text.
    Create a background to go with your menu; include text in it if it is not flexible (cannot be affected in any way by the gamne state). If you didn't knew already, an RPG Maker VX Ace game default dimensions are 544 x 416. If you want to replicate the default RTP font follow the following steps:
    This method is for Paint.net only.
    1. Write in white in Verdana size:14.
    2. Create a shadow under it. (Duplicate that is fully blackened with the saturation effect).
    3. Photo glow with values: 1, -100 -100
    4. Create 5 layer duplicate (with first, 6 layers shadow layer total)

    Once you have designed your menu background, it is time for "flexible" text, create multiple images with the value changed, oif there is alot of possible values (like stats), consider creating base text (exemple: Your attack level is: ) and then create individuals image that contain the digit 0 to 9.

    You will also need to create a cursor, there is two way of creating a cursor image: Eitheir you create a fixed image size and make the cursor move position in relation to the possble cursor slot or just makeone cursor picture (simpler - especially if you are going to go for a complex menu).

    4. Graphic display.
    Go to your 'inv.handler.open' common event and insert the following:
    Spoiler                 Code:        
    1. Triggered by: None
    2. Set variable 'cursor.slot_id' to 0
    3. Show picture n°50 (this your background)
    4. Show picture n°51 (this the "non-flexible" text)
    5. Common event 'inv.display_stats'
    6. Set variable 'cursor.X' to (value you want want)
    7. Set variable 'cursor.Y' to (value you want want)
    8. Show picture n°53 at X Y (with aforementionned variables) (this you cursor default position)
    复制代码






    Now in the common event 'inv.handler.cursor' this where you will need to set where the cursor will go for each selectable thing in your menu. Exemple:

    Spoiler                 Code:        
    1. Triggered by: None
    2. if variable 'cursor.slot_id' = 1
    3. Move picture n°53 at X Y [Origin top-left and do not wait for end]
    4. else
    5. end
    复制代码






    Create multiple conditonal branches according to your needs.

    5. Cursor updating and button press.
    Now we need to get the cursor to move and update its position. In the common event 'inv.handler' you will need to insert the player arrow keys input. Here's an example:
    Spoiler                 Code:        
    1. Triggered by: Parallel Process Conditional switch: 'inv_is_open'
    2. if switch 'inv_preventing' = off
    3. if right key is pressed
    4.   if variable 'cursor_slot_id'  = 0
    5.   Play SE {sound effect name here, if none ignore}
    6.   Set variable 'cursor_slot_id' to 1
    7.   Common event 'inv.handler.cursor'
    8.   Wait 30 frame
    9. Else
    10. [Insert an equivalent of the previous branch but for every combinaisons and directions]
    11. Else
    12.   Else
    13. End
    14. If C key pressed
    15. If variable 'cursor_slot_id' = 1
    16. Play SE {sound effect name here, if none ignore}
    17. [What you want the slot/button to do is up to you]
    18. Else
    19. End
    复制代码






    If you want to make a save/load game function here some script call to help you:
    Spoiler: Save game (script call)
                    Code:        
    1. [/code]
    2. DataManager.save_game(0)[/quote]Spoiler: Load game (script call[quote]                 Code:        
    3. [code]
    复制代码

    if DataManager.load_game(0)
      $game_system.on_after_load
      SceneManager.goto(Scene_Map)
    End
    Spoiler: Check if savegame exist[quote]                 Code:        
    1. [/code]
    2. If File.file?('Save01.rvdata2')
    3. [Insert whatever you want here]
    4. Else
    5. End[/quote]
    6. [b]6. Making the interface close[/b]
    7. Go in 'inv.handler.close'and do the following:
    8. Spoiler                 Code:        
    9. [code]If switch 'inv.close_prevent' = off
    10. Set switch 'inv_preventing' = on
    11. Delete image n°X (delete all the images you used in your menu)
    12. Play SE {sound effect name here, if none ignore}
    13. Set switch 'inv_is_open' = off
    14. Set switch 'inv_preventing' = off
    复制代码






    I hope this tutorial helped you to understand the basic on how to make event-based interfaces. If you have trouble making the player to stop while the interface is open, make a common event to change the tileset or get a script that allow you to prevent the player to walk if a switch is on.





    本贴来自国际rpgmaker官方论坛作者:manpaint处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/intermediate-and-scriptless-how-to-make-an-inventory-menu-with-events-only.87971/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-14 14:21 , Processed in 0.067237 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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