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

[转载发布] DoubleX RMMZ State Triggers

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

    连续签到: 2 天

    [LV.7]常住居民III

    4593

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 前天 12:22 | 显示全部楼层 |阅读模式
    Purpose
    Lets you run some codes set by your notetags on some important state timings

    Introduction
                    Code:       
    1. *    1. This plugin lets you use notetags to set what happens when a state's
    2. *       added/removed/expired/turn's updated/turn's reset on the battler
    3. *       involved
    4. *    2. You're expected to write JavaScript codes directly, as there are so
    5. *       much possibilities that most of them are just impossible to be
    6. *       covered by this plugin itself, so this plugin just lets you write
    7. *       JavaScript codes that are executed on some important timings
    复制代码


    Video

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

    Games using this plugin
    None so far

    Spoiler: Parameters
                    Code:       
    1. * @param addNotetagDataTypePriorities
    2. * @type select[]
    3. * @option Data of the actor
    4. * @value actor
    5. * @option Data of the current class
    6. * @value class
    7. * @option Data of learnt skills/action list(Shouldn't be used with Data of usable skills)
    8. * @value skills
    9. * @option Data of usable skills(Shouldn't be used with Data of learnt skills)
    10. * @value usableSkills
    11. * @option Data of possessed items(Shouldn't be used with Data of usable items)
    12. * @value items
    13. * @option Data of usable items(Shouldn't be used with Data of possessed items)
    14. * @value usableItems
    15. * @option Data of the latest skill/item being used(Can double-count with skills/items/usableSkills/usableItems)
    16. * @value latestSkillItem
    17. * @option Data of equipped weapons
    18. * @value weapons
    19. * @option Data of equipped armors
    20. * @value armors
    21. * @option Data of the enemy
    22. * @value enemy
    23. * @option Data of effective states
    24. * @value states
    25. * @option Data of the state to have triggers run
    26. * @value thisState
    27. * @desc Sets data type priorities of the add notetags
    28. * You can use script calls/plugin commands to change this
    29. * @default ["thisState"]
    30. *
    31. * @param removeNotetagDataTypePriorities
    32. * @type select[]
    33. * @option Data of the actor
    34. * @value actor
    35. * @option Data of the current class
    36. * @value class
    37. * @option Data of learnt skills/action list(Shouldn't be used with Data of usable skills)
    38. * @value skills
    39. * @option Data of usable skills(Shouldn't be used with Data of learnt skills)
    40. * @value usableSkills
    41. * @option Data of possessed items(Shouldn't be used with Data of usable items)
    42. * @value items
    43. * @option Data of usable items(Shouldn't be used with Data of possessed items)
    44. * @value usableItems
    45. * @option Data of the latest skill/item being used(Can double-count with skills/items/usableSkills/usableItems)
    46. * @value latestSkillItem
    47. * @option Data of equipped weapons
    48. * @value weapons
    49. * @option Data of equipped armors
    50. * @value armors
    51. * @option Data of the enemy
    52. * @value enemy
    53. * @option Data of effective states
    54. * @value states
    55. * @option Data of the state to have triggers run
    56. * @value thisState
    57. * @desc Sets data type priorities of the remove notetags
    58. * You can use script calls/plugin commands to change this
    59. * @default ["thisState"]
    60. *
    61. * @param resetNotetagDataTypePriorities
    62. * @type select[]
    63. * @option Data of the actor
    64. * @value actor
    65. * @option Data of the current class
    66. * @value class
    67. * @option Data of learnt skills/action list(Shouldn't be used with Data of usable skills)
    68. * @value skills
    69. * @option Data of usable skills(Shouldn't be used with Data of learnt skills)
    70. * @value usableSkills
    71. * @option Data of possessed items(Shouldn't be used with Data of usable items)
    72. * @value items
    73. * @option Data of usable items(Shouldn't be used with Data of possessed items)
    74. * @value usableItems
    75. * @option Data of the latest skill/item being used(Can double-count with skills/items/usableSkills/usableItems)
    76. * @value latestSkillItem
    77. * @option Data of equipped weapons
    78. * @value weapons
    79. * @option Data of equipped armors
    80. * @value armors
    81. * @option Data of the enemy
    82. * @value enemy
    83. * @option Data of effective states
    84. * @value states
    85. * @option Data of the state to have triggers run
    86. * @value thisState
    87. * @desc Sets data type priorities of the reset notetags
    88. * You can use script calls/plugin commands to change this
    89. * @default ["thisState"]
    90. *
    91. * @param expireNotetagDataTypePriorities
    92. * @type select[]
    93. * @option Data of the actor
    94. * @value actor
    95. * @option Data of the current class
    96. * @value class
    97. * @option Data of learnt skills/action list(Shouldn't be used with Data of usable skills)
    98. * @value skills
    99. * @option Data of usable skills(Shouldn't be used with Data of learnt skills)
    100. * @value usableSkills
    101. * @option Data of possessed items(Shouldn't be used with Data of usable items)
    102. * @value items
    103. * @option Data of usable items(Shouldn't be used with Data of possessed items)
    104. * @value usableItems
    105. * @option Data of the latest skill/item being used(Can double-count with skills/items/usableSkills/usableItems)
    106. * @value latestSkillItem
    107. * @option Data of equipped weapons
    108. * @value weapons
    109. * @option Data of equipped armors
    110. * @value armors
    111. * @option Data of the enemy
    112. * @value enemy
    113. * @option Data of effective states
    114. * @value states
    115. * @option Data of the state to have triggers run
    116. * @value thisState
    117. * @desc Sets data type priorities of the expire notetags
    118. * You can use script calls/plugin commands to change this
    119. * @default ["thisState"]
    120. *
    121. * @param turnNotetagDataTypePriorities
    122. * @type select[]
    123. * @option Data of the actor
    124. * @value actor
    125. * @option Data of the current class
    126. * @value class
    127. * @option Data of learnt skills/action list(Shouldn't be used with Data of usable skills)
    128. * @value skills
    129. * @option Data of usable skills(Shouldn't be used with Data of learnt skills)
    130. * @value usableSkills
    131. * @option Data of possessed items(Shouldn't be used with Data of usable items)
    132. * @value items
    133. * @option Data of usable items(Shouldn't be used with Data of possessed items)
    134. * @value usableItems
    135. * @option Data of the latest skill/item being used(Can double-count with skills/items/usableSkills/usableItems)
    136. * @value latestSkillItem
    137. * @option Data of equipped weapons
    138. * @value weapons
    139. * @option Data of equipped armors
    140. * @value armors
    141. * @option Data of the enemy
    142. * @value enemy
    143. * @option Data of effective states
    144. * @value states
    145. * @option Data of the state to have triggers run
    146. * @value thisState
    147. * @desc Sets data type priorities of the turn notetags
    148. * You can use script calls/plugin commands to change this
    149. * @default ["thisState"]
    复制代码


    Spoiler: Notetags
                    Code:       
    1. *    ## Notetag Info
    2. *       1. Among all the same notetag types in the same data, all can be
    3. *          effective
    4. *       2. Each line can only have at most 1 notetag
    5. *       3. The following is the structure of all notetags in this plugin:
    6. *          - <doublex rmmz state triggers>
    7. *          - <state triggers>
    8. *          Where contents are in the form of type suffixes: entries
    9. *          Either of the above can be used, but the 1st one reduce the chance
    10. *          of causing other plugins to treat the notetags of this plugin as
    11. *          theirs, while the 2nd one is more user-friendly
    12. *          - type is one of the following:
    13. *            1. add
    14. *            2. remove
    15. *            3. reset
    16. *            4. expire
    17. *            5. turn
    18. *          - suffixes is the list of suffixes in the form of:
    19. *            suffix1 suffix2 suffix3 ... suffixn
    20. *            Where each suffix is either of the following:
    21. *            val(The notetag value will be used as-is)
    22. *            switch(The value of the game switch with id as the notetag value
    23. *                   will be used)
    24. *            event(The common event with id as the notetag value will be
    25. *                  reserved)
    26. *            (Advanced)script(The value of the game variable with id as the
    27. *                            notetag value will be used as the contents of
    28. *                            the functions to be called upon using the
    29. *                            notetag)
    30. *          - The this pointer of the script suffix is the action involved
    31. *            (Game_Battler.prototype)
    32. *          - entries is the list of entries in the form of:
    33. *            entry1, entry2, entry3, ..., entryn
    34. *            Where entryi must conform with the suffixi specifications
    35. *----------------------------------------------------------------------------
    36. *    # Actor/Class/Learnt Skills/Usable Skills/Posessed Items/Usable Items/
    37. *      Inputted Skill Or Item/Weapon/Armor/Enemy/States/This State Notetags
    38. *      1. add condSuffix eventSuffix: condEntry, eventEntry
    39. *         - Triggers what specified in eventEntry when the state's just added
    40. *           to the battler involved(not when the state already exists before)
    41. *           if condEntry returns a truthy result
    42. *         - condSuffix can be val, switch or script
    43. *         - eventEntry can be event or script
    44. *         - The result of condEntry can be anything as only whether it's
    45. *           truthy matters
    46. *         - If the result of condEntry is falsy, this notetag will be
    47. *           discarded upon such use cases
    48. *         - The result of eventEntry can be anything as it's supposed to run
    49. *           commands instead of returning results
    50. *         - E.g.:
    51. *           <state triggers add switch event: 1, 2> will reserve the common
    52. *           event with id 2 when the state's just added to the battler
    53. *           involved(not when it already exists before) if the game switch
    54. *           with id 1 is on
    55. *      2. remove condSuffix eventSuffix: condEntry, eventEntry
    56. *         - Triggers what specified in eventEntry when the state's just
    57. *           removed from the battler involved(not when the state turn just
    58. *           expired causing the removal) if condEntry returns a truthy result
    59. *         - condSuffix can be val, switch or script
    60. *         - eventEntry can be event or script
    61. *         - The result of condEntry can be anything as only whether it's
    62. *           truthy matters
    63. *         - If the result of condEntry is falsy, this notetag will be
    64. *           discarded upon such use cases
    65. *         - The result of eventEntry can be anything as it's supposed to run
    66. *           commands instead of returning results
    67. *         - E.g.:
    68. *           <state triggers remove val script: true, 3> will always run the
    69. *           JavaScript codes stored as a string in variable with id 3 when
    70. *           the state's just removed from the battler involved(not when the
    71. *           state turn just expired causing the removal)
    72. *      3. reset condSuffix eventSuffix: condEntry, eventEntry
    73. *         - Triggers what specified in eventEntry when the state's turn's
    74. *           just reset due to trying to add that state to the battler
    75. *           involved if condEntry returns a truthy result
    76. *         - condSuffix can be val, switch or script
    77. *         - eventEntry can be event or script
    78. *         - The result of condEntry can be anything as only whether it's
    79. *           truthy matters
    80. *         - If the result of condEntry is falsy, this notetag will be
    81. *           discarded upon such use cases
    82. *         - The result of eventEntry can be anything as it's supposed to run
    83. *           commands instead of returning results
    84. *         - E.g.:
    85. *           <state triggers reset switch event: 1, 2> will reserve the common
    86. *           event with id 2 when the state's turn's just reset due to trying
    87. *           to add that state to the battler involved if the game switch with
    88. *           id 1 is on
    89. *      4. expire condSuffix eventSuffix: condEntry, eventEntry
    90. *         - Triggers what specified in eventEntry when the state's turn's
    91. *           just expired causing the state to be removed from the battler
    92. *           involved if condEntry returns a truthy result
    93. *         - condSuffix can be val, switch or script
    94. *         - eventEntry can be event or script
    95. *         - The result of condEntry can be anything as only whether it's
    96. *           truthy matters
    97. *         - If the result of condEntry is falsy, this notetag will be
    98. *           discarded upon such use cases
    99. *         - The result of eventEntry can be anything as it's supposed to run
    100. *           commands instead of returning results
    101. *         - E.g.:
    102. *           <state triggers expire val script: true, 3> will always run the
    103. *           JavaScript codes stored as a string in variable with id 3 when
    104. *           the state's turn's just expired causing the state to be removed
    105. *           from the battler involved
    106. *      5. turn condSuffix eventSuffix: condEntry, eventEntry
    107. *         - Triggers what specified in eventEntry when the state's turn's
    108. *           just updated without being expired for the battler involved if
    109. *           condEntry returns a truthy result
    110. *         - condSuffix can be val, switch or script
    111. *         - eventEntry can be event or script
    112. *         - The result of condEntry can be anything as only whether it's
    113. *           truthy matters
    114. *         - If the result of condEntry is falsy, this notetag will be
    115. *           discarded upon such use cases
    116. *         - The result of eventEntry can be anything as it's supposed to run
    117. *           commands instead of returning results
    118. *         - E.g.:
    119. *           <state triggers turn val event: true, 2> will always reserve the
    120. *           common event with id 2 when the state's turn's just updated
    121. *           without being expired for the battler involved
    复制代码


    Spoiler: Script Calls
                    Code:       
    1. *    # Parameter manipulations
    2. *      1. $gameSystem.setStateTriggersParam(param, val)
    3. *         - Sets the fully parsed value of the parameter param as val
    4. *         - param must be the name of a valid parameter of this plugin
    5. *         - val must be a valid new fully parsed value of the parameter param
    6. *         - Such parameter value changes will be saved
    7. *         - E.g.:
    8. *           $gameSystem.setStateTriggersParam("addNotetagDataTypePriorities", [
    9. *               "thisState"
    10. *           ]) sets the fully parsed value of the parameter
    11. *           addNotetagDataTypePriorities as ["thisState"]
    12. *      2. $gameSystem.stateTriggersParam(param)
    13. *         - Returns the fully parsed value of the parameter param
    14. *         - param must be the name of a valid parameter of this plugin
    15. *         - E.g.:
    16. *           $gameSystem.setStateTriggersParam("removeNotetagDataTypePriorities")
    17. *           returns the fully parsed value of the parameter
    18. *           removeNotetagDataTypePriorities, which should be
    19. *           ["thisState"] if it uses its default parameter value
    复制代码


    Spoiler: Plugin Commands
                    Code:       
    1. *      1. setStateTriggersParam param val
    2. *         - Applies the script call
    3. *           $gameSystem.setStateTriggersParam(param, val)
    复制代码


    Spoiler: Prerequisites
    Plugins:
    1. DoubleX RMMZ Enhanced Codebase
    Abilities:
    1. Some RMMV plugin development proficiency
       (Basic knowledge on what RMMV plugin development does in general with several easy, simple and small plugins written without nontrivial bugs up to 1000 LoC scale but still being inexperienced)
    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 0400):
    2. *      1. You no longer have to edit the value of
    3. *         DoubleX_RMMZ.State_Triggers.PLUGIN_NAME when changing this plugin
    4. *         file name
    5. *      { codebase: "1.0.0", plugin: "v1.00a" }(2020 Aug 29 GMT 1300):
    6. *      1. 1st version of this plugin finished
    复制代码


    Download Link
    Demo Link


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

    使用道具 举报

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

    本版积分规则

    简体中文
    繁體中文
    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.095621 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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