- 5,256
- Posts
- 17
- Years
- Age 27
- Leicester, UK
- Seen Mar 31, 2025
1. Grayscale and "Red"scale -FireRed-
I didn't discover this, but I can't remember who did, I've had the script saved on my test rom for ages and just rediscovered it.
To make your scripts make a map go from this:
To this:
Or even this:
In, like, two lines of code.
And these codes are, for greyscale, then redscale, and then back to normal:
OR
Obviously, you can change the warp's parameters to go to different places, etc.
OR
OR
Where # is equal to anything higher then 4.
The warp is needed for the change to take place, and if it's not there the change will just happen whenever the player warps out. Strangely enough, using special 0x8E, which resets the map for the setmaptile command, does not work, and warping is the only way.
This code can lead to some freaking awesome stuff: flashback scripts, ambient volcanoes, alternate dimensions, whatever. It could be used in conjunction with weather, (some are affected by the palette change - rain and snow, for example - and some are not, such as sandstorms).
Mum...I think we've been teleported to Mt. Ember again...
Unfortunately, I can't seem to be able to edit the palette of the "redscale" effect, and it can't be found using the conventional method of palette editing, but if someone were to work out how, this would unlock even more possibilties (underwater maps?).
2. Level Scripts
For some reason, when people make level scrips, they insert it through the unprofessional view area in Advance Map which means they then have to go to Professional View and edit the '#raw word 0xFFFF' part of a level script and then recompile. That's far too much work. A much quicker, more efficient way, is to simply add this in your script before:
Then, when you compile this script, go into Professional View of Advance Map, and paste it in the Map Script Offset box. There, that's it. Done. No more recompiling or whatever.
3. #include, #alias, #define -XSE-
When you download XSE, it comes bundled with multiple .rbh files. These files have names such as "stdpoke.rbh" and "std.rbh". Opening these files with Notepad will show stuff like "#define LASTRESULT 0x800D
#define LASTTALKED 0x800F
#define PLAYERFACING 0x800C".
What this means, is, when you add the code "#include __.rbh", when __ is the name of the rbh file, it will make all the #defines in that file affect this script. For example, if you have a script:
XSE will understand that PKMN_CHARMANDER means 0x4, without you having to remember the hex code for Charmander. Furthermore, all codes in the std.rbh file are automatically included in XSE, so typing: "compare LASTRESULT 0x1" will automatically mean "compare 0x800D 0x1" without you needing to add the #include script.
We can use this to our advantage. Take the example of the Redscale and Grayscale code up there. There's no way you'd be able to remember all that stuff with ease, so with the use of #alias and #define (#alias renames commands. so if you put #alias giveitem gimmedatitem, typing "gimmedatitem" in a script will have the same effect as typing "giveitem") we can make it a lot easier.
I'm going to make it so that typing "setcolour red mask" will make the screen go "redscale". In my std.rbh file, I'll add these lines of code:
This means that I can simplify those codes up there to:
Pretty cool, eh?
I didn't discover this, but I can't remember who did, I've had the script saved on my test rom for ages and just rediscovered it.
To make your scripts make a map go from this:
![[PokeCommunity.com] Some Tips and Tricks [PokeCommunity.com] Some Tips and Tricks](https://i.imgur.com/JsE5Q.png)
To this:
![[PokeCommunity.com] Some Tips and Tricks [PokeCommunity.com] Some Tips and Tricks](https://i.imgur.com/WVCWc.png)
Or even this:
![[PokeCommunity.com] Some Tips and Tricks [PokeCommunity.com] Some Tips and Tricks](https://i.imgur.com/AnOBm.png)
In, like, two lines of code.
And these codes are, for greyscale, then redscale, and then back to normal:
![[PokeCommunity.com] Some Tips and Tricks [PokeCommunity.com] Some Tips and Tricks](https://i.imgur.com/WVCWc.png)
Code:
writebytetooffset 0x1 0x2036E28
warp 0x4 0x1 0x0 0x0 0x0
OR
Code:
writebytetooffset 0x3 0x2036E28
warp 0x4 0x1 0x0 0x0 0x0
![[PokeCommunity.com] Some Tips and Tricks [PokeCommunity.com] Some Tips and Tricks](https://i.imgur.com/AnOBm.png)
Code:
writebytetooffset 0x2 0x2036E28
warp 0x4 0x1 0x0 0x0 0x0
![[PokeCommunity.com] Some Tips and Tricks [PokeCommunity.com] Some Tips and Tricks](https://i.imgur.com/JsE5Q.png)
Code:
writebytetooffset 0x0 0x2036E28
warp 0x4 0x1 0x0 0x0 0x0
OR
Code:
writebytetooffset 0x4 0x2036E28
warp 0x4 0x1 0x0 0x0 0x0
OR
Code:
writebytetooffset 0x[U][COLOR="Red"]#[/COLOR][/U] 0x2036E28
warp 0x4 0x1 0x0 0x0 0x0
The warp is needed for the change to take place, and if it's not there the change will just happen whenever the player warps out. Strangely enough, using special 0x8E, which resets the map for the setmaptile command, does not work, and warping is the only way.
This code can lead to some freaking awesome stuff: flashback scripts, ambient volcanoes, alternate dimensions, whatever. It could be used in conjunction with weather, (some are affected by the palette change - rain and snow, for example - and some are not, such as sandstorms).
![[PokeCommunity.com] Some Tips and Tricks [PokeCommunity.com] Some Tips and Tricks](https://i.imgur.com/GgzSq.png)
Mum...I think we've been teleported to Mt. Ember again...
Unfortunately, I can't seem to be able to edit the palette of the "redscale" effect, and it can't be found using the conventional method of palette editing, but if someone were to work out how, this would unlock even more possibilties (underwater maps?).
2. Level Scripts
For some reason, when people make level scrips, they insert it through the unprofessional view area in Advance Map which means they then have to go to Professional View and edit the '#raw word 0xFFFF' part of a level script and then recompile. That's far too much work. A much quicker, more efficient way, is to simply add this in your script before:
Code:
#org @setup
#raw 0x2
#raw pointer @setup1
#raw 0x0
#org @setup1
#raw word 0x7000 //This is the variable you set later on in your script.
#raw word 0x0
#raw pointer @start
#raw word 0x0
#org @start //actual script goes here
...
setvar 0x7000 0x1
release
end
Then, when you compile this script, go into Professional View of Advance Map, and paste it in the Map Script Offset box. There, that's it. Done. No more recompiling or whatever.
3. #include, #alias, #define -XSE-
When you download XSE, it comes bundled with multiple .rbh files. These files have names such as "stdpoke.rbh" and "std.rbh". Opening these files with Notepad will show stuff like "#define LASTRESULT 0x800D
#define LASTTALKED 0x800F
#define PLAYERFACING 0x800C".
What this means, is, when you add the code "#include __.rbh", when __ is the name of the rbh file, it will make all the #defines in that file affect this script. For example, if you have a script:
Code:
#dynamic 0x800000
#include stdpoke.rbh
#org @start
lock
faceplayer
givepokemon PKMN_CHARMANDER 0x5 0x0 0x0 0x0 0x0
release
end
XSE will understand that PKMN_CHARMANDER means 0x4, without you having to remember the hex code for Charmander. Furthermore, all codes in the std.rbh file are automatically included in XSE, so typing: "compare LASTRESULT 0x1" will automatically mean "compare 0x800D 0x1" without you needing to add the #include script.
We can use this to our advantage. Take the example of the Redscale and Grayscale code up there. There's no way you'd be able to remember all that stuff with ease, so with the use of #alias and #define (#alias renames commands. so if you put #alias giveitem gimmedatitem, typing "gimmedatitem" in a script will have the same effect as typing "giveitem") we can make it a lot easier.
I'm going to make it so that typing "setcolour red mask" will make the screen go "redscale". In my std.rbh file, I'll add these lines of code:
Code:
#alias writebytetooffset setcolour
#define red 0x2
#define grey 0x1
#define normal 0x0
#define mask 0x2036E28
This means that I can simplify those codes up there to:
![[PokeCommunity.com] Some Tips and Tricks [PokeCommunity.com] Some Tips and Tricks](https://i.imgur.com/WVCWc.png)
Code:
setcolour grey mask
warp 0x4 0x1 0x0 0x0 0x0
![[PokeCommunity.com] Some Tips and Tricks [PokeCommunity.com] Some Tips and Tricks](https://i.imgur.com/AnOBm.png)
Code:
setcolour red mask
warp 0x4 0x1 0x0 0x0 0x0
![[PokeCommunity.com] Some Tips and Tricks [PokeCommunity.com] Some Tips and Tricks](https://i.imgur.com/JsE5Q.png)
Code:
setcolour normal mask
warp 0x4 0x1 0x0 0x0 0x0
Pretty cool, eh?
Last edited: