• 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
No, That is Not what I mean, I know that routines usage. what I mean is The game will check not only the Specie and Item but also party slot,
example: A bulbasaur holding Master ball in 1st slot only.

I'm telling you that is exactly what it does...

Code:
#dyn 0x740000
#org @start
lock
faceplayer
setvar 0x8000 0xspecies
setvar 0x8001 0xItemID
storevar 0x0 0x8000
storevar 0x1 0x8001
callasm 0x[Where you inserted the above routine +1]
compare 0x8000 0x6
if == jump @notFound
storevar 0x2 0x8000
msgbox @result
callstd MSG_NORMAL
release
end

#org @notFound
msgbox @failed
callstd MSG_NORMAL
release
end

#org @failed
= No match found for /v/h02 with a /v/h03

#org @result
= /v/h02 with a /v/h03 found in /v/h04
 

Lance32497

LanceKoijer of Pokemon_Addicts
792
Posts
9
Years
I'm telling you that is exactly what it does...

Code:
#dyn 0x740000
#org @start
lock
faceplayer
setvar 0x8000 0xspecies
setvar 0x8001 0xItemID
storevar 0x0 0x8000
storevar 0x1 0x8001
callasm 0x[Where you inserted the above routine +1]
compare 0x8000 0x6
if == jump @notFound
storevar 0x2 0x8000
msgbox @result
callstd MSG_NORMAL
release
end

#org @notFound
msgbox @failed
callstd MSG_NORMAL
release
end

#org @failed
= No match found for /v/h02 with a /v/h03

#org @result
= /v/h02 with a /v/h03 found in /v/h04

All it does is tell the exact slot of an specified Pokemon holding specified item...
what I really mean is it will check only in 1st slot(lets say) Even though you have bulbasaur holding masterball in 2nd, 3rd, 4th, 5th, or 6th slot, it ignores it because it just needs to check only in 1st.
By the way, how if I have 2 Bulbasaurs holding Masterball in same party, will this not affect the entire script? (thats why I request this routine to add new var that will be set in order for the game to check only in an specific area
: another example:
Code:
...
setvar 0x8000 0xspecies
setvar 0x8001 0xItemID
setvar 0x8002 0xSlotnumber(0-5:just an example)
storevar 0x0 0x8000
storevar 0x1 0x8001
storevar 0x2 0x8002
callasm 0x[Where you inserted the above routine +1]
compare 0x8000 0x6
...
 
146
Posts
11
Years
  • CO
  • Seen Mar 16, 2023
All it does is tell the exact slot of an specified Pokemon holding specified item...
what I really mean is it will check only in 1st slot(lets say) Even though you have bulbasaur holding masterball in 2nd, 3rd, 4th, 5th, or 6th slot, it ignores it because it just needs to check only in 1st.
By the way, how if I have 2 Bulbasaurs holding Masterball in same party, will this not affect the entire script? (thats why I request this routine to add new var that will be set in order for the game to check only in an specific area
: another example:
Code:
...
setvar 0x8000 0xspecies
setvar 0x8001 0xItemID
setvar 0x8002 0xSlotnumber(0-5:just an example)
storevar 0x0 0x8000
storevar 0x1 0x8001
storevar 0x2 0x8002
callasm 0x[Where you inserted the above routine +1]
compare 0x8000 0x6
...


Hello Lance32497 ,
Now I might be wrong here but
I think "compare 0x8000 0x6" is the slots...
ergo "0x6" is comparing the routine to all 6 slots in the party...
Try changing that to "0x1"...

Now again I am not a scripter and am just starting to really learn my self...
so take my advice with a grain of salt... >_<

Oh an so this post is not off topic,
This is not really a request but more of "is it even possible"
Changing the Battle system to Action Battle System like Mystery Dungeon...
Example would be when you get into a battle, "Player" and challenging Trainer are warped to a simple small map where battle...
Here is the link that gave me the idea, Check it out when you have time FBI Agent an again I would just like to know if this can even be done?
Cause I assume Asm could do it is the only reason I bring it up...

http://youtu.be/XNPuaPBm6ss
 

Lance32497

LanceKoijer of Pokemon_Addicts
792
Posts
9
Years
Hello Lance32497 ,
Now I might be wrong here but
I think "compare 0x8000 0x6" is the slots...
ergo "0x6" is comparing the routine to all 6 slots in the party...
Try changing that to "0x1"...

Now again I am not a scripter and am just starting to really learn my self...
so take my advice with a grain of salt... >_<

Oh an so this post is not off topic,
This is not really a request but more of "is it even possible"
Changing the Battle system to Action Battle System like Mystery Dungeon...
Example would be when you get into a battle, "Player" and challenging Trainer are warped to a simple small map where battle...
Here is the link that gave me the idea, Check it out when you have time FBI Agent an again I would just like to know if this can even be done?
Cause I assume Asm could do it is the only reason I bring it up...

http://youtu.be/XNPuaPBm6ss

Ill try to warch that if I am on PC... thanks ^_^
 
17
Posts
17
Years
  • Age 36
  • Seen Dec 13, 2016
RAM location 0x2023E8A will be zero if they lost. Something else if they won.

This worked a treat!, copied the byte from RAM to a varaible and branched from there. Thank you very much, and keep up the good work :-)

if I could suggest/request one more thing (if it's feasible?). When you knock out/faint another trainers Pokémon. You are shown the next Pokémon the trainer will be using and also prompted if you want to switch out your current in-play Pokémon.

Is it possible to skip the prompt (without switching) and continue through to the 'go [bufferedpokemon]!' message and continue the battle?

I'm aiming to have a system where the Player is on an even playing field with the AI. Where if the player wanted to switch a pokémon for any reason, they would have to sacrifice a full turn to do so.

Many thanks
 
Last edited:

Lance32497

LanceKoijer of Pokemon_Addicts
792
Posts
9
Years
Teaching a move in certain pokemon using Script
So this is different in Teaching moves in overworld, instead of choosing who is the pokemon compatible for the move, it will automagically replaces the 1st or the Last move that the pokemon knows.
 

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good
265
Posts
12
Years
  • Seen Feb 24, 2024
This worked a treat!, copied the byte from RAM to a varaible and branched from there. Thank you very much, and keep up the good work :-)

if I could suggest/request one more thing (if it's feasible?). When you knock out/faint another trainers Pokémon. You are shown the next Pokémon the trainer will be using and also prompted if you want to switch out your current in-play Pokémon.

Is it possible to skip the prompt (without switching) and continue through to the 'go [bufferedpokemon]!' message and continue the battle?

I'm aiming to have a system where the Player is on an even playing field with the AI. Where if the player wanted to switch a pokémon for any reason, they would have to sacrifice a full turn to do so.

Many thanks


Either turn set mode on in the options, or put 28 92 87 1D 08 at x1D8727. Be warned that the latter approach has a nasty side effect; scrubs will complain about your hack being "bugged" or that you removed a feature that should've stayed.
 

Blah

Free supporter
1,924
Posts
11
Years
Teaching a move in certain pokemon using Script
So this is different in Teaching moves in overworld, instead of choosing who is the pokemon compatible for the move, it will automagically replaces the 1st or the Last move that the pokemon knows.

You just want to overwrite a Pokemon's first move? That sounds like a bad idea. What's wrong with the over-world ingame move tutor?

All it does is tell the exact slot of an specified Pokemon holding specified item...
what I really mean is it will check only in 1st slot(lets say) Even though you have bulbasaur holding masterball in 2nd, 3rd, 4th, 5th, or 6th slot, it ignores it because it just needs to check only in 1st.
By the way, how if I have 2 Bulbasaurs holding Masterball in same party, will this not affect the entire script? (thats why I request this routine to add new var that will be set in order for the game to check only in an specific area
: another example:
Code:
...
setvar 0x8000 0xspecies
setvar 0x8001 0xItemID
setvar 0x8002 0xSlotnumber(0-5:just an example)
storevar 0x0 0x8000
storevar 0x1 0x8001
storevar 0x2 0x8002
callasm 0x[Where you inserted the above routine +1]
compare 0x8000 0x6
...

Alright. This is a minor edit of the existing code. Use 0x8004 for slot number. Everything else is the same.
Spoiler:


Either turn set mode on in the options, or put 28 92 87 1D 08 at x1D8727. Be warned that the latter approach has a nasty side effect; scrubs will complain about your hack being "bugged" or that you removed a feature that should've stayed.

Thanks for saving me time :)
 
17
Posts
17
Years
  • Age 36
  • Seen Dec 13, 2016
Either turn set mode on in the options, or put 28 92 87 1D 08 at x1D8727. Be warned that the latter approach has a nasty side effect; scrubs will complain about your hack being "bugged" or that you removed a feature that should've stayed.

Completely forgot about the options menu. But yeah the idea was to force the option. Haters gonna hate!

Much appreciated!
 

Kenny1

On a break from Rom hacking, to improve other skil
86
Posts
10
Years
  • Age 23
  • Seen Nov 6, 2017
Finally, thanks to Jambo, the routine is finished
Changing textboxes depending on var
This uses variable 40F0, but it can be changed(probably :P)

First compile this routine:
Spoiler:

Lastly the hook:
Spoiler:


Usage:
You would setvar 0x40F0 to the number of your choice, 0x0 would be the first, 0x1 second etc.
 

Lance32497

LanceKoijer of Pokemon_Addicts
792
Posts
9
Years
You just want to overwrite a Pokemon's first move? That sounds like a bad idea. What's wrong with the over-world ingame move tutor?
Move tutor is limited. Then, as I have said, it will be taught automagically, like in Daycare, it replaces the last move learned by the pokemon.
Alright. This is a minor edit of the existing code. Use 0x8004 for slot number. Everything else is the same.
Spoiler:
Nice one! I really like you! Thanks for this :)
 

Ephraim225

Freaky Frillish Guy
161
Posts
10
Years
Hello, I have a quick question before I start using any of these wonderful ASM hacks. For anything that uses a flag or variable, if I have this hack in my ROM hack do I need to alter any offsets or are they all compatible without needing to edit anything?
 

Blah

Free supporter
1,924
Posts
11
Years
Finally, thanks to Jambo, the routine is finished
Changing textboxes depending on var
This uses variable 40F0, but it can be changed(probably :P)

First compile this routine:
Spoiler:

Lastly the hook:
Spoiler:


Usage:
You would setvar 0x40F0 to the number of your choice, 0x0 would be the first, 0x1 second etc.

Great work, I'll add it to the first post soon

Move tutor is limited. Then, as I have said, it will be taught automagically, like in Daycare, it replaces the last move learned by the pokemon.

Nice one! I really like you! Thanks for this :)

You just expand the bit map. Read the thread about expanding TMs, it talks about the move tutor stuff.

In the past, I attempted forme change (using my own silent evolution which works the same except it would handle changing Rotom's attacks and handling PP etc.). I used the special 0x9F that allowed the party selection screen (correct me if I'm wrong).

This, however, causes problems (like losing control of your character and gaining control of an NPC) when transitioning between different maps that don't have warps (town -> route). I know it's the special because I used in-game scripts that used the same special. I also used the scripts without the special and both the in-game and my scripts worked. I also used the scripts and transitioned through a warp or didn't transition and there was no problem.

FBI, I saw previously you advised using this special and I remembered what happened. Have you had similar problems with this? (This is a problem when trying to use the "script from bag" but that's also not the cause of the glitch).

Also, 2 suggestions for ASM. Scripts that read the EVs and IVs of individual mons in the party. I had coding for this but it used JPAN's decryption, I ran into that special 0x9F problem, and I don't have it on me :(

I personally have not had any problems with special 0x9F. I also suggest that you use the game's own decryption function. I'll look into making a routine which reads EVs/IVs.

That sounds like a game breaking bug. 0/10 would not use.

go finish ur rombase

Hello, I have a quick question before I start using any of these wonderful ASM hacks. For anything that uses a flag or variable, if I have this hack in my ROM hack do I need to alter any offsets or are they all compatible without needing to edit anything?

Hi. My advice is don't use that. There's 255 safe flags in the game + the game flags. There's also 238 safe to use variables + the ingame variables and temporary variables. If you use these, you will 100% not run out of variables/flags unless your ROM is a 256MB mega hack. Also Jambo made the 0x8000 - 0x8016 variables saved, which are temporary and don't really need saving (not that it matters). Basically he uses JPAN's memory save blocks and saves the variables/flags onto there. So you would need to re-point the PSS, Roaming, seen counter, berry system and the bag restoration/deletion routines. The rest work regardless.

But like I said, there really isn't a need to expand the variables/flags. Fire Red uses plenty for it's original story, and there are a lot of "spares" as I've mentioned. Utilizing those you surely won't run out unless you're scripting/organizing very poorly.
 
215
Posts
11
Years
  • Seen Jul 14, 2020
If this is not ASM just tell me i'm being stupid, but is there an ASM code that you can use to help you change the HP bars? I want to change mine and ive discovered nothing yet :S
 
3
Posts
10
Years
Your works are insanely great, I like them all, thanks!

Here are some request
Custom Runtime Trainer
Simply read every data from RAM to built a custom trainer via script, very useful when doing something like battle tower

The ability to adjust the chance to meet a shiny pokemon
Double (or adjust by using percentage) the original chance when set, or having a Shiny Charm inside your bag.
 

Lance32497

LanceKoijer of Pokemon_Addicts
792
Posts
9
Years
Aaahmmm....
I dont know how to expand Move tutor, but its ok ^_^ I should throw my request in garbage and think of an implementation that fits on your taste.
Updating Daycare System
This routine will let you put 6 Pokemons in a daycare, making the first 2 Pokemon you put in a daycare will be able to gain experience and to produce an egg, and the remaining 4 pokemon will grow only.
Static Level for a Pokemon
It will be useful for events, like a disease spreads out that causes an Specific pokemon not to grow or gain experience and EV's...
in short, making Magikarp,example, to be permanent level 0
 

Kenny1

On a break from Rom hacking, to improve other skil
86
Posts
10
Years
  • Age 23
  • Seen Nov 6, 2017
If this is not ASM just tell me i'm being stupid, but is there an ASM code that you can use to help you change the HP bars? I want to change mine and ive discovered nothing yet :S

Wouldn't this be graphics? Unless you're wanting to change them when an event happens?
 

Lance32497

LanceKoijer of Pokemon_Addicts
792
Posts
9
Years
Setting Gender for A Trainers Pokemon
All it does is set a var for into whatever slot we want(0-5), then set a var again for gender(0-2) or whatever method you will use, The problem that I think this implementation will encounter is for when we attempt to set the 6 slot even thought it only has 4 Pokemon, but we can prevent that.
 

Blah

Free supporter
1,924
Posts
11
Years

Getting IVs and EVs


The routines are very similar so I ended up just combining the two routines into one. Basically given a slot number of a Pokemon in 0x8004, the routines will return the EVs or IVs, respectively, into the vars 0x8005-0x800A with 0x8003 as the IV/EV switch.


How to insert:

Compile and insert the following routine into free space:

Spoiler:



Usage:
setvar 0x8003 0x[anything except 0 = IV, 0 = EV]
setvar 0x8004 0x[slot number 0 to 5]
callasm 0x[this routine +1]

The variables will be:
0x8005: HP IV/EV
0x8006: Atk IV/EV
0x8007: Def IV/EV
0x8008: Spd IV/EV
0x8009: S.atk IV/EV
0x800A: S.def IV/EV
 
Last edited:
Back
Top