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

[转载发布] Single Quest Title ACE

[复制链接]
累计送礼:
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-3 07:22:19 | 显示全部楼层 |阅读模式
    Single Quest Title ACE

    by Kyonides


    Introduction


    A forumer once asked any of the available scripters to come up with a way to show the current quest's title on screen the same way the map name is displayed on the map.

    Well, now it is possible!


    The user also wanted to use some game variables that I hate a lot, but there is one that will hold the title until it gets replaced by a new one.

    Here are the list of available Constants:

    • HIDE_WHEN_ZERO - true or false
    • SWITCH_ID - switch in charge or showing or hiding the quest title window
    • VAR_ID - variable holding the quest title
    • WINDOW_X, WINDOW_Y, WINDOW_WIDTH and WINDOW_HEIGHT constants are self evident.

    This script has only 2 script calls, the second one is usually optional.

    • Set New Title:
      new_quest_title("Quest Name")
    • Repeat the Most Recent Title:
      repeat_quest_title!
    The Script

                    Ruby:       
    1. # * Single Quest Title ACE * #
    2. #  Scripter : Kyonides Arkanthes
    3. #  2023-05-21
    4. # This scriptlet lets you show the Current Quest Title on the map using a
    5. # given Game Variable. The state of a certain Game Switch determines
    6. # whether or not the window will be visible on screen.
    7. # * Script Calls * #
    8. # - Set New Title
    9. # new_quest_title("Quest Name")
    10. # - Repeat the Most Recent Title
    11. # repeat_quest_title!
    12. module SingleQuest
    13.   HIDE_WHEN_ZERO = nil
    14.   SWITCH_ID = 1
    15.   VAR_ID = 1
    16.   WINDOW_X = 0
    17.   WINDOW_Y = 0
    18.   WINDOW_WIDTH = 240
    19.   WINDOW_HEIGHT = 56
    20. class TitleWindow < Window_Base
    21.   include SingleQuest
    22.   def initialize
    23.     super(WINDOW_X, WINDOW_Y, window_width, WINDOW_HEIGHT)
    24.     $game_variables[VAR_ID] = "" if $game_variables[VAR_ID] == 0
    25.     self.opacity = 0
    26.     self.contents_opacity = 0
    27.     @back_color1 = Color.new(0, 0, 0, 192)
    28.     @back_color2 = Color.new(0, 0, 0, 0)
    29.     @show_count = 0
    30.     refresh
    31.   end
    32.   def window_width
    33.     Graphics.width - WINDOW_WIDTH
    34.   end
    35.   def refresh
    36.     contents.clear
    37.     return if $game_variables[VAR_ID].empty?
    38.     rect = contents.rect
    39.     draw_background(rect)
    40.     draw_text(rect, $game_variables[VAR_ID])
    41.   end
    42.   def draw_background(rect)
    43.     temp_rect = rect.dup
    44.     temp_rect.width /= 2
    45.     contents.gradient_fill_rect(temp_rect, @back_color2, @back_color1)
    46.     temp_rect.x = temp_rect.width
    47.     contents.gradient_fill_rect(temp_rect, @back_color1, @back_color2)
    48.   end
    49.   def update_fadein
    50.     self.contents_opacity += 16
    51.   end
    52.   def update_fadeout
    53.     self.contents_opacity -= 16
    54.   end
    55.   def update
    56.     super
    57.     self.visible = $game_switches[SWITCH_ID]
    58.     if self.visible && @show_count > 0
    59.       update_fadein
    60.       @show_count -= 1
    61.     elsif HIDE_WHEN_ZERO
    62.       update_fadeout
    63.     end
    64.   end
    65.   def open
    66.     refresh
    67.     @show_count = 150
    68.     self.contents_opacity = 0
    69.     self
    70.   end
    71.   def close
    72.     @show_count = 0
    73.     self
    74.   end
    75. end
    76. end
    77. module SceneManager
    78.   extend self
    79.   attr_accessor :quest_window
    80. end
    81. class Game_Interpreter
    82.   def new_quest_title(title)
    83.     $game_variables[SingleQuest::VAR_ID] = title
    84.     repeat_quest_title!
    85.   end
    86.   def repeat_quest_title!
    87.     SceneManager.quest_window.open
    88.   end
    89. end
    90. class Scene_Map
    91.   alias :kyon_single_quest_scn_map_create_all_win :create_all_windows
    92.   def create_all_windows
    93.     kyon_single_quest_scn_map_create_all_win
    94.     make_single_quest_window
    95.   end
    96.   def make_single_quest_window
    97.     @quest_window = SingleQuest::TitleWindow.new
    98.     SceneManager.quest_window = @quest_window
    99.     @quest_window.open
    100.   end
    101.   attr_reader :quest_window
    102. end
    复制代码


    Terms & Conditions

    Free for use in any game.
    Include my nickname in your game credits.
    Don't adopt stray cats nor sleeping beauties nor undead fans nor blue squirrels even if they desperately need to drink a cup of coffee!
    That's it!


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-17 08:30 , Processed in 0.106353 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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