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

[转载发布] The_Sarah - [v1.0] Show Target Names

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

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 2026-8-2 17:02:39 | 显示全部楼层 |阅读模式
    Hey all!

    Here's my next release!



    Show Target Names
    by The_Sarah


    Introduction


    .
    This script provides more freedom for writing skill "use message"s for skills in the Database.
    It does this by giving you the ability to have single-target skills include the target's name, rather than just the user's name (which it is by default).
    .
    .
    ---------------------
    Patch Notes
    .
    None as of yet
    .

    ---------------------
    .
    .
    Features
    .

    Original script made by me (The_Sarah).
    Initially requested by Ticomanel
    .

       With this script, you will be able to make any chosen single-target skills show both the user's
    name AND the target's name when writing out their "use message"s in the Database.
    .
    This is accomplished through the use of the notetag "<callname>" in your chosen skills.
    And the replacement of where your target's name would go with the single word "targetname".
    .
    .
    .
    How to Use
    Place the script below materials and above main in the Script Editor.

    Then follow these steps:
    .​

    Step 1) Add the "<callname>" note tag (without the speech marks) to the notebox of any single-target skill you wish to consider applying this script's effects to.

    Step 2) Make sure the skill you added <callname> to is a single-target skill.
    This version of the script does not currently interact with multi-target or self-target skills.

    Step 3) In your skill's Database section, write out how you want your skill to be shown being used "on-use" in the normal boxes provided.
    Make sure to replace the name of the target with the word (no spaces or speech marks): "targetname"

    Examples: (user) "attacks targetname!"
                       (user) "punches targetname square in the jaw!"
                       (user) "is so sexy that targetname falls head over heels and takes damage!"

    Step 4) Enjoy the script!
    Maybe leave a like on my RPG Maker Forum Thread page?



    Script
    Show Target Names by The_Sarah [v1.0]
    Spoiler: Click this box to get Script
                    Ruby:       
    1. #------------------------------------------------------------------------------#
    2. =begin
    3.                           Show Target Names Script
    4.                                 by The_Sarah
    5.                                    (v1.0)
    6.                  
    7. --                                                                            --
    8.                              ~~~ REQUIREMENTS ~~~
    9.                      
    10.                                     None
    11.                            
    12. --                                                                            --
    13.                           ~~~ IMPORTANT TO KNOW ~~~
    14.                  
    15.      This version of the script currently only affects single-target skills.
    16. --                                                                            --
    17.                               ~~~ HOW TO USE ~~~
    18.                      
    19. Step 1) Add the "<callname>" note tag (without the speech marks) to any skill
    20.          you wish to consider applying this script's effects to.
    21. Step 2) Make sure the skill you added <callname> to is a single-target skill.
    22.          As this version of the script does not currently interact well with
    23.          multi-target or self-target skills.
    24. Step 3) In your skill's Database section, write out how you want your skill
    25.          to be written on-use in the normal boxes.
    26.          Make sure to replace the name of the target with the word
    27.          (with no spaces) "targetname".
    28.          Examples: (user) "attacks targetname!"
    29.                    (user) "punches targetname square in the jaw!"
    30.                    (user) "is so sexy that targetname falls onto the ground!"
    31. Step 4) Enjoy the script!
    32.          Maybe leave a like on my RPG Maker Forum Thread page? :P
    33. --                                                                            --
    34.                               ~~~ FEATURES ~~~
    35.                        
    36.    With this script, you will be able to make any chosen single-target skills
    37.    show both the user's name AND the target's name when writing out their
    38.    "use messages" in the Database.
    39.                      
    40. --                                                                            --
    41.                             ~~~ NOTETAGS KEY ~~~
    42. "<callname>"  - Written in the chosen skills' note boxes. Applies this script
    43.                  to those skills.
    44.       
    45. "targetname"  - Written in the chosen skills' "use messages" boxes. Allows
    46.                  you to have more freedom in writing your "use skill" messages.
    47.       
    48. --                                                                            --
    49.                             ~~~ TERMS OF USE ~~~
    50.                   
    51.     If you share a game with this script in it (freely or commercially), you
    52.     must credit me in the game.
    53.       Ideally like this: "Show Target Names script by The_Sarah"
    54.       Of like this if you edit the script yourself:
    55.                          "Original Show Target Names script by The_Sarah"
    56.                   
    57.                
    58.     Other than that, this script is free to download and use or edit in any
    59.     game or project you desire (free or commercial).
    60.                   
    61. --                                                                            --
    62.                               ~~~ REQUESTS ~~~
    63.                      
    64.    If you would like me to add more functionality to this script, such as
    65.    multi-targeting, please request so in the RPG Maker Forum Thread I made
    66.    to originally host this Script.
    67.    I will reply to all requests when I have the time (which shouldn't be too
    68.    long to be honest) and do my best to accomodate them.
    69. --                                                                            --
    70.                                 ~~~ BUGS ~~~
    71.                            No current known issues.
    72.       
    73. --                                                                            --
    74.                            ~~~ SPECIAL THANKS ~~~
    75.      * The_Sarah (aka me) for being awesome and making this script :D
    76.      * RPG Maker Forum user Ticomanel for requesting it / the idea.
    77. --                                                                            --
    78.                                 ~~~ OUTRO ~~~
    79.    And that's it!
    80.    This is only my third public script so it might be a little messy
    81.    (especially in its early versions), but hope it helps those interested in
    82.    something like this.
    83.    Have wonderful lives everyone.
    84.    Be kind to eachother.
    85.    Remember we're all human!
    86.                     Let's make wonderful games together!
    87.                                                             - The_Sarah
    88. =end
    89. #------------------------------------------------------------------------------#
    90. #=begin
    91. #------------------------------------------------------------------------------#
    92. #                                The Script                                    #
    93. #------------------------------------------------------------------------------#
    94. #==============================================================================
    95. # ** New Module: The_Sarah's Target Log
    96. #==============================================================================
    97. module TheSarahTargetLog
    98.   class << self
    99.     attr_accessor   :skill_target_name
    100.   end
    101. end
    102. #==============================================================================
    103. # ** Window_BattleLog
    104. #------------------------------------------------------------------------------
    105. #  This window is for displaying battle progress. No frame is displayed, but it
    106. # is handled as a window for convenience.
    107. #==============================================================================
    108. class Window_BattleLog < Window_Selectable
    109.   #--------------------------------------------------------------------------
    110.   # * Aliased Method: Display Skill/Item Use
    111.   #--------------------------------------------------------------------------
    112.   alias thesarah_targetlog_windowbattlelog_displayuseitem    display_use_item
    113.   def display_use_item(subject, item)
    114.     if item.is_a?(RPG::Skill)
    115.       if item.note[/<callname>/i] && item.message1[/targetname/i] || item.message2[/targetname/i]
    116.         item.message1 = item.message1.gsub("targetname", TheSarahTargetLog::skill_target_name)
    117.         item.message2 = item.message2.gsub("targetname", TheSarahTargetLog::skill_target_name)
    118.         thesarah_targetlog_windowbattlelog_displayuseitem(subject, item) # calls original method
    119.         item.message1 = item.message1.gsub(TheSarahTargetLog::skill_target_name, "targetname")
    120.         item.message2 = item.message2.gsub(TheSarahTargetLog::skill_target_name, "targetname")
    121.       elsif item.note[/<callname>/i] && !item.message1[/targetname/i] && !item.message2[/targetname/i]
    122.         thesarah_targetlog_windowbattlelog_displayuseitem(subject, item) # calls original method
    123.         item.message1 = item.message1.gsub(TheSarahTargetLog::skill_target_name, "targetname")
    124.         item.message2 = item.message2.gsub(TheSarahTargetLog::skill_target_name, "targetname")
    125.       else  # skill has no relevant name notes
    126.         thesarah_targetlog_windowbattlelog_displayuseitem(subject, item) # calls original method
    127.       end
    128.     else  # item is not a skill
    129.       thesarah_targetlog_windowbattlelog_displayuseitem(subject, item) # calls original method
    130.     end
    131.   end # end of method
    132. end # end of Window_BattleLog class
    133. #==============================================================================
    134. # ** Scene_Battle
    135. #------------------------------------------------------------------------------
    136. #  This class performs battle screen processing.
    137. #==============================================================================
    138. class Scene_Battle < Scene_Base
    139.   #--------------------------------------------------------------------------
    140.   # * Aliased Method: Use Skill/Item
    141.   #--------------------------------------------------------------------------
    142.   alias thesarah_targetlog_scenebattle_useitem              use_item
    143.   def use_item
    144.     item = @subject.current_action.item
    145.     if item.is_a?(RPG::Skill) && item.note[/<callname>/i]
    146.       return the_sarahs_custom_use_item_method
    147.     end
    148.     thesarah_targetlog_scenebattle_useitem  # calls original method
    149.   end
    150.   #--------------------------------------------------------------------------
    151.   # * New Method: The_Sarah's Custom Use_Item Method
    152.   #--------------------------------------------------------------------------
    153.   def the_sarahs_custom_use_item_method
    154.     item = @subject.current_action.item
    155.     targets = @subject.current_action.make_targets.compact
    156.     targets.each {|target| get_target_info(target) }
    157.     @log_window.display_use_item(@subject, item)
    158.     @subject.use_item(item)
    159.     refresh_status
    160.     show_animation(targets, item.animation_id)
    161.     targets.each {|target| item.repeats.times { invoke_item(target, item) } }
    162.   end
    163.   #--------------------------------------------------------------------------
    164.   # * New Method: Get Target Info
    165.   #--------------------------------------------------------------------------
    166.   def get_target_info(target)
    167.     TheSarahTargetLog::skill_target_name = target.name
    168.   end
    169. end # end of Scene_Battle class
    170. #=end
    171. #------------------------------------------------------------------------------#
    172. #                            End of the Script                                 #
    173. #------------------------------------------------------------------------------#
    复制代码


    .
    Credit and Thanks
    Me, aka The_Sarah for making the script.
    Ticomanel for the idea.
    .
    .
    Terms of use


    1) Users must link to this forum post when sharing the script elsewhere.
    2) Users must credit The_Sarah when sharing free games with others that have this script in them.
    3) Users must credit The_Sarah when using the script in a game selling commercially.
    4) If Users have edited the script, credit must still be provided to The_Sarah for the original script.
    5) Other than that, there is no cost and it is free to use wherever
    .

    And that's it!
    Enjoy, everyone!

    .
    .
    Screenshots
    (forgive the media play bar in the screenshots, captured them in gif form first)​

    001 - Without the script ~~~~~~~~~~~~~~~~ 002 - With the Script ~~~~~~~~~~~~~~~~~~





    003 - With the Script (pre-damage) ~~~~~~~~004 - With the Script (customised further)~~~







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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-17 09:26 , Processed in 0.136377 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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