• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Day and Night

Webmaster Tyler

Owner of Pokemon Help
490
Posts
19
Years
  • All you need are:

    One Common Event.
    Switch: Day Time
    Switch: Night Time

    Common Events:

    Name: Day Night
    Event Start Condition: Parallel Process
    Event Commands: (start)

    <>Cycle
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>switch:daytime off
    <>switch: nigth time on
    <>set screen tone: 50,50,50,100
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>switch: nigth time off
    <>set screen tone: 100,100,100,100


    Now you can do what ever you want with it!
    O yea this is only for Rpg maker 2003
     

    Webmaster Tyler

    Owner of Pokemon Help
    490
    Posts
    19
    Years
  • srry for the Double Post
    Heres one for Rpg Maker XP
    #=======================================#
    # ■ class Game_Title #
    # written by Deke
    # Rewiten by Near Fantastica
    # 16.02.05
    #------------------------------------------------------------------------------#
    #=======================================#
    class Game_Time

    attr_accessor :minute_length

    def initialize
    @minute_length=2.0 #length of game minute in real seconds
    @hour_length= 60.0 #minute in an hour
    @day_length=24.0 #hours in a day
    @month_length=30.0 #days in a month
    @year_length=12.0 #months in a year
    @minutes=0 #starting minute count
    start_minute=56
    add_minutes(start_minute)
    start_hour=23 #starting hour count
    add_hours(start_hour)
    start_day=5 #starting day count
    add_days(start_day)
    start_month=1 #starting month count
    add_months(start_month-1)
    start_year=129 #starting year count
    add_years(start_year)
    end

    def add_minutes(minutes)
    @minutes +=minutes
    end

    def add_hours(hours)
    @minutes +=hours*@hour_length
    end

    def add_days(days)
    @minutes += days*@hour_length*@day_length
    end

    def add_months(months)
    @minutes +=months * @hour_length*@day_length*@month_length
    end

    def add_years(years)
    @minutes += years * @hour_length*@day_length*@month_length * @year_length
    end


    def get_year
    minutes=get_total_minutes
    year=minutes / @hour_length / @day_length / @month_length / @year_length
    return year
    end

    def get_month
    minutes=get_total_minutes
    month=minutes / @hour_length / @day_length / @month_length % @year_length + 1
    return month
    end

    def get_day
    minutes=get_total_minutes
    day=minutes / @hour_length / @day_length % @month_length
    return day
    end

    def get_hour
    minutes=get_total_minutes
    hour=minutes / @hour_length % @day_length
    return hour
    end

    def get_total_minutes
    total_sec=Graphics.frame_count / Graphics.frame_rate
    minute=(total_sec/@minute_length+@minutes)
    return minute
    end

    def get_minute
    minutes=get_total_minutes % @hour_length
    return minutes
    end

    def get_tone
    period_length=Math::PI*(get_hour / @day_length)
    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 # of class Game_Time

    #=======================================#
    # ■ 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
    self.contents.clear
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    @minute=$game_time.get_minute.floor
    hour = $game_time.get_hour
    pm_flag= hour >=12 ? true : false
    hour= hour >= 12 ? hour-12 : hour
    day=$game_time.get_day
    month=$game_time.get_month
    year=$game_time.get_year
    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)
    text = sprintf("%02d-%02d-%02d", month, day, year)
    self.contents.font.color=system_color
    self.contents.draw_text(4,32,120,32,text)
    end

    #--------------------------------------------------------------------------
    def update
    if $game_time.get_minute.floor != @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 :outside_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
    @minute=$game_time.get_minute.floor
    $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
    $light_effects.update
    conditional1 =$game_temp.outside_array[$game_map.map_id] and $game_time.get_minute.floor != @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.get_minute.floor
    $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 Scene_Load
    def read_save_data(file)
    characters = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    $game_system = Marshal.load(file)
    $game_switches = Marshal.load(file)
    $game_variables = Marshal.load(file)
    $game_self_switches = Marshal.load(file)
    $game_screen = Marshal.load(file)
    $game_actors = Marshal.load(file)
    $game_party = Marshal.load(file)
    $game_troop = Marshal.load(file)
    $game_map = Marshal.load(file)
    $game_player = Marshal.load(file)
    $game_time =Marshal.load(file) #Added Line
    if $game_system.magic_number != $data_system.magic_number
    $game_map.setup($game_map.map_id)
    $game_player.center($game_player.x, $game_player.y)
    end
    $game_party.refresh
    end
    end # of Scene_Load updates

    #=======================================================
    class Scene_Save
    def write_save_data(file)
    characters = []
    for i in 0...$game_party.actors.size
    actor = $game_party.actors
    characters.push([actor.character_name, actor.character_hue])
    end
    Marshal.dump(characters, file)
    Marshal.dump(Graphics.frame_count, file)
    $game_system.save_count += 1
    $game_system.magic_number = $data_system.magic_number
    Marshal.dump($game_system, file)
    Marshal.dump($game_switches, file)
    Marshal.dump($game_variables, file)
    Marshal.dump($game_self_switches, file)
    Marshal.dump($game_screen, file)
    Marshal.dump($game_actors, file)
    Marshal.dump($game_party, file)
    Marshal.dump($game_troop, file)
    Marshal.dump($game_map, file)
    Marshal.dump($game_player, file)
    Marshal.dump($game_time,file) # Added Line
    end
    end # of Scene_Save updates

    #========================================================

    class Game_Map
    #--------------------------------------------------------------------------
    # ● Refer the attr
    #--------------------------------------------------------------------------
    attr_reader :outside
    attr_reader :map_id
    #--------------------------------------------------------------------------
    # ● Outside
    #--------------------------------------------------------------------------
    def outside
    return $game_temp.outside_array[@map_id]
    end
    end

    #==============================================================================
    # ■ 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
    if $game_time.get_hour > 7 and $game_time.get_hour < 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

    #==============================================================================
    # ■ 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

    #==============================================================================
    # ■ 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 light effects
    #--------------------------------------------------------------------------
    def update
    $light_effects = Light_Effect_System.new
    les_scene_title_update
    end
    end

    Make person appear at night?
    Change

    Code:
    def update
    if $game_time.get_hour > 7 and $game_time.get_hour < 14
    hide
    else
    show
    end
    end
    to
    Code:
    def update
    if $game_time.get_hour > 7 and $game_time.get_hour < 14
    hide
    $game_switches[1] = true
    else
    show
    $game_switches[1] = false
    end
    end
    On day switch 0001 will be on.
    24-hour clock?
    Code:
    def refresh
    self.contents.clear
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    @minute=$game_time.get_minute.floor
    hour = $game_time.get_hour
    day=$game_time.get_day
    month=$game_time.get_month
    year=$game_time.get_year
    text=sprintf("%02d:%02d",hour,@minute)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 120, 32, text, 2)
    text = sprintf("%02d-%02d-%02d", month, day, year)
    self.contents.font.color=system_color
    self.contents.draw_text(4,32,120,32,text)
    end
     

    funnybunny

    Advanced RM2k(3) Coder
    178
    Posts
    19
    Years
  • Webmaster Tyler said:
    All you need are:

    One Common Event.
    Switch: Day Time
    Switch: Night Time

    Common Events:

    Name: Day Night
    Event Start Condition: Parallel Process
    Event Commands: (start)

    <>Cycle
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>switch:daytime off
    <>switch: nigth time on
    <>set screen tone: 50,50,50,100
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>switch: nigth time off
    <>set screen tone: 100,100,100,100


    Now you can do what ever you want with it!
    O yea this is only for Rpg maker 2003

    This won't work unless you have one big map, and I don't think most people will have. You code will reset once you have teleported(I think).

    I would do it like this:

    <>Cycle
    <>var night +1
    <>If var night = 300
    <>switch:daytime off
    <>switch: nigth time on
    <>set screen tone: 50,50,50,100
    <>End
    <>If var night >= 600
    <>switch:daytime on
    <>switch: nigth time off
    <>set screen tone: 100,100,100,100
    <>Set var night to 0
    <>End
    <>wait 1.0
    <>End cycle

    This will also work when you teleport to an other map
     

    Webmaster Tyler

    Owner of Pokemon Help
    490
    Posts
    19
    Years
  • funnybunny said:
    This won't work unless you have one big map, and I don't think most people will have. You code will reset once you have teleported(I think).

    I would do it like this:

    <>Cycle
    <>var night +1
    <>If var night = 300
    <>switch:daytime off
    <>switch: nigth time on
    <>set screen tone: 50,50,50,100
    <>End
    <>If var night >= 600
    <>switch:daytime on
    <>switch: nigth time off
    <>set screen tone: 100,100,100,100
    <>Set var night to 0
    <>End
    <>wait 1.0
    <>End cycle

    This will also work when you teleport to an other map

    But then if you use urs then if you go into a house it would be day and night in there to!
     

    funnybunny

    Advanced RM2k(3) Coder
    178
    Posts
    19
    Years
  • Webmaster Tyler said:
    But then if you use urs then if you go into a house it would be day and night in there to!
    Yes, but you can change it with the tint screen thing(same with yours too you know) but with my code the time will keep running so you can use the conditions better and you actully know when it is going to be day or night.

    just place this after the teleport event when you enter the house

    <>set screen tone: 100,100,100,100 wait 0.0

    and place this after the teleport event when you leave the house

    <>IF nigth time on
    <>set screen tone: 50,50,50,100 wait 0.0
    <>End
    <>IF daytime on
    <>set screen tone: 100,100,100,100 wait 0.0
    <>End

    That would fix the problem, also you can add the second code to a common event and call that, would save some time if you want to change something.
     

    rubyrulez

    Back in Action...again...
    578
    Posts
    20
    Years
  • Well, here is how I programmed the Pokemon: Dawn Day/Night system. First and Foremost, you need to program the clock.

    Code:
    <>Branch if Var [Hours] is 0 or more
     <>Tint: (R30, G30, B70, S120), Wait 1 sec
     <>
    :Else Handler
     <>
    :End
    <>Branch if Var [Hours] is 6 or more
     <>Tint: (R100, G60, B60, S120), Wait 1 sec
     <>
    :Else Handler
     <>
    :End
    <>Branch if Var [Hours] is 9 or more
     <>Tint: (R100, G100, B100, S100), Wait 1 sec
     <>
    :Else Handler
     <>
    :End
    <>Branch if Var [Hours] is 18 or more
     <>Tint: (R100, G60, B60, S120), Wait 1 sec
     <>
    :Else Handler
     <>
    :End
    <>Branch if Var [Hours] is 20 or more
     <>Tint: (R30, G30, B70, S120), Wait 1 sec
     <>
    :Else Handler
     <>
    :End
    <>

    It works for me...
     

    Webmaster Tyler

    Owner of Pokemon Help
    490
    Posts
    19
    Years
  • rubyrulez said:
    Well, here is how I programmed the Pokemon: Dawn Day/Night system. First and Foremost, you need to program the clock.

    Code:
    <>Branch if Var [Hours] is 0 or more
     <>Tint: (R30, G30, B70, S120), Wait 1 sec
     <>
    :Else Handler
     <>
    :End
    <>Branch if Var [Hours] is 6 or more
     <>Tint: (R100, G60, B60, S120), Wait 1 sec
     <>
    :Else Handler
     <>
    :End
    <>Branch if Var [Hours] is 9 or more
     <>Tint: (R100, G100, B100, S100), Wait 1 sec
     <>
    :Else Handler
     <>
    :End
    <>Branch if Var [Hours] is 18 or more
     <>Tint: (R100, G60, B60, S120), Wait 1 sec
     <>
    :Else Handler
     <>
    :End
    <>Branch if Var [Hours] is 20 or more
     <>Tint: (R30, G30, B70, S120), Wait 1 sec
     <>
    :Else Handler
     <>
    :End
    <>

    It works for me...


    Yours looks really good i really like it :shocked:
     

    funnybunny

    Advanced RM2k(3) Coder
    178
    Posts
    19
    Years
  • rubyrulez said:
    Well, here is how I programmed the Pokemon: Dawn Day/Night system. First and Foremost, you need to program the clock.

    It works for me...
    would your code not change color all the time? sinds you used the "is # or more" instaid of the "same as", well if you tested it and it works good job then :).

    PS I'm not sute if it is a paralel event of a call one. And the else cases can be removed, the have no function
     

    rubyrulez

    Back in Action...again...
    578
    Posts
    20
    Years
  • funnybunny said:
    would your code not change color all the time? sinds you used the "is # or more" instaid of the "same as", well if you tested it and it works good job then :).

    PS I'm not sute if it is a paralel event of a call one. And the else cases can be removed, the have no function

    Well, since there is no option that lets you choose 2 numbers and the event occurs when the value of the variable is between those 2 numbers, I used that system and it works extremely well for me. Using the 'same as' would make it more difficult, as you would have to program the event for each hour. BTW, the event is a call event.
     

    funnybunny

    Advanced RM2k(3) Coder
    178
    Posts
    19
    Years
  • Well I was thinking about your code and it still seems weird, Example:

    var hour = 10 and you call the event because you came out of a house where the tint is (R100, G100, B100, S100)
    Code:
    <>Branch if Var [Hours] is 0 or more
     <>Tint: (R30, G30, B70, S120), Wait 1 sec
     <>
    :End
    What the code will do is change the tint to(R30, G30, B70, S120)
    after a second it will continu to the next part of coding,
    Code:
    <>Branch if Var [Hours] is 6 or more
     <>Tint: (R100, G60, B60, S120), Wait 1 sec
     <>
    :End
    Because the variable is also higher then 6 he will then change the tint to (R30, G30, B70, S120) and continu to the next part of coding.
    Code:
    <>Branch if Var [Hours] is 9 or more
     <>Tint: (R100, G100, B100, S100), Wait 1 sec
     <>
    :End
    Same here.
    Code:
    <>Branch if Var [Hours] is 18 or more
     <>Tint: (R100, G60, B60, S120), Wait 1 sec
     <>
    :End
    <>Branch if Var [Hours] is 20 or more
     <>Tint: (R30, G30, B70, S120), Wait 1 sec
     <>
    :End
    this part he will skip 'cause the Branch prevents it.

    So the result is when this event is called, the screen first goes dark to change back to the original tint :\
    That seems a bit weird to me, I didn't test it but this is what will happen IMO(I could be wrong).
     

    rubyrulez

    Back in Action...again...
    578
    Posts
    20
    Years
  • Actually, it does work perfectly, because coding like that acts as an in-between command (as I said, you can't choose 2 values and tell the event to occur between those variables.) This style of coding acts like choosing 2 values and having the event occur between. I would reccomend testing it before you say something like that...
     

    funnybunny

    Advanced RM2k(3) Coder
    178
    Posts
    19
    Years
  • rubyrulez said:
    Actually, it does work perfectly, because coding like that acts as an in-between command (as I said, you can't choose 2 values and tell the event to occur between those variables.) This style of coding acts like choosing 2 values and having the event occur between. I would reccomend testing it before you say something like that...
    ah I see, okay that is solved then :)

    As for the testing, I don't have the clock code from you so I can't realy fully test it. Maybe post that too.
     

    rubyrulez

    Back in Action...again...
    578
    Posts
    20
    Years
  • funnybunny said:
    ah I see, okay that is solved then :)

    As for the testing, I don't have the clock code from you so I can't realy fully test it. Maybe post that too.

    Ah, now the clock code is very extensive, so I will post a general version of it.
    The event is a Parallel Process event

    Code:
    <>Wait 1 sec
    <>Var Oper: [Seconds] +1
    <>Branch if Var: [Seconds] is 60 or more
        <>Var Oper: [Minutes] +1
        <>Var Oper: [Seconds] Set 0
        <>Branch if Var: [Minutes] is 60 or more
            <>Var Oper: [Hours] +1
            <>Var Oper: [Minutes] Set 0
            <>Var Oper: [Seconds] Set 0

    The clock I coded also includes Days, Months and Years (30 days per month, though.), and it is also set to change seasons based on the month, but this is the basic version of my clock. BTW, the wait command won't stop the hero from moving, what it does is count off the seconds and add 1 to the Variable seconds. After the Seconds variable hits 60, it resets and 1 is added to the vairable minutes. After that hits 60, it will add 1 to the variable hours and reset both minutes and seconds. If you want to go further, once the hours variable hits 24, reset it and add 1 to the day variable, and so on...

    Hope this helps...
     
    61
    Posts
    19
    Years
  • Webmaster Tyler said:
    All you need are:

    One Common Event.
    Switch: Day Time
    Switch: Night Time

    Common Events:

    Name: Day Night
    Event Start Condition: Parallel Process
    Event Commands: (start)

    <>Cycle
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>switch:daytime off
    <>switch: nigth time on
    <>set screen tone: 50,50,50,100
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>wait 60 seconds
    <>switch: nigth time off
    <>set screen tone: 100,100,100,100


    Now you can do what ever you want with it!
    O yea this is only for Rpg maker 2003


    with this one, when I go into a house or building it will come up with an error message. So whats wrong with it...
     
    Back
    Top