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

Setflag command breaks script when advance map shows game decompile code

  • 4
    Posts
    1
    Years
    • Seen Feb 22, 2024
    I built the below code using PKSV-UI and it compiles properly without any errors that i can see. However, When i re-open the script within Advance Map, it shows a bunch of errors. Is there something i'm missing within my code that is causing the errors?


    This is the code i built and compile in PKSV-UI

    Code:
    #org 0x88000D6
    '-----------------------------------
    lock
    faceplayer
    checkflag 0x201
    if false jump 0x1EB501
    msgbox 0x88000F1 ' Hello Champion, Past...
    callstd MSG_LOCK ' Built-in lock command
    applymovement 0x2 0x8001A2 
    pauseevent 0x0
    setflag 0x201
    release
    end
    
    
    #org 0x88000F1
    = Hello Champion, Past this point is the\npath to Johto. Many new adventures\lawait!
    
    #org  0x8001A2
    m walk_right look_down end
    
    #org 0x1EB501
    message 0x27B285
    callstd MSG_NORMAL
    release 
    end
    
    #org 0x27B285
    = You're not the Champion!

    This is what PKSV shows when I re-open the code using advance map. It appears to change the setflag and proceeds to error out from there. I'm hoping someone can help me figure out what is causing it to do this?

    Code:
    #org 0x88000D6
    '-----------------------------------
    lock
    faceplayer
    checkflag 0x201
    if false jump 0x81EB501 ' Flag is unset
    msgbox 0x88000F1 ' Hello Champion, Past...
    callstd MSG_LOCK ' Built-in lock command
    applymovement 0x2 0x88001A2 ' walk_right look_down...
    setflag 0xD9C2
    #raw 0xE0
    #raw 0xE0
    #raw 0xE3
    nop0 ' #raw 0x0
    #raw 0xBD
    #raw 0xDC
    #raw 0xD5
    #raw 0xE1
    #raw 0xE4
    #raw 0xDD
    #raw 0xE3
    #raw 0xE2
    #raw 0xB8
    nop0 ' #raw 0x0
    msgboxsign
    #raw 0xD5
    #raw 0xE7
    #raw 0xE8
    nop0 ' #raw 0x0
    #raw 0xE8
    #raw 0xDC
    #raw 0xDD
    #raw 0xE7
    nop0 ' #raw 0x0
    #raw 0xE4
    #raw 0xE3
    #raw 0xDD
    #raw 0xE2
    #raw 0xE8
    nop0 ' #raw 0x0
    #raw 0xDD
    #raw 0xE7
    nop0 ' #raw 0x0
    #raw 0xE8
    #raw 0xDC
    #raw 0xD9
    CMD_FE 0xE4
    #raw 0xD5
    #raw 0xE8
    #raw 0xDC
    nop0 ' #raw 0x0
    #raw 0xE8
    #raw 0xE3
    nop0 ' #raw 0x0
    warp6 0xE3 0xDC 0xE8 0xADE3 0xC700
    #raw 0xD5
    #raw 0xE2
    #raw 0xED
    nop0 ' #raw 0x0
    #raw 0xE2
    #raw 0xD9
    #raw 0xEB
    nop0 ' #raw 0x0
    #raw 0xD5
    #raw 0xD8
    #raw 0xEA
    #raw 0xD9
    #raw 0xE2
    #raw 0xE8
    #raw 0xE9
    #raw 0xE6
    #raw 0xD9
    #raw 0xE7
    #raw 0xFA
    #raw 0xD5
    #raw 0xEB
    #raw 0xD5
    #raw 0xDD
    #raw 0xE8
    tempspriteface 0xFF 0xFF
    nop0 ' #raw 0x0
    #raw 0xDC
    #raw 0xD9
    #raw 0xE6
    #raw 0xD9
    setdoorclosed 0xD9C2 0xE0E0
    #raw 0xE3
    nop0 ' #raw 0x0
    #raw 0xBD
    #raw 0xDC
    #raw 0xD5
    #raw 0xE1
    #raw 0xE4
    #raw 0xDD
    #raw 0xE3
    #raw 0xE2
    doorchange
    #raw 0xE8
    #raw 0xE3
    doorchange
    #raw 0xD6
    #raw 0xD9
    tempspriteface 0x0 0xD3
    #raw 0xE3
    #raw 0xE9
    givetocoincase 57568 ' Bear in mind, it's not in hex
    nop0 ' #raw 0x0
    #raw 0xE2
    #raw 0xD9
    #raw 0xD9
    #raw 0xD8
    nop0 ' #raw 0x0
    CMD_FE 0xE8
    #raw 0xE3
    nop0 ' #raw 0x0
    #raw 0xD6
    #raw 0xD9
    #raw 0xD7
    #raw 0xE3
    #raw 0xE1
    #raw 0xD9
    nop0 ' #raw 0x0
    #raw 0xE8
    #raw 0xDC
    #raw 0xD9
    nop0 ' #raw 0x0
    CMD_C3 0xE2
    #raw 0xD8
    #raw 0xDD
    #raw 0xDB
    #raw 0xE3
    nop0 ' #raw 0x0
    storeboxname 0xD9 0xDBD5
    #raw 0xE9
    #raw 0xD9
    nop0 ' #raw 0x0
    #raw 0xBD
    #raw 0xDC
    #raw 0xD5
    #raw 0xE1
    #raw 0xE4
    #raw 0xDD
    #raw 0xE3
    #raw 0xE2
    nop0 ' #raw 0x0
    #raw 0xFA
    nop0 ' #raw 0x0
    #raw 0xE8
    #raw 0xE3
    nop0 ' #raw 0x0
    #raw 0xD9
    #raw 0xE2
    #raw 0xE8
    #raw 0xD9
    #raw 0xE6
    nop0 ' #raw 0x0
    #raw 0xDC
    #raw 0xD9
    #raw 0xE6
    #raw 0xD9
    setdoorclosed 0x13FF 0xFE04
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    #raw 0xFF
    'Decompiler stopped due to failsafe mechanism (too many #RAW 0xFF commands)
    
    #org 0x81EB501
    '-----------------------------------
    message 0x827B285 ' You're not the Champ...
    callstd MSG_LOCK ' Built-in lock command
    release
    end
    
    
    #org 0x88000F1
    = Hello Champion, Past this point is the\npath to Johto. Many new adventures\lawait!
    
    #org 0x827B285
    = You're not the Champion!
    
    #org 0x88001A2
    M walk_right look_down end
     
  • 8,909
    Posts
    9
    Years
    Spoiler:


    Just letting you know I've moved this to the right place for you now.
     

    Asith

    Uwao
  • 237
    Posts
    3
    Years
    • Seen today
    Consider reading a more modern scripting tutorial: https://www.pokecommunity.com/showthread.php?p=9705656
    Not only is pksvui an old tool that has now been replaced twice over (once by XSE, then recently by HMA) so it may just be plain misbehaving, but this seems to be a basic case of trying to compile a script over already existing data. Scripts take a set amount of space and you will mess things if you don't know exactly where the bytes you're compiling will go. This problem was somewhat fixed by XSE's dynamic offsets, but got even easier with HMA scripting which automatically moves around scripts based on size so you don't have to worry about overwriting anything ever
     
    Back
    Top