• 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] Weather Variety

7
Posts
7
Years
    • Seen Dec 16, 2018
    I have an idea for scripting multiple weather on the same map, but I have no idea how to implement it. I was thinking the pseudo-code would be something like this:

    Generate Random number X between 1 and 100
    If X <= 5, the weather is rainy
    Else, if X <= 15 AND it is daytime, the weather is sunny
    Else, no weather

    Would something like this work? Has someone already done this? How would I implement such a script and where would it go (sorry, I have very, very little programming experience)?
     

    Sir_Tman

    Overworked game Dev
    201
    Posts
    8
    Years
  • Basically the easiest way to set this up is a common events and an event on each map to call the common event.
    For example I have it change the weather daily so I have an event that checks if I've run a switch that effects the other events and a random number variable that picks a number between 0 and 5 and the conditional branches.
    0-Clear Skies
    1-Rain
    2-Hail
    3-Thunder
    4-Clear Skies(Unless in Desert then Sand storm)
    5-Clear Skies

    You could also set up for the weather to be different in areas and use a variable to say what town your in inside the weather event on the map
    0-Everywhere Else
    1-This town
    2-That town

    An example, I have a town that rains all the time so I have
    0-Clear Skies
    1-Rain
    2-Rain
    3-Thunder
    4-Thunder
    5-Hail
     
    Back
    Top