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

[转载发布] [MZ/MV] KC_Mirrors - Add reflections to your map characters

[复制链接]
累计送礼:
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

    灌水之王

    发表于 前天 12:50 | 显示全部楼层 |阅读模式
    KC_Mirrors 1.5.1
    by Kelly Chavez


    Introduction
    This is a plugin that adds reflections to your actors, events, and vehicles. This is done by placing tiles with transparency on your map wherever you want to show reflections. Floor reflections are drawn at the characters' feet and wall reflections are drawn on areas of the map with certain region ID(s).

    This plugin was inspired by the reflection portion of Galv's Character Effects script for VX Ace. So, credits are due there for the original idea.

    Features
    This is a plugin that allows the developer to add reflections to actors and  events. This is done by drawing sprites below the map but above the parallax layer. So, to get full usage out of this plugin, you must be using tilesets that actually show the parallax layer (i.e. tilesets with transparency). The demo uses a tileset with reduced opacity on the water tiles to achieve the water reflection effect, for example.

    If you own MZ, you can also find RTP tileset graphics where water has reduced opacity in the <RPG Maker MZ Folder>/dlc/BasicResources/tilesets folder.

    Character reflections can be controlled with note tags, script calls, and plugin commands! On a per-actor and a per-event basis, the developer can control whether wall reflections are enabled, whether floor reflections are enabled, and the character graphic actually used in the reflection.

    Screenshots
    Spoiler: Screenshots
    A room with the wall reflections in pseudo-perspective mode:




    A room with the wall reflections in event-like mode (available in version 1.1.0+):




    A room with a filter applied to the floor reflections (available in version 1.3.0+):




    An example of characters having their floor reflections offset by an arbitrary amount (available in version 1.3.0+):




    This plugin is even backwards compatible with RPG Maker MV (available in versions 1.4.0+)

    How to Use
    To use, download and place this plugin into your plugin manager and enable it. From there, follow the instructions in the help section of the plugin and the descriptions of each command.

    If you're using any of the following plugins, KC_Mirrors should be BELOW them in the plugin manager:
    Spoiler: Plugins KC_Mirrors Should be below

    • PluginCommonBase
    • GALV_DiagonalMovement
    • GALV_DiagonalMovementMZ
    • GALV_CharacterFrames
    • GALV_CharacterFramesMZ
    • GALV_EventSpawner
    • GALV_EventSpawnerMZ
    • QMovement
    • QSprite

    Plugin Commands / Script Calls
    Spoiler: MZ Plugin Commands

    • Change Event Reflection

      • Change the reflection parameters of a specified event. These changes are reset on map reload.

    • Match Event Reflection

      • Sets this event's reflection graphic to their normal top view graphic.

    • Change Actor Reflection

      • Change the reflection parameters of a specified actor. These changes are persistent and are included in the save file.

    • Match Actor Reflection

      • Sets this actor's reflection graphic to their normal top view graphic.

    • Change Vehicle Reflection

      • Change the reflection parameters of a specified vehicle. These changes are persistent and are included in the save file.

    • Match Vehicle Reflection

      • Sets this vehicle's reflection graphic to its normal top view graphic.

    • Set Wall Reflection Variable

      • Sets the wall reflection mode by changing the wall reflection mode variable defined in the plugin parameters. Does nothing if that parameter is 0.

    • Refresh Wall Reflections

      • Refreshes the wall reflection positions on the current map. Useful if tiles on the current map have their regions updated.

    • Override Map Settings

      • Overrides reflection settings for the current map. This can be used to quickly disable all reflections or change the perspective mode temporarily. All changes are lost upon leaving and re-entering the map.

    Spoiler: MV Plugin Commands
                    Code:       
    1. Note that all of these commands are case sensitive unless otherwise noted.
    2. If an argument is formatted as [choice1/choice2/choice3/etc], then you must
    3. choose only one of the options without brackets.
    4. Arguments that end in a ? are OPTIONAL
    5. You can use \v[x] and \s[y] as arguments to substitute in the values stored
    6. in game variable x and game switch y, respectively.
    7. setReflectImage char_type id character?
    8.   | Change the character reflection graphic.
    9.   * example: setReflectImage actor 1 People2
    10.   - char_type: [actor/event] Set whether the target is an actor or map event
    11.   - id: ID number of the actor or event
    12.     + If char_type is 'actor,' then 0 is the party leader, -1 is the first
    13.       follower, -2 is the second follower, and so on
    14.     + If char_type is 'event,' then 0 is 'this event'
    15.   - character?: Optional argument. This is the character graphic name
    16.   | Leave character blank to reset the reflection graphic name
    17. setReflectIndex char_type id index?
    18.   | Change the reflection's character ID. 0 is the top left in spritesheets
    19.     not prefixed with $.
    20.   * example: setReflectIndex event 5 1
    21.   - char_type: [actor/event] Set whether the target is an actor or map event
    22.   - id: ID number of the actor or event
    23.     + If char_type is 'actor,' then 0 is the party leader, -1 is the first
    24.       follower, -2 is the second follower, and so on
    25.     + If char_type is 'event,' then 0 is 'this event'
    26.   - index?: Optional argument. Sets the character index (0 is the first)
    27.   | Leave index blank to make it the same as the character.
    28. setReflectVisible char_type id reflect_type new_visibility
    29.   | Simple on/off set for reflection visibility.
    30.   * example: setReflectVisible actor -1 all false
    31.   - char_type: [actor/event] Set whether the target is an actor or map event
    32.   - id: ID number of the actor or event
    33.     + If char_type is 'actor,' then 0 is the party leader, -1 is the first
    34.       follower, -2 is the second follower, and so on
    35.     + If char_type is 'event,' then 0 is 'this event'
    36.   - reflect_type: [floor/wall/all] Determines whether the floor or wall
    37.                   reflection is being modified. 'all' modifies both.
    38.   - new_visibility: Set to true to make reflect_type of reflection visible
    39.                     and to false to make reflect_type of reflection
    40.                     invisible
    41. setReflectOpacity char_type id reflect_type opacity?
    42.   | Set reflection opacity.
    43.   * example: setReflectOpacity actor 4 127
    44.   - char_type: [actor/event] Set whether the target is an actor or map event
    45.   - id: ID number of the actor or event
    46.     + If char_type is 'actor,' then 0 is the party leader, -1 is the first
    47.       follower, -2 is the second follower, and so on
    48.     + If char_type is 'event,' then 0 is 'this event'
    49.   - reflect_type: [floor/wall/all] Determines whether the floor or wall
    50.                   reflection is being modified. 'all' modifies both.
    51.   - opacity?: Optional argument. Should be a number in range 0-255,
    52.               inclusive
    53.   | Leaving the opacity argument blank will reset the opacity.
    54. setReflectAngle char_type id reflect_type angle
    55.    | Set character reflection offset. This is added to the map angle.
    56.    * example: setReflectAngle actor 0 floor 90
    57.    - char_type: [actor/event/vehicle] Set what type of character the
    58.                 target is
    59.    - id: [(number)/boat/ship/airship] identifier of the character
    60.      + If char_type is 'actor,' then 0 is the party leader, -1 is the first
    61.        follower, -2 is the second follower, and so on
    62.      + If char_type is 'event,' then 0 is 'this event'
    63.      + If char_type is 'vehicle,' then numbers are an invalid agument
    64.    - reflect_type: [floor/wall/all] Determines whether the floor or wall
    65.                    reflection is being modified. 'all' modifies both.
    66.    - angle: An angle that the reflection will be offset by in degrees.
    67.             Positive values rotate the reflection sprite clockwise.
    68.             Negative values rotate the reflection counterclockwise.
    69. setReflectOffset char_type id reflect_type axis offset
    70.   | Set character reflection offset. This is added to the map offset.
    71.   * example: setReflectOffset event 10 floor y -8
    72.   - char_type: [actor/event] Set whether the target is an actor or map event
    73.   - id: ID number of the actor or event
    74.     + If char_type is 'actor,' then 0 is the party leader, -1 is the first
    75.       follower, -2 is the second follower, and so on
    76.     + If char_type is 'event,' then 0 is 'this event'
    77.   - reflect_type: [floor/wall/all] Determines whether the floor or wall
    78.                   reflection is being modified. 'all' modifies both.
    79.   - axis: [x/y/xy] Which axis to modify. xy affects x and y.
    80.   - offset: A number that the reflection will be offset by. Remember,
    81.             positive x moves to the right, and positive y moves down,
    82.             and the opposites are true
    83. resetReflect char_type id
    84.   | Reset a characters reflections to the current character graphic
    85.     and index.
    86.   * example: resetReflect actor 0
    87.   - char_type: [actor/event] Set whether the target is an actor or map event
    88.   - id: ID number of the actor or event
    89.     + If char_type is 'actor,' then 0 is the party leader, -1 is the first
    90.       follower, -2 is the second follower, and so on
    91.     + If char_type is 'event,' then 0 is 'this event'
    92. forceWallReflectMode mode
    93.   | Set the current map's wall reflection mode regardless of default setting
    94.     and map notes.
    95.   * example: forceWallReflectMode perspective
    96.   - mode: [perspective/event] Set the map's wall reflection type.
    97. refreshReflectMap
    98.   | Forces the wall reflection positions to be rebuilt. Mainly useful if
    99.     a plugin is being used that changes map regions at runtime.
    100.   * example: refreshReflectMap
    101. setMapReflect reflect_type new_visibility
    102.   | Enable or disable reflection types for the entire map.
    103.     Disabling reflections takes priority over individual character settings.
    104.     Enabling reflections does NOT take priority over individual settings.
    105.   * example: setMapReflect floor false
    106. setReflectMapAngle reflect_type angle
    107.   | Offset all reflections on this map by angle degrees.
    108.   * example: setReflectMapAngle all 120
    109.   - reflect_type: [floor/wall/all] Determines whether the floor or wall
    110.                   reflection is being modified. 'all' modifies both.
    111.   - angle: An angle that the reflection will be offset by in degrees.
    112.            Positive values rotate the reflection sprite clockwise.
    113.            Negative values rotate the reflection counterclockwise.
    复制代码

    Spoiler: Script calls
    The script calls for this plugin are as follows.

    Format your script commands as KCDev.Mirrors.<function name>

    Example: KCDev.Mirrors.setEventReflect(1, 'Actor1', 0, true, false)

    The functions are as follows:

    • setEventReflect(event_id, reflection_filename, reflection_index, floor_enabled, wall_enabled, floor_opacity, wall_opacity, floor_x_offset, floor_y_offset, wall_x_offset, wall_y_offset)

      • Same as Change Event Reflection command

    • resetEventReflectImage(event_id)

      • Same as Match Event Reflection

    • setActorReflect(actor_id, reflection_filename, reflection_index, floor_enabled, wall_enabled, floor_opacity, wall_opacity, floor_x_offset, floor_y_offset, wall_x_offset, wall_y_offset, floor_angle, wall_angle)

      • Same as Change Actor Reflection command

    • resetActorReflectImage(actor_id)

      • Same as Match Actor Reflection command

    • setVehicleReflect(vehicle_name, reflection_filename, reflection_index, floor_enabled, wall_enabled, floor_opacity, wall_opacity, floor_x_offset, floor_y_offset, wall_x_offset, wall_y_offset, floor_angle, wall_angle)

      • Same as Change Vehicle Reflection command

    • resetVehicleReflectImage(actor_id)

      • Same as Match Vehicle Reflection command

    • setWallReflectMode(mode)

      • Same as Set Wall Reflection Mode command

    • refreshReflectWallCache()

      • Same as Refresh Wall Reflections command

    Demo
    Grab one of the demo zip files from this GitHub release

    Download
    Grab KC_Mirrors.js from this GitHub release

    Old Versions & Demos
    GitHub Releases

    Changelog
    Spoiler: Changelog

    • 2025/04/24 - v1.5.1

      • Fix incompatibility with QSprite
      • Fix bug in MV parameter parsing for wall reflections

        • Affected commands: setReflectOpacity, setReflectVisible, setReflectAngle

      • Removed JsonEx parsing cleanup
      • General code cleanup and light optimization

    • 2024/11/24 - v1.5.0

      • Added support for vehicles
      • Added rotation property to reflections

    • 2024/09/18 - v1.4.3

      • Fixed crash that occurred when using this plugin and Galv's Character Frames in projects created with older versions of MV

    • 2024/08/18 - v1.4.2

      • Fixed incompatibility with plugins that create characters without metadata (e.g. QABS)
      • Fixed wall reflections not appearing if a character's x and y properties are not integers, which occurs with some pixel movement plugins
      • Note metadata is now parsed again (e.g. \v[1] resolves to whatever value is stored in game variable 1)

    • 2024/08/18 - v1.4.1

      • MV

        • Updated demo
        • Made compatible with Galv's Character Frames plugin
        • Made compatible with Galv's Event Spawner plugin

      • MZ

        • Added workaround for a performance issue that occurred when using this plugin and Galv's Character Frames and loading a map with a lot of events
        • Fixed incorrect argument handling when using plugin commands without PluginCommonBase

      • Both

        • Miscellaneous code cleanup
        • Fixed using "Load Game" on a save file without KC_Mirrors causing the game to crash


    • 2024/08/16 - v1.4.0

      • PluginCommonBase is still supported but is now OPTIONAL
      • Added support for RPG Maker MV
      • Minor bug fixes and code restructuring

    • 2024/04/25 - v1.3.7

      • Fix issue where events unspawned by Galv_EventSpawnerMZ do not have their reflections removed

    • 2024/03/09 - v1.3.6

      • Initialize Sprite_Reflection properly for compatibility with other plugins
      • Consolidated internal classes Sprite_Reflect and Sprite_Reflect_Wall into single class
      • Optimized y coordinate lookup for walls to perform faster and create less garbage

    • 2024/03/07 - v.1.3.5

      • Change how character frames are handled for reflections internally
      • Made this plugin compatible with Galv's Character Frames, Diagonal Movement, and Character Animation
      • Miscellaneous bug fixes and stability improvements

    • 2024/02/17 - v1.3.4

      • Updated plugin url to point to current Github repo

    • 2023/12/01 - v1.3.3

      • Fixed a bug that caused a crash when launching without FilterControllerMZ

    • 2022/12/20 - v1.3.2

      • Fixed bugs that caused incorrect scaling on the x axis to be applied to reflections of events using tileset sprites

    • 2022/10/26 - v1.3.1

      • Quick fix to CharReflections Filter Controller target

    • 2022/10/26 - v1.3.0

      • Added FilterControllerMZ targets

        • CharReflectionsFloor - Applies filter to all floor reflections
        • CharReflectionsWall - Applies filter to all wall reflections
        • CharReflections - Applies filter to all character reflections

      • Added new note tags to actors, characters, and maps:

        • <REFLECT_FLOOR_OFFSETS:[x],[y]>
        • <REFLECT_WALL_OFFSETS:[x],[y]>
        • See newly updated plugin help section for details

      • Added an option to fix Z-fighting under certain conditions on wall reflections in 'perspective' mode

        • You probably don't need this fix unless you're using a pixel movement plugin

      • Fixed a bug in the Change Event Reflect plugin command that caused the wrong event to be used as reference for unchanged parameters
      • Internal code refactor

        • All plugin parameters are exposed on the KCDev.Mirrors object


    • 2022/08/05 - v1.2.0

      • Reflections of each type can now be separately toggled on and off for the entire map through note tags and a new plugin command

        • New command: Override Map Settings
        • New map note tag: <REFLECT_TYPE:[ALL/FLOOR/WALL]>

      • The reflection mode the map uses can be changed via the map notes and the aforementioned new command

        • New map note tag: <REFLECT_MODE:[PERSPECTIVE/EVENT]>

      • The developer can now set the opacity of each reflection type through the updated plugin command and via new note tags

        • New event and actor tags: <REFLECT_FLOOR_OPACITY:[x]>, <REFLECT_WALL_OPACITY:[x]>

      • Characters that are made transparent via move route commands now also have their reflections disappear if those reflections are not using custom opacities
      • For specifics on new features, see the updated 'help' section of the plugin

    • 2022/07/19 - v1.1.4

      • Adjusted how reflections are handled internally for compatibility with KC_MoveRouteTF

    • 2022/07/16 - v1.1.3

      • Fixed issue where characters using a sprite from the tileset and with a priority other than 'Below Characters' would never have reflections

    • 2022/07/14 - v1.1.2

      • Fixed a typo that caused incorrect behavior when setting event reflection properties via plugin command and manually selecting 'Unchanged' from the dropdown box

    • 2022/07/14 - v1.1.1

      • Added a few safety checks to avoid a game crash when trying to access characters that do not exist (e.g. trying to change the reflection of the third follower when the player has two followers)

    • 2022/07/12 - v1.1.0

      • Fixed bug where characters standing out of the maximum wall reflection range would appear on the mirror with incorrect scaling
      • Added the 'event-like' wall reflection mode and renamed the mode featured in the previous version to 'pseudo-perspective' mode
      • Removed restriction that caused events using tile IDs to not appear in wall reflections

    • 2022/07/11 - v1.0.0

      • Initial release

    Terms and Credits
    I've released this plugin under the MIT license. So, you can include this plugin in any project as long as you include the license with your distribution. For most projects, this requirement is fulfilled as long as you keep the license text that is at the top of the plugin's js file intact.

    Also, though not strictly required, I would appreciate being credited as K. Chavez or Kelly Chavez in your games' credits.


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

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

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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