Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Single Quest Title ACE
#1
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! Grinning

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

Code:
# * Single Quest Title ACE * #
#  Scripter : Kyonides Arkanthes
#  2023-05-21

# This scriptlet lets you show the Current Quest Title on the map using a
# given Game Variable. The state of a certain Game Switch determines
# whether or not the window will be visible on screen.

# * Script Calls * #

# - Set New Title
# new_quest_title("Quest Name")

# - Repeat the Most Recent Title
# repeat_quest_title!

module SingleQuest
  HIDE_WHEN_ZERO = nil
  SWITCH_ID = 1
  VAR_ID = 1
  WINDOW_X = 0
  WINDOW_Y = 0
  WINDOW_WIDTH = 240
  WINDOW_HEIGHT = 56

class TitleWindow < Window_Base
  include SingleQuest
  def initialize
    super(WINDOW_X, WINDOW_Y, window_width, WINDOW_HEIGHT)
    $game_variables[VAR_ID] = "" if $game_variables[VAR_ID] == 0
    self.opacity = 0
    self.contents_opacity = 0
    @back_color1 = Color.new(0, 0, 0, 192)
    @back_color2 = Color.new(0, 0, 0, 0)
    @show_count = 0
    refresh
  end

  def window_width
    Graphics.width - WINDOW_WIDTH
  end

  def refresh
    contents.clear
    return if $game_variables[VAR_ID].empty?
    rect = contents.rect
    draw_background(rect)
    draw_text(rect, $game_variables[VAR_ID])
  end

  def draw_background(rect)
    temp_rect = rect.dup
    temp_rect.width /= 2
    contents.gradient_fill_rect(temp_rect, @back_color2, @back_color1)
    temp_rect.x = temp_rect.width
    contents.gradient_fill_rect(temp_rect, @back_color1, @back_color2)
  end

  def update_fadein
    self.contents_opacity += 16
  end

  def update_fadeout
    self.contents_opacity -= 16
  end

  def update
    super
    self.visible = $game_switches[SWITCH_ID]
    if self.visible && @show_count > 0
      update_fadein
      @show_count -= 1
    elsif HIDE_WHEN_ZERO
      update_fadeout
    end
  end

  def open
    refresh
    @show_count = 150
    self.contents_opacity = 0
    self
  end

  def close
    @show_count = 0
    self
  end
end

end

module SceneManager
  extend self
  attr_accessor :quest_window
end

class Game_Interpreter
  def new_quest_title(title)
    $game_variables[SingleQuest::VAR_ID] = title
    repeat_quest_title!
  end

  def repeat_quest_title!
    SceneManager.quest_window.open
  end
end

class Scene_Map
  alias :kyon_single_quest_scn_map_create_all_win :create_all_windows
  def create_all_windows
    kyon_single_quest_scn_map_create_all_win
    make_single_quest_window
  end

  def make_single_quest_window
    @quest_window = SingleQuest::TitleWindow.new
    SceneManager.quest_window = @quest_window
    @quest_window.open
  end
  attr_reader :quest_window
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!
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Skip Title Once kyonides 0 208 01-07-2024, 01:26 AM
Last Post: kyonides
   Queen's Quest DerVVulfman 1 4,188 10-07-2019, 04:34 AM
Last Post: DerVVulfman
   Title Skip for Lycan ABS JayRay 3 6,593 04-21-2014, 01:55 PM
Last Post: MetalRenard
   Xenres' Title Skip Kirito 0 4,895 11-25-2010, 06:03 AM
Last Post: Kirito
   Xenres' Title Skip Kirito 0 6,529 11-25-2010, 05:59 AM
Last Post: Kirito
   Xenres Single Actor Escape Kirito 0 5,319 10-24-2010, 05:28 AM
Last Post: Kirito
   Jaber's Quest Log v2.1.3 Jaberwocky 12 18,259 05-28-2010, 07:11 PM
Last Post: sakhawat21
   Pre-title maps deValdr 3 9,244 04-22-2010, 05:24 PM
Last Post: yamina-chan
   TITLE KILLER by Villain Villain 5 9,018 03-04-2010, 05:49 PM
Last Post: Villain
   [Unsupported] Title Skip 2 XP PK8 3 8,328 02-17-2010, 12:01 PM
Last Post: Villain



Users browsing this thread: