• 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

leyn09

Truant Trainer
84
Posts
13
Years
  • 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.
     

    Ayonn-

    The Unbelivable
    209
    Posts
    9
    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:


    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 ?
     

    BLAx501!

    Pokemon Flux
    80
    Posts
    10
    Years
  • 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
     

    Ayonn-

    The Unbelivable
    209
    Posts
    9
    Years
  • 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:

    Trainer 781

    Guest
    0
    Posts
    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.)?
     

    leyn09

    Truant Trainer
    84
    Posts
    13
    Years
  • 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:

    Trainer 781

    Guest
    0
    Posts
    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?
     

    leyn09

    Truant Trainer
    84
    Posts
    13
    Years
  • 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.
     
    146
    Posts
    11
    Years
    • CO
    • Seen Mar 16, 2023

    Trainer 781

    Guest
    0
    Posts
    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.
     

    Ayonn-

    The Unbelivable
    209
    Posts
    9
    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:


    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 ?
     

    BLAx501!

    Pokemon Flux
    80
    Posts
    10
    Years
  • 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.
     

    Ayonn-

    The Unbelivable
    209
    Posts
    9
    Years
  • I have a suggestion, when we see the resume screen a pokemon, is it possible to add a page with the IV/EVs ?
     

    BLAx501!

    Pokemon Flux
    80
    Posts
    10
    Years
  • 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