• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

[Scripting Question] How to force it to be night on a specific map

  • 224
    Posts
    9
    Years
    • Seen Feb 20, 2025
    Does anyone have another way to temporarily force (or simulate) night on a map?

    Changing screen tones is not fully working for me. In the example below, the tone is set to (-127, -127, 25, 68) (Night). It seems to be working (left screen); but when walking to some areas of the same map, the tone suddenly changes without any reason (no particular event, no map connection...) - here, in a deeper blue. I have no clue why the tone keeps changing (randomly?) in some places.

    [PokeCommunity.com] How to force it to be night on a specific map
     
    Last edited by a moderator:
    The script section PField_Time implements a method pbGetTimeNow, which you can override to force a certain time of day on a given map.

    Code:
    def pbGetTimeNow
      time=Time.now
      if $game_map.map_id == 10 #Your map id here
        #Set time to midnight of the current day
        time = Time.new(time.year,time.month,time.day,0,0)
      end
      return time
    end
    Note: If you're using an extension that already overrides pbGetTimeNow, like -FL-'s "Unreal time system", doing the above WILL screw that up. Also, this won't work if you don't have time of day shading on already...

    Note: I haven't tested the above code.
     
    Thank you! As it is your solution is not entirely satisfying since I need to change time only temporarily and on multiple maps. So I thought using a global switch could do the trick (I use 15.1):

    Code:
    def pbGetTimeNow
      return Time.now
      if $game_switches[70]==true
        time = Time.new(time.year,time.month,time.day,0,0)
      end
      return time
    end

    But it doesn't do anything. Shading is enabled.

    It looks like there are plenty of ways to question the actual time of the game, but no way to change it. That's why it may be easier to simulate it, but I can't do that properly with changing screen tones.
     
    your code isn't being ran because of the return Time.now statement at the beginning

    try something as this (not tested)
    Code:
    def pbGetTimeNow
      if $game_switches[70]==true
        return Time.new(time.year,time.month,time.day,0,0)
      end
      return Time.now
    end
     
    Thank you but it doesn't do anything neither (by that I mean the time remains unchanged).

    EDIT: By the way all of this does not explain why, when I change the screen tone in an event (which could do the trick), i've got different blue tones such as displayed in first post.

    EDIT2: Issue solved by using FL's Unreal Time System.
     
    Last edited:
    Back
    Top