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

[Custom Feature Question] Global weather but only on outdoor maps

3
Posts
245
Days
    • Seen Mar 28, 2024
    Hello Internet, first post, first try on a Pokemon X Back to Nature game.

    I want have a day system where going to bed changes the weather for today and sets a new one for tomorrow so I can display it on the tv.

    Currently done :
    Code:
    weather today = weather tomorrow;
    weather tomorrow = new weather;
    
    $game_screen.weather(:weather today,power,duration)

    As soon as I use the script event "$game_screen.weather()" the weather starts to appear inside the players house.

    The PBS file "metadata.txt" shows an Outdoor option but it's only for tinting & fly (DUH!?).

    What can I do to show my global & daily weather only on outdoor maps?
     
    Last edited:

    Swdfm

    Game Developer
    245
    Posts
    5
    Years
    • he/him
    • UK
    • Seen Dec 8, 2023
    Hello Zanlan. The internet has heard you!
    So, $game_screen.weather overrides any metadata checks that requires the map to be an outdoor one.
    What do we do then?
    Depending on how you calculate which weather appears, will depend on how it is stored
    Let us assume you know how to store future weather, and there is some sort of variable for today's weather
    The TV should call to that variable rather than directly to "$game_screen.weather"
    To allow only outdoor maps to show the weather, you must call the method upon entry to a new map

    So, it would look something like:
    Code:
    EventHandlers.add(:on_enter_map, :change_weather,
      proc { |_old_map_id|
        next if !$game_map
        next unless $game_map.metadata&.outdoor_map
        # next unless # TODAY'S WEATHER IS SET!
        $game_screen.weather(:weather today,power,duration)
      }
    )

    The only time this won't work is if you set the weather in an outside map, but that would not be the most comfortable nap!

    Hope this helps!
    Swdfm
     
    Back
    Top