• 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.

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

226
Posts
8
Years
    • Seen Jul 19, 2023
    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.

    Screentone.jpg
     
    Last edited by a moderator:
    129
    Posts
    8
    Years
    • Seen Mar 23, 2023
    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.
     
    226
    Posts
    8
    Years
    • Seen Jul 19, 2023
    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.
     
    772
    Posts
    13
    Years
  • 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
     
    226
    Posts
    8
    Years
    • Seen Jul 19, 2023
    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