Make your game run off the internal clock
#1
Make your game run off the internal clock
Bob151jr
Jun 9 2006

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Well I have been studing script and for my first real script I edited Window_PlayTime to let the computers internal clock show in the playtime window (changed to Time)

From here someone can take it and change it to have day and night.

Change Window_Playtime to this:
Code:
#==============================================================================
# ■ Window_PlayTime
#------------------------------------------------------------------------------
#  メニュー画面でプレイ時間を表示するウィンドウです。
#==============================================================================

class Window_PlayTime < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype  # "Play Time" window font
    self.contents.font.size = $defaultfontsize
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, "Time")
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    t = Time.now
    text = t.strftime("%m/%d/%Y %I:%M:%S %p")
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 32, 120, 32, text, 2)
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end


This will show the Day/Month/Year Hour:Min:Sec (Am or Pm)
Example: 06/09/06 11:40:26 PM
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Enemies Level UP and Game Difficulty Options Combined DrakoShade 0 2,448 03-27-2006, 01:00 PM
Last Post: DrakoShade
  New Game + Script Dubealex 0 2,423 03-09-2005, 01:00 PM
Last Post: Dubealex



Users browsing this thread: 1 Guest(s)