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

[转载发布] DoubleX_RMMZ_Plugin_Query

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

    连续签到: 2 天

    [LV.7]常住居民III

    4593

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 3 天前 | 显示全部楼层 |阅读模式
    Purpose
    Lets you use plugin queries in conditional branch and control variables

    Introduction
                    Code:       
    1. *      1. The RMMZ plugin commands are supposed to make side effects but not
    2. *         return end results
    3. *      2. With this plugin, other plugins can declare plugin queries that
    4. *         behave like RMMV plugin commands but return end results instead of
    5. *         making side effects
    6. *      3. Plugin queries can replace skill/item damage formulae
    7. *      4. Plugin queries can also replace script calls in conditional branch
    8. *         and control variables event commands
    复制代码


    Video

    https://www.youtube.com/embed/_6L8IJDiTcI

    Games using this plugin
    None so far

    Spoiler: Parameters
                    Code:       
    1. * @param newDamageFormulaPluginQueries
    2. * @type struct<NewPluginQuery>[]
    3. * @desc Sets the list of new damage formula plugin queries
    4. * This list shouldn't include those already added by other plugins
    5. * @default []
    6. *
    7. * @param newEventCmdPluginQueries
    8. * @type struct<NewPluginQuery>[]
    9. * @desc Sets the list of new event command plugin queries
    10. * This list shouldn't include those already added by other plugins
    11. * @default []
    复制代码


    Spoiler: Plugin Query Info
                    Code:       
    1. *    1. General form
    2. *       queryName argName1 argName2 argName3 argNameI argNameN
    3. *       E.g.:
    4. *       - If the plugin query has its query name as abcdefg and arguments
    5. *         as h, i, j and k, then the plugin query is abcdefg h i j k
    6. *    2. (Plugin Developers Only)Registration
    7. *       PluginManager.damageFormulaPluginQueries.set(name, func);
    8. *       - Registers a plugin query with the name being name and function
    9. *         returning the result being func
    10. *       - The first 5 arguments of the function must be the following:
    11. *         i. item - The skill/item having the damage formula
    12. *         ii. a - The subject executing the skill/item
    13. *         iii. b - The target having the damage formula applied to
    14. *         iv. v - The raw data list of the game variables
    15. *         v. sign - 1(damage)/-1(recovery)
    16. *       - The registered plugin query can be used in skill/item damage
    17. *         formulae
    18. *       E.g.:
    19. *       - PluginManager.damageFormulaPluginQueries.set("matDmg", (item, a, b, v, sign, baseDmg) => {
    20. *             return +baseDmg + a.mat * 2 - b.mdf * 2;
    21. *         });
    22. *         Will define the plugin query atkDmg in the skill/item damage
    23. *         formulae as baseDmg + a.mat * 2 - b.mdf * 2
    24. *         Where baseDmg must be a Number
    25. *       PluginManager.eventCmdPluginQueries.set(name, func);
    26. *       - Registers a plugin query with the name being name and function
    27. *         returning the result being func
    28. *       - The registered plugin query can be used in conditional branch and
    29. *         control variables event commands
    30. *       E.g.:
    31. *       - PluginManager.eventCmdPluginQueries.set("isActorAnyStateAffected", (actorId, paramIds) => {
    32. *             return $gameActors.actor(+actorId).isAnyStateAffected(paramIds.split("_").map(Number));
    33. *         });
    34. *         Will define the plugin query
    35. *         isActorAnyStateAffected actorId paramIds
    36. *         in the conditional branch/control variables event commands as
    37. *         $gameActors.actor(actorId).isAnyStateAffected(paramIds);
    38. *         If paramIds is written in the form of
    39. *         paramId1_paramId2_paramId3_paramIdI_paramIdN
    复制代码


    Spoiler: Author Notes
                    Code:       
    1. *      1. The plugin command name collision issues in RMMV applies to
    2. *         plugin queries registed to this RMMZ plugin as well, and in this
    3. *         case, the last registered plugin query having the same name will be
    4. *         used
    5. *      2. DON'T MAKE SIDE EFFECTS IN THE SKILL/ITEM DAMAGE FORMULA PLUGIN
    6. *         QUERIES UNLESS YOU REALLY KNOW WHAT YOU'RE TRULY DOING
    复制代码


    Spoiler: Prerequisites
    Plugins:
    1. DoubleX RMMZ Enhanced Codebase
    Abilities(Plugin Users):
    1. Nothing special
    Abilities(Plugin Developers):
    1. Little RMMZ plugin development proficiency to fully utilize this
       (Elementary Javascript exposures being able to write beginner codes up to 300LoC scale)
    Spoiler: Terms Of Use
                    Code:       
    1. *      1. Commercial use's always allowed and crediting me's always optional.
    2. *      2. You shall keep this plugin's Plugin Info part's contents intact.
    3. *      3. You shalln't claim that this plugin's written by anyone other than
    4. *         DoubleX or my aliases. I always reserve the right to deny you from
    5. *         using any of my plugins anymore if you've violated this.
    6. *      4. If you repost this plugin directly(rather than just linking back),
    7. *         you shall inform me of these direct repostings. I always reserve
    8. *         the right to request you to edit those direct repostings.
    9. *      5. CC BY 4.0, except those conflicting with any of the above, applies
    10. *         to this plugin, unless you've my permissions not needing follow so.
    11. *      6. I always reserve the right to deny you from using this plugin
    12. *         anymore if you've violated any of the above.
    复制代码


    Spoiler: Contributors
                    Code:       
    1. *      Authors:
    2. *      1. DoubleX
    3. *      Plugin Development Collaborators:
    4. *      - None So Far
    5. *      Bug Reporters:
    6. *      - None So Far
    7. *      Compatibility Issue Raisers:
    8. *      - None So Far
    9. *      Feature Requesters:
    10. *      - None So Far
    复制代码


    Spoiler: Changelog
                    Code:       
    1. *      { codebase: "1.1.0", plugin: "v1.00b" }(2020 Dec 2 GMT 0700):
    2. *      1. You no longer have to edit the value of
    3. *         DoubleX_RMMZ.Plugin_Query.PLUGIN_NAME when changing this plugin
    4. *         file name
    5. *      { codebase: "1.0.2", plugin: "v1.00a" }(2020 Oct 6 GMT 1600):
    6. *      1. 1st version of this plugin finished
    复制代码


    Download Link
    Demo Link


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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-16 14:17 , Processed in 0.110433 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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