• 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

Finally got around to refactoring my Bug-Catching Contest scripts / code, and decided to make it publicly available on GitHub. Check it out here: https://github.com/sphericalice/Bug-Catching-Contest

It's not an exact clone of how the HG/SS contest works, but it's good enough (& the beauty of source code is you're free to improve it)!
 
Most probably, things like Conversion and Mirror Move will fail on those custom battle script moves.
For removeitem, check the Natural Gift move implementation in move resource thread.

Hey, thanks! Btw, I'm having some issues with battle end routine application. It works perfectly fine but when the pinch berry triggers, it freeze or not continue at all.
 

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:


Compiled version:
Code:
3F B5 00 24 05 2C 14 D8 0A 48 00 78 01 21 61 43 09 4B 1B 78 00 2B FF D0 1A 31 08 4A 00 F0 08 F8 01 1C 07 4A 02 20 60 43 12 18 11 70 01 34 E9 E7 10 47 3F BD C0 70 03 02 BE 70 03 02 E9 FB 03 08 C2 70 03 02

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


I didn't really understand what it does can you explain me please ?
 
I didn't really understand what it does can you explain me please ?

There's no better explanation than the one at the top of the post you've quoted...

With this routine you can get the EV/IV of a chosen Pokemon from your party.

One var acts as a switch to get EV or IV depending on its value, the next one stores the position of the Pokemon you want to get the data from your team (so it can be easily implemented via a special I don't remember). After that, each value is stored on a different variable so you can easily access each of them
 
There's no better explanation than the one at the top of the post you've quoted...

With this routine you can get the EV/IV of a chosen Pokemon from your party.

One var acts as a switch to get EV or IV depending on its value, the next one stores the position of the Pokemon you want to get the data from your team (so it can be easily implemented via a special I don't remember). After that, each value is stored on a different variable so you can easily access each of them

Okaaaay thank you, I just didn't understand the first because english is not my first language, sorry ><

DOES ANYONE KNOW THE SPECIAL PLEASE ?
 
Last edited:
Hey, thanks! Btw, I'm having some issues with battle end routine application. It works perfectly fine but when the pinch berry triggers, it freeze or not continue at all.

Which pinch berry did you activate?
Which battle end routine are you refering to? The one for cmd49 ( used by weakness policy, rocky helmet etc.)?
 
Which pinch berry did you activate?
Which battle end routine are you refering to? The one for cmd49 ( used by weakness policy, rocky helmet etc.)?

Yes. The cmd49. It was not actually pinch berries but the activation of healing berries (mago and sitrus for ex.). I haven't tested the stat boosting but I'll test it later. Though, rocky helmet is working fine.

EDIT: I also added your damage reduction berry routine. I wonder if it affect this. Tho, it doesn't work in my game (due to the setword command, i think. I just leave the setword command FA as is)
 
Last edited:
Yes. The cmd49. It was not actually pinch berries but the activation of healing berries (mago and sitrus for ex.). I haven't tested the stat boosting but I'll test it later. Though, rocky helmet is working fine.

EDIT: I also added your damage reduction berry routine. I wonder if it affect this. Tho, it doesn't work in my game (due to the setword command, i think. I just leave the setword command FA as is)

Activation of healing berries and cmd49 are called at different locations and use different counters. I don't think they should affect each other.

Damage reduction berry also does not affect this. You might need to adjust the of setword command if your game is freezing.

Did you insert the toxic orb routine?
 
Activation of healing berries and cmd49 are called at different locations and use different counters. I don't think they should affect each other.

Damage reduction berry also does not affect this. You might need to adjust the of setword command if your game is freezing.

Did you insert the toxic orb routine?

No. I haven't put it yet. healing berries are working fine before putting the battle end routine command. So, what could be the problem? when the healing berry activates, it just stops to its text "Foe ????'s xxxx berry restored its health but the music is still playing. Btw, I'm using Mrdollsteak's rom and JPAN patch.
 
No. I haven't put it yet. healing berries are working fine before putting the battle end routine command. So, what could be the problem? when the healing berry activates, it just stops to its text "Foe ????'s xxxx berry restored its health but the music is still playing. Btw, I'm using Mrdollsteak's rom and JPAN patch.

Not sure what is causing this. I'll look into it later.
 

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:


Compiled version:
Code:
3F B5 00 24 05 2C 14 D8 0A 48 00 78 01 21 61 43 09 4B 1B 78 00 2B FF D0 1A 31 08 4A 00 F0 08 F8 01 1C 07 4A 02 20 60 43 12 18 11 70 01 34 E9 E7 10 47 3F BD C0 70 03 02 BE 70 03 02 E9 FB 03 08 C2 70 03 02

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

is it possible to display the Iv / EV in a script thanks to this ? If yes, how ?
 
Do you have any example ? I never used that ....

Here you are, it's just a c&p from Diegoisawesome XSE tutorial

Buffernumber

This is just used to display a number stored in a variable. It's set up like this:
buffernumber [buffer#] [Variable]
The downside of this command is that it can only display numbers from 0-65535 [Hex = 0x0 - I'll show an example. We're going to put the number 50000 in [buffer1].
Code:
setvar 0x800D 0xC350
buffernumber 0x00 0x800D
msgbox @1 0x6
.... .... ....

#org @1
= Account Balance: \hB7: [buffer1]
That's all there is to it.
 
I have a suggestion, when we see the resume screen a pokemon, is it possible to add a page with the IV/EVs ?
 
I'm not sure if it's done yet or not, but... Would it be possible to have a routine that acts like a warp but enables you to choose bank, map and possition via variables instead of fixed parameters like the actual commando on XSE (and similar)
 
Back
Top