Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Trickster's Time System Bugs

I need someone to change Sprite_Timer to show the time instead of a clock ticking, also
I am getting a error on line 70 of the hud script, and
if I remove that then I am getting a error on line 77 from the Day/night script.
Can someone have it where the time system works with custom title scripts, because this relies on SDK, and that alone it doesn't look at anything else, so it is a let down. If I remove the
Custom Title Script it works, but I hate the default SDK one.
Unknown for nil class is what is major error is though. Has to do with Scene_Title, I
hope someone can please help me, thanks for your time though.

(Hud Add-on Error) - Both are from the same problem (Scene_Title)
return if @time == $game_time.time

(Day/Night Script Error)
if $game_map.outside? and $game_time.tone_enabled

Trickster's Hud Script
=begin
==============================================================================
●● HUD Addon for Trickster's Time System
------------------------------------------------------------------------------
Trickster (tricksterguy@hotmail.com)
Version 1.0
Date 3/31/07
Goto rmxp.org for updates/support/bug reports
==============================================================================
=end
#--------------------------------------------------------------------------
# * Begin SDK Log
#--------------------------------------------------------------------------
SDK.log('Time HUD', 'Trickster', 1.0, '3.21.07')
#--------------------------------------------------------------------------
# Begin SDK Requirement Check
#--------------------------------------------------------------------------
SDK.check_requirements(2.2, [1, 2, 3, 4], ['Time System'])
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?('Time HUD')

module Time_Setup
#--------------------------------------------------------------------------
# * Time HUD Location
# - note: width = 160 height = 64
#--------------------------------------------------------------------------
Position = 480, 0
#--------------------------------------------------------------------------
# * Time HUD Opacity
#--------------------------------------------------------------------------
Opacity = 160
#--------------------------------------------------------------------------
# * Time HUD Back Opacity
#--------------------------------------------------------------------------
Back_Opacity = 160
#--------------------------------------------------------------------------
# * HUD Switch
# - Switch ID to turn hud off
#--------------------------------------------------------------------------
HUD_Switch = 1
end

class Window_TimeHUD < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Call Window_Base#initialize
super(0, 0, 160, 64)
# Setup Contents
self.contents = Bitmap.new(width - 32, height - 32)
# Setup Time
@time = nil
# Setup Opacity
self.opacity = Time_Setup::Opacity
# Setup Back Opacity
self.back_opacity = Time_Setup::Back_Opacity
# Refresh
refresh
# Setup Visibility
self.visible = $game_switches[Time_Setup::HUD_Switch]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Return if same time
return if @time == $game_time.time
# Set Time
@time = $game_time.time
# Clear
self.contents.clear
# Get Width
cx = contents.text_size('Time').width
# System Color
self.contents.font.color = system_color
# Draw Time Text
self.contents.draw_text(0, 0, cx, 32, 'Time', 2)
# Normal Color
self.contents.font.color = normal_color
# Get Width
dx = contents.text_size(@time).width
# Print Time
self.contents.draw_text(cx, 0, contents.width - cx, 32, $game_time.time, 2)
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
# Call Window_Base#update
super
# Refresh if different time
refresh if @time != $game_time.time
# Setup Visibility
self.visible = $game_switches[Time_Setup::HUD_Switch]
end
end

class Scene_Map
#--------------------------------------------------------------------------
# * Main Window
#--------------------------------------------------------------------------
alias_method :trick_timehud_map_main_window, :main_window
def main_window
# The Usual
trick_timehud_map_main_window
# Create Time Hud Window
@time_hud = Window_TimeHUD.new
# Setup it's position
@time_hud.x, @time_hud.y = Time_Setup::Position
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

Trickster's Day/Night Script
=begin
==============================================================================
●● Day/Night Addon for Trickster's Time System
------------------------------------------------------------------------------
Trickster (tricksterguy@hotmail.com)
Version 2.0
Date 3/31/07
Goto rmxp.org for updates/support/bug reports
==============================================================================
=end
#--------------------------------------------------------------------------
# * Begin SDK Log
#--------------------------------------------------------------------------
SDK.log('Day Night', 'Trickster', 1.0, '3.31.07')
#--------------------------------------------------------------------------
# Begin SDK Requirement Check
#--------------------------------------------------------------------------
SDK.check_requirements(2.2, [1, 2, 3, 4], ['Time System'])
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?('Day Night')

module Time_Setup
#--------------------------------------------------------------------------
# * Tone Enabled (At Start of Game)
#--------------------------------------------------------------------------
Tone_Enabled = true
#--------------------------------------------------------------------------
# * Tone Disabled Maps
# - syntax map_id => disabled flag true: disabled false: enabled
#--------------------------------------------------------------------------
Tone_Disabled = {2 => true}
#--------------------------------------------------------------------------
# * Tone Disabled Maps Default
#--------------------------------------------------------------------------
Tone_Disabled.default = false
#--------------------------------------------------------------------------
# * Transition
# - Number of Frames to Transition to new tone
#--------------------------------------------------------------------------
Transition = 4
end

class Game_Time
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias_method :trick_day_night_time_initialize, :initialize
def initialize
# Setup Tone Disabled Flag
@tone_enabled = Tone_Enabled
# The Usual
trick_day_night_time_initialize
end
#--------------------------------------------------------------------------
# * Tone - Deke for Original Formula
#--------------------------------------------------------------------------
def tone
period_length = Math::PI * (hours.to_f / Day)
red_shift = -100 + 115 * Math.sin(period_length)
green_shift = -140 + 155 * Math.sin(period_length)
blue_shift = -150 + 165 * Math.sin(period_length)
return Tone.new(red_shift, green_shift, blue_shift, 0)
end
end

class Scene_Map
#--------------------------------------------------------------------------
# * Update Systems
#--------------------------------------------------------------------------
alias_method :trick_day_night_map_update_systems, :update_systems
def update_systems
# The Usual
trick_day_night_map_update_systems
# If Outside and not tone disabled
if $game_map.outside? and $game_time.tone_enabled
# Set Screen Tone
$game_screen.start_tone_change($game_time.tone, Time_Setup::Transition)
end
end
#--------------------------------------------------------------------------
# * Transfer Player
#--------------------------------------------------------------------------
alias_method :trick_day_night_map_transfer_player, :transfer_player
def transfer_player
# The Usual
trick_day_night_map_transfer_player
# If Outside and not tone disabled
unless $game_map.outside? and $game_time.tone_enabled
# If Map is inside set to (0, 0, 0, 0) Tone
$game_screen.start_tone_change(Tone.new(0, 0, 0, 0), Time_Setup::Transition)
end
end
end

class Scene_Battle
#--------------------------------------------------------------------------
# * Update Systems
#--------------------------------------------------------------------------
alias_method :trick_day_night_battle_update_systems, :update_systems
def update_systems
# The Usual
trick_day_night_battle_update_systems
# If Outside and not tone disabled
if $game_map.outside? and $game_time.tone_enabled
# Set Screen Tone
$game_screen.start_tone_change($game_time.tone, Time_Setup::Transition)
end
end
end

class Scene_Title
#--------------------------------------------------------------------------
# * Command New Game Map Setup
#--------------------------------------------------------------------------
alias_method :trick_day_night_title_commandnewgame_mapsetup, :commandnewgame_mapsetup
def commandnewgame_mapsetup
# The Usual
trick_day_night_title_commandnewgame_mapsetup
# If Outside and not tone disabled
unless $game_map.outside? and $game_time.tone_enabled
# If Map is inside set to (0, 0, 0, 0) Tone
$game_screen.start_tone_change(Tone.new(0, 0, 0, 0), Time_Setup::Transition)
end
end
end

class Game_Map
#--------------------------------------------------------------------------
# * Outside
#--------------------------------------------------------------------------
def outside?
return !Time_Setup::Tone_Disabled[map_id]
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
 
I have another request for this can someone edit playtime to have it where it displays the time no matter what menu you use.

HTML:
=begin
==============================================================================
 ●● Time in Menu Addon for Trickster's Time System
------------------------------------------------------------------------------
 Trickster ([email=tricksterguy@hotmail.com]tricksterguy@hotmail.com[/email])
 Version 1.0
 Date 3/31/07
 Goto rmxp.org for updates/support/bug reports
==============================================================================
=end
#--------------------------------------------------------------------------
# * Begin SDK Log
#--------------------------------------------------------------------------
SDK.log('Time in Menu', 'Trickster', 1.0, '3.21.07')
#--------------------------------------------------------------------------
# Begin SDK Requirement Check
#--------------------------------------------------------------------------
SDK.check_requirements(2.2, [1, 2, 3, 4], ['Time System'])
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?('Time in Menu')
  
class Window_PlayTime
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    # Setup Time
    @time = nil
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @time = $game_time.time
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, 'Time')
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 32, 120, 32, $game_time.time, 2)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Call Window_Base Update
    super
    # Refresh if different time
    refresh if @time != $game_time.time
  end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
 
Thanks, that is one less thing I have to worry about, but I still have 2
other problems 1 is Scene_Title (Custom Scripts), and
lastly I kind of want the Sprite_Timer to show what time it is
like Trickster's Menu Add-On, though I want it to work with all
menu, including Custom ones.
I still need help still, please someone :(
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top