![]() |
I'd prefer seeing the RNG script as assembly and not a script and it'd be able to store the value in lastresult pretty easily.
Then an example script would be like #define normal 1 #define cloudy 2 etc call asm $blah 'rng number will be stored here cmp lastresult normal if 1 goto normalscript cmp lastresult cloudy if 1 goto cloudyscript etc I see something like that being much perferable |
Hmm, a easy solution i'd see is to make the script for one town, make sure it'd work, then place a hook in the level loading script before the map script( so map script over rides your weather) the asm hook would make your script execute every time a level loads, I see that as very feasible, i'd be willing to make the hook for FR/LG if you or some one can do the scripting
|
first off, i like where this is going
second, when you enter the maps like indoors it would run by your last comment, but i believe that you could get around that, or that it isn't even a problem to start with. and interdpth, with the RTC for Fr/Lg you have, this could inevitably be a staple for all hacking third, i wish i new more about this stuff 0.o |
Quote:
DreadWaffles post made me think of numerous possibilities this effect could have with the day and night systems. I think amazing effects can be pulled off with this. |
Quote:
Quote:
just so many things, and it seems simple, but it isn't i believe this kind of opens up a whole new world of scripting ideas for me, i would make a thread but i don't know to much hex :laugh: but i have some ideas like adding onto what was already there EX: if it is 6:00pm-6:00am chances from sunny(clear) to: Clouds 7/20, Rain 3/20, the same 8/20 and, Thunderstorm 2/20. and also for different areas like snow/ice, lake affect, valleys, and droughts I have realized that if this works out possibilities are near endless just wish i could help :'( |
This probably won't be anything interdpth doesn't know already but here is some information about the RAM regarding weather:
The default weather for a map is stored at 0x02036E12 in the RAM, it's 8 bit by the way. Surely this can be used to create maps with a higher chance of a certain weather than other. And the 8 bit value at 0x02036E13 contains the type of map. Code:
EDIT: Tell me if you think I should just edit this new information into the script that has been posted, it won't be difficult. EDIT2: As it turns out I have already created a similar script a while ago, though I only have the compiled version at the moment I can easily edit it to your needs... I'll implement my RAM data and also your preferred likeliness of weather, then post it. |
Quote:
Code:
|
Quote:
EDIT: One working natural weather script that won't work indoors. Code:
You won't need the bold lines if you're manually putting them on each map. The italic lines are there merely the set up the script to work, you don't run this from the level script, you run @Main. |
Hmm, there is one other graphical problem you need to get around. As in Liquid Crystal, when the weather is forced to be changed by the "setweather" command, sometimes the weather palette doesn't refresh. I don't know whether that's secific to that hack, but I believe it will apply to all ROMs because I've noticed that the natural weather change from maps is not immediate. I would say that instead of using "setweather" edit it directly from the ram. (However this might still do the same things which would cause for maybe a big recoding :0)
|
Quote:
|
Quote:
|
Quote:
EDIT: It seems that his bug was confined to Liquid Crystal only, so ignore it for now. |
I was using a Fire Red ROM when I was testing my script and I never encountered any problems. I was using a "01 'setmaptile' script" level script, if that makes any difference.
|
Quote:
Say V_RANDVAR = 1... Code:
I don't know how you would have got it to work. :\ |
Quote:
In @main, @sunnyscript is called. However, in @sunnyscript (and the other corresponding scripts), @becomecloudy is accessed with 'goto'. So when the GBA reads the 'return' statement in @becomecloudy, it actually picks up where it left off all the way back in @main. Hopefully you see what I did. It's a little hard to read because Pokémon scripting doesn't have "else if" statements. I tested it quite a bit and it worked pretty darn well, if I may say so myself. |
Quote:
On a side note, your script should have "random 0x13" since it would give a random value between 0 and 19. Your current script is out of 21 possible situations, not 20. ;) |
Quote:
Though the part that you originally pointed out seems to be correct, I think I just spotted another bug. Again, I'm terrible at explaining things but bear with me here: Let's say the weather is currently sunny. Control would branch off to @sunnyscript. Now let's say the random number that was returned 0x1, which would therefore activate @becomecloudy. However, in @becomecloudy, V_WEATHER is actually changed to W_CLOUDY. This might cause a bug when control returns to @main because the script will check if V_WEATHER is set to W_CLOUDY. Because of this, it would be possible for it to go straight to a thunderstorm from sunny and it also increases chances of spontaneous rain too. It can be fixed by replacing all the "call"s in @main to "goto"s and then changing the "return"s in @becomesunny/cloudy/etc. to "goto @end" and adding: Code:
|
Quote:
EDIT: It would save space to just replace the "return"s with the code you posted. "goto" uses 5 bytes, but... Code:
EDIT2: Here is my script which will be quicker and save space. :) Code:
|
Quote:
I don't know if I should even bother fixing it as it seems like interdpth has some snazzy ASM plan which makes my method look pretty rudimentary. With mine, you have to add a level script for every single map that you want random weather on. Though the fact that you don't have to edit indoor maps (unless you want it to rain inside^^) makes things easier, it's still a hassle. Still, I'm interested in seeing what you guys come up with. I could try to help out but my ASM knowledge is pretty pathetic. :( Best of luck. |
Quote:
|
SOmeone make a script that everyone agree's on, and i'll hack the level loading routines and make it execute.
DEAL? |
Code:
This hasn't been fully tested yet but it's nearing the final stages. Does anyone have any other ideas that they want added? I've already added manual override and the ability to disable the random weather at any time but if there are any other features that you think would be nice to have, just speak up and I'm sure we can figure out how to implement them. |
Quote:
edit: We think we're nearing in on a final version but we're still testing it. We'll keep you updated. edit2: Well we think we have finally agreed on a script. We've tested it too and as far as we can tell, it works like we want it to. Now all we need is for interdpth to work his magic. Here's the script: Code:
|
Well well well, stuff happened pretty fast!
I wasn't even here for the initial idea pitch, oh well. I've tried out this script a bit on my PSP, and all goes well, well indeed. Though I had an idea... What about snow? I know for a fact that people nowadays have the strangest fascination with snowy maps in a ROM hack, and if someone makes a snowy mountain, how would this random weather be incorporated... I guess as of yet one could simply change the "Storm" and "Rain" to things like "3 Snowflakes" and the Ash snow used in R/S/E... But that would require compiling a completely different script, and if someone were to cross maps while things are stormy, to a map intended to have the chance of snow, things may get a little buggy. |
Quote:
Code:
Quote:
|
| All times are GMT -8. The time now is 8:50 AM. |
![]()
© 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.
Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.