• 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] Script issue: givepokemon works, applymovement doesn't?

25
Posts
19
Years
    • Seen Nov 8, 2015
    Basically that, yeah. A givepokemon script that at the end SHOULD have the giver walk away nort offscreen. The give goes off without a hitch. The rest...doesn't. :P

    Note: I realize I forgot lock and faceplayer. I herped when I should have derped. But that didn't stop the script from running, soooooo yeah.



    '---------------
    #org 0x800000
    checkflag 0x828
    if 0x1 goto 0x880012A
    msgbox 0x8800064 MSG_KEEPOPEN '"Hey-hey, are you travelling alone?..."
    goto 0x8800019

    '---------------
    #org 0x80012A
    checkobedience 0xD9DC
    '---------------
    #org 0x800019
    givepokemon 0xEC 0x3 0x0 0x0 0x0 0x0
    fanfare 0x13E
    msgbox 0x88000D9 MSG_KEEPOPEN '"[black_fr]You've been given a Tyro..."
    waitfanfare
    closeonkeypress
    setflag 0x828
    msgbox 0x88000FB MSG_YESNO '"[black_fr]Do you want to give a Ty..."
    compare LASTRESULT 0x1
    if 0x1 call 0x880005D
    msgbox 0x880012A MSG_NORMAL '"There, you'll be a lot safer if yo..."
    applymovement 0x1 0x88001C3
    release
    end

    '---------------
    #org 0x80005D
    call 0x81A74EB
    return

    '---------------
    #org 0x1A74EB
    fadescreen 0x1
    special 0x9E
    waitstate
    return


    '---------
    ' Strings
    '---------
    #org 0x800064
    = Hey-hey, are you travelling alone?\nOutside town, it's really not safe\lto be without a Pokémon. Here, use\lthis one.

    #org 0x8000D9
    = [black_fr]You've been given a Tyrogue!

    #org 0x8000FB
    = [black_fr]Do you want to give a Tyrogue a nickname?

    #org 0x80012A
    = There, you'll be a lot safer if you\nhave that little guy by your side.\lAnyway, 'gotta jet. It was nice to\lmeet you! Oh, my name's Kenneth, by\lthe way.


    '-----------
    ' Movements
    '-----------
    #org 0x8001C3
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x60 'Hide
     
    25
    Posts
    19
    Years
    • Seen Nov 8, 2015
    Wow! THAT's a fast repsonse! :D Thank you so much, I'll go diddle with this. Hopefully he does like he's told. :P

    Unrelated, yet awesome: I've got your Spheal Clicker running in the background while I work xDDDDD

    Hm...nope, that didn't fix it. Re-opened it in XSE though, and apparently it thought I wanted him to jump right...?

    '---------------
    #org 0x800000
    checkflag 0x828
    if 0x1 goto 0x880012A
    msgbox 0x8800064 MSG_KEEPOPEN '"Hey-hey, are you travelling alone?..."
    goto 0x8800019

    '---------------
    #org 0x80012A
    checkobedience 0xD9DC
    '---------------
    #org 0x800019
    givepokemon 0xEC 0x3 0x0 0x0 0x0 0x0
    fanfare 0x13E
    msgbox 0x88000D9 MSG_KEEPOPEN '"[black_fr]You've been given a Tyro..."
    waitfanfare
    closeonkeypress
    setflag 0x828
    msgbox 0x88000FB MSG_YESNO '"[black_fr]Do you want to give a Ty..."
    compare LASTRESULT 0x1
    if 0x1 call 0x880005D
    msgbox 0x880012A MSG_NORMAL '"There, you'll be a lot safer if yo..."
    applymovement 0x1 0x88001C3
    release
    end

    '---------------
    #org 0x80005D
    call 0x81A74EB
    return

    '---------------
    #org 0x1A74EB
    fadescreen 0x1
    special 0x9E
    waitstate
    return


    '---------
    ' Strings
    '---------
    #org 0x800064
    = Hey-hey, are you travelling alone?\nOutside town, it's really not safe\lto be without a Pokémon. Here, use\lthis one.

    #org 0x8000D9
    = [black_fr]You've been given a Tyrogue!

    #org 0x8000FB
    = [black_fr]Do you want to give a Tyrogue a nickname?

    #org 0x80012A
    = There, you'll be a lot safer if you\nhave that little guy by your side.\lAnyway, 'gotta jet. It was nice to\lmeet you! Oh, my name's Kenneth, by\lthe way.


    '-----------
    ' Movements
    '-----------
    #org 0x8001C3
    #raw 0x11 'Step Up (Normal)
    #raw 0x51 'Jump Right
    #raw 0x0 'Face Down
    #raw 0x0 'Face Down
    #raw 0x11 'Step Up (Normal)
    #raw 0x51 'Jump Right
    #raw 0x0 'Face Down
    #raw 0x0 'Face Down
    #raw 0x11 'Step Up (Normal)
    #raw 0x51 'Jump Right
    #raw 0x0 'Face Down
    #raw 0x0 'Face Down
    #raw 0x11 'Step Up (Normal)
    #raw 0x51 'Jump Right
    #raw 0x0 'Face Down
    #raw 0x0 'Face Down
    #raw 0x11 'Step Up (Normal)
    #raw 0x51 'Jump Right
    #raw 0x0 'Face Down
    #raw 0x0 'Face Down
    #raw 0x11 'Step Up (Normal)
    #raw 0x51 'Jump Right
    #raw 0x0 'Face Down
    #raw 0x0 'Face Down
    #raw 0x60 'Hide
    #raw 0x51 'Jump Right
    #raw 0x0 'Face Down
    #raw 0x0 'Face Down
    #raw 0xFE 'End of Movements
     
    Last edited by a moderator:
    5,256
    Posts
    16
    Years
  • Something must've gone wrong when you compiled it. Here's a fresh, refactored script, with some of the unnecessary / problematic stuff that I came across in the original removed:

    Code:
    #dynamic 0x800000
    #include stditems.rbh
    #include stdpoke.rbh
    
    '---------------
    #org @start
    checkflag 0x828
    if 0x1 goto @snippet1
    msgbox @string1 MSG_KEEPOPEN '"Hey-hey, are you travelling alone?..."
    givepokemon PKMN_TYROGUE 0x3 ITEM_NONE 0x0 0x0 0x0
    fanfare 0x13E
    msgbox @string2 MSG_KEEPOPEN '"[black_fr]You've been given a Tyro..."
    waitfanfare
    closeonkeypress
    setflag 0x828
    msgbox @string3 MSG_YESNO '"[black_fr]Do you want to give a Ty..."
    compare LASTRESULT 0x1
    if 0x1 call @snippet2
    msgbox @string4 MSG_NORMAL '"There, you'll be a lot safer if yo..."
    applymovement 0x1 @move1
    waitmovement 0x0
    release
    end
    
    '---------------
    #org @snippet1
    release
    end
    
    '---------------
    #org @snippet2
    fadescreen 0x1
    special 0x9E
    waitstate
    return
    
    
    '---------
    ' Strings
    '---------
    #org @string1
    = Hey-hey, are you travelling alone?\pOutside town, it's really not safe\nto be without a Pokémon.\pHere, use this one.
    
    #org @string2
    = [black_fr]You've been given a Tyrogue!
    
    #org @string3
    = [black_fr]Do you want to give a Tyrogue a\nnickname?
    
    #org @string4
    = There, you'll be a lot safer if\nyou have that little guy by your\lside.\pAnyway, 'gotta jet. It was nice to\nmeet you!\pOh, my name's Kenneth, by the way.
    
    
    '-----------
    ' Movements
    '-----------
    #org @move1
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x11 'Step Up (Normal)
    #raw 0x60 'Hide
    #raw 0xFE 'End of Movements

    Try compiling this and using its offset instead.
     
    25
    Posts
    19
    Years
    • Seen Nov 8, 2015
    Woohoo! That did it. I didn't know the script could be reduced down that much. o.o Handy!

    Now I just have to remember that lock and faceplayer...and...it's hidesprite to make the now-defunct sprite reappear on the map when I come back to it?
     
    5,256
    Posts
    16
    Years
  • Partly, yes, though you'll also need to include a setflag 0xFLAG command, wherein FLAG is a flag number which you also put into the overworld's "Person ID" field on Advance Map, to make the change permanent. I suggest checking out diegoisawesome's XSE tutorial if you're unsure on how to effectively use a command.
     
    Back
    Top