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

[Script] I can't figure out why this script won't work properly

4
Posts
3
Years
    • Seen Oct 18, 2022
    This script is supposed to make the npc that looks like oak walk down then say a message to the player then walk away then, after the npc walks away the player should take one step up from the tall grass. The problem is the npc and the player won't move and I'm not sure why.I have attached an image of both the map and the script. I would appreciate any help.
     

    Attachments

    • I can't figure out why this script won't work properly
      Capture.PNG
      75.6 KB · Views: 16

    __fred__40

    fred
    277
    Posts
    4
    Years
  • you are missing the waitmovement command after the move player,maybe that's all it takes to fix this,also try to put waitmovement 0x2,if you are moving the NPC number 2,waitmovement 0xFF after a applymovement 0xFF,etc.
     
    4
    Posts
    3
    Years
    • Seen Oct 18, 2022
    you are missing the waitmovement command after the move player,maybe that's all it takes to fix this,also try to put waitmovement 0x2,if you are moving the NPC number 2,waitmovement 0xFF after a applymovement 0xFF,etc.

    Thanks for the reply. So i tried adding waitmovement 0xFF after the player moves and changing waitmovement 0x0 to waitmovement 0x2 but i did not see any changes
     
    4
    Posts
    3
    Years
    • Seen Oct 18, 2022
    Can you post your script here (in text, from XSE).

    #dynamic 0x800000

    #org @start
    checkflag 0x201
    if 0x1 goto @done
    checkflag 0x200
    if 0x1 goto @lab
    applymovement 0x2 @move1
    waitmovement 0x2
    msgbox @t1 0x6
    applymovement 0x2 @move2
    waitmovement 0x2
    applymovement 0xFF @move3
    waitmovement 0xFF
    setflag 0x200
    release
    end

    #org @lab
    msgbox @t2 0x4
    closeonkeypress
    applymovement 0xFF @move3
    waitmovement 0xFF
    release
    end

    #org @done
    release
    setvar 0x4012 0x1
    end

    #org @t2
    = I should go to the [red_fr]lab[black_fr].

    #org @t1
    = Prof: I need you to come with me\nto the [red_fr]lab[black_fr] it's urgent.

    #org @move1
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0xFE

    #org @move2
    #raw 0x11
     

    __fred__40

    fred
    277
    Posts
    4
    Years
  • i think your prof NPC is too far from the location of the script box from where your script is called.
    Try move him down 4/5 blocks
     
    4
    Posts
    3
    Years
    • Seen Oct 18, 2022
    i think your prof NPC is too far from the location of the script box from where your script is called.
    Try move him down 4/5 blocks

    Alright i did that and now the npc moves however when the player moves they go down instead of up. I have tried changing #raw 0x10 #raw 0x11 in case i got the values messed up but the player moves down in both cases.
     
    990
    Posts
    4
    Years
  • Alright i did that and now the npc moves however when the player moves they go down instead of up. I have tried changing #raw 0x10 #raw 0x11 in case i got the values messed up but the player moves down in both cases.


    There, I reworked the whole script for you:
    Code:
    #dynamic 0x[FSF Offset]
    
    #org @start
    lock
    checkflag 0x200
    if 0x1 goto @done1
    applymovement 0x2 @move1
    waitmovement 0x0
    msgbox @msg1 0x2
    waitmsg
    applymovement 0x2 @move2
    waitmovement 0x0
    hidesprite 0x2
    applymovement 0xFF @move3
    waitmovement 0x0
    setflag 0x200
    setflag 0x201
    release
    end
    
    #org @done1
    msgbox @msg2 0x2
    applymovement 0xFF @move3
    end
    
    #org @msg1
    = Prof: I need you to come with me\nto the [red_fr]lab[black_fr] it's urgent.
    
    #org @msg2
    = I should go to the [red_fr]lab[black_fr].
    
    #org @move1
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0xFE
    
    #org @move2
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0xFE
    
    #org @move3
    #raw 0x11
    #raw 0xFE

    Two important things to point out:
    • I removed the checkflag 0x201 and used it instead for the NPC's (Oak) person flag. So you have to change his Person ID to 201.
    • I've interlinked this script so that you set the variable of the script to 0x1 in another script to avoid a whole flag being wasted + the script being that long.
     
    Back
    Top