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

[Emerald] Moving camera freely resets overworld sprite locations

  • 6
    Posts
    4
    Years
    Hiya! I'm using a level script that moves the player and an npc a few tiles forward and then moves the camera such that the player and npc are both offscreen. However, when I move the camera back down to center on the player, that npc has reset his position to where he started. It's really frustrating. Here's the script:

    Code:
    #dynamic 0x800000
    
    #org @start
    setvar 0x4022 0x1
    applymovement 0x1 @walkin
    applymovement MOVE_PLAYER @walkin
    waitmovement 0x1
    msgbox @rival_text1 0x06
    pause 0x20
    special 0x116                                 ' Unlock the camera
    applymovement MOVE_CAMERA @movecameraup
    waitmovement MOVE_CAMERA
    msgbox @assistant_prof_talk 0x06
    applymovement 0x3 @stepinplaceright
    waitmovement 0x3
    msgbox @prof_talk 0x06
    applymovement 0x3 @stepinplacedown
    waitmovement 0x3
    applymovement 0x2 @stepinplaceleft
    waitmovement 0x2
    applymovement 0x3 @stepinplaceright
    waitmovement 0x3
    msgbox @assistant_prof_talk2 0x06
    pause 0x30
    applymovement 0x3 @move_prof
    applymovement 0x2 @move_asst
    applymovement MOVE_CAMERA @movecameradown
    waitmovement MOVE_CAMERA
    special 0x117
    end
    
    #org @walkin
    #raw 0x09
    #raw 0x09
    #raw 0xFE
    
    #org @stepinplaceright
    #raw 0x20
    #raw 0xFE
    
    #org @stepinplacedown
    #raw 0x1D
    #raw 0xFE
    
    #org @stepinplaceleft
    #raw 0x1F
    #raw 0xFE
    
    #org @move_prof
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x0A
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0xFE
    
    #org @move_asst
    #raw 0x0A
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x0A
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0xFE
    
    #org @movecameraup
    #raw 0x09
    #raw 0x09
    #raw 0x09
    #raw 0x09
    #raw 0x09
    #raw 0x09
    #raw 0x09
    #raw 0x09
    #raw 0x09
    #raw 0x09
    #raw 0xFE
    
    #org @movecameradown
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0x08
    #raw 0xFE
    
    
    #org @rival_text1
    = text
    #org @assistant_prof_talk
    = text
    #org @prof_talk
    = text
    #org @assistant_prof_talk2
    = text

    Any help would be appreciated!
     
  • 760
    Posts
    16
    Years
    • Seen yesterday
    If an npc is not in camera view (+1/2 tiles) anymore, the npc resets to its original position it has on the map. So you should either, not move the camera too far away from the npc sprite, or change the location of the npc in the script with a movesprite/movesprite2 command. (Don't remember what the difference between movesprite and movesprite2 was anymore. But if one of them doesn't work, try the other). Also, if if the npc sprite needs another sprite behavior than it's default behavior, use the spritebehave command as well.
     
    Back
    Top