• 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.
  • There is an important update regarding account security and 2FA. Please click here for more information.
  • Our Witching Week events are now on! If you'd like to participate in some fun activities with the community, check out the list of events!
  • 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.
  • Imgur has blocked certain regions from viewing any images uploaded to their site. If you use Imgur, please consider replacing any image links/embeds you may have on PokéCommunity so everyone can see your images. Click here to learn more.

[Script] why my Script changes itself ?!?!!!

  • 2
    Posts
    5
    Years
    • Seen Sep 25, 2020
    I wanted to roll random number between 0-2
    and every number will give the player something different
    but the script changes itself and ruin everything

    my script:
    '---------------
    #org 0x850E00
    random 0x3
    compare LASTRESULT 0x0
    if 0x1 goto 0x8234561
    compare LASTRESULT 0x1
    if 0x1 goto 0x8234564
    compare LASTRESULT 0x2
    if 0x1 goto 0x8234567


    '---------------
    #org 0x234561
    givepokemon 0x1 0x5 0x0 0x0 0x0 0x0
    end

    '---------------
    #org 0x234564
    givepokemon 0x4 0x5 0x0 0x0 0x0 0x0
    end

    '---------------
    #org 0x234567
    givepokemon 0x7 0x5 0x0 0x0 0x0 0x0
    end



    The Script that the game gives:
    '---------------
    #org 0x71A46C
    random 0x3
    compare LASTRESULT 0x0
    if 0x1 goto 0x8234561
    compare LASTRESULT 0x1
    if 0x1 goto 0x8234564
    compare LASTRESULT 0x2
    if 0x1 goto 0x8234567
    end

    '---------------
    #org 0x234561
    givepokemon 0x1 0x79 0x4 0x5000779 0x0 0x0
    nop
    nop
    nop
    nop
    nop
    nop

    end

    '---------------
    #org 0x234564
    givepokemon 0x4 0x79 0x7 0x5 0x0 0x0
    nop
    nop
    nop

    end

    '---------------
    #org 0x234567
    givepokemon 0x7 0x5 0x0 0x0 0x0 0x0
    end



    please HELP!!!
     
    Last edited:
    I
    I'm pretty sure you're getting this error because you're giving only 3 bytes to each jump. The givepokemon command requires 9 bytes so you can try this script. This is just a reference. I'm not sure if you have more free space in this cares of your ROM.

    '---------------
    #org 0x850E00
    random 0x3
    compare LASTRESULT 0x0
    if 0x1 goto 0x8234561
    compare LASTRESULT 0x1
    if 0x1 goto 0x823456B
    compare LASTRESULT 0x2
    if 0x1 goto 0x8234575


    '---------------
    #org 0x234561
    givepokemon 0x1 0x5 0x0 0x0 0x0 0x0
    end

    '---------------
    #org 0x23456B
    givepokemon 0x4 0x5 0x0 0x0 0x0 0x0
    end

    '---------------
    #org 0x234575
    givepokemon 0x7 0x5 0x0 0x0 0x0 0x0
    end[/B]
     
    @ronik2014

    From the provided info I can see that both scripts are at completely different offsets. Are you sure you put the correct script offset for the person event/script event in AdvanceMap?

    yeah my mistake
    I didn't copy it good
    but it's not the problem

    I
    I'm pretty sure you're getting this error because you're giving only 3 bytes to each jump. The givepokemon command requires 9 bytes so you can try this script. This is just a reference. I'm not sure if you have more free space in this cares of your ROM.

    '---------------
    #org 0x850E00
    random 0x3
    compare LASTRESULT 0x0
    if 0x1 goto 0x8234561
    compare LASTRESULT 0x1
    if 0x1 goto 0x823456B
    compare LASTRESULT 0x2
    if 0x1 goto 0x8234575


    '---------------
    #org 0x234561
    givepokemon 0x1 0x5 0x0 0x0 0x0 0x0
    end

    '---------------
    #org 0x23456B
    givepokemon 0x4 0x5 0x0 0x0 0x0 0x0
    end

    '---------------
    #org 0x234575
    givepokemon 0x7 0x5 0x0 0x0 0x0 0x0
    end[/B]

    so couldn't I do this script from the beginning ?
     
    Last edited:
    Back
    Top