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

[Other] Scripting Question

  • 6
    Posts
    9
    Years
    • Seen Nov 26, 2014
    So, I'm working on the basis for my entire rom hack, the fact that pokemon are gone forever after they reach the hp of 0. I'm using JPAN's hack engine to do so, it contains absically all the commands needed for me to accomplish this (I believe).

    How I want to make the script operate is by having it check the hp of each slotted pokemon after a battle, and if any of those pokemon have reached the hp of 0, to simply delete them. The special commands I know I need, are these:

    Special 0x6 (Decrypts pokemon data)
    Special 0x65 (Checks HP of a specific pokemon slot) (Returns value of hp)
    Special 0x62 (Deletes all or one party pokemon)

    Setvar 0x8004 (Sets the slot to check/delete)

    The questions I'm running into are how to make the script activate after a battle, how to use the returned hp value to determine whether it deletes the pokemon or not, and how to make it delete multiple pokemon if multiple pokemon reached 0 hp.

    Any pointers, or examples of how this script could work?

    Thanks!
     

    Le pug

    Creator of Pokémon: Discovery / Fat Kid
  • 870
    Posts
    10
    Years
    So, I'm working on the basis for my entire rom hack, the fact that pokemon are gone forever after they reach the hp of 0. I'm using JPAN's hack engine to do so, it contains absically all the commands needed for me to accomplish this (I believe).

    How I want to make the script operate is by having it check the hp of each slotted pokemon after a battle, and if any of those pokemon have reached the hp of 0, to simply delete them. The special commands I know I need, are these:

    Special 0x6 (Decrypts pokemon data)
    Special 0x65 (Checks HP of a specific pokemon slot) (Returns value of hp)
    Special 0x62 (Deletes all or one party pokemon)

    Setvar 0x8004 (Sets the slot to check/delete)

    The questions I'm running into are how to make the script activate after a battle, how to use the returned hp value to determine whether it deletes the pokemon or not, and how to make it delete multiple pokemon if multiple pokemon reached 0 hp.

    Any pointers, or examples of how this script could work?

    Thanks!

    Easiest way I guess would be with a level script but that's only for when you enter a new map ... something like this requires ASM any other way. to check for multiple just have it to where you compare the var throught the script like


    #org @event
    comparevar 0x8004 0x1
    if 0x1 goto @next1
    comparevar 0x8004 0x2
    if 0x1 goto @next2
    comparevar 0x8004 0x3
    if 0x1 goto @next3
    comparevar 0x8004 0x4
    if 0x1 goto @next4
    comparevar 0x8004 0x5
    if 0x1 goto @next5
    comparevar 0x8004 0x6
    if 0x1 goto @next6
    release
    end

    #org @next1
    deleteurpokemonspecial
    comparevar 0x8004 0x2
    if 0x1 goto @next2
    comparevar 0x8004 0x3
    if 0x1 goto @next3
    comparevar 0x8004 0x4
    if 0x1 goto @next4
    comparevar 0x8004 0x5
    if 0x1 goto @next5
    comparevar 0x8004 0x6
    if 0x1 goto @next6
    release
    end

    etc idk maybe something like that....... again this takes ASM to work
     
  • 6
    Posts
    9
    Years
    • Seen Nov 26, 2014
    Easiest way I guess would be with a level script but that's only for when you enter a new map ... something like this requires ASM any other way. to check for multiple just have it to where you compare the var throught the script like


    #org @event
    comparevar 0x8004 0x1
    if 0x1 goto @next1
    comparevar 0x8004 0x2
    if 0x1 goto @next2
    comparevar 0x8004 0x3
    if 0x1 goto @next3
    comparevar 0x8004 0x4
    if 0x1 goto @next4
    comparevar 0x8004 0x5
    if 0x1 goto @next5
    comparevar 0x8004 0x6
    if 0x1 goto @next6
    release
    end

    #org @next1
    deleteurpokemonspecial
    comparevar 0x8004 0x2
    if 0x1 goto @next2
    comparevar 0x8004 0x3
    if 0x1 goto @next3
    comparevar 0x8004 0x4
    if 0x1 goto @next4
    comparevar 0x8004 0x5
    if 0x1 goto @next5
    comparevar 0x8004 0x6
    if 0x1 goto @next6
    release
    end

    etc idk maybe something like that....... again this takes ASM to work

    So it would require ASM to pull this off at all? I'm willing to learn if only to accomplish that script :P. And the example you posted is in order to make it compare every other pokemon to the first slot, right?
     

    Le pug

    Creator of Pokémon: Discovery / Fat Kid
  • 870
    Posts
    10
    Years
    So it would require ASM to pull this off at all? I'm willing to learn if only to accomplish that script :P. And the example you posted is in order to make it compare every other pokemon to the first slot, right?

    8004 is for the buffer for the pokemon slot that you're looking for the 0 HP for is what you said so in the beginning of the script, it looks for the first slot that has 0. So if pokemon slot 3 has 0 hp it'd go to that offset. if after you delete the pokemon, there is still another dead pokemon, it'd check the others for a 0 hp pokemon and continue doing the same thing until every dead pokemon is gone then it'd end the script. and yes it would take ASM to do this. its not that hard though, there are a lot of checks you can do and HP is one of them so it wouldn't be hard. But ASM is advanced so make sure you're looknig around for the best tutorials to help you try to understand and learn
     
  • 6
    Posts
    9
    Years
    • Seen Nov 26, 2014
    8004 is for the buffer for the pokemon slot that you're looking for the 0 HP for is what you said so in the beginning of the script, it looks for the first slot that has 0. So if pokemon slot 3 has 0 hp it'd go to that offset. if after you delete the pokemon, there is still another dead pokemon, it'd check the others for a 0 hp pokemon and continue doing the same thing until every dead pokemon is gone then it'd end the script. and yes it would take ASM to do this. its not that hard though, there are a lot of checks you can do and HP is one of them so it wouldn't be hard. But ASM is advanced so make sure you're looknig around for the best tutorials to help you try to understand and learn

    *Plot Twist* Relatively seemingly simple script becomes more complicated >.<
     
    Back
    Top