• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.

Development: RNG and Weather

interdpth

I've seen things, man.
275
Posts
19
Years
  • Seen Jun 8, 2021
A level script, okay. So I have to put it on a level script for each map I want this random weather to be on?

So, uh, have you read the thread at all? And have you read the rules for this sub-forum?
 
115
Posts
15
Years
  • Age 27
  • Seen Apr 27, 2023
Makes no difference to me.

Anyways, all you need to know is that this isn't finished yet. It's nearing completion but it's not ready for public release yet. Try to be patient, please.

Sorry if I was impatient, I have a tendency to to that. :| Anyways, I can wait. For me, the more complicated stuff can wait till later; since I'm starting a new hack, I want to get some of the essentials out of the way.
 

interdpth

I've seen things, man.
275
Posts
19
Years
  • Seen Jun 8, 2021
Okay, so I take it we now have a set script to use? :)
*didn't read most of the thread*
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
For those interested, I'll briefly explain how I made it in my hack. First of all, the weather-based seasons are enabled only on maps where the weather byte is set to 0xF. This is useful to provide a manual override for particular maps and, at the same point, to avoid weather changes inside buildings, caves etc. So, let's suppose the player has just entered a 0xF map. If the old weather value (stored elsewhere from the actual map weather) is set to 0x0, and the weather timer is 0x0 as well, a new weather type would be randomly selected from the weather-season tables, one for each season and 32 byte each. This gives a 3.125% chance for each item in the table. Then the weather would be applied and stored in the extra memory area I talked about earlier. Finally, the timer would be randomly set to a certain amount of seconds, representing a few hours. Whenever the timer elapses, a new weather is randomly chosen and the timer is reinitialized. Saving the weather byte is important, as when going to another 0xF map (as long as the timer is not 0x0) the same weather would be applied.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Interesting, a timer system is a good idea, but it seems a little impractical.
So far as I can tell all that is needed now is an ASM routine to get the weather to run whenever you enter the maps you want. (This script also used 0xF as the weather byte for this to work.)
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
Interesting, a timer system is a good idea, but it seems a little impractical.
So far as I can tell all that is needed now is an ASM routine to get the weather to run whenever you enter the maps you want. (This script also used 0xF as the weather byte for this to work.)

Why a timer would be impractical? I don't get it.
 

Darthatron

巨大なトロール。
1,152
Posts
18
Years
If anything it would be more practical. You could stand in one spot and the weather could change randomly. That makes much more sense then just when changing maps.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
I was thinking it had a timer to the point where it would only change when changing maps, and if the timer went off. A Real-time timer would be even better.
Sorry for the confusion.
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
I was thinking it had a timer to the point where it would only change when changing maps, and if the timer went off. A Real-time timer would be even better.
Sorry for the confusion.

In fact, it would be "only change when changing maps, and/or if the timer went off."
BTW, what do you mean by "real-time timer" ?
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
I mean it happens as soon as the timer goes off, no need to change maps.

I've set up a timer in a hack before, wasn't very helpful as the player could sit in the map forever and never have the event planned happen until they change map.
Not exactly Real Time if you ask me...
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
I mean it happens as soon as the timer goes off, no need to change maps.

Maybe I didn't express myself correctly, but that's exactly what would happen. There's no need to change map. But if you do, the same weather is applied (assuming the weather byte is set to 0xF).
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
HackMew said:
Maybe I didn't express myself correctly, but that's exactly what would happen. There's no need to change map. But if you do, the same weather is applied (assuming the weather byte is set to 0xF).
The timer updates a lot so theres no need to change maps ^^ As it refreshes and then there's script execution as well when the timer hits max/min.
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
The timer updates a lot so theres no need to change maps ^^ As it refreshes and then there's script execution as well when the timer hits max/min.

Well, the timer updates, but only once some hours. So it's perfectly understandable the player might change map in the meanwhile. Anyway, I never said you need to change map. I only said then when you enter/exit a map, if the map weather is 0xF, then the same weather as the old map is going to be applied. The weather actually changes, from 0xF to whatever, but the result in-game is not noticeable.
 
Back
Top