Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Help with Dynamic Time System Gliche
TheCableGuy
post Nov 16 2011, 07:46 AM
Post #1


Level 5
Group Icon

Group: Member
Posts: 68
Type: Mapper
RM Skill: Beginner




Anyone Familiar with eharper256's Dynamic Time System?

Ran into a Bug with it's Time Display. Normally, you can set it to display the Time/Date up in the Corner of the screen. That works fine up until 9 pm (21:00), then the display vanishes and will not come back. I can't figure out what's causing it. The Demo Provided with the Script actually has the same Bug, so I believe it is a Design Flaw of the Scripter but he does not appear to be working on it anymore and I don't believe he'll get around to fixing it any time soon.

It's a Complicated System with multiple Scripts and Common Events but it's the only one I've gotten working.

This is the Setup Script

CODE
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#--Dynamic Time System--
#--VERSION 5.1--
#By JT (aka. eharper256)
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#Feel free to use in your projects!
#Just keep this comment; thanks!
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#Change the variables here to choose your default settings.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#Version 5 fixes a pretty big frackin' error that occured
#with saves. (Errors with "[ ]" not being defined,
#which occured because a loaded save did not have
#any stored global variables loaded with it...)
#Of course, it does this by loading all of its global defintions
#through this new upgraded pseudo-script module.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#Version 5.1 includes a modified watch module
#originally created by robot 79796.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

#SWITCH SETTINGS
#You define a number of global YES/NO questions for the system here.
#To change something, alter the true/false to its opposite.
#Each setting is explained in the comments below it.
class Game_Switches
  def initialize
    @data = []
    #--------------------------------------------------------------------------
    @data[378] = false # Seasonal Variation
    #--------------------------------------------------------------------------
    #Do you want tilesets to change dependant on
    #the season? If not, set this to FALSE.
    #You also don't need to bother setting up
    #the other season stuff if its FALSE.
    #If it is FALSE, then only the weather generator
    #even bothers looking at seasons.
    #Of course, your starting season depends on
    #the date you start.
    #--------------------------------------------------------------------------
    @data[391] = false # Weather Background Sound Muffler
    #--------------------------------------------------------------------------
    #Do you want to be able to still hear the effects
    #of the Weather when you're inside with
    #the 'Is Inside?' switch on?
    #By default, this is false (as in, the muffler is disengaged)
    #If you DON'T want to hear BGS changes, make this TRUE.
    #--------------------------------------------------------------------------
    @data[394] = false # Use Weather Related fogs?
    #--------------------------------------------------------------------------
    #By making this true, you're allowing the weather generator to
    #change the currently active fog to suit the weather conditions.
    #In areas where you want to use a custom fog, make sure to
    #set this switch off manually (394).
    #--------------------------------------------------------------------------
    @data[389] = false # Disable the FAST-TONE feature?
    #--------------------------------------------------------------------------
    #In early versions of the DTS, many people
    #didn't like the fact that the tone changed slowly
    #when you stepped out of a building at night.
    #Personally; I thought it was like ones eyes adjusting
    #to the new conditions, and liked it, but whatever...
    #In any case, Fast-Tone is now on by default.
    #Things will fade to darkness much quicker now,
    #and the extra Fast-Tone event automatically
    #detects when it is needed.
    #**If you prefer the old effect, make this TRUE**
    #--------------------------------------------------------------------------
    @data[381] = true # Start the game with the watch on?
    #--------------------------------------------------------------------------
    #Created by robot 79796, and slightly modified by me, the watch creates a
    #small window in the top left hand corner of the screen that dynamically
    #updates the current time and date. You can switch it on and off at any time
    #by flipping this switch. Having it TRUE means it'll be on straight away,
    #which may not be good if you have any kind of intro to your game.
    end
end

class Game_Variables
#VARIABLE SETTINGS
#You define a number of global values for the system here.
#To change something, alter its value to a different number.
#Each variable, and valid numbers, are explained in the comments below it.
#ACTUALLY, LOL, in version 5, you only define ONE variable here, ROFL.
#I Say that above because more might be here in future...
  def initialize
    @data = []
    #--------------------------------------------------------------------------
    @data[140] = 0  # Default Time-Flow Speed
    #--------------------------------------------------------------------------
    #Choose which of the timeflow speeds you want to
    #start with. You can change the rate of times
    #flow later by simply changing this variable,
    #assigning a value from 0 to 4 (normal flows)
    #or 5 (worldmaptime special flow).
    #The actual values for time flow speed are defined in the JT_DTS class.
    #--------------------------------------------------------------------------
  end
end

class JT_DTS
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#>>>TIMEFLOW SETUP<<<
#Integral part of the DTS since Version 1...
#Pseudo-Scripted version all new for Version 5!
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  $timeflowspeeds = Array.new(4)
#Creates a global array for use below.
#Though technically you could have more than
#5 timeflow speeds, the system isn't actually
#setup to recognise more than 5 and might
#hang unless you shuffle stuff around.
#Therefore, don't alter this for now, please.
  $timeflowspeeds = [40, 20, 10, 5, 60]
#Setup your timeflow speeds here. New in Version 4.
#The number is literally how many FRAMES
#constitutes a minute in the time system.
#The value retrieved from this array
#depends on variable 140, the Time Flow Speed,
#set up to its default below...
#DEFAULTS:
#0 is Normal (default 40 frames to a minute)
#1 is Fast (default 20 frames to a minute)
#2 is Very Fast (default 10 frames to a minute)
#3 is Uber-fast (default 5 frames to a minute)
#4 is Sloooow (default 60 frames to a minute)\

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#>>>DAYS SETUP<<<
#All new stuff for Version 4!
#Pseudo-Scripted version all new for Version 5!
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  $daynames = Array.new(7)
#The Above creates a global array.
#If you want more or less days in a week,
#Please change the number in brackets from 7
#to whatever. Ensure this value is the same as
#$weeklength, below.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  $weeklength = 7
#A simple global variable.
#Set it to the number of days there are in a week.
#Ensure this number is the same as the
#one defined in $daynames, above.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  $daynames = ["Null", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
  "Saturday", "Sunday"]
#Please Ignore the "Null". Do not delete it.
#It ensures there is a value for 0th day
#(which of course, doesn't exist).
#---------------------------------------------------------
#The Above Array stores the names of your days.
#Change 'em to suit your game
#But Ensure each day has quotation marks- ""
#around its name. Also make sure you've
#got the same amount of values that you've
#already defined. (7 or whatever)

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#>>>MONTHS SETUP<<<
#All new stuff for Version 4!
#Pseudo-Scripted version all new for Version 5!
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  $monthnames = Array.new(12)
  $monthlengths = Array.new(12)
  $monthseasons = Array.new(12)
#The Above creates three global arrays.
#If you want more or less months,
#Please change the number in brackets from 12
#to whatever.Ensure the three numbers are
#the same, or some months might return nil;
#which potentially screws stuff up.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  $monthnames = ["Null", "January", "February", "March", "April", "May",
  "June", "July", "August", "September", "October", "November", "December"]
#Please Ignore the "Null". Do not delete it.
#It ensures there is a value for 0th month
#(which of course, doesn't exist).
#---------------------------------------------------------
#The Above Array stores the names of your months.
#Change 'em to suit your game
#But Ensure each month has quotation marks- ""
#around its name. Also make sure you've
#got the same amount of values that you've
#already defined. (12 or whatever)
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  $monthlengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
#Please Ignore the first "0". Do not delete it.
#It ensures there is a value for 0th month
#(which of course, doesn't exist).
#---------------------------------------------------------
#The Above Array stores the how long (in days)
#each of your months is.
#Change 'em to suit your game
#No need for "" marks here.
#Just make sure you've
#got the same amount of values that you've
#already defined. (12 or whatever)
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  $monthseasons = [0, 3, 3, 0, 0, 0, 1, 1, 1, 2, 2, 3, 3]
#Please Ignore the first "0". Do not delete it.
#It ensures there is a value for 0th month
#(which of course, doesn't exist).
#0 = Spring, 1 = Summer, 2 = Autumn, 3 = Winter
#---------------------------------------------------------
#The Above Array stores which season
#each of your months is.
#Change 'em to suit your game.
#No need for "" marks here.
#Just make sure you've
#got the same amount of values that you've
#already defined. (12 or whatever)

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#>>>SEASONS SETUP<<<
#All new stuff for Version 4!
#Pseudo-Scripted version all new for Version 5!
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  $seasontilesets = Array.new(3)
  $seasontilesets = [0, 50, 100, 150]
#These are of course the values used for the 0, 1, 2, 3
#settings from above. Spring uses the default tileset.
#The array helps to store how many tilesets to add
#when changing the seasonal tileset.
#---------------------------------------------------------
#So, in the default setup, if you wanted seasons for
#the Grasslands set (ID 1), you'd put the Summer version
#of the tileset at ID 51 (1+50), the Autumn version at 101 (1+100),
#and the Winter version at 151 (1+150). Spring is default.
#---------------------------------------------------------
#Obviously, this means nothing if the 'Use Seasonal variations' switch is off...

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#>>>SPECIAL DAYS SETUP<<<
#Special days upgrade all new for Version 5!
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  $specialdays = Array.new(6)
#How many special days exist in your world? Change the above number to the
#correct amount required. Be sure you define exactly the same number of day
#names in $specialdaynames, and exactly the same number of instances in
#$specialwhatmonth and $specialwhatdate. All of these are below.
  $specialdaynames = ["Null", "New Year's Day", "Lovers Day", "White Day",
  "Springwatch Day", "Harvest Festival", "Silent Night"]
#Please Ignore the "Null". Do not delete it.
#It ensures there is a value for 0th special day
#(which of course, doesn't exist).
#---------------------------------------------------------
#The Above Array stores the names of your special days.
#Change 'em to suit your game
#But Ensure each day has quotation marks- ""
#around its name. Also make sure you've
#got the same amount of values that you've
#already defined above.
  $specialwhatdate = [0, 1, 14, 10, 25, 18, 25]
  $specialwhatmonth = [0, 1, 2, 3, 3, 8, 12]
#Please Ignore the first "0". Do not delete it.
#It ensures there is a value for 0th special day
#(which of course, doesn't exist).
#---------------------------------------------------------
#Its the british format of date/month,
#So, in the default: 14/2 is 'Lovers day', or 25/12 is 'Silent Night'
#Since they're that way around, I thought I'd point it out
#for the benefit of you americans out there.
#---------------------------------------------------------
#The Above Array stores the precise location
#of the special day in the calendar format.
#Change it to match the days you've entered.
#No need for "" marks here.
#Just make sure you've
#got the same amount of values that you've
#already defined above.

end

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# >>>SCENE_SAVE<<< Modification (Aliased')
# This saves global settings when you save a game; preventing cock-ups when
# you load a file. This ~might~ render your old saves useless, sorry.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
class Scene_Save < Scene_File
  
  alias JT_DTS_write_save_data write_save_data
  
  def write_save_data(file)
    JT_DTS_write_save_data(file)
    Marshal.dump($JT_DTS, file)
  end
  
end

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# >>>SCENE_SAVE<<< Modification (Aliased')
# This loads global settings.
# This ~might~ render your old saves useless, sorry.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
class Scene_Load < Scene_File
  
  alias JT_DTS_read_save_data read_save_data
  
  def read_save_data(file)
    JT_DTS_read_save_data(file)
    $JT_DTS      = Marshal.load(file)
  end
  
end


The Timedisplay

CODE
#==============================================================================
# ** Window_Timewindow
#------------------------------------------------------------------------------
#    By Robot 79796
#    modified by eharper256
#------------------------------------------------------------------------------
# for eharper256's Dynamic Time System
#------------------------------------------------------------------------------
#  This places a compact 'digital watch' type window on the playfield.
#  Alterations: Smaller window, much better syntax.
#==============================================================================


class Time_Window < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(440, 0, 200, 75)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Arial"
    self.contents.font.size = 18
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    if $game_variables[142] >= 12
      if $game_variables[141] <= 10
        self.contents.draw_text(0, -20, 170, 62, "Time: #{$game_variables[142]}:0#{$game_variables[141]} pm")
      else
        self.contents.draw_text(0, -20, 170, 62, "Time: #{$game_variables[142]}:#{$game_variables[141]} pm")
      end
    else
      if $game_variables[141] <= 10
        self.contents.draw_text(0, -20, 170, 62, "Time: #{$game_variables[142]}:0#{$game_variables[141]} am")
      else
        self.contents.draw_text(0, -20, 170, 62, "Time: #{$game_variables[142]}:#{$game_variables[141]} am")
      end
    end
    self.contents.font.color = normal_color
    $datesuffix = $game_variables[143]
    if $datesuffix > 30
      $datesuffix -= 30
    end
    if $datesuffix > 20
      $datesuffix -= 20
    end
    if $datesuffix > 10
      $datesuffix = 4
    end
    if $datesuffix == 1
      $datesuffix = "st"
    elsif $datesuffix == 2
      $datesuffix = "nd"
    elsif $datesuffix == 3
      $datesuffix = "rd"
    else
      $datesuffix = "th"
    end
    self.contents.draw_text(0, 5, 180, 60, "#{$game_variables[138]}, #{$game_variables[137]}, #{$game_variables[143]}#{$datesuffix}",0)
    self.contents.font.color = normal_color

  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end


The Bulk of the system is contained in Multiple Common Events but I can't copy and paste those.
But this is the forum it's posted in eharper256's Dynamic Time System
Go to the top of the page
 
+Quote Post
   
Night_Runner
post Nov 17 2011, 06:00 AM
Post #2


Level 50
Group Icon

Group: +Gold Member
Posts: 1,529
Type: Scripter
RM Skill: Undisclosed




The download links there weren't working, so I downloaded it from here link.
I'm pretty sure it's the same version happy.gif

Anyway, the problem's just a small mistake in a common event
Before

That section highlighted turns off all switches in the range, and switch 381 activates the HUD, so I've simple changed it:
After

So it no longer includes switch 381 smile.gif


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
TheCableGuy
post Nov 17 2011, 06:58 AM
Post #3


Level 5
Group Icon

Group: Member
Posts: 68
Type: Mapper
RM Skill: Beginner




QUOTE (Night_Runner @ Nov 17 2011, 06:00 AM) *
The download links there weren't working, so I downloaded it from here link.
I'm pretty sure it's the same version happy.gif

Anyway, the problem's just a small mistake in a common event
Before

That section highlighted turns off all switches in the range, and switch 381 activates the HUD, so I've simple changed it:
After

So it no longer includes switch 381 smile.gif


Woot! Thanks NR. That's perfect.

If I couldn't get it working, I would have had to try getting a different System working and I've already written this one too far into the existing Project so this is great.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th June 2013 - 09:38 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker