I'm trying to create a random weather event that changes every in-game hour or so that spans across all maps in the game other than indoors. I've followed a few tutorials but they seem to only set it up to work on a single map so it's basically a common event that goes:
RandomWeatherVariable set to a random number between 1-4
Wait 900
RandomWeatherVariable set to a random number between 1-4
Wait 900
and that gets repeated a few times. I haven't tested it but I've read comments saying that the "wait" timer will reset if you move to a different map so if the player keeps switching maps before the 900 frames are up, the weather won't change unless the player stays on a specific map. My goal is to make the weather change every in game hour or two (haven't decided on the frequency yet) across all outdoor maps in the game. From my understanding, the best way to do that would be to set a variable to 900, then subtract -1 from that variable and then set it to reroll that random number variable once that variable reaches 0. I've tried it in multiple different ways but haven't gotten it to work. I think my last attempt I tried doing something like this (going off of memory because I erased it because I wanted to start from scratch and try again):
RandomWeatherVariable set to a random number between 1-4
Label:Start
Set WeatherTimeVariable to 900
Loop
WeatherTimerVariable-1
If WeatherTimerVariable = 0
RandomWeatherVariable set to a random number between 1-4
Jump To Label: Start
Break Loop
Obviously this is dumb and completely wrong because it didn't work because it would start a weather effect for two seconds then switch as if it's rerolling too quickly. That's why I tried to make it jump to the label under the initial reroll at the top so that it would immediately roll a random number for weather on loading the game.
RandomWeatherVariable set to a random number between 1-4
Wait 900
RandomWeatherVariable set to a random number between 1-4
Wait 900
and that gets repeated a few times. I haven't tested it but I've read comments saying that the "wait" timer will reset if you move to a different map so if the player keeps switching maps before the 900 frames are up, the weather won't change unless the player stays on a specific map. My goal is to make the weather change every in game hour or two (haven't decided on the frequency yet) across all outdoor maps in the game. From my understanding, the best way to do that would be to set a variable to 900, then subtract -1 from that variable and then set it to reroll that random number variable once that variable reaches 0. I've tried it in multiple different ways but haven't gotten it to work. I think my last attempt I tried doing something like this (going off of memory because I erased it because I wanted to start from scratch and try again):
RandomWeatherVariable set to a random number between 1-4
Label:Start
Set WeatherTimeVariable to 900
Loop
WeatherTimerVariable-1
If WeatherTimerVariable = 0
RandomWeatherVariable set to a random number between 1-4
Jump To Label: Start
Break Loop
Obviously this is dumb and completely wrong because it didn't work because it would start a weather effect for two seconds then switch as if it's rerolling too quickly. That's why I tried to make it jump to the label under the initial reroll at the top so that it would immediately roll a random number for weather on loading the game.
