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

[转载发布] Death Common Event

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

    连续签到: 2 天

    [LV.7]常住居民III

    5778

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 昨天 21:13 | 显示全部楼层 |阅读模式
    Hey there folks. Was just plugging away at MV, up-porting a project from scratch, and I decided my next task was going to be creating a "Common Event on Death" script since, as far as I was aware, none existed yet. A few minutes learning how data is handled, and that plugin is now complete.


            The plugin is simple: place this somewhere in your combat plugins batch, and in any Actors, Classes or Enemies that need a common event to call on death, add this Note tag:

                    Code:       
    1. <DeathCommonEvent:ID>
    2. ID = the common event ID you wish to call. For example:
    3.   <DeathCommonEvent:3>
    4. Common Event #3 will run when this character dies.
    复制代码


            All it does is make an aliased call to Game_BattlerBase.die that checks if the Battler is an Actor or Enemy. If it is, it checks for the tag in both the Actor or Class, and if it finds one then it runs the common event referenced in the tag. Then it calls the original .die function. Note that because of this, any condition you set to the event will not be checked, same as if you were to use the "Common Event" event action.


            If you are utilizing All Ally Dead or All Enemy Dead plugin parameters, you do not need to repeat that event ID in a character's note box. Having a one-member party with the same event as <DeathCommonEvent:ID> will not function -- if you are not using Common Event Queue, only the last common event initialized will be run.


    If you are using Hime's Common Event Queue: Place this plugin below Common Event Queue. If you set the 'DCE Fallthrough' parameter to true, if a Class and Actor both have a Death Common Event, then both will run. The same also applies for Any Ally, Any Enemy, All Allies and All Enemy plugin parameters.


            If you are not using Hime's Common Event Queue, the furthest Common Event down in the following list will be run:


            For Player Characters: [Actor DCE] --> [Class DCE] --> [Any Ally DCE] --> [All Allies DCE (if all allies dead)]


            For Enemies: [Enemy DCE] --> [Any Enemy DCE] --> [All Enemies DCE (if all enemies dead)]


    Important Note: If you use All Ally Dead DCE, you will need to call Game Over yourself. This is because the Game Over screen would still trigger, even after a revive. I am sorry for the inconvenience. This also leads me to believe that enemies being somehow revived by All Enemy DCE probably won't work. I haven't had time to test this, however.


            You can get the latest version of my plugin from my GitHub repository here: https://github.com/chronosv2/Cv2MVPlugins/blob/master/Cv2_DeathCommonEvent.js


            Latest Version: 1.2.0 (5:17AM 10/27/2016)


            Plugin is free for commercial and non-commercial use. I wrote it for convenience, and the plugin is generic so feel free to use it as you see fit.


            Anyway, I hope you find this useful. Have a great day and happy RPG Making!


            ---


    Changelog:


    v1.0.0 - Initial version. Death Common Event worked for Actors only.


    v1.1.0 - You can now set a Death Common Event to Actors, Enemies or Classes.


    v1.1.1 - Added compatibility with Hime's Common Event Queue.


    v1.1.2 - No idea why I didn't revert the version number, but I tried to use a filename-less plugin parameter parse and it failed (I clearly did something wrong) so I reverted the code to the old way. I will be revisiting the filename-less parameters system at a later time -- right now rapid development and deployment is a little more important. Sorry for the possible inconvenience.


    v1.2.0 - Added 4 new Parameters:


    • All Ally Dead DCE: The Event ID to be run when All Allies are dead. This actually runs before Game Over, so it could be used to check for a condition to revive a party member, for example.
    • All Enemy Dead DCE: The Event ID to be run when All Enemies are dead. This actually runs before Battle Victory. I'm not exactly sure what this could be used for but it could be useful I'm sure.
    • Any Ally Dead DCE: The Event ID to be run when any Ally dies. This will only be run if the actor does not have an Actor or Class DCE. Next version will add the ability for more DCE fallthrough so that "Any" DCE will be run in sequence if Hime's Common Event Queue is loaded and DCE Fallthrough is set to true.
    • Any Enemy Dead DCE: The Event ID to be run when any Enemy dies. See above for information about fallthrough.

    Caveats: While the new plugin version should open up options for the entire party being KO'ed (or entire enemy group), if you try to use it for a Dragon Quest-like Game Over you will run into problems at worst (it simply won't work if you try and do the transfer on the Battle Screen), and a glitchy looking system (the Status window reappears for a few frames) at best. If you would like defeat to still technically occur while having something secondary still happen, I suggest Tsukihime's Gameover Events plugin.


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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-26 03:53 , Processed in 0.138607 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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