• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

Code: ASM Resource Thread

Can I request to have this thread to have examples of scripts (I mean the scripts which are XSE based)? Since a lot of people ask those here while checking ASMs. I think this should be started in the future posts of new ASMs (well, if you have effort enough to edit every single ASMs posted, then do so).

Erm.. Last time I checked, FBI posts how to use the ASM in a script, at the end of each post in the 'usage' part. If you mean a full on script starting from dynamic to end, well I guess thats FBI's chioce :/ But this isn't exactly a thread on scripting, which is why he includes basically everything you need to know in the usage section depending on the code. But again, it's FBI's decision lol.
 
Hm... How about a lazy method of doing this?
Like this...

Have 10/20 Shockwave -> Learn TM Hyperbeam 5/5 --> Learn Shockwave 5/20

Simply keep the numerator and only run a check if it's greater than the denominator. If the numerator's greater than the denominator, then make both values equal. :3

Yeah, this seems like the only solution that would help solve the problem. Unless someone comes up with something better, this is probably what I'm going to do. Thanks.

Well, my intent was to use the bike as, well, a key item called the dive suit. Its an item needed to access a certain place in the game (underwater as you may guess). The bicycle has a number of features that the running shoes do not to make things a hell of a ton simpler. For one, it is an actual item, rather than a flag. Also, the bike has its own soundtrack, where as the running shoes simply stick with the current sound track playing. That was one thing I felt this suit must need, a custom track (which I already inserted in sappy.) Now, if these things could be done to the running shoes using ASM (But I'd imagine that making the shoes an actual item and have its own sound track would be awfully complicated) thats another story, but for now I've just decided to use the bicycle as the thing to replace, I didn't find myself using the bike in the games anyways, mainly the shoes. It only has a tiny bit of a speed difference anyway.

That was my motive :)

So, possible?

I understand now. Hmm, this is a little specific though. The thread rules state that I'm not going to do routines which are specific to a hack. Anyways, since this is your first request, and this is relatively simple I'll do it. Look at the bottom of this post.

Can you be a more specific with the naming routines? Seems interesting :D

Sure. I'll give you a video. It's the naming portion of the video in this post: https://www.pokecommunity.com/posts/8662862/

Can I request to have this thread to have examples of scripts (I mean the scripts which are XSE based)? Since a lot of people ask those here while checking ASMs. I think this should be started in the future posts of new ASMs (well, if you have effort enough to edit every single ASMs posted, then do so).

Hi, I think most of the ones that require scripts have script examples. There are a few simple ones which don't, but that's because all it is, is just a callasm command after setting a few variables. In future, I'll look into putting a little more effort into the usage portion.


Set Bike Speed to Walk speed


How to insert:
Change byte at 0x150514 to 01

This has got to be the simplest thing here. lol.
 
Can I request something that I hope is relatively straight forward? A routine which adds 1 to a variable after winning a trainer battle? Could be used to record victories, count winning streaks, etc.
 

Set Bike Speed to Walk speed


How to insert:
Change byte at 0x150514 to 01

lol Thanks :P

I'm not sure how you found that offset.. I've been looking for it for a long time. Despite, it still partially does not work. Registering the bike is glitched up. You can register it fine, you can click select and use it fine, however you cannot recall it. I think I have a slight understanding why this is, but I have absolutely no idea how I could fix this. Do you, just maybe, know how it could be done? :)
 
lol Thanks :P

I'm not sure how you found that offset.. I've been looking for it for a long time. Despite, it still partially does not work. Registering the bike is glitched up. You can register it fine, you can click select and use it fine, however you cannot recall it. I think I have a slight understanding why this is, but I have absolutely no idea how I could fix this. Do you, just maybe, know how it could be done? :)

Well here is a complicated but theoretically working method.

Using Darthatron's script item hack, you can call FBI' overworld change with the code Playsong 0x## 0x1 the 0x1 will act like the bike music (ie only change after map change, not a trainer/wild battle).
 

Set Bike Speed to Walk speed


How to insert:
Change byte at 0x150514 to 01

This has got to be the simplest thing here. lol.

Hmmm... so that means can we also fasten up the FR Bike to match RSE Mach Bike?
 
Hmmm... so that means can we also fasten up the FR Bike to match RSE Mach Bike?

Not nessisarily, at least using this method. I've already tested it, if you keep going higher, it still does the exact same thing as the bike for 2-7. Everything above there still has the same speed, except you get the oak message (nows not the time to use that!) when trying to recall it after using it. Basically meaning you can't get off of it unless you warp somewhere.
 
I'm right! The naming routine is very interesting :D

edit: I can't understand the Re-usable TM's. (This one).
It says:
To insert:
Do the byte changes below
[S-HIGHLIGHT]0x124F78: 00 00 00 00[/S-HIGHLIGHT]
0x125C80: 00 00 00 00

Make it Ungivable:
insert that at 0x1326B8: 00 00 17 E0

Make it consumable after animation:
[S-HIGHLIGHT]Insert: 00 00 00 00 at 0x124F78[/S-HIGHLIGHT]

I can't understand that... :s
Am I just dumb or ...
 
Last edited:
I'm right! The naming routine is very interesting :D

edit: I can't understand the Re-usable TM's. (This one).
It says:


I can't understand that... :s
Am I just dumb or ...

For example, at 0x124F78, in the default game it has 75 F7 2E F9. You insert 00 over those four bytes, essentially replacing them. That goes for all of the offsets you listed - the four two digit bytes at each offset, replace them with 00 in a hex editor.
 
For example, at 0x124F78, in the default game it has 75 F7 2E F9. You insert 00 over those four bytes, essentially replacing them. That goes for all of the offsets you listed - the four two digit bytes at each offset, replace them with 00 in a hex editor.

I know that, lol.
I'm confused of this:
To insert:
Do the byte changes below
[S-HIGHLIGHT]0x124F78: 00 00 00 00[/S-HIGHLIGHT]
0x125C80: 00 00 00 00

Make it Ungivable:
insert that at 0x1326B8: 00 00 17 E0

Make it consumable after animation:
[S-HIGHLIGHT]Insert: 00 00 00 00 at 0x124F78[/S-HIGHLIGHT]

The offsets highlighted is the same, by the way. Anyway, that's fixed now! Thanks FBI!
 
I saw a post in the script help thread by Méw who said he was trying to make it so that when you make a warp script, when you warp a key item is also activated. I looked through all of XSE's commands and there is no command that uses an item. I think this is the right place to post this, but how possible is it to make an item activated when making a warp script? I'm assuming the only thing the routine would involve is using an item, and the script does the rest..
 
Wow. I'm genuinely happy someone requested this. Believe it or not, this exact routine was my first ever routine. Darthatron held my hand through the process, and it's been years since I've done it. I'd be happy to redo it just for the nostalgia
[PokeCommunity.com] ASM Resource Thread


However, I should warn you that fitting it all into one routine is not possible.

Okay then! Now I don't care how many routines it needs just to work! Just knowing that it can be done and how you've had an experience with this fires me up!
[PokeCommunity.com] ASM Resource Thread
Teach us how and I'll put it to good use! Thank you!
 

Battle by turn addon HP-regen


Before inserting this routine, you need to have the battle by turn routine enabled. See first post for that.

Intro:

A simple routine which adds HP regeneration to a Pokemon every odd turn of battle. The amount added can be changed (read the comment in the code).

How to insert:

Insert as a new battle by turn routine specified by the battle by turn frame. No further instructions required.

Spoiler:


Usage:

No usage, it's automatic. Make sure you have set the battle by turn flag.
 
Last edited:

HP Regeneration per step


Intro:
Basically a routine to regenerate a Pokemon's HP every step. In this routine it's set to 3 per step. You may want to modify the exact amount to a percentage or something (see the commented line).

How to insert:

First compile and insert the following routine into free space.

Spoiler:


Now in a hex editor navigate to 0x6D5F6. There you will need to insert the following byte changes:
Code:
 01 4A 10 47 00 00 XX XX XX 08
Where XX XX XX is the pointer to where you inserted the above routine +1.

Usage:

There isn't any usage. It's automatically done. You can change the amount generated by reading the line in the code which I've commented.
 
Last edited:
Okay then! Now I don't care how many routines it needs just to work! Just knowing that it can be done and how you've had an experience with this fires me up!
[PokeCommunity.com] ASM Resource Thread
Teach us how and I'll put it to good use! Thank you!

Done!

I know that, lol.
I'm confused of this:


The offsets highlighted is the same, by the way. Anyway, that's fixed now! Thanks FBI!
That's because I wrote it down twice due to my brain malfunctioning. I'll have to edit that when I've mustered enough willpower.

I saw a post in the script help thread by Méw who said he was trying to make it so that when you make a warp script, when you warp a key item is also activated. I looked through all of XSE's commands and there is no command that uses an item. I think this is the right place to post this, but how possible is it to make an item activated when making a warp script? I'm assuming the only thing the routine would involve is using an item, and the script does the rest..
That's interesting. Why can't he use a level script? In the end, in my ASM routine, I will end up having to execute the item's script/routine as a level script anyways. It's better to just use scripting here I'd think. It's a matter of finding each item's function, see davidjcobb's tutorial on adding items. There's a field in each item where it's routine is located. Most times you can just callasm to this routine. If you have trouble running a specific routine there, shoot me to routine offsets.
 
This is very dependent on what you're swapping. The solution is probably going to be a rewrite using the same skeleton. Also iirc, the badges are OAMs, not tile/bg graphics. You will need to generate/hide/show these extra OAMs on top of the BG overlay depending on the extra badge flags that have been implemented.

I was actually thinking of just swapping which graphics it loaded, but I actually think it'll be more than that. Sorry Dionen.
 
I was actually thinking of just swapping which graphics it loaded, but I actually think it'll be more than that. Sorry Dionen.

I think that's all it takes, honestly. Find where the pointers to the graphics are loaded and hijack that routine to potentially load different pointers.
 
I'd really like to see some ports of these routines (particulary this one, this one, this one, and this one) ported over to Ruby.

Dereferencing the necessary pointers should be easier in the absence of malloc(), so it shouldn't be too difficult. We should have better support for Ruby than this.
 
I think that's all it takes, honestly. Find where the pointers to the graphics are loaded and hijack that routine to potentially load different pointers.

He needs to load OAMs, the BGs are always easy to swap around. daniilS pls :x

I'd really like to see some ports of these routines (particulary this one, this one, this one, and this one) ported over to Ruby.

Dereferencing the necessary pointers should be easier in the absence of malloc(), so it shouldn't be too difficult. We should have better support for Ruby than this.

Well you don't need to dereferencing pointers, most of the RAM pointers are statically allocated to specific portions which are flagged. \What you'd need to do is find these static RAM blocks equivalents in your game of choice.

Anyways, why do you want support for R/S or LG? They're all pretty bad bases to use. The biggest problem is their lack of research. It's pointless to research something for R/S when it's already been discovered for Emerald, because Emerald will be better than Ruby as a base, but never vise versa. It's just not worth the time researching things for a ROM base which is inferior.

Fire Red has the most research done, and in my opinion, is the best base to use. Second comes Emerald, and finally the rest are trash.

But, yeah, if you wanted to port them, the pointers are all that needs changing (for the ones you've linked). Actually, the surf one may be a little different depending on the base. Fire Red launches that routine when "A" is pressed on any tile. Other bases may be a little different.
 
Last edited:
Back
Top