Tropical Sunlight
The Faltine
- 3,476
- Posts
- 17
- Years
- Age 29
- Slovenia
- Seen Mar 30, 2015
Of course I'm right.No, he's right; they're trainers. :P
I'm always right.
Anyways, good luck on your hack, can't wait to play a new beta!
Of course I'm right.No, he's right; they're trainers. :P
'----------------------------------------------------------------
' Natural Weather Script
' By colcolstyles
' 10/17/2009
' As the player moves from one map to the next, the weather has
' the possibility of changing. Both the type of weather that
' might begin and the odds of a change occurring depend on
' the current weather (actual odds given in script). This script
' also contains an available option for manual override; the
' hacker can (by setting the OVERRIDE flag) specify a particular
' weather to be used, thus deactivating the random weather.
'----------------------------------------------------------------
#erase 0x800000 0x100
#dynamic 0x800000
#define V_WEATHER 0x7000
#define V_RANDVAR 0x7001
#define F_OVERRIDE 0x500
#define W_SUNNY 0x2
#define W_CLOUDY 0xB
#define W_RAIN 0x3
#define W_THUNDER 0xD
'----------------------------------------------------------------
#org @main
compare F_OVERRIDE B_TRUE
if B_== goto @manual
random 0x14
copyvar V_RANDVAR LASTRESULT
compare V_WEATHER W_SUNNY
if B_== call @sunnyscript
compare V_WEATHER W_CLOUDY
if B_== call @cloudyscript
compare V_WEATHER W_RAIN
if B_== call @rainscript
compare V_WEATHER W_THUNDER
if B_== call @thunderscript
doweather
end
'----------------------------------------------------------------
#org @sunnyscript
compare V_RANDVAR 0x1 ' 2/20 chance of becoming cloudy
if B_<= goto @becomecloudy
compare V_RANDVAR 0x2 ' 1/20 chance of spontaneous rain
if B_<= goto @becomerainy
setweather W_SUNNY ' 17/20 chance of remaining the same
return
#org @cloudyscript
compare V_RANDVAR 0x4 ' 5/20 chance of becoming sunny
if B_<= goto @becomesunny
compare V_RANDVAR 0xE ' 10/20 chance of becoming rainy
if B_<= goto @becomerainy
compare V_RANDVAR 0x11 ' 3/20 chance of thunderstorm
if B_<= goto @becomethunder
setweather W_CLOUDY ' 2/20 chance of remaining the same
return
#org @rainscript
compare V_RANDVAR 0x2 ' 3/20 chance of thunderstorm
if B_<= goto @becomethunder
compare V_RANDVAR 0xA ' 8/20 chance of rain stopping but remaining cloudy
if B_<= goto @becomecloudy
compare V_RANDVAR 0xC ' 2/20 of rain cutting out completely
if B_<= goto @becomesunny
setweather W_RAIN ' 7/20 chance of remaining the same
return
#org @thunderscript
compare V_RANDVAR 0xC ' 13/20 chance of reducing to rain
if B_<= goto @becomerainy
compare V_RANDVAR 0xF ' 3/20 chance of suddenly reducing cloudy
if B_<= goto @becomecloudy
setweather W_RAIN ' 4/20 chance of remaining the same
return
'----------------------------------------------------------------
#org @becomesunny
setvar v_WEATHER W_SUNNY
setweather W_SUNNY
return
#org @becomecloudy
setvar V_WEATHER W_CLOUDY
setweather W_CLOUDY
return
#org @becomerainy
setvar V_WEATHER W_RAIN
setweather W_RAIN
return
#org @becomethunder
setvar V_WEATHER W_THUNDER
setweather W_THUNDER
return
'----------------------------------------------------------------
#org @manual
setweather V_WEATHER
doweather
end
'----------------------------------------------------------------
Yeah but I don't know if Hiroshi Sotomura would appreciate it if I stole his idea. Though it technically wasn't his idea to begin with, I still would like to ask for his permission first.You should be able to. Its not copyrighted or anything
Sure, knock yourself out. After all, you're the one who gave me the idea.Quite frankly, I'm the one who should be asking you if I can "steal" that script. :P
(And with this vague question-sentence, I'm indeed asking for permission.)
What, exactly, were you planning on using then? Variables were the first and only thing that came to mind when I was writing the script and even looking back, I still can't think of any other way to do it :\Bonus points for (though I did expect someone to think of it) utilising variables to implement it.
Thanks ^_^By the way, you're awesome.
I'm a little lost now but at least I can take solace in the fact that I help in one way or another :PWell actually, I meant to say that it's great that you directly utiliised the already-provided variables from the game. Since I was actually thinking of pre-assigning existing weather conditions and creating variables for them when I wrote the structure, the code ends up being cleaner if you initialise existing variables instead (not to mention, familiar for those who know the weather codes).
Just compile the script and then create a 'setmaptile' (0x01) level script on two maps (I used Pallet Town and Route 1 for convenience). The script will activate upon switching between the two.Also colcolstyles, can I get the exact things you did to get the script working to begin with? :P
That's genius! Of course, the script would have to be different for every map as the locations of puddles would vary from map to map. But that's a really neat idea :)@colcolstyles: Ah, a setmaptile script. I should consider making special deviations with that script to allow setmaptile to… plant puddles in certain areas. :P (I was already considering this, but I forgot about it as I rewrote this.)
That's genius! Of course, the script would have to be different for every map as the locations of puddles would vary from map to map. But that's a really neat idea :)
Also, I looked over your latest entry and the idea looks pretty cool. Only, I can't seem to think of any useful function for it :\
There was an issue in the old RHN that demonstrated how one could use 'writebytetooffset' to change the pointer to the player's OW in the RAM to another OW. Using that method would eliminate some of the glitches present with the '0x0B' behavior method, leading me to believe that the '0x0B' method doesn't have any benefits.
Though if you're interested I found out that when the player switches control to the "0x0B NPC", their range of movement is limited. Upon closer inspection, I discovered that the available walking range is dependent on the value in the 'Movement' byte in AdvanceMap. As I'm sure you're already aware, that byte controls how many tiles a NPC can move vertically and horizontally. For example, a value of 21 would give the NPC a range like this (behold the amazing ASCII art):
______
|_|_|_|
|_|_|_|
|_|X|_|
|_|_|_|
|_|_|_|
...with the X representing the original location. Anyways, I found that when you switch control from the player to the NPC, the player is limited to only those tiles. Everything else acts as though it's movement permission is '1'. Once I discovered that the Movement byte was the controlling factor, I deducted that the maximum movement range would be 17x17 ('0xFF' (counting the original location)) but if you set the Movement byte to 0x00, then the NPC's range becomes unlimited :O
So I guess that might be useful if you plan on using this.
As a helpful tip, you can use the command 'spritebehave wPeople# bBehaviour#' to change a NPC's behavior byte to '0x0B' at any time.
One thing which I was very disappointed to discover was that 'special 0x8E' doesn't mimic the effect of, say, opening and closing the bag. Nor does 'fadescreen', though (unlike 'special 0x8E') I didn't expect that work in the first place. So unless you can think of some other 'special' (or anything that might emulate the opening and closing of the bag) then we can't control when and where the player switches control to the NPC :\
On a final note, I've been experimenting with the possibility of having two "0x0B NPCs" on the same map but I haven't been able to draw any conclusions so far. Please, let me know if you make any discoveries of your own.
Edit: Whoa, I just found out something more. If you open the Bag again (after you've already "morphed" into the "0x0B NPC" (do you mind if I just start calling them BNPCs?)), you will retain control over that NPC but the OW graphic will change back to that of the Player's default OW. Interesting...
celebi wasnt in the normal fire red, but i dont think it wont obey. i thought deoxys was the only one.