• 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] Script disappearing in AdvanceMap

6
Posts
5
Years
    • Seen Sep 17, 2020
    I'm very new to ROM hacking and i feel like i'm being dumb but I've been stuck on this for hours.

    I'm trying to make a simple person event where you talk to an npc but every time i'm done close of XSE and open the script again, the written script is gone.
    I have compiled and saved it but every time i open it, it just goes back to:

    '---------------
    #org 0x800200
    end

    and my written script is gone.
    This is the script i wrote:

    #dynamic 0x800200

    #org @start
    lock
    faceplayer
    msgbox @test 0x6
    release
    end

    #org @test
    = This is a test.

    This is my first time posting here so excuse me if i made some kind of mistake.
    Thanks in advance
     
    124
    Posts
    8
    Years
    • Seen Apr 5, 2024
    well, how new are u to scripting? I remember when I couldnt compile a single script, but luckily this place has taught me a lot, now usually when u look for free space I start at 0x740000....but I think 0x800000 and above is ok. After you compile your script, you need to copy the offset that the compile gave you....usually if u havent compiled anything after 0x800000, then ur first offset given by the compiler would be 0x800001, just add that offset to ur person event on AM 1.95
     
    6
    Posts
    5
    Years
    • Seen Sep 17, 2020
    This is one of my first time making a ROM hack and this is one of the first scripts I've made. Is there something different you need to do when editing a script instead of making one? Because when I put the same script with a new offset, it works just fine. But when I edit it, it goes back to how it was before i edited it. Is there something besides just saving it you need to do?

    Sorry if it sounds confusing(English is not my first language)
     
    124
    Posts
    8
    Years
    • Seen Apr 5, 2024
    yes, editing an existing script might not work if it's more bytes than originally, i think if you edit an existing script, you might corrupt it, so its better that you open up a script and study how the script is made and make your own with dynamic offsets so you don't overwrite anything...and backup your rom often, there's many easy ways to corrupt your rom and if u dont back up often, you will be very sad when you have to start all over with a clean rom.

    P.s. I will gladly help you make any script if you tell me what you are looking for. I myself made a whole hack by myself, its not super advance but I do consider myself a good scripter I just wish I was even better with asm.
     
    Last edited:
    90
    Posts
    5
    Years
  • OK then, baby steps.

    1. Open Advance Map and wed it with XSE.
    Advance Map > Settings > Choose Script Editor > XSE.exe
    2. Open Route 1
    3. There should be 2 people there. One with a script that will give you potion and one with a script that will give you advice that you can jump down a ledge.
    If you can't see any NPC, click the EVENTS tab just below the MAGNIFIER icon
    3. Click the NPC with a script that will give you advice. Then look at the very right part of Advance Map.
    4. This is the details of the NPC that you clicked. And one of those is Script Offset.
    Script offset is the location within your ROM that will tell the game where to look when you interact with this NPC. The script should be $167F52
    5. So if you want to edit what will this NPC do when you interact with it, you need to insert a new script here.
    6. Open its script with XSE.
    Look at the right part of Advance Map, There should be Open Script button
    It should open a new window in XSE and you will see :

    #org 0x167F52
    msgbox 0x81833B9 MSG_FACE '"See those ledges along the road?\p..."
    end

    '---------
    ' Strings
    '---------
    #org 0x1833B9
    = See those ledges along the road?\pIt's a bit scary, but you can jump\nfrom them.\pYou can get back to Pallet Town\nquicker that way.
    7. Delete all of them and input your new script, here is the example :
    #dynamic 0x800000

    #org @start
    msgbox @test MSG_FACE
    end

    #org @test
    = I like train.
    8. Compile it, then XSE will automatically repoints the offsets into your ROM.
    9. Pay attention to the detail of XSE Compiler Output. At the bottom of it, you will see Dynamic Offsets
    10. Copy the first offset and put it in the NPC Script Offset in the Advance Map.
    If your ROM is clean and this is your first script, the offset should start at 800000
    11. After you have replaced $167F52 with $800000. Save it.
    12. Test your ROM ingame, the NPC should tell you that he likes train instead to tell you to jump off a ledge.
     
    Last edited:
    124
    Posts
    8
    Years
    • Seen Apr 5, 2024
    You got it, it's as simply as that, although I use PKSV instead of XSE, i dont know I guess it's what I'm used to.
     
    Back
    Top