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

Assemblable Files

417
Posts
9
Years
  • Age 33
  • Seen Nov 20, 2016
It always pains me to know how many people repeatedly insert the same data over and over each time they start on a new ROM/make a mistake instead of setting it up a single time in an easily modifiable and transferable way. I think that .s files are heavily underused here, so I'm going to be slowly uploading some of my own. If anyone else has any helpful files to contribute, that would be great.

Today's submission is FireRed's Pokedex sorting (alphabetical, type, weight, height) for all 721 Pokemon. Although it doesn't use C, I'm running on the assumption that you know how to use this https://github.com/EternalCode/Empty-Template. You can insert without it, but that honestly seems like a waste of time and you're better off just learning to set up the empty template. http://www.pokecommunity.com/showthread.php?t=364458 GitHub may be a better way to do this, but for now, here are the files you'll need:

Dex Sorting
Defines Pokemon
 
325
Posts
10
Years
So I really agree with this kind of thinking, and I wrote a ton of macros for regular scripting here so we can start doing everything on github for organization.
Anyway, I need to write out things like msgbox and giveitem, so if I don't update this soon, someone poke me.
Spoiler:
It's worth noting that I changed the format of trainerbattle, so you should look at it before you try writing a trainer battle using these macros.

~EDIT~ I fixed bufferitems2 and added as many of the macros from XSE as I could. wildbattle2 doesn't work in this scenario, so if you need to use it, you need to write it out by the individual commands. It goes setwildbattle -> special -> waitstate. You'll need to figure out what to put in the special's parameters by yourself, as right now there's no real documentation on it.

~EDIT 2~ Added azurile13's implementation of if.
 
Last edited:
417
Posts
9
Years
  • Age 33
  • Seen Nov 20, 2016
Does this contain stats too ? Megas ?
Nope, sorry. I have an old one of those, but it was pasted from a file (all in hex) so its pretty useless.
So I really agree with this kind of thinking, and I wrote a ton of macros for regular scripting here so we can start doing everything on github for organization.
Anyway, I need to write out things like msgbox and giveitem, so if I don't update this soon, someone poke me.
Spoiler:
It's worth noting that I changed the format of trainerbattle, so you should look at it before you try writing a trainer battle using these macros.

~EDIT~ I fixed bufferitems2 and added as many of the macros from XSE as I could. wildbattle2 doesn't work in this scenario, so if you need to use it, you need to write it out by the individual commands. It goes setwildbattle -> special -> waitstate. You'll need to figure out what to put in the special's parameters by yourself, as right now there's no real documentation on it.
Yeah good idea. That's how I script too :D Did you set up yours to 100% match XSE? (I don't know because I've never used it). My scripts resembles a PKSV and look similar to ASM in some cases. Like, this is how I did if:
.equ _goto, 0x06
.equ _call, 0x07

.macro if condition goto_or_call script
.byte \goto_or_call, \condition
.long \script
.endm

so it can just be used as
compare 0x800D 0x0000
if cmp_beq _goto LABEL
 
325
Posts
10
Years
Nope, sorry. I have an old one of those, but it was pasted from a file (all in hex) so its pretty useless.Yeah good idea. That's how I script too :D Did you set up yours to 100% match XSE? (I don't know because I've never used it). My scripts resembles a PKSV and look similar to ASM in some cases. Like, this is how I did if:
.equ _goto, 0x06
.equ _call, 0x07

.macro if condition goto_or_call script
.byte \goto_or_call, \condition
.long \script
.endm

so it can just be used as
compare 0x800D 0x0000
if cmp_beq _goto LABEL
I tried to match it 100% to XSE, but there were some small things that I changed. For instance, the creator of XSE got some cmd__ parameters wrong, so I fixed those, as well as the settrainerflag and cleartrainerflag, because he got those backwards. In addition, trainerbattle uses a different number of parameters depending on the type, so I changed that as well.

The way you handled if is definitely better than mine, as it flows much easier. I'll edit my post to include that as well as the original if commands.
 
417
Posts
9
Years
  • Age 33
  • Seen Nov 20, 2016
I tried to match it 100% to XSE, but there were some small things that I changed. For instance, the creator of XSE got some cmd__ parameters wrong, so I fixed those, as well as the settrainerflag and cleartrainerflag, because he got those backwards. In addition, trainerbattle uses a different number of parameters depending on the type, so I changed that as well.

The way you handled if is definitely better than mine, as it flows much easier. I'll edit my post to include that as well as the original if commands.
Yeah that makes sense. Since you brought up trainerbattle, however.
Code:
.macro trainerbattle type index tb_intro tb_loss tb3 tb4
.byte 0x5C, \type
.short \index, 0x0000
.long \tb_intro, \tb_loss
.long \tb3
.long \tb4
.endm
That's all that you need. It doesn't matter that there are a different number of arguments. Placing the .long \tb3 and .long \tb4 on their own new line (as opposed to adding them after a comma) means that simply not providing anything for them when you use the macro results in no data being inserted. So you don't need trainerbattle0, trainerbattle1, etc. It can follow the same format of trainerbattle TYPE. The other difference I have is that there isn't a halfword argument. I just assumed 0x0000. I'm not really sure what that halfword is for, and I've never looked, because I've never even seen it used as something besides 0x0000? It may be better to leave it in, though, since people seem used to adding it to their scripts.
 
325
Posts
10
Years
Yeah that makes sense. Since you brought up trainerbattle, however.
Code:
.macro trainerbattle type index tb_intro tb_loss tb3 tb4
.byte 0x5C, \type
.short \index, 0x0000
.long \tb_intro, \tb_loss
.long \tb3
.long \tb4
.endm
That's all that you need. It doesn't matter that there are a different number of arguments. Placing the .long \tb3 and .long \tb4 on their own new line (as opposed to adding them after a comma) means that simply not providing anything for them when you use the macro results in no data being inserted. So you don't need trainerbattle0, trainerbattle1, etc. It can follow the same format of trainerbattle TYPE. The other difference I have is that there isn't a halfword argument. I just assumed 0x0000. I'm not really sure what that halfword is for, and I've never looked, because I've never even seen it used as something besides 0x0000? It may be better to leave it in, though, since people seem used to adding it to their scripts.
Huh, I didn't know that. I assumed it would give me errors if I didn't provide all the parameters each time, but I never tested it.

Yes, the halfword that's usually 0x0000 does something. It's not been looked into all that much, but it does. Placing 0x0003 in trainerbattle type 9 creates the Professor Oak text in the battle, for example. I'm not sure what other things it does though.
 
Back
Top