I heard about this beind done and i'm not sure what script it is...
here is the one im using...
i would like to see the script where it reads the actual current time and runs it...?
can anyone help me...
ex: on your lower comp display it says 12:41pm in game its 12:41pm...
Edit : I got it...
The only problem is the shading... at night it gets dark, but the color is dull nothing great!!!
i want to use the tone of (-51,-51,-17,136) which is a darker blue and grey tint...
can someone help...
secondly... how can i change the time in the menu screen to the current time?
here is the one im using...
#=======================================#
# Day-Night System
# Written by Deke
# Rewiten by Near Fantastica
# Changed by Silentdragon
# Tweaked by EmuMaster2002
# To make a map get dark at night, put an asterisk in its name (*)
# Uses Switches 0001-0004 to denote time-blocks based on multiples of six.
# 6:00AM-12:00PM is Morning, 12:00PM-6:00PM is Evening, etc.
#=======================================#
class Game_Time
attr_accessor :minute_length
attr_accessor :hours
attr_accessor :minutess
attr_accessor :timess
def initialize
@minute_length=2.0
@hour_length= 60.0
@day_length=24.0
@month_length=30.0
@year_length=12.0
@minutes=0
@timess=Time.now #Real-Time Tweak
@hours=timess.strftime("%H").to_i #Real Hours
@minutess=timess.strftime("%M").to_i #Real Min
end
def get_time
@timess=Time.now #Real-Time Tweak
@hours=timess.strftime("%H").to_i #Real Hours
@minutess=timess.strftime("%M").to_i #Real Min
end
def get_tone
get_time
hour=hours
minutes=minutess + hour*@hour_length
phase_shift=Math::PI*(minutes/(@hour_length*@day_length))
illumination= -150+ 165*Math.sin(phase_shift)
tone=Tone.new(illumination,illumination,illumination,0)
return tone
end
end # of class Game_Time
#=======================================#
# ?ƒÂ¢Ã¢?‚??€œ?‚¦nbsp; class Window_Time #
# written by Deke #
#------------------------------------------------------------------------------#
#=======================================#
class Window_Time < Window_Base
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype # "Time" window font
self.contents.font.size = $defaultfontsize
refresh
end
#--------------------------------------------------------------------------
def refresh
$game_time.get_time
self.contents.clear
@total_sec = Graphics.frame_count / Graphics.frame_rate
@minute=$game_time.minutess
hour = $game_time.hours
pm_flag= hour >=12 ? true : false
hour= hour >= 12 ? hour-12 : hour
if hour.floor==0
text=sprintf("%02d:%02d",12,@minute)
else
text=sprintf("%02d:%02d",hour,@minute)
end
if pm_flag
text += " PM"
else
text += " AM"
end
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, text, 2)
end
#--------------------------------------------------------------------------
def update
$game_time.get_time
if $game_time.minutess != @minute
refresh
end
end
end # of class
#=======================================
class Game_Temp
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer setup to Game Temp
#--------------------------------------------------------------------------
alias dns_game_temp_initalize initialize
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer the Attr
#--------------------------------------------------------------------------
attr_reader :map_infos #Added Lines
attr_reader utside_array #Added Lines
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer setup to Scene Map
#--------------------------------------------------------------------------
def initialize
dns_game_temp_initalize
@outside_array = Array.new
@map_infos = load_data("Data/MapInfos.rxdata")
for key in @map_infos.keys
@outside_array[key] = @map_infos[key].name.include?("*")
end
end
end
#=======================================
class Scene_Map
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer setup to Scene Map
#--------------------------------------------------------------------------
alias dns_scene_map_main main
alias dns_scene_map_update update
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Main
#--------------------------------------------------------------------------
def main
if $game_temp.outside_array[$game_map.map_id]
tone=$game_time.get_tone
$game_time.get_time
@minute=$game_time.minutess
$game_screen.start_tone_change(tone, 0)
end
@spriteset = Spriteset_Map.new
@message_window = Window_Message.new
Graphics.transition
loop do
$light_effects.refresh
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@message_window.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end
$light_effects.hide
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Update
#--------------------------------------------------------------------------
def update
$game_time.get_time
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Added by Shado
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if $game_time.hours <= 6
$game_switches[1] = true
$game_switches[2] = false
$game_switches[3] = false
$game_switches[4] = false
elsif $game_time.hours <= 12
$game_switches[1] = false
$game_switches[2] = true
$game_switches[3] = false
$game_switches[4] = false
elsif $game_time.hours <= 18
$game_switches[1] = false
$game_switches[2] = false
$game_switches[3] = true
$game_switches[4] = false
elsif $game_time.hours <= 0
$game_switches[1] = false
$game_switches[2] = false
$game_switches[3] = false
$game_switches[4] = true
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#End of modification
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$light_effects.update
conditional1 =$game_temp.outside_array[$game_map.map_id] and $game_time.minutess != @minute
conditional2 =$game_temp.outside_array[$game_map.map_id] and @current_id != $game_map.map_id
if conditional1 or conditional2
tone=$game_time.get_tone
$game_screen.start_tone_change(tone, 0)
@minute = $game_time.minutess
$game_map.need_refresh=true
@current_id=$game_map.map_id
end
if $game_temp.outside_array[$game_map.map_id] == false and @current_id != $game_map.map_id
$game_screen.start_tone_change(Tone.new(0,0,0,0),0 )
@current_id=$game_map.map_id
end
dns_scene_map_update
end
end
#================================================= =====
class Scene_Title
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer setup to Scene Map
#--------------------------------------------------------------------------
alias dns_scene_title_update update
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer setup to Scene Map
#--------------------------------------------------------------------------
def update
$game_time=Game_Time.new
#Dubealex Addition (from XRXS) to show Map Name on screen
dns_scene_title_update
end
end
class Game_Map
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer the attr
#--------------------------------------------------------------------------
attr_reader utside
attr_reader :map_id
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Outside
#--------------------------------------------------------------------------
def outside
return $game_temp.outside_array[@map_id]
end
end
#================================================= =============================
# ?ƒÂ¢Ã¢?‚??€œ?‚¦nbsp; Light Effect System
#------------------------------------------------------------------------------
# ?ƒÂ£Ã¢?€šÂ¬Ã¢?€šÂ¬By: Near Fantastica
# Date: 13/2/05
#
# Addes light Effects to the DNS so objects glow and have ground effect lighting...
#================================================= =============================
class Light_Effect_System
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer the attr
#--------------------------------------------------------------------------
attr_accessor :picture_le
attr_accessor :event_list
attr_accessor :type_list
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Initialization
#--------------------------------------------------------------------------
def initialize
@event_counter = 0
@picture_le = Array.new
@event_list = Array.new
@type_list = Array.new
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Setup Light Effects on Map Change
#--------------------------------------------------------------------------
def setup
# Setup Event Max
@event_counter = 0
for i in 1..999
if $game_map.map.events.id > @event_counter
@event_counter = $game_map.map.events.id
end
end
#
for i in 1..@event_counter
if $game_map.map.events == nil
next
end
case $game_map.map.events.name
when "Ground"
ground(i)
when "Fire"
fire(i)
when "Lamp Post"
lamp(i)
when "Left Lantern"
left_lantern(i)
when "Right Lantern"
right_lantern(i)
end
end
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Updates the Array based on time of day
#--------------------------------------------------------------------------
def update
$game_time.get_time
if $game_time.hours > 7 and $game_time.hours < 14
hide
else
show
end
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Updates the XY of the sprites
#--------------------------------------------------------------------------
def refresh
for i in 0..$light_effects.picture_le.size - 1
case $light_effects.type_list
when "Ground"
$light_effects.picture_le.x = ($game_map.events[$light_effects.event_list].real_x - 200 - $game_map.display_x) / 4
$light_effects.picture_le.y = ($game_map.events[$light_effects.event_list].real_y - 200 - $game_map.display_y) / 4
$light_effects.picture_le.visible = true
when "Fire"
$light_effects.picture_le.x = ($game_map.events[$light_effects.event_list].real_x - 300 - $game_map.display_x) / 4
$light_effects.picture_le.y = ($game_map.events[$light_effects.event_list].real_y - 300 - $game_map.display_y) / 4
$light_effects.picture_le.visible = true
when "Left Lamp Post"
$light_effects.picture_le.x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list].x * 32) - 5
$light_effects.picture_le.y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list].y * 32) - 15
when "Right Lamp Post"
$light_effects.picture_le.x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list].x * 32) - 25
$light_effects.picture_le.y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list].y * 32) - 15
$light_effects.picture_le.visible = true
when "Left Lantern"
$light_effects.picture_le.x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list].x * 32) - 20
$light_effects.picture_le.y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list].y * 32) - 5
$light_effects.picture_le.visible = true
when "Right Lantern"
$light_effects.picture_le.x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list].x * 32) - 10
$light_effects.picture_le.y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list].y * 32) - 5
$light_effects.picture_le.visible = true
end
end
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Redraws the Array
#--------------------------------------------------------------------------
def redraw
if @picture_le != []
for i in 0..@picture_le.size - 1
@picture_le.bitmap.dispose
end
@picture_le = Array.new
@event_list = Array.new
@type_list = Array.new
end
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Shows Array
#--------------------------------------------------------------------------
def show
if @picture_le != []
for i in 0..@picture_le.size - 1
@picture_le.visible = true
end
end
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Hides Array
#--------------------------------------------------------------------------
def hide
if @picture_le != []
for i in 0..@picture_le.size - 1
@picture_le.visible = false
end
end
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Setup Light Effects for Ground
#--------------------------------------------------------------------------
def ground(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.zoom_x = 200 / 100.0
light_effects.zoom_y = 200 / 100.0
light_effects.z = 1000
light_effects.opacity = 50
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Ground")
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Setup Light Effects for Fire
#--------------------------------------------------------------------------
def fire(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.zoom_x = 300 / 100.0
light_effects.zoom_y = 300 / 100.0
light_effects.z = 1000
light_effects.opacity = 100
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Fire")
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Setup Light Effects for Lamp
#--------------------------------------------------------------------------
def lamp(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 100
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Left Lamp Post")
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 100
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Right Lamp Post")
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Setup Light Effects for Lantern
#--------------------------------------------------------------------------
def left_lantern(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 150
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Left Lantern")
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Setup Light Effects for Lantern
#--------------------------------------------------------------------------
def right_lantern(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 150
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Right Lantern")
end
end
#================================================= =============================
# ?ƒÂ¢Ã¢?‚??€œ?‚¦nbsp; Game_Map
#------------------------------------------------------------------------------
# ?ƒÂ£Ã¢?€šÂ¬Ã¢?€šÂ¬Add defenision of the names to Game Map Class
#================================================= =============================
class Game_Map
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer the attr
#--------------------------------------------------------------------------
attr_accessor :map
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer setup to Game Map
#--------------------------------------------------------------------------
alias les_game_map_setup setup
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refers the Map Setup
#--------------------------------------------------------------------------
def setup(map_id)
$light_effects.redraw
les_game_map_setup(map_id)
$light_effects.setup
end
end
#================================================= =============================
# ?ƒÂ¢Ã¢?‚??€œ?‚¦nbsp; Scene_Title
#------------------------------------------------------------------------------
# ?ƒÂ£Ã¢?€šÂ¬Ã¢?€šÂ¬It is the class which processes the title picture
#================================================= =============================
class Scene_Title
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer setup to Scene Title
#--------------------------------------------------------------------------
alias les_scene_title_update update
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Sets up the ABS
#--------------------------------------------------------------------------
def update
$light_effects = Light_Effect_System.new
les_scene_title_update
end
end
# Day-Night System
# Written by Deke
# Rewiten by Near Fantastica
# Changed by Silentdragon
# Tweaked by EmuMaster2002
# To make a map get dark at night, put an asterisk in its name (*)
# Uses Switches 0001-0004 to denote time-blocks based on multiples of six.
# 6:00AM-12:00PM is Morning, 12:00PM-6:00PM is Evening, etc.
#=======================================#
class Game_Time
attr_accessor :minute_length
attr_accessor :hours
attr_accessor :minutess
attr_accessor :timess
def initialize
@minute_length=2.0
@hour_length= 60.0
@day_length=24.0
@month_length=30.0
@year_length=12.0
@minutes=0
@timess=Time.now #Real-Time Tweak
@hours=timess.strftime("%H").to_i #Real Hours
@minutess=timess.strftime("%M").to_i #Real Min
end
def get_time
@timess=Time.now #Real-Time Tweak
@hours=timess.strftime("%H").to_i #Real Hours
@minutess=timess.strftime("%M").to_i #Real Min
end
def get_tone
get_time
hour=hours
minutes=minutess + hour*@hour_length
phase_shift=Math::PI*(minutes/(@hour_length*@day_length))
illumination= -150+ 165*Math.sin(phase_shift)
tone=Tone.new(illumination,illumination,illumination,0)
return tone
end
end # of class Game_Time
#=======================================#
# ?ƒÂ¢Ã¢?‚??€œ?‚¦nbsp; class Window_Time #
# written by Deke #
#------------------------------------------------------------------------------#
#=======================================#
class Window_Time < Window_Base
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype # "Time" window font
self.contents.font.size = $defaultfontsize
refresh
end
#--------------------------------------------------------------------------
def refresh
$game_time.get_time
self.contents.clear
@total_sec = Graphics.frame_count / Graphics.frame_rate
@minute=$game_time.minutess
hour = $game_time.hours
pm_flag= hour >=12 ? true : false
hour= hour >= 12 ? hour-12 : hour
if hour.floor==0
text=sprintf("%02d:%02d",12,@minute)
else
text=sprintf("%02d:%02d",hour,@minute)
end
if pm_flag
text += " PM"
else
text += " AM"
end
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, text, 2)
end
#--------------------------------------------------------------------------
def update
$game_time.get_time
if $game_time.minutess != @minute
refresh
end
end
end # of class
#=======================================
class Game_Temp
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer setup to Game Temp
#--------------------------------------------------------------------------
alias dns_game_temp_initalize initialize
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer the Attr
#--------------------------------------------------------------------------
attr_reader :map_infos #Added Lines
attr_reader utside_array #Added Lines
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer setup to Scene Map
#--------------------------------------------------------------------------
def initialize
dns_game_temp_initalize
@outside_array = Array.new
@map_infos = load_data("Data/MapInfos.rxdata")
for key in @map_infos.keys
@outside_array[key] = @map_infos[key].name.include?("*")
end
end
end
#=======================================
class Scene_Map
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer setup to Scene Map
#--------------------------------------------------------------------------
alias dns_scene_map_main main
alias dns_scene_map_update update
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Main
#--------------------------------------------------------------------------
def main
if $game_temp.outside_array[$game_map.map_id]
tone=$game_time.get_tone
$game_time.get_time
@minute=$game_time.minutess
$game_screen.start_tone_change(tone, 0)
end
@spriteset = Spriteset_Map.new
@message_window = Window_Message.new
Graphics.transition
loop do
$light_effects.refresh
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@message_window.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end
$light_effects.hide
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Update
#--------------------------------------------------------------------------
def update
$game_time.get_time
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Added by Shado
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if $game_time.hours <= 6
$game_switches[1] = true
$game_switches[2] = false
$game_switches[3] = false
$game_switches[4] = false
elsif $game_time.hours <= 12
$game_switches[1] = false
$game_switches[2] = true
$game_switches[3] = false
$game_switches[4] = false
elsif $game_time.hours <= 18
$game_switches[1] = false
$game_switches[2] = false
$game_switches[3] = true
$game_switches[4] = false
elsif $game_time.hours <= 0
$game_switches[1] = false
$game_switches[2] = false
$game_switches[3] = false
$game_switches[4] = true
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#End of modification
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$light_effects.update
conditional1 =$game_temp.outside_array[$game_map.map_id] and $game_time.minutess != @minute
conditional2 =$game_temp.outside_array[$game_map.map_id] and @current_id != $game_map.map_id
if conditional1 or conditional2
tone=$game_time.get_tone
$game_screen.start_tone_change(tone, 0)
@minute = $game_time.minutess
$game_map.need_refresh=true
@current_id=$game_map.map_id
end
if $game_temp.outside_array[$game_map.map_id] == false and @current_id != $game_map.map_id
$game_screen.start_tone_change(Tone.new(0,0,0,0),0 )
@current_id=$game_map.map_id
end
dns_scene_map_update
end
end
#================================================= =====
class Scene_Title
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer setup to Scene Map
#--------------------------------------------------------------------------
alias dns_scene_title_update update
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer setup to Scene Map
#--------------------------------------------------------------------------
def update
$game_time=Game_Time.new
#Dubealex Addition (from XRXS) to show Map Name on screen
dns_scene_title_update
end
end
class Game_Map
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer the attr
#--------------------------------------------------------------------------
attr_reader utside
attr_reader :map_id
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Outside
#--------------------------------------------------------------------------
def outside
return $game_temp.outside_array[@map_id]
end
end
#================================================= =============================
# ?ƒÂ¢Ã¢?‚??€œ?‚¦nbsp; Light Effect System
#------------------------------------------------------------------------------
# ?ƒÂ£Ã¢?€šÂ¬Ã¢?€šÂ¬By: Near Fantastica
# Date: 13/2/05
#
# Addes light Effects to the DNS so objects glow and have ground effect lighting...
#================================================= =============================
class Light_Effect_System
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer the attr
#--------------------------------------------------------------------------
attr_accessor :picture_le
attr_accessor :event_list
attr_accessor :type_list
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Initialization
#--------------------------------------------------------------------------
def initialize
@event_counter = 0
@picture_le = Array.new
@event_list = Array.new
@type_list = Array.new
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Setup Light Effects on Map Change
#--------------------------------------------------------------------------
def setup
# Setup Event Max
@event_counter = 0
for i in 1..999
if $game_map.map.events.id > @event_counter
@event_counter = $game_map.map.events.id
end
end
#
for i in 1..@event_counter
if $game_map.map.events == nil
next
end
case $game_map.map.events.name
when "Ground"
ground(i)
when "Fire"
fire(i)
when "Lamp Post"
lamp(i)
when "Left Lantern"
left_lantern(i)
when "Right Lantern"
right_lantern(i)
end
end
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Updates the Array based on time of day
#--------------------------------------------------------------------------
def update
$game_time.get_time
if $game_time.hours > 7 and $game_time.hours < 14
hide
else
show
end
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Updates the XY of the sprites
#--------------------------------------------------------------------------
def refresh
for i in 0..$light_effects.picture_le.size - 1
case $light_effects.type_list
when "Ground"
$light_effects.picture_le.x = ($game_map.events[$light_effects.event_list].real_x - 200 - $game_map.display_x) / 4
$light_effects.picture_le.y = ($game_map.events[$light_effects.event_list].real_y - 200 - $game_map.display_y) / 4
$light_effects.picture_le.visible = true
when "Fire"
$light_effects.picture_le.x = ($game_map.events[$light_effects.event_list].real_x - 300 - $game_map.display_x) / 4
$light_effects.picture_le.y = ($game_map.events[$light_effects.event_list].real_y - 300 - $game_map.display_y) / 4
$light_effects.picture_le.visible = true
when "Left Lamp Post"
$light_effects.picture_le.x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list].x * 32) - 5
$light_effects.picture_le.y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list].y * 32) - 15
when "Right Lamp Post"
$light_effects.picture_le.x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list].x * 32) - 25
$light_effects.picture_le.y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list].y * 32) - 15
$light_effects.picture_le.visible = true
when "Left Lantern"
$light_effects.picture_le.x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list].x * 32) - 20
$light_effects.picture_le.y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list].y * 32) - 5
$light_effects.picture_le.visible = true
when "Right Lantern"
$light_effects.picture_le.x = (-0.25 * $game_map.display_x) + ($game_map.events[$light_effects.event_list].x * 32) - 10
$light_effects.picture_le.y = (-0.25 * $game_map.display_y) + ($game_map.events[$light_effects.event_list].y * 32) - 5
$light_effects.picture_le.visible = true
end
end
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Redraws the Array
#--------------------------------------------------------------------------
def redraw
if @picture_le != []
for i in 0..@picture_le.size - 1
@picture_le.bitmap.dispose
end
@picture_le = Array.new
@event_list = Array.new
@type_list = Array.new
end
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Shows Array
#--------------------------------------------------------------------------
def show
if @picture_le != []
for i in 0..@picture_le.size - 1
@picture_le.visible = true
end
end
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Hides Array
#--------------------------------------------------------------------------
def hide
if @picture_le != []
for i in 0..@picture_le.size - 1
@picture_le.visible = false
end
end
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Setup Light Effects for Ground
#--------------------------------------------------------------------------
def ground(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.zoom_x = 200 / 100.0
light_effects.zoom_y = 200 / 100.0
light_effects.z = 1000
light_effects.opacity = 50
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Ground")
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Setup Light Effects for Fire
#--------------------------------------------------------------------------
def fire(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.zoom_x = 300 / 100.0
light_effects.zoom_y = 300 / 100.0
light_effects.z = 1000
light_effects.opacity = 100
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Fire")
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Setup Light Effects for Lamp
#--------------------------------------------------------------------------
def lamp(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 100
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Left Lamp Post")
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 100
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Right Lamp Post")
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Setup Light Effects for Lantern
#--------------------------------------------------------------------------
def left_lantern(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 150
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Left Lantern")
end
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Setup Light Effects for Lantern
#--------------------------------------------------------------------------
def right_lantern(event_index)
light_effects = Sprite.new
light_effects.bitmap = RPG::Cache.picture("LE.PNG")
light_effects.z = 1000
light_effects.opacity = 150
light_effects.visible = false
@picture_le.push(light_effects)
@event_list.push(event_index)
@type_list.push("Right Lantern")
end
end
#================================================= =============================
# ?ƒÂ¢Ã¢?‚??€œ?‚¦nbsp; Game_Map
#------------------------------------------------------------------------------
# ?ƒÂ£Ã¢?€šÂ¬Ã¢?€šÂ¬Add defenision of the names to Game Map Class
#================================================= =============================
class Game_Map
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer the attr
#--------------------------------------------------------------------------
attr_accessor :map
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer setup to Game Map
#--------------------------------------------------------------------------
alias les_game_map_setup setup
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refers the Map Setup
#--------------------------------------------------------------------------
def setup(map_id)
$light_effects.redraw
les_game_map_setup(map_id)
$light_effects.setup
end
end
#================================================= =============================
# ?ƒÂ¢Ã¢?‚??€œ?‚¦nbsp; Scene_Title
#------------------------------------------------------------------------------
# ?ƒÂ£Ã¢?€šÂ¬Ã¢?€šÂ¬It is the class which processes the title picture
#================================================= =============================
class Scene_Title
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Refer setup to Scene Title
#--------------------------------------------------------------------------
alias les_scene_title_update update
#--------------------------------------------------------------------------
# ?ƒÂ¢Ã¢?‚??€?? Sets up the ABS
#--------------------------------------------------------------------------
def update
$light_effects = Light_Effect_System.new
les_scene_title_update
end
end
i would like to see the script where it reads the actual current time and runs it...?
can anyone help me...
ex: on your lower comp display it says 12:41pm in game its 12:41pm...
Edit : I got it...
The only problem is the shading... at night it gets dark, but the color is dull nothing great!!!
i want to use the tone of (-51,-51,-17,136) which is a darker blue and grey tint...
can someone help...
secondly... how can i change the time in the menu screen to the current time?