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

Code: ASM Resource Thread

Blah

Free supporter
1,924
Posts
11
Years

Pokemon Obedience via Level and Happiness!


How it works:
If your Pokemon outlevels the level your badges say you can control, it will disobey you if it's unhappy. The concept was pretty simple sounding, but there was a lot of work that went into it. This should keep some similarities to the anime.
I should note that if your Pokemon loves you, and you don't have the badge to train it, it will still listen to you :3

This one is called love.asm

How to insert:
Compile and insert into freespace the following code:
Spoiler:


Here's a compiled version:
Code:
82 24 24 01 00 22 20 1C 15 4E 00 F0 28 F8 01 28 04 D1 01 34 01 32 08 2A 1A D0 F4 E7 0A 20 82 22 12 01 A4 1A 44 43 14 34 28 88 78 43 0D 4E 80 19 38 21 0D 4E 00 F0 13 F8 A0 42 09 DD 28 88 78 43 08 4E 80 19 20 21 08 4E 00 F0 09 F8 7F 28 01 D9 01 20 01 E0 05 48 00 47 00 22 05 49 08 47 30 47 D1 E6 06 08 84 42 02 02 E9 FB 03 08 15 D4 01 08 2B D4 01 08

Navigate to 0x1D3E0 and insert:
Code:
 00 48 00 47 XX XX XX 08
Where XX XX XX is the reverse hex pointer to location you compiled the routine.

I should mention there was a little bit of this routine which I'm skipping over. Basically it checks if the Pokemon is a Mew or Deoxys. It then checks if the Mew/Deoxys has it's obedience set. I find the need for this non-existent because the obedience is checked by happiness and badges my way. In the end, if you want to keep these two (rather pointless) checks, insert at 0x1D406.

Sorry for the double post. I want to keep my routines on separate posts to help in formatting the first post's index :x

Requested here: http://www.pokecommunity.com/showpost.php?p=8510180&postcount=1
I made a special exception and decided to do it for her here by that I mean no other requests were on the table:)
 
Last edited:
6,355
Posts
18
Years
  • Seen Apr 16, 2020
I'm going to suggest something as well since it's kind of similar to all these routines you're doing. It's something that's been done in OR/AS. Going to put this in a spoiler:
Spoiler:

So basically, a routine that would check if any of your Pokémon (or a specific one) are holding a certain item, or any of your Pokémon are nicknamed, though I believe the first one would be more useful.
 
204
Posts
9
Years
  • Age 37
  • Seen Jul 26, 2021
Is it possible to make exp dependend on how big the level gap between you and the opponent pokemon are? for example that you get 100% of the exp if you beat a Pokemon, that is on a higher level or the same level as your pokemon, but only get 50% if your Pokemon is 10 level higher than the opponent Pokemon or so.
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
Dood, this sounds awesome, I hope you get some cool ideas from this.

Here's what came to my mind (For Fire Red U):
Spoiler:
Spoiler:
 

Blah

Free supporter
1,924
Posts
11
Years
I'm going to suggest something as well since it's kind of similar to all these routines you're doing. It's something that's been done in OR/AS. Going to put this in a spoiler:
Spoiler:

So basically, a routine that would check if any of your Pokémon (or a specific one) are holding a certain item, or any of your Pokémon are nicknamed, though I believe the first one would be more useful.

I accept your challenge!
Nickname checks are done in a script via special2 0x7B. It returns 1 in the variable if it wasn't nicknamed.

Is it possible to make exp dependend on how big the level gap between you and the opponent pokemon are? for example that you get 100% of the exp if you beat a Pokemon, that is on a higher level or the same level as your pokemon, but only get 50% if your Pokemon is 10 level higher than the opponent Pokemon or so.

I'll add it to my projects list. iirc, this is read off of a table isn't it?

Ooh, I think I know this one, It doesn't require ASM, but it's actually a table I found a loooong while back. Either way, I believe the table is located at 0846AEFC, and the cutscene is executed using special 0x17B and the number in variable 0x8006. If you want to, you can repoint the table and then increase the length, setting the byte at 08147148 to the new number of locations you have. As for the format, I believe it's <bank> <map> <xpos> <ypos> <something>.

Thanks :D


Party Item Checker:


How it works:
So I use the variables 0x8000 and 0x8001 again.
0x8000 Should be set to Pokemon species (2 bytes)
0x8001 Needs to be set to Item ID (1 byte...can be changes to 2 if you inserted more than 255 items)

case 1:
If a Pokemon in your party has the item specified by 0x8001 and the species matches 0x8000, return that Pokemon's slot

case 2:
If 0x8000 is set to 0x0 (no species), the routine will search your whole party and return the slot of the Pokemon holding the item specified in 0x8001

case 3:
If no Pokemon in the party are holding the item, returns 0x6.

The result will be stored in variable 0x8000. The result will, obviously, be 0x0-0x5 (slot) for item found and 0x6 for not found.


How to insert:

Compile and insert into free space the following routine:
Spoiler:


Here's a compiled version:
Code:
7F B5 18 4E 36 78 00 25 AE 42 22 D0 64 20 68 43 01 1C 15 48 40 18 0C 21 14 4A 00 F0 1E F8 0F 4B 1B 78 98 42 01 D0 01 35 EE E7 0D 4C 24 88 00 2C 0C D0 0E 4A 64 20 68 43 01 1C 0B 48 40 18 0B 21 00 F0 0B F8 06 4C 24 88 A0 42 EC D1 04 4A 15 70 7F BD 03 48 06 21 01 70 7F BD 10 47 BA 70 03 02 B8 70 03 02 29 40 02 02 84 42 02 02 E9 FB 03 08

Usage:
In a script,
setvar 0x8000 0xspecies
setvar 0x8001 0xItemID
callasm 0x[Where you inserted the above routine +1]

That's it!
 
Last edited:

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
Is it possible to make exp dependend on how big the level gap between you and the opponent pokemon are? for example that you get 100% of the exp if you beat a Pokemon, that is on a higher level or the same level as your pokemon, but only get 50% if your Pokemon is 10 level higher than the opponent Pokemon or so.

You mean like in BW? Because that has been ported already.
 
204
Posts
9
Years
  • Age 37
  • Seen Jul 26, 2021
Well i didnt meant especially like in bw when i wrote my post, because i didnt play bw and thus didnt know that it had such a exp system. I now looked the bw system up and yes, it comes close to what i want, even though i would like it to be a bit more radical.
Um i searched for a thread were this port is explained and if such a thread exist, i couldnt find it.
I would be really thankful if you could send me a link to the port!
 

BLAx501!

Pokemon Flux
80
Posts
10
Years
I was writing you some ideas when I lost all the text I had wrote... Very frustrating xD

Well, I have 3 ideas to show up, here we go!

1.- Forced evolution For some points it would be great to have this, like for example give your starter a final evolutionary stage really powerful, or for some plot twists (like when on the manga, Red's Poliwhirl evolves to Poliwrath).

2.- Keeping TM like on BW: This was done before, but it doesn't work properly. I don't usually leave comments here so I can't put any link yet, but if you want I can send you them by Profile Message or Private Message.

3.- Skip Prof. Oak's introduction: In my opinion this introducion is okay for the original games, but not everyone likes it, and it's bad for people who look for a really inmersive story, cause it has to start always more or less the same. It is possible to skip it (I don't know how it's done, but I guess you just have to branch instead of the direction of the intro, the direction of where the game itself starts) and to give preset names to both the player and the rival, but again, I'm not as good to do it yet xD.


Well, I hope I don't bother you with these ideas xD. Thanks in advanced an really nice work here :D
 

Blah

Free supporter
1,924
Posts
11
Years
Well i didnt meant especially like in bw when i wrote my post, because i didnt play bw and thus didnt know that it had such a exp system. I now looked the bw system up and yes, it comes close to what i want, even though i would like it to be a bit more radical.
Um i searched for a thread were this port is explained and if such a thread exist, i couldnt find it.
I would be really thankful if you could send me a link to the port!
I don't know where it is either. Perhaps you can ask daniilS via VM or something.


I was writing you some ideas when I lost all the text I had wrote... Very frustrating xD

Well, I have 3 ideas to show up, here we go!

1.- Forced evolution For some points it would be great to have this, like for example give your starter a final evolutionary stage really powerful, or for some plot twists (like when on the manga, Red's Poliwhirl evolves to Poliwrath).

2.- Keeping TM like on BW: This was done before, but it doesn't work properly. I don't usually leave comments here so I can't put any link yet, but if you want I can send you them by Profile Message or Private Message.

3.- Skip Prof. Oak's introduction: In my opinion this introducion is okay for the original games, but not everyone likes it, and it's bad for people who look for a really inmersive story, cause it has to start always more or less the same. It is possible to skip it (I don't know how it's done, but I guess you just have to branch instead of the direction of the intro, the direction of where the game itself starts) and to give preset names to both the player and the rival, but again, I'm not as good to do it yet xD.


Well, I hope I don't bother you with these ideas xD. Thanks in advanced an really nice work here :D

1) For forced evolution, I don't know what you're really talking about. You mean just make a Pokemon evolve without giving the player time to hit the "b" button? I'll look into Pokemon evolution sure.

2) I haven't seen it so VMing me it would be nice. Anyways this is rather easy, I've done it before. I'll post the results at the bottom of this post.

3) Skipping the introduction was already done by Knizz. There's a post in the research and development section's quick research thread.


Preventing TMs from being consumed on use


Quick research:
TMs are deleted in two places. The first place is in their own function. When called from the bag, after use the TM has it's own deletion mechanism. The second way is from the bag, after you use a TM the bag attempts to delete it as well. Well, the solution is quite simple. There's two ways to do this, either go to 0809A1D8 call your own function there which checks if the item is a TM, and if it is, just jump to the end. Or much more simply you just remove the parts from the bag and tm function that deletes the TM (Which is what I did). The former way is a way you can make another item you have unconsumable.

To insert:
Do the byte changes below
0x124F78: 00 00 00 00
0x125C80: 00 00 00 00

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

Make it consumable after animation:
Insert: 00 00 00 00 at 0x124F78

To remove the quantities showing up in the bag:

Compile and insert into free space:
Spoiler:


Here's a compiled version:
Code:
00 2D 01 D1 05 4B 18 47 38 1C 08 21 22 1C 04 4E 00 F0 02 F8 01 4B 18 47 30 47 C0 46 FF 1E 13 08 B1 35 13 08

Now navigate to 0x131EF4 and insert:
Code:
00 48 00 47 XX XX XX 08
Where XX XX XX is the pointer to where you assembled the routine +1

Now navigate to 0x131EA5 and change the byte to E0

Unsellable:
Basically for the TMs, you can still sell them to vendors. To change this, you need to modify each TM individually. It's unfortunate, but the game checks if an item can be sold my comparing it's market price to zero. If it's strictly greater than zero, then you can sell it to a vendor, seems to be the rule. So to make TMs unsellable you need to set their market prices individually to zero.
I can't use my own checks to disguise the TMs as unique because the sell routine in shops are used for ALL items including potions, berries, TMs, and other items like nuggets.


Present :3
3nina1p.png
 
Last edited:
6,355
Posts
18
Years
  • Seen Apr 16, 2020
1) For forced evolution, I don't know what you're really talking about. You mean just make a Pokemon evolve without giving the player time to hit the "b" button? I'll look into Pokemon evolution sure.

I think what BLAxTOISE meant by forced evolution is making a Pokémon from your party evolve from a script. I can see this being used as an alternative for trade evolutions, for example paying someone to make your Pokémon evolve.
 

BLAx501!

Pokemon Flux
80
Posts
10
Years
1) For forced evolution, I don't know what you're really talking about. You mean just make a Pokemon evolve without giving the player time to hit the "b" button? I'll look into Pokemon evolution sure.

Exactly, I was meant to say that @Christos hahahahaha. As far as I know, there are two problems with that. Even if you have found the starting offset of the routine (I'm not 100% sure of what I'm saying xD), you need to find the one who returns you to the regular gameplay after it. Also, you need to check the species involved into the process, to make it coherent.

This will just make the TM's usage infinite. It will still allow you to sell the TM, give it to a Pokemon..ect.
Playing with the Mistery Values on an Item Editor you can get the TM behave like HM in terms of equipping them, selling or tossing them. Did you get the amount of TM removed?? It's purely aesthetic, but it would be nice.

As far as I know, changing the first Mistery Value of a TM from 00 to 01, it displays like an HM, without the amount, but with the HM tag behind the TM number.


Thanks for answering so quickly :P
 

Blah

Free supporter
1,924
Posts
11
Years
I think what BLAxTOISE meant by forced evolution is making a Pokémon from your party evolve from a script. I can see this being used as an alternative for trade evolutions, for example paying someone to make your Pokémon evolve.
Thanks for clearing that up.

Exactly, I was meant to say that @Christos hahahahaha. As far as I know, there are two problems with that. Even if you have found the starting offset of the routine (I'm not 100% sure of what I'm saying xD), you need to find the one who returns you to the regular gameplay after it. Also, you need to check the species involved into the process, to make it coherent.

Playing with the Mistery Values on an Item Editor you can get the TM behave like HM in terms of equipping them, selling or tossing them. Did you get the amount of TM removed?? It's purely aesthetic, but it would be nice.

As far as I know, changing the first Mistery Value of a TM from 00 to 01, it displays like an HM, without the amount, but with the HM tag behind the TM number.


Thanks for answering so quickly :P

1) For the TMs, no I did not remove the number that appears beside it (I just simply modified it to work like HMs in the ways you mentioned above, except the quantity). I think that this is directly related to the "HM tag". When the bag opens it displays it's contents and this number appears depending on this value. I'll try to track this down later, it's definitely not going to be easy.

2) Your evolution request is turning out to be quite the big request! There's a lot of work that goes into evolution including stat updates, Pokedex updates, species updates and depending on if it has a nickname or not the nickname updates. There's also Having to figure out which Pokemon evolves into which Pokemon too. Although normally I wouldn't take on something like this that'd take me a while, I've decided that I'll do it because it's actually a very neat and fun feature :P
 

Trainer 781

Guest
0
Posts
Thanks for clearing that up.

sy.

2) Your evolution request is turning out to be quite the big request! There's a lot of work that goes into evolution including stat updates, Pokedex updates, species updates and depending on if it has a nickname or not the nickname updates. There's also Having to figure out which Pokemon evolves into which Pokemon too. Although normally I wouldn't take on something like this that'd take me a while, I've decided that I'll do it because it's actually a very neat and fun feature :P

There is Chaos Rush's Thread for changing species of a pokemon via script and using JPAN's ASM for Ruby. http://www.pokecommunity.com/showthread.php?t=279194. This might save you some work.
 

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
There is Chaos Rush's Thread for changing species of a pokemon via script and using JPAN's ASM for Ruby. http://www.pokecommunity.com/showthread.php?t=279194. This might save you some work.

Actually, I wouldn't recommend using JPAN's method: for some reason he wrote a completely custom decryptor, while there is an existing one in the rom already. It's way easier to use because changing a pokémon's species requires just a single callasm. (If anybody is interested, I made this in ancient times: )
Spoiler:

However, I believe the thing that's important about his request is playing the evolution animation, which isn't as easy to do as this.
 

Blah

Free supporter
1,924
Posts
11
Years
Thanks, I'm actually already done the parts of getting the evolution done. I'm working on animation right now :)

Also yours, Danills, doesn't seem to work to update the nickname, pokedex entry, new moves or get the next evolution automagically?
I've fixed these in my version.
 
Last edited:

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
Thanks, I'm actually already done the parts of getting the evolution done. I'm working on animation right now :)

Also yours, Danills, doesn't seem to work to update the nickname, pokedex entry, new moves or get the next evolution automagically?
I've fixed these in my version.

Nope, because mine was more of a reply to using JPAN's decryptor. The routine I had written is used for Rotom.
 

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
Can you create an evolution like arceus in which the Pokemon will change form if holding an item without showing the evolution screen

That's not even an evolution, it's an index number change, like in that other routine I sent. And I have made such a routine in the past indeed, the problem is it's so horribly coded that it only works if the indexes are the same as in PRPB, and nobody is able to understand it. Rewriting it is on my to-do list for the Christmas holiday.
 

Blah

Free supporter
1,924
Posts
11
Years
Hmm, so I'm at this point where I can silently make the evolution happen without a problem in sight. However, once I add in the animation, it works fine too, until the part where the animation is over and it's time to enter back into OW. We get a gamefreeze once that happens. That and you can cancel the animation process by pressing "b". So it's very buggy and it will take time to rework.

I'll save the Evolution + animation till a later time. Currently it's 70% done, just have to figure out how to remove the freeze.

Until then here's the "silent evolution" one. Which, ironically, is a lot longer than with the animation.


Forced Evolution (silently):

(with animation to come at a later date).

How to insert:
Compile and insert into free space the following routine:

Spoiler:


Here's a compiled version:
Code:
FF B5 49 48 00 88 64 21 48 43 48 49 40 18 07 1C 0B 21 47 4B 00 F0 84 F8 05 1C 00 F0 29 F8 06 1C 38 1C 38 21 42 4B 00 F0 7B F8 04 1C 38 1C 3D 4A 31 1C 11 80 0B 21 3F 4B 00 F0 72 F8 38 1C 3E 4B 00 F0 6E F8 30 1C 3D 4B 00 F0 6A F8 30 1C 02 21 3B 4B 00 F0 65 F8 30 1C 03 21 39 4B 00 F0 60 F8 38 1C 38 21 32 4B 00 F0 5B F8 A0 42 37 D1 0C E0 04 21 41 43 40 18 C0 00 32 4B C1 18 48 88 8A 88 90 42 00 DC 70 47 10 1C 70 47 38 1C 2E 49 0A 1C 02 21 27 4B 00 F0 44 F8 2C 48 0B 21 69 43 09 18 0D 1C 29 49 0C 1C 00 20 0A 28 0D D0 01 35 29 78 01 34 22 78 8A 42 32 D1 FF 2A 00 D0 02 E0 FF 29 02 D0 2C E0 01 30 EF E7 20 4A 0B 20 46 43 B6 18 38 1C 32 1C 02 21 17 4B 00 F0 22 F8 1F E0 A0 42 D3 D0 02 1C 38 1C 19 21 11 4B 00 F0 19 F8 01 1C 00 09 A2 42 01 D9 09 18 00 E0 09 1A 09 4A 11 60 19 21 38 1C 0B 4B 00 F0 0B F8 38 1C 0A 4B 00 F0 07 F8 38 1C 38 21 06 4B 00 F0 02 F8 DF E7 FF BD 18 47 C0 46 B8 70 03 02 BA 70 03 02 84 42 02 02 E9 FB 03 08 7D 03 04 08 7D E4 03 08 99 32 04 08 75 8E 08 08 54 97 25 08 D0 1C 02 02 E0 5E 24 08

Usage:

Set the slot of the Pokemon you want to evolve in var 0x8001 (0x0 to 0x5). Then callasm to this routine and the rest is done automagically.

You can use this routine in conjunction with the checkItem routine to make a Pokemon evolve if it's holding an Item. Or if you wanted an evolution scene inside the Overworld this is useful too.
Like I said, an animated version will come out later once I figure out a way to fix some bugs. No promises on the date, it's very complicated :P
 
Last edited:
6,355
Posts
18
Years
  • Seen Apr 16, 2020
Usage:

Set the slot of the Pokemon you want to evolve in var 0x8001 (0x0 to 0x5). Then callasm to this routine and the rest is done automagically.

What if the Pokémon I choose to evolve has two evolutions available, like Gloom, Slowpoke or Poliwhirl? Would it just go for the normal level-up evolution, which is the first in their data?
 
Back
Top