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

[制作教程] Storing and Access Text / Data via Plugin

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

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 昨天 16:51 | 显示全部楼层 |阅读模式
    This tutorial may change your experience of how you use RPG Maker MV.

    I must admit, I found this method long time ago by accident. I only have little knowledge of coding and can't call myself a proper programmer. As I never see anybody else has discovered / publishing it, I thought this would be groundbreaking.

    What is this about?
    Have you ever thought of how big your story and your dialog is and it will be a pain if you have to edit em or even keep em organized? "Can't we just store the whole text inside text editor?" Certainly that would be convenient. And this tutorial is the simplest form to achieve that.

    Feature

    • Keep your story and dialog organized inside text file (js).
    • Might achieve new potential for databasing. Less hard-code inside the editor.
    • Teach you a bit about coding.

    Requirement

    • Basic knowledge of how to use plugin.
    • Basic knowledge of using text editor.
    • Difficulty level : Adept

    How?
    Spoiler: Making the Plugin
    Prepare your favorite text editor! We are making the plugin to store your text now! It's WAAAAY too easy that I doubt it could even be called coding.

    • Make an object. Name it whatever you want. It's case sensitive.


    • Store your text inside a key whatever you name it following this format.
      sample_01 for example


    • You are done! Easy peasy, right? Save it as a js file with whatever name you like. Then put it inside yourgame/js/plugins folder.


    • Don't forget to activate it in your plugin manager.


    Spoiler: Accessing Your Data
    Yes, you may already access it directly through event!

    • The proper way to access it is by using game variables.
      (It's CASE SENSITIVE, but I posted an outdated screenshot)


    • Your variable is now containing your stored text! Let's see it in action using show text~


    • Result :


    Spoiler: Control Characters and Escape Code
    To write these code, we just have to borrow those that already made.

    • Let's make a quick example


    • Red : Control Characters in show text (\N[ID], \V[ID], etc) shall start with \x1b
      Cyan : To make a new line (enter), write \n
      Purple : To make a new page (window), write \f
      Green : Before writing a single quote ', put a backslash beforehand \
    • Result :


    Points to be noted

    • This method open new possibility to access data. With more understanding, you could even organize your own database.
    • It's not just limited to data. You may also create your own function and directly access it.
    • Making an object are not really necessary, but it's RECOMMENDED to avoid polluting the namespace.
    • Since your plugin consist of constants, you may access them using different mean such as local variable, other plugin, etc. Using game variables is the proper way since they are a global variable and saved by the system itself.
    • Escape code are not global. It's only accessable through window message.

    What we learn?

    • Making plugin without any knowledge of coding is possible. You just prove it by following this tutorial. To be honest, it's also surprise me.
    • Game variables are flexible since it can store different type of data anytime.
    • \x1b is a code used to read any control characters in window message.

    For the last, let me know if there's something you don't understand or what would you like to suggest to improve this tutorial I made.

    Thank you ~


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

    本帖子中包含更多资源

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

    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.067660 second(s), 57 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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