• 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?".
  • 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.

0m3GA ARS3NAL's Obscure XSE Commands

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Hello PokeCommunity.

I know there are many XSE tutorials out there, but I thought I would give my 2 cents

about topics not covered often.


Uncommon Commands


comparefarbytetobyte



The command comparefarbytetobyte is useful for initiating a script depending on a

value in the RAM, like pallet, or some other random thing.
(Useful for you DaN (Day and Night) users, for making night and day based scripts.

An example of this code would be...
Code:
comparefarbytetobyte 0xPOINTER 0x5
if b_== goto @script

This would compare 0x5 to a byte at the pointer, (Wherever you decide to make it.)
And if the byte is 05, it will go branch off to the otehr script.

Pretty simple yeah?

The alternate version of this being
comparefarbytes
is very similar, only instead it compares bytes found at 2 pointers together.

Code:
comparefarbytes 0xPOINTER1 0xPOINTER2

special2


The command special2 has a lot of different confusinf aspects, mainly because we

don't know all of the commands, but what it does is it gives a value back depending

on the command executed.

For instance, special2 0x800D 0x104, would excecute special2, and it would do

something, and a vale would be put into 0x800D...
Kinda difficult to explain...

Basically it checks some random thing in the RAM, and depending on what it sees, it

gives back a number.
A good example being the daycare script.

Here is a small portion...
Code:
special2 LASTRESULT 0x178
compare LASTRESULT 0x1

special2 0x178 checks if we have a pokemon in the daycare. (Single Daycare, not Dual)
And if we do, it sets LASTRESULT to be 1, otehrwise, it is 0.
(you could use this for a hack...)


yesnobox


yesnobox is nothing too important.
It just pops up a yes/no prompt.
This can be a cool command though, since you can choose where the box will be.
it is simple to use.

Code:
yesnobox 0xXCORDINATE 0xYCORDIANTE
The first byte is the X Coordinate, and the second is the Y Concordia, of the screen

of course, not the map. (I never really tested out the cordinate plane of the

screen, so you'll have to experiment with it...)

multichoice2 and multichoice3


the command multichoice2 is nothing that special, all it does it show a regular

multichoice command, only you are able to select which choice is higlighted when

opened.
(Crude ASCII drawings)

Normal
--------<
--------
--------
--------
--------

Multichoice2
--------
--------
--------
--------<
--------

Nothing too special, but I'll give you a code example for the heck of it.
Code:
multichoice2 0x5 0x5 0x10 0x2 0x0
This will make a multichoice box, at coordinates 5,5, using multichoice #16, and the

3rd selection is highlighted. (I cant remember if 0x0 makes the B button press able or not...)


multichoice3


Multichoice3 is a bit more interesting.
With this one we choose how many answers are in a row, making for an interesting way

to use multichoices. (I like using yes/no multichoices like this, set at the top of

the screen, or just above the text box... =3)
(Crude ASCII drawing)
Normal
--------<
--------
--------
--------
--------
--------

Multichoice3 (3 per row)
--------< --------
-------- --------
-------- --------

Here is a code example of the above scenario.

Code:
multichoice3 0x5 0x5 0x10 0x3 0x0


bufferpokemon


This is a great command for people who like to give random pokemon to the player.
Especially since variables can be used as pokemon species numbers.

For example, if you have a script that randomly selects 3 pokemon, lets say it

chooses 0x19 (Pikachu) and it stores it in a variable, LASTRESULT (0x800D).
You can use the bufferpokemon command to make Pikachu's name appear in a script.

Code:
bufferpokemon 0x1 LASTRESULT

The first byte is the buffer Number. (There are 3 buffers.) and the second is the

variable that has pikachus number in it!
Pretty simple eh?

This exact process can be done with items too, only use the;
bufferitem command.
This also works with attack names.
bufferattack, and many otehrs, check the XSE database for more info.



Well, that is all for now, if you have any suggestions, comment!
If you like, comment, +rep, or whatever you want, I don't care so long it is positive!
 
Last edited:
219
Posts
16
Years
Really a good start,0m3GA ARS3NAL!
There are a lot of "new" commands that I want to learn,such as comparefarbytetobank.If you can say something about it,I'll appreciate.
 

sab

Now too much of a life.
999
Posts
15
Years
good start! I would personaly add "random" "setweather" and "countpokemon" to this but it's your call.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Really a good start,0m3GA ARS3NAL!
There are a lot of "new" commands that I want to learn,such as comparefarbytetobank.If you can say something about it,I'll appreciate.

I never really used that command, I'll look into it.

good start! I would personaly add "random" "setweather" and "countpokemon" to this but it's your call.

Sure! Random has been covered before, but I'll do it. Countpokemon is also a good Idea, I'll get on these!
 
Last edited:

ckret2

usually pronounced "secret 2"
518
Posts
15
Years
Oh, wow!! Thank you SO much! I was just about to post a question in the Script Help Thread about special2, and found you explained it here! I've spent a couple hours or so today decoding the special2 used in the legendary bird scripts, 0xB4.

I've also got a question about that special2, but, before I get on to that, here's what I know; maybe this is something you'd be interested in for the tutorial, I dunno. :P Here's, for example, the Zapdos script in full:

Spoiler:


To make things easier on myself, I took out the offsets and added normal text explanations where appropriate, so here's the "dumbed down" script:

Spoiler:


And even further abbreviated, condensed, randomly swuished together, and messed with until it's turned into what I think is relevant to the special2 used here:

Spoiler:


Side note: Oddly enough, even though flag 0x2BF is set, that's not Zapdos's number in AdvanceMap; Zapdos's number is 5D. However, it seems that 5D is a preset flag in FireRed (like the flag that make all the non-Rocket NPCs of Saffron City hidden until you beat Giovanni, at which point the flag is cleared). There's a command in the map script to check and see if flag 0x2BF has been set; if it has, then it won't clear 5D. As long as 2BF has not been set, the map script will do clearflag 0x5D, which lets Zapdos be visible.

These are the conclusions I can draw from the above:

special2 0x800D 0xB4
compare 0x800D...
• 0x1; if true then set the flag to make the Pokémon vanish and hide the sprite
• 0x4; if true then the sprite is hidden and the Pokémon flies away, but the flag isn't set
• 0x5; if true then the same as 0x4
• if none are true, then the flag is set and that's the end.

The reason I included some of the above stuff ("setflag 0x807" through "clearflag 0x807") is because, I assume, those flags are used to check and see if you fainted while battling the Zapdos, because it's set immediately before the battle starts and yet is cleared immediately after the battle ends. This is pretty much confirmed in the map script of the Power Plant:

Spoiler:


And with the relevant info extracted:

Spoiler:


So, along with the conclusions I already had above, we can add one more:

special2 0x800D 0xB4
compare 0x800D...
• 0x1; if true then set the flag to make the Pokémon vanish and hide the sprite
• 0x4; if true then the sprite is hidden and the Pokémon flies away, but the flag isn't set (so you can rebattle the Pokémon?)
• 0x5; if true then the same as 0x4
• if none are true, then the flag is set to hide the Pokémon and that's apparently the end.
if you faint, so that flag 0x807 isn't cleared...
• 0x7; if it's 0x5 (in other words, "not exactly equal to" 0x7), then the Pokémon is apparently hidden.


Sorry for the tl;dr it took to reach that conclusion. But it never hurts to show your work. :P

The reason I'm throwing all this at you is because, for one thing, you're the first person so far to actually start to address what a special2 is, rather than just throw one into a tutorial in the middle of something else without talking about what it is and how it works. I'm trying to decode the script above to create another script that makes it impossible to progress unless you beat--don't catch, but beat--a Pokémon.

I've decoded as much as I can of special2 0xB4, so I thought I'd present my research to someone who probably knows more about the command than I do. :D This same special2 is used with the legendary trio, Mewtwo, Lugia, Ho-Oh, Deoxys, and Snorlax, at the very least. (And those scripts use the "setflag/clearflag 0x807" trick too, which confuses me; if 0x807 is set and that means you can't go back to battle the Pokémon you were fighting when it was set, wouldn't that mean you can't ever battle any of the other legendaries, too...?)

Any insight into how this command behaves would be useful and appreciated, and I hope I've presented some useful information and not just wasted you time with all this.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Oh, wow!! Thank you SO much! I was just about to post a question in the Script Help Thread about special2, and found you explained it here! I've spent a couple hours or so today decoding the special2 used in the legendary bird scripts, 0xB4.

I've also got a question about that special2, but, before I get on to that, here's what I know; maybe this is something you'd be interested in for the tutorial, I dunno. :P Here's, for example, the Zapdos script in full:

Spoiler:


To make things easier on myself, I took out the offsets and added normal text explanations where appropriate, so here's the "dumbed down" script:

Spoiler:


And even further abbreviated, condensed, randomly swuished together, and messed with until it's turned into what I think is relevant to the special2 used here:

Spoiler:


Side note: Oddly enough, even though flag 0x2BF is set, that's not Zapdos's number in AdvanceMap; Zapdos's number is 5D. However, it seems that 5D is a preset flag in FireRed (like the flag that make all the non-Rocket NPCs of Saffron City hidden until you beat Giovanni, at which point the flag is cleared). There's a command in the map script to check and see if flag 0x2BF has been set; if it has, then it won't clear 5D. As long as 2BF has not been set, the map script will do clearflag 0x5D, which lets Zapdos be visible.

These are the conclusions I can draw from the above:

special2 0x800D 0xB4
compare 0x800D...
• 0x1; if true then set the flag to make the Pokémon vanish and hide the sprite
• 0x4; if true then the sprite is hidden and the Pokémon flies away, but the flag isn't set
• 0x5; if true then the same as 0x4
• if none are true, then the flag is set and that's the end.

The reason I included some of the above stuff ("setflag 0x807" through "clearflag 0x807") is because, I assume, those flags are used to check and see if you fainted while battling the Zapdos, because it's set immediately before the battle starts and yet is cleared immediately after the battle ends. This is pretty much confirmed in the map script of the Power Plant:

Spoiler:


And with the relevant info extracted:

Spoiler:


So, along with the conclusions I already had above, we can add one more:

special2 0x800D 0xB4
compare 0x800D...
• 0x1; if true then set the flag to make the Pokémon vanish and hide the sprite
• 0x4; if true then the sprite is hidden and the Pokémon flies away, but the flag isn't set (so you can rebattle the Pokémon?)
• 0x5; if true then the same as 0x4
• if none are true, then the flag is set to hide the Pokémon and that's apparently the end.
if you faint, so that flag 0x807 isn't cleared...
• 0x7; if it's 0x5 (in other words, "not exactly equal to" 0x7), then the Pokémon is apparently hidden.


Sorry for the tl;dr it took to reach that conclusion. But it never hurts to show your work. :P

The reason I'm throwing all this at you is because, for one thing, you're the first person so far to actually start to address what a special2 is, rather than just throw one into a tutorial in the middle of something else without talking about what it is and how it works. I'm trying to decode the script above to create another script that makes it impossible to progress unless you beat--don't catch, but beat--a Pokémon.

I've decoded as much as I can of special2 0xB4, so I thought I'd present my research to someone who probably knows more about the command than I do. :D This same special2 is used with the legendary trio, Mewtwo, Lugia, Ho-Oh, Deoxys, and Snorlax, at the very least. (And those scripts use the "setflag/clearflag 0x807" trick too, which confuses me; if 0x807 is set and that means you can't go back to battle the Pokémon you were fighting when it was set, wouldn't that mean you can't ever battle any of the other legendaries, too...?)

Any insight into how this command behaves would be useful and appreciated, and I hope I've presented some useful information and not just wasted you time with all this.

WOW, quite a lengthy post you got there, but yeah, special 2 does not really make anything in the game happen, but make a variable set to a number depending on what happens in the game... or what has already happened.
 

ckret2

usually pronounced "secret 2"
518
Posts
15
Years
WOW, quite a lengthy post you got there, but yeah, special 2 does not really make anything in the game happen, but make a variable set to a number depending on what happens in the game... or what has already happened.

So I figured, yeah. :P Knowing that it does that, though, and knowing how to use that to get it to do what you want, are two different matters... Have you looked into 0xB4, by any chance, or so far am I the only one who's been crazy enough to study it in-depth? I'm hoping to figure out how exactly to get it to work--like, do you have to do setwildbattle beforehand and then use special 0x138, or can a simple wildbattle be used and still be functional with 0xB4? And what exactly do all those numbers mean--does a value of 0x1 mean that you caught the Pokémon; what do 0x4 and 0x5 do, maybe one means "ran from battle" and the other means "made the Pokémon faint"; and what is 0x7 and why is the Pokémon hidden if you faint in battle and get any result other than 0x7?

There's very few ROM hackers out there who I think might've done enough research into XSE to figure out this kind of stuff, one of whom is you, another of which is HackMew, and in the guide that comes with XSE HackMew doesn't discuss special2. There isn't nearly enough info about special2 available, is there...?

I can tell you've figured out how to use various special2s to create a daycare script. Do you know if the behaviors of any other special2s have been determined yet?
 
1
Posts
10
Years
  • Age 34
  • Seen Feb 23, 2014
Hey, did you now if there's a command like "if var 0x??? = 0 goto" or "if var 0x??? > 0 goto"?
Thank you

(I'm sorry for my english but i'm italian and i don't speak english ver well... :) )
 
Back
Top