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

[转载发布] Anyone's Message_Face_Switcher v1.2

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

    连续签到: 2 天

    [LV.7]常住居民III

    7959

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 3 天前 | 显示全部楼层 |阅读模式
    Anyone's Message_Face_Switcher v1.2
    by Anyone

    Introduction:
    This is a small plugin made for my current project that allows the game to switch out the message face for the face of an actor designated in the message face's file name.

    Features:

    • Easy switching of faces to actor faces without using escape codes in the message text
    • Compatible with plugins that hard-edit the command101 (such as Yanfly's Message Core)
    • The exchange happens early in the message generation, meaning that all text escape codes within the actual message text will act as if that face had been the face assigned in the editor from the start
    • With normal faces, this saves you the time of using an escape like \af[x] to call the actor's face. With face busts plugins, especially the more complex ones, that load the message face from the message face name (such as Irina's VisualNovelBusts), this is essential to load a different bust as face in a seemless way without glitches and other bugs. (For example if your character has a different bust based on the equipment you're wearing)
    • New: (v1.2) Redirection to other Files possible through prefix and suffix
    How To Use:
    1. Load the plugin preferably close to the bottom of your load order and activate it.
    2. Create a *.png file that you wish to use as placeholder of the actor's face and ensure that it contains "_Actor" followed by the number of the ActorId of the actor whose face you wish to load.
    Example: Harold_Actor1.png
    3. Use the "Harold_Actor1.png" as the face when creating the "Show Text" function in your dialogue event. Regardless of whether Harold_Actor1.png is an empty png file, or contains some other face, this face will instead be switched to whatever face has currently been assigned to Actor1.

    Alternatively, you can also use the phrase "_Partymember" in the *.png files' name to instead reference the face of the current party member in the slot.

    Take care: the Actor ID's count from 1,2,3,4...
    While the Partymember starts with 0 for the party leader: 0,1,2,3
    This means that Actor 2 is "_Actor2" but Partymember 2 is "_Partymember1".

    FAQ:

    Q: The face isn't getting loaded.
    A: Make sure you include the "_" sign in front of Actor. This is done to ensure that it won't pick up stuff like Factor12 as valid terms.
    HaroldActor1.png is incorrect
    Harold_Actor1.png is correct

    Q: The wrong Partymember face is assigned.
    A: Keep in mind that partymembers are counted from 0. If you want to reference the Partyleader in Slot 1, use...
    _Partymember0.png
    The Partymembers 2,3 etc. need -1 deducated from their number.

    Partymember 3:
    _Partymember2.png

    Terms of Use:


    • 1. This plugin can be used for free in free and commercial games alike.
    • 2. Credit must be given to "Anyone".
    • 3. The code may be edited & altered to your liking.
    • 4. Redistribution of the original code as well as of edited versions is allowed, so long as proper credit is given.

    Demo:
    New Demo Version!
    Equip items and see the message window face use the correct face.
    (This is made possible with the Way_Core and Way_OnEquip plugins)
    https://workupload.com/file/3NJTLPD4


    Spoiler: Anyone's Message Face Switcher v1.0
                    Code:       
    1. /*:
    2. *
    3. * @plugindesc Version 1.2. This plugin switches the Message Window Face for the Actor's current Face.
    4. *
    5. * @author Anyone
    6. *
    7. * @param Redirect from ActorFace to Image
    8. * @type boolean
    9. * @on YES
    10. * @off NO
    11. * @desc Instead of direction to an Actor, it directs to another face based on the prefix
    12. * designated in the Reference Phrase Prefix.
    13. * @default false
    14. *
    15. * @param Reference Phrase Prefix
    16. * @desc Instead of directing to an Actor, it directs to prefix + ActorFaceFile.
    17. * @default prefix_
    18. * @help
    19. *
    20. * @param Reference Phrase Suffix
    21. * @desc Instead of directing to an Actor, it directs to ActorFaceFile + suffix.
    22. * @default _suffix
    23. * @help
    24. *
    25. * //==========================================================================//
    26. * //                     Anyone's Message Face Switcher                         //
    27. * //========================================================================//
    28. *                            //~~~~~~~~~~~~~~//
    29. *                           //   by Anyone  //
    30. *                          //~~~~~~~~~~~~~~//
    31. *
    32. *
    33. *
    34. * This script allows you to use a placeholder face for an Actor that will switch
    35. * out with the Actor's current face.
    36. * Simply ensure that the term "_Actor" lower/uppercase insensitive is in the
    37. * placeholder face file's name, followed by a number.
    38. * So if you use an empty face as a png file called:
    39. * "Harold's_Placeholder_Face_Actor1.png"
    40. * the "_Actor1" will be detected and the face of Actor 1 will be used instead of
    41. * the placeholder face.
    42. *
    43. * Alternatively you can also use "_Partymember" followed by a number to use a
    44. * placeholder for a partymember. Keep in mind that Slot 1, the leader, is
    45. * Partymember 0.
    46. *
    47. * Partymember1 (Leader): _Partymember0.png
    48. * Partymember2 (Leader): _Partymember1.png
    49. * Partymember3 (Leader): _Partymember2.png
    50. * Partymember4 (Leader): _Partymember3.png
    51. *
    52. * Additionally, instead of directing to the Actor, you can also redirect from
    53. * the Actor to a different file based on suffixes and prefixes.
    54. * To do so, activate "Redirect from ActorFace to Image" in the plugin parameters
    55. * by setting it to true. Then configure the prefix and the suffix for the image
    56. * you intend to redirect to.
    57. *
    58. * E.g. Prefix: "Bust_" and Suffix: "_[Exp5x2]"
    59. * The Face assigned to the Actor 1 is "David.png" in img\faces
    60. * By using any face image as message face that contains "Actor1" inside the name
    61. * the message window face will switch to David.png because this is Actor1's face.
    62. * From there, with the Redirection active, it will actually switch over to
    63. * Bust_David_[Exp5x2].png and use this as the message window face.
    64. *
    65. * //==========================================================================//
    66. * //                          When is that useful?                           //
    67. * //========================================================================//
    68. *
    69. * If your character's face changes throughout the game, and you want to have the
    70. * current one displayed without having * to resort to in-message escapes such as
    71. * yanfly's \af[x] to adjust it.
    72. *
    73. * While that may not seem big...it's huge for plugins that use face busts based
    74. * on the message face which use their own escapes in the message text.
    75. *
    76. * Plugins such as Irina's VisualNovelBusts plugin are almost entirely
    77. * incompatible with yanfly's \af[] escapes and at best create glitchy, laggy
    78. * busts and at worst, either bug out or don't function at all.
    79. *
    80. * Since this plugin ensures the switch happens before the message text is even
    81. * read,
    82. * the switch is entirely seemless as if that face had been the one assigned to
    83. * the message from the very beginning.
    84. *
    85. * //==========================================================================//
    86. * //                             TERMS OF USE                                //
    87. * //========================================================================//
    88. *
    89. * 1. This plugin can be used for free in free and commercial games alike.
    90. * 2. Credit must be given to "Anyone".
    91. * 3. The code may be edited & altered to your liking.
    92. * 4. Redistribution of the original code as well as of edited versions is allowed,
    93. * so long as proper credit is given.
    94. *
    95. * //==========================================================================//
    96. * //                              CHANGELOG                                  //
    97. * //========================================================================//
    98. *
    99. * Version 1.2:
    100. * - Added Suffix Sheet redirection (25th of December 2019)
    101. *
    102. * Version 1.1:
    103. * - Added Prefix Sheet redirection (19th of November 2019)
    104. *
    105. * Version 1.0:
    106. * - Released (12th of November 2019)
    107. *
    108. */
    109. var Imported = Imported || {};
    110. Imported.ANY_Message_Face_Switcher = true;
    111. var ANY = ANY || {};
    112. ANY.MessageFaceSwitcher = ANY.MessageFaceSwitcher || {};
    113. (function() {
    114. var params = PluginManager.parameters('ANY_Message_Face_Switcher');
    115. ANY.MessageFaceSwitcher.UseSheet = String(params['Redirect from ActorFace to Image']);
    116. ANY.MessageFaceSwitcher.UseSheet = eval(ANY.MessageFaceSwitcher.UseSheet);
    117. ANY.MessageFaceSwitcher.DirectPrefix = String(params['Reference Phrase Prefix'] || "");
    118. ANY.MessageFaceSwitcher.DirectSuffix = String(params['Reference Phrase Suffix'] || "");
    119. var _IS_Game_Message_Show_Text = Game_Interpreter.prototype.command101;
    120. Game_Interpreter.prototype.command101 = function() {
    121.         _IS_Game_Message_Show_Text.call(this);
    122.         var _IS_ActorId = $gameMessage.faceName().match(/_Actor(\d+)/i);
    123.         if (_IS_ActorId) {
    124.                 var _Actor_faceName_To_Use = $gameActors.actor(_IS_ActorId[1]).faceName();
    125.                 var _Actor_faceIndex_to_Use = $gameActors.actor(_IS_ActorId[1]).faceIndex();
    126.                 if (ANY.MessageFaceSwitcher.UseSheet == true) {
    127.                         _Actor_faceName_To_Use = ANY.MessageFaceSwitcher.DirectPrefix + _Actor_faceName_To_Use + ANY.MessageFaceSwitcher.DirectSuffix;
    128.                         $gameMessage.setFaceImage(_Actor_faceName_To_Use, _Actor_faceIndex_to_Use);
    129.                 } else {
    130.                 $gameMessage.setFaceImage(_Actor_faceName_To_Use, _Actor_faceIndex_to_Use)};
    131.         } else {
    132.         var _IS_PartyId = $gameMessage.faceName().match(/_Partymember(\d+)/i);
    133.         if (_IS_PartyId) {
    134.                 var _Party_Is_Actor = $gameParty.members()[_IS_PartyId[1]].actorId()
    135.                 var _Party_faceName_To_Use = $gameActors.actor(_Party_Is_Actor).faceName();
    136.                 var _Party_faceIndex_to_Use = $gameActors.actor(_Party_Is_Actor).faceIndex();
    137.                 if (ANY.MessageFaceSwitcher.UseSheet == true) {
    138.                         _Party_faceName_To_Use = ANY.MessageFaceSwitcher.DirectPrefix + _Party_faceName_To_Use + ANY.MessageFaceSwitcher.DirectSuffix;
    139.                         $gameMessage.setFaceImage(_Party_faceName_To_Use, _Party_faceIndex_to_Use);
    140.                 } else {
    141.                 $gameMessage.setFaceImage(_Party_faceName_To_Use, _Party_faceIndex_to_Use)};
    142.                 }
    143.         }
    144. };
    145. })();
    复制代码


    Also attached as *.rar archive.

    Have fun.

    CHANGELOG:
    -v1.2
    Added new Demo version, added a Redirect Functionality


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

    本帖子中包含更多资源

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

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-1 01:30 , Processed in 0.140451 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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