Fathan Novice
Posts : 143 Thanked : 0 Engine : RMVX Skill : Advanced Type : Developer
Trophies
Awards: | Subyek: Time System 2013-09-07, 12:01 | |
| - Spoiler:
- Fathan wrote:
- #==============================================================================
# Afhan's Time System VX # March, 5 2012 #------------------------------------------------------------------------------ # Script by : Afhan # For : Enasty - Live for Fun #============================================================================== # This script for Enasty, let me know if you use this script #==============================================================================
module ATS #----------------------------------------------------------------------- # ICON #----------------------------------------------------------------------- ICONTIME = 140 #----------------------------------------------------------------------- # Coordinat #----------------------------------------------------------------------- # Clock Window in Map MAP_TIME_WINDOW = true MAP_TIME_WINDOWS = 3 #Switch on = show on map, off = don't show on map MAP_TIME_WINDOW_COORDS = [420, 32] #Time window coordinat # Clock Window in Menu MENU_TIME_WINDOW = true #true = show on menu, false = don't show MENU_TIME_WINDOW_COORDS = 128 #----------------------------------------------------------------------- # User Definable Clock Settings #----------------------------------------------------------------------- SPEED = 5 #30 # AMPM (True: 12-hour clock, False: 24-hour clock) AMPM = true # Update in map only UPDATE_ONLY_ON_MAP = true # Sets the time at the start of your game. START_MINUTE = 0 START_HOUR = 4 START_DAY = 0 START_MONTH = 0 #(0 = Spring, 1 = Summer, 2 = Autumn, 3 = Winter) START_YEAR = 1 #----------------------------------------------------------------------- # If you want custom day names, edit away! #----------------------------------------------------------------------- DAY_NAMES = ["Minggu","Senin","Selasa","Rabu","Kamis","Jum'at","Sabtu"] # Switch for Days SUNDAY = 5 MONDAY = 6 TUESDAY = 7 WEDNESDAY = 8 THURSDAY = 9 FRIDAY = 10 SATURDAY = 11 #----------------------------------------------------------------------- # If you want custom month names, edit away! #----------------------------------------------------------------------- MONTH_NAMES = ["Semi","Panas","Gugur","Dingin"] # Switch for Season SPRING = 13 SUMMER = 14 AUTUMN = 15 WINTER = 16 #----------------------------------------------------------------------- # Settings for Time Periods #----------------------------------------------------------------------- T1 = [ 0,5 ] # Night # Sets time periods for tinting effects T2 = [ 6,7 ] # Dawn # [Start Hour, End Hour] for time period T3 = [ 8,14] # Day # Use 24-hour values for time periods T4 = [15,16] # Sunset T5 = [17,24] # Night # <- Ex: Night is between 21:00 and 24:00 #Switch for Time NIGHT = 18 # This switch is on during night hours DAWN = 19 # This switch is on during dawn hours DAY = 20 # This switch is on during daytime hours SUNSET = 21 # This switch is on during sunset hours # Compitible with Thomas Edison VX Edit, # not working for Thomas Edison default script ENABLE_THOMAS_EDISON = true TIMENIGHT = 22 TIMEDAY = 23 # Switch FIRE = 30 LIGHT = 31 GROUND = 32 TORCH = 33 #----------------------------------------------------------------------- # Setting of seosons. #----------------------------------------------------------------------- SUNNY = 25 RAIN = 26 SNOW = 27 OUTSIDE = 28 #----------------------------------------------------------------------- # Settings for Output to Game Variables option. #----------------------------------------------------------------------- # Set this to true to output the current time to game variables. DATABASE_OUTPUT = true # Game Variable to be used for time output. TIME = 2 #(Time in string format. Ex: "2:48 AM" or "02:48") MINUTES = 3 HOURS = 4 DAYS = 5 DAYNAME = 6 DAYDATE = 7 MONTHS = 8 MONTHNAME = 9 YEARS = 10 #----------------------------------------------------------------------- # Settings for time controlled screen toning #----------------------------------------------------------------------- # True will enable screen toning to be used by the script. USE_TONE = true # Sets the duration of tone changes (in frames) FADE_LENGTH = 450 # Sunny Tone # Defines tones to be used in the corresponding time periods defined above. # RED, GREEN, BLUE, GREY C1 = Tone.new(-100, -100, -40, 90) #Night C2 = Tone.new( -50, -50, -50, 0) #Dawn C3 = Tone.new( 0, 0, 0, 0) #Day C4 = Tone.new( 17, -51, -102, 0) #Sunset C5 = Tone.new(-100, -100, -40, 90) #Night # Defines anti-tones A1 = Tone.new( 100, 100, 40,-140) A2 = Tone.new( -50, -50, -50, 0) A3 = Tone.new( 0, 0, 0, 0) A4 = Tone.new( -17, 51, 102, 0) A5 = Tone.new( 100, 100, 40,-140) # Rain Tone # Defines tones to be used in the corresponding time periods defined above. # RED, GREEN, BLUE, GREY R1 = Tone.new(-110, -110, -50, 100) #Night R2 = Tone.new( -90, -90, -90, 40) #Dawn R3 = Tone.new( -60, -60, -60, 0) #Day R4 = Tone.new( -90, -90, -90, 40) #Sunset R5 = Tone.new(-110, -110, -50, 100) #Night # Defines anti-tones U1 = Tone.new( 110, 110, 50,-150) U2 = Tone.new( 90, 90, 90, -40) U3 = Tone.new( 60, 60, 60, 0) U4 = Tone.new( 90, 90, 90, -40) U5 = Tone.new( 110, 110, 50,-150) # Don't touch, not important DAY_DATE = [" 1st"," 2nd"," 3rd"," 4th"," 5th"," 6th"," 7th"," 8th"," 9th","10th", "11th","12th","13th","14th","15th","16th","17th","18th","19th","20th", "21st","22nd","23rd","24th","25th","26th","27th","28th","29th","30th" ] end
#============================================================================== # Scans Map Names for Toning #============================================================================== class RPG::MapInfo def name return @name.gsub(/\[.*\]/) {""} end def outside_tint? return @name.scan(/\[ATS\]/).size > 0 end end
#============================================================================== # Core Time System Engine #============================================================================== class Afhan_Time_System include ATS attr_accessor :day attr_accessor :day_name attr_accessor :days_passed attr_accessor :month attr_accessor :month_name attr_accessor :month_day attr_accessor :hour attr_accessor :minute attr_accessor :minute_length attr_accessor :year attr_accessor :frozen_time attr_accessor :map_infos attr_accessor :period def initialize @day = ATS::START_DAY % ATS::DAY_NAMES.length @days_passed = ATS::START_DAY @hour = ATS::START_HOUR @months = ATS::START_MONTH @minute = ATS::START_MINUTE @years = ATS::START_YEAR @frozen_time = false @map_infos = load_data("data/mapinfos.rvdata") @minute_length = 0 @period = 1 $ats_event_tone = false $ats_battle_tone = true $ats_anti_tone = Tone.new(0,0,0,0) end def update # ---- TIME ---- # @minute_length += 1 unless @frozen_time if @minute_length == ATS::SPEED @minute += 1 @minute_length = 0 end if @minute == 60 @hour += 1 @minute = 0 end if @hour == 24 @day += 1 @kadar_weather = 1 + rand(5 - 1 + 1) @hour = 0 end if @day > ATS::DAY_DATE.length @months += 1 @day = 0 end if @months > ATS::MONTH_NAMES.length @years += 1 @months = 0 end if ATS::DATABASE_OUTPUT $game_variables[ATS::TIME] = getTime end update_variables update_switchs update_weather update_tint end #----------------------------------------------------------------------- # Update Variables/Switchs #----------------------------------------------------------------------- def update_variables $game_variables[ATS::MINUTES] = @minute $game_variables[ATS::HOURS] = @hour $game_variables[ATS::YEARS] = @year $game_variables[ATS::DAYS] = @day $game_variables[ATS::DAYNAME] = getDayName $game_variables[ATS::DAYDATE] = getDate $game_variables[ATS::MONTHS] = @months $game_variables[ATS::MONTHNAME] = getMonthName $game_variables[ATS::YEARS] = @years end def update_switchs #--- time ---# if @period == 1 || @period == 5 $game_switches[ATS::NIGHT] = true $game_switches[ATS::DAWN] = false $game_switches[ATS::DAY] = false $game_switches[ATS::SUNSET] = false if ATS::ENABLE_THOMAS_EDISON $game_switches[ATS::TIMENIGHT] = true $game_switches[ATS::TIMEDAY] = false end elsif @period == 2 $game_switches[ATS::NIGHT] = false $game_switches[ATS::DAWN] = true $game_switches[ATS::DAY] = false $game_switches[ATS::SUNSET] = false if ATS::ENABLE_THOMAS_EDISON $game_switches[ATS::TIMENIGHT] = false $game_switches[ATS::TIMEDAY] = true end elsif @period == 3 $game_switches[ATS::NIGHT] = false $game_switches[ATS::DAWN] = false $game_switches[ATS::DAY] = true $game_switches[ATS::SUNSET] = false if ATS::ENABLE_THOMAS_EDISON $game_switches[ATS::TIMENIGHT] = false $game_switches[ATS::TIMEDAY] = true end elsif @period == 4 $game_switches[ATS::NIGHT] = false $game_switches[ATS::DAWN] = false $game_switches[ATS::DAY] = false $game_switches[ATS::SUNSET] = true if ATS::ENABLE_THOMAS_EDISON $game_switches[ATS::TIMENIGHT] = false $game_switches[ATS::TIMEDAY] = true end end #--- Thomas Alpha Edison ---# if ATS::ENABLE_THOMAS_EDISON if $game_switches[ATS::TIMENIGHT] $game_switches[ATS::FIRE] = false $game_switches[ATS::LIGHT] = false $game_switches[ATS::GROUND] = false $game_switches[ATS::TORCH] = false elsif $game_switches[ATS::TIMEDAY] $game_switches[ATS::FIRE] = true $game_switches[ATS::LIGHT] = true $game_switches[ATS::GROUND] = true $game_switches[ATS::TORCH] = true end end #--- day ---# if getDayName == ATS::DAY_NAMES[0] $game_switches[ATS::SUNDAY] = true $game_switches[ATS::MONDAY] = false $game_switches[ATS::TUESDAY] = false $game_switches[ATS::WEDNESDAY] = false $game_switches[ATS::THURSDAY] = false $game_switches[ATS::FRIDAY] = false $game_switches[ATS::SATURDAY] = false elsif getDayName == ATS::DAY_NAMES[1] $game_switches[ATS::SUNDAY] = false $game_switches[ATS::MONDAY] = true $game_switches[ATS::TUESDAY] = false $game_switches[ATS::WEDNESDAY] = false $game_switches[ATS::THURSDAY] = false $game_switches[ATS::FRIDAY] = false $game_switches[ATS::SATURDAY] = false elsif getDayName == ATS::DAY_NAMES[2] $game_switches[ATS::SUNDAY] = false $game_switches[ATS::MONDAY] = false $game_switches[ATS::TUESDAY] = true $game_switches[ATS::WEDNESDAY] = false $game_switches[ATS::THURSDAY] = false $game_switches[ATS::FRIDAY] = false $game_switches[ATS::SATURDAY] = false elsif getDayName == ATS::DAY_NAMES[3] $game_switches[ATS::SUNDAY] = false $game_switches[ATS::MONDAY] = false $game_switches[ATS::TUESDAY] = false $game_switches[ATS::WEDNESDAY] = true $game_switches[ATS::THURSDAY] = false $game_switches[ATS::FRIDAY] = false $game_switches[ATS::SATURDAY] = false elsif getDayName == ATS::DAY_NAMES[4] $game_switches[ATS::SUNDAY] = false $game_switches[ATS::MONDAY] = false $game_switches[ATS::TUESDAY] = false $game_switches[ATS::WEDNESDAY] = false $game_switches[ATS::THURSDAY] = true $game_switches[ATS::FRIDAY] = false $game_switches[ATS::SATURDAY] = false elsif getDayName == ATS::DAY_NAMES[5] $game_switches[ATS::SUNDAY] = false $game_switches[ATS::MONDAY] = false $game_switches[ATS::TUESDAY] = false $game_switches[ATS::WEDNESDAY] = false $game_switches[ATS::THURSDAY] = false $game_switches[ATS::FRIDAY] = true $game_switches[ATS::SATURDAY] = false elsif getDayName == ATS::DAY_NAMES[6] $game_switches[ATS::SUNDAY] = false $game_switches[ATS::MONDAY] = false $game_switches[ATS::TUESDAY] = false $game_switches[ATS::WEDNESDAY] = false $game_switches[ATS::THURSDAY] = false $game_switches[ATS::FRIDAY] = false $game_switches[ATS::SATURDAY] = true end #--- Month ---# if @months == 0 $game_switches[ATS::SPRING] = true $game_switches[ATS::SUMMER] = false $game_switches[ATS::AUTUMN] = false $game_switches[ATS::WINTER] = false elsif @months == 1 $game_switches[ATS::SPRING] = false $game_switches[ATS::SUMMER] = true $game_switches[ATS::AUTUMN] = false $game_switches[ATS::WINTER] = false elsif @months == 2 $game_switches[ATS::SPRING] = false $game_switches[ATS::SUMMER] = false $game_switches[ATS::AUTUMN] = true $game_switches[ATS::WINTER] = false elsif @months == 3 $game_switches[ATS::SPRING] = false $game_switches[ATS::SUMMER] = false $game_switches[ATS::AUTUMN] = false $game_switches[ATS::WINTER] = true end end #----------------------------------------------------------------------- # Weather #----------------------------------------------------------------------- def update_weather #--- Main ---# if @atur_ulang @random_time = 2 + rand(5 - 2 + 1) @time_change_weather = @hour + @random_time @atur_ulang = false end #--- Random ---# if @hours == @time_change_weather if @months == 0 if @kadar_weather == 1 @weather = 1 + rand(5 - 1 + 1) #25% elsif @kadar_weather == 2 @weather = 1 + rand(3 - 1 + 1) #50% elsif @kadar_weather == 3 @weather = 1 + rand(2 - 1 + 1) #75% elsif @kadar_weather == 4 @weather = 1 #100% end elsif @months == 1 if @kadar_weather == 1 @weather = 1 + rand(5 - 1 + 1) #75% elsif @kadar_weather == 2 @weather = 1 #100% end elsif @months == 2 if @kadar_weather == 1 @weather = 1 + rand(5 - 1 + 1) #65% elsif @kadar_weather == 2 @weather = 1 + rand(3 - 1 + 1) #75% elsif @kadar_weather == 3 @weather = 1 #100% end elsif @months = 3 if @kadar_weather == 1 @weather = 1 + rand(5 - 1 + 1) #25% elsif @kadar_weather == 2 @weather = 1 + rand(4 - 1 + 1) #50% elsif @kadar_weather == 3 @weather = 1 + rand(3 - 1 + 1) #75% elsif @kadar_weather == 4 @weather = 1 #100% end end @atur_ulang = true end #--- Switch ---# if @months ==0 if @weather == 1 @rain = false $game_switches[ATS::SUNNY] = true $game_switches[ATS::RAIN] = false $game_switches[ATS::SNOW] = false elsif @weather == 2 @rain = true $game_switches[ATS::SUNNY] = false $game_switches[ATS::RAIN] = true $game_switches[ATS::SNOW] = false elsif @weather == 3 @rain = true $game_switches[ATS::SUNNY] = false $game_switches[ATS::RAIN] = true $game_switches[ATS::SNOW] = false elsif @weather == 4 @rain = true $game_switches[ATS::SUNNY] = false $game_switches[ATS::RAIN] = true $game_switches[ATS::SNOW] = false elsif @weather == 5 @rain = true $game_switches[ATS::SUNNY] = false $game_switches[ATS::RAIN] = true $game_switches[ATS::SNOW] = false end elsif @months == 1 if @weather == 1 @rain = false $game_switches[ATS::SUNNY] = true $game_switches[ATS::RAIN] = false $game_switches[ATS::SNOW] = false elsif @weather == 2 @rain = false $game_switches[ATS::SUNNY] = true $game_switches[ATS::RAIN] = false $game_switches[ATS::SNOW] = false elsif @weather == 3 @rain = false $game_switches[ATS::SUNNY] = true $game_switches[ATS::RAIN] = false $game_switches[ATS::SNOW] = false elsif @weather == 4 @rain = true $game_switches[ATS::SUNNY] = false $game_switches[ATS::RAIN] = true $game_switches[ATS::SNOW] = false elsif @weather == 5 @rain = true $game_switches[ATS::SUNNY] = false $game_switches[ATS::RAIN] = true $game_switches[ATS::SNOW] = false end elsif @months == 2 if @weather == 1 @rain = false $game_switches[ATS::SUNNY] = true $game_switches[ATS::RAIN] = false $game_switches[ATS::SNOW] = false elsif @weather == 2 @rain = false $game_switches[ATS::SUNNY] = true $game_switches[ATS::RAIN] = false $game_switches[ATS::SNOW] = false elsif @weather == 3 @rain = true $game_switches[ATS::SUNNY] = false $game_switches[ATS::RAIN] = false $game_switches[ATS::SNOW] = true elsif @weather == 4 @rain = false $game_switches[ATS::SUNNY] = true $game_switches[ATS::RAIN] = false $game_switches[ATS::SNOW] = false elsif @weather == 5 @rain = true $game_switches[ATS::SUNNY] = false $game_switches[ATS::RAIN] = true $game_switches[ATS::SNOW] = false end elsif @months == 3 if @weather == 1 @rain = false $game_switches[ATS::SUNNY] = true $game_switches[ATS::RAIN] = false $game_switches[ATS::SNOW] = false elsif @weather == 2 @rain = false $game_switches[ATS::SUNNY] = true $game_switches[ATS::RAIN] = false $game_switches[ATS::SNOW] = false elsif @weather == 3 @rain = true $game_switches[ATS::SUNNY] = false $game_switches[ATS::RAIN] = false $game_switches[ATS::SNOW] = true elsif @weather == 4 @rain = true $game_switches[ATS::SUNNY] = false $game_switches[ATS::RAIN] = false $game_switches[ATS::SNOW] = true elsif @weather == 5 @rain = true $game_switches[ATS::SUNNY] = false $game_switches[ATS::RAIN] = false $game_switches[ATS::SNOW] = true end end #--- Weather on screen ---# if $game_switches[ATS::SUNNY] if $game_swithces[ATS::OUTSIDE] screen.weather(0, 0, 0) else screen.weather(0, 0, 0) end elsif $game_switches[ATS::RAIN] if $game_swithces[ATS::OUTSIDE] screen.weather(1, 4 || 5, 999) else screen.weather(0, 0, 0) end elsif $game_switches[ATS::SNOW] if $game_swithces[ATS::OUTSIDE] screen.weather(3, 4 || 5, 999) else screen.weather(0, 0, 0) end end end #----------------------------------------------------------------------- # Screen Tone Functions #----------------------------------------------------------------------- def update_tint(duration = ATS::FADE_LENGTH) return if $BTEST if ATS::USE_TONE && !$ats_event_tone && @map_infos[$game_map.map_id].outside_tint? if @rain #--- Rain Tone ---# if @hour >= ATS::T1[0] and @hour <= ATS::T1[1] @period = 1 screen.start_tone_change(ATS::R1,duration) $ats_anti_tone = ATS::U1 elsif @hour >= ATS::T2[0] and @hour <= ATS::T2[1] @period = 2 screen.start_tone_change(ATS::R2,duration) $ats_anti_tone = ATS::U2 elsif @hour >= ATS::T3[0] and @hour <= ATS::T3[1] @period = 3 screen.start_tone_change(ATS::R3,duration) $ats_anti_tone = ATS::U3 elsif @hour >= ATS::T4[0] and @hour <= ATS::T4[1] @period = 4 screen.start_tone_change(ATS::R4,duration) $ats_anti_tone = ATS::U4 elsif @hour >= ATS::T5[0] and @hour <= ATS::T5[1] @period = 5 screen.start_tone_change(ATS::R5,duration) $ats_anti_tone = ATS::U5 end elsif !@rain #--- Sunny Tone ---# if @hour >= ATS::T1[0] and @hour <= ATS::T1[1] @period = 1 screen.start_tone_change(ATS::C1,duration) $ats_anti_tone = ATS::A1 elsif @hour >= ATS::T2[0] and @hour <= ATS::T2[1] @period = 2 screen.start_tone_change(ATS::C2,duration) $ats_anti_tone = ATS::A2 elsif @hour >= ATS::T3[0] and @hour <= ATS::T3[1] @period = 3 screen.start_tone_change(ATS::C3,duration) $ats_anti_tone = ATS::A3 elsif @hour >= ATS::T4[0] and @hour <= ATS::T4[1] @period = 4 screen.start_tone_change(ATS::C4,duration) $ats_anti_tone = ATS::A4 elsif @hour >= ATS::T5[0] and @hour <= ATS::T5[1] @period = 5 screen.start_tone_change(ATS::C5,duration) $ats_anti_tone = ATS::A5 end end end else #--- No tone if in door ---# if !@map_infos[$game_map.map_id].outside_tint? screen.start_tone_change(Tone.new(0,0,0,0),duration) end end #--- Update on screen ---# def screen if $game_temp.in_battle return $game_troop.screen else return $game_map.screen end end #----------------------------------------------------------------------- # Get Name #----------------------------------------------------------------------- def getTime if ATS::AMPM # Formats a 12-Hour Clock if @hour > 12 hour1 = @hour - 12 if hour1 > 9 time = sprintf("%02d:%02d" + " PM", hour1, @minute) else time = sprintf("%01d:%02d" + " PM", hour1, @minute) end else if @hour > 9 time = sprintf("%02d:%02d" + " AM", @hour, @minute) else time = sprintf("%01d:%02d" + " AM", @hour, @minute) end end return time else # Formats a 24-Hour Clock time = sprintf("%02d:%02d", @hour, @minute) return time end end def getYears years = sprintf ("%02d", @years) return years end def getDayName weekday = (@day % ATS::DAY_NAMES.length) return ATS::DAY_NAMES[weekday] end def getDate days = (@day % ATS::DAY_DATE.length) return ATS::DAY_DATE[days] end def getMonthName month = (@months % ATS::MONTH_NAMES.length) return ATS::MONTH_NAMES[month] end
end
class Spriteset_Map #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias ats_initialize initialize def initialize $ats.update_variables if ATS::DATABASE_OUTPUT $ats.update_switchs if ATS::DATABASE_OUTPUT ats_initialize end end
#============================================================================== # Integrates the Time System into the Game System. #============================================================================== class Game_System # inits a ATS object alias ats_initialize initialize def initialize $ats = Afhan_Time_System.new ats_initialize end end
class Scene_Base include ATS alias afh8922_update update unless $@ def update afh8922_update if ATS::UPDATE_ONLY_ON_MAP $ats.update if $scene.is_a?(Scene_Map) else $ats.update unless $scene.is_a?(Scene_Title) end end end
#============================================================================== # Instantly updates screen tone when a new map is loaded. #============================================================================== class Game_Map alias ats_setup setup def setup(map_id) ats_setup(map_id) $ats_event_tone = false $ats.update $ats.update_tint(0) end end
#============================================================================== # Instantly updates screen tone when a battle starts. #============================================================================== class Spriteset_Battle alias ats_create_battleback create_battleback def create_battleback $ats.update_tint(0) ats_create_battleback end end
#============================================================================== # Temporarily disables auto-toning if an event tints the screen. #============================================================================== class Game_Interpreter alias ats_Interpreter_command_223 command_223 def command_223 $ats_event_tone = true ats_Interpreter_command_223 end end
#============================================================================== # Sets up the time window for the menu. #============================================================================== class Window_ATS < Window_Base include ATS def initialize super(0, 360, 180, WLH + 50) refresh end def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(30, -6, 125, 32, $ats.getMonthName+" "+$ats.getDate) self.contents.font.color = crisis_color self.contents.draw_text(30, -6, 125, 72, $ats.getDayName+" "+$ats.getTime) draw_icon(ATS::ICONTIME, 2, 7) end def update refresh end end
#============================================================================== # Adds the time window to the menu. #============================================================================== class Scene_Menu include ATS alias afh04_start start unless $@ def start @ats_window = Window_ATS.new if MENU_TIME_WINDOW @ats_window.y = MENU_TIME_WINDOW_COORDS if MENU_TIME_WINDOW afh04_start end # Update alias afh05_update update unless $@ def update afh05_update @ats_window.update if MENU_TIME_WINDOW end # Terminate alias afh06_terminate terminate unless $@ def terminate @time_stopped = @total_seconds @ats_stop = true @ats_window.dispose if MENU_TIME_WINDOW afh06_terminate end end
#============================================================================== # Adds the time window to the map. #============================================================================== class Scene_Map include ATS alias afh01_start start unless $@ def start @ats_window_map = Window_ATS.new if MAP_TIME_WINDOW @ats_window_map.x = MAP_TIME_WINDOW_COORDS[0] if MAP_TIME_WINDOW @ats_window_map.y = MAP_TIME_WINDOW_COORDS[1] if MAP_TIME_WINDOW afh01_start end # Update alias afh02_update update unless $@ def update if !$game_switches[ATS::MAP_TIME_WINDOWS] @ats_window_map.visible = false else @ats_window_map.visible = true end @ats_window_map.update if MAP_TIME_WINDOW afh02_update end # Terminate alias afh03_terminate terminate unless $@ def terminate @time_stopped = @total_seconds @ats_stop = true @ats_window_map.dispose if MAP_TIME_WINDOW afh03_terminate end end
#============================================================================== # Saves and Loads game time to/from save game file. #============================================================================== class Scene_File alias ats_write_save_data write_save_data def write_save_data(file) ats_write_save_data(file) Marshal.dump($ats, file) end alias ats_read_save_data read_save_data def read_save_data(file) ats_read_save_data(file) $ats = Marshal.load(file) end end
mo tanya kak, gimana buat script ini bisa update variable dan switch truss ke screen terus menerus. soalnya yang masih ini macet switchnya alias gak keupdate sebelum direfresh. klo dihunting2 dari script KTS sihh bisa diupdate truss.. | |
|