• 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] How can I decompile a script in XSE????

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
  • Compiling is the process of turning commands within XSE into a string of hexadecimal values in the ROM. Thus, decompiling is turning a string of hexadecimal values in the ROM into commands within XSE. You decompile with XSE whenever you open a script that has already been inserted in a ROM. Here's what a decompiled scripts looks like vs one that hasn't been compiled yet:

    Code:
    '---------------
    #org 0x800000
    msgbox 0x880000B MSG_FACE '"Hello world!"
    release
    end
    
    
    '---------
    ' Strings
    '---------
    #org 0x80000B
    = Hello world!

    Code:
    #dynamic 0x800000
    
    #org @start
    msgbox @talk 0x2
    release
    end
    
    #org @talk
    = Hello world!

    I'm sure you've seen this before. The biggest difference between the two is that the pointers are not dynamic (@start, @talk), but static (0x800000, 0x80000B). Unless you're making changes that don't affect the length of a script (e.g turning a 0x0 into a 0x1) or you're an expert scripter and know what you're doing, you should always be working with dynamic pointers. Because of this, it isn't safe to port a decompiled script to another ROM unless you know that it will be inserted into free space, or else you're at risk of overwriting data. Its good practice to change every static pointer to a dynamic one in order to be on the safe side if you want to port.
     

    __fred__40

    fred
    277
    Posts
    4
    Years
  • I'm sure you've seen this before. The biggest difference between the two is that the pointers are not dynamic (@start, @talk), but static (0x800000, 0x80000B). Unless you're making changes that don't affect the length of a script (e.g turning a 0x0 into a 0x1) or you're an expert scripter and know what you're doing, you should always be working with dynamic pointers. Because of this, it isn't safe to port a decompiled script to another ROM unless you know that it will be inserted into free space, or else you're at risk of overwriting data. Its good practice to change every static pointer to a dynamic one in order to be on the safe side if you want to port.

    Thx,
    My problem is that I corrupted the texts in Oak's lab and I can't use AText(cause my laptop doesnt meet the requirements or whatever)So i was planning of decompiling the script from a vanilla rom and then compile them into my hack
    Do you think that is possible or should I still change all the pointers??
     
    Last edited:

    Dr. Seuss

    Will finish GS Chronicles, I swear!
    523
    Posts
    10
    Years
  • Thx,
    My problem is that I corrupted the texts in Oak's lab and I can't use AText(cause my laptop doesnt meet the requirements or whatever)So i was planning of decompiling the script from a vanilla rom and then compile them into my hack
    Do you think that is possible or should I still change all the pointers??

    The best way to fix these kinds of issues is by copying and pasting the original data form a clean rom to yours. You can get the script offsets in XSE and copy that data from the clean one to the corrupted one. That should resolve the issue.
     

    __fred__40

    fred
    277
    Posts
    4
    Years
  • The best way to fix these kinds of issues is by copying and pasting the original data form a clean rom to yours. You can get the script offsets in XSE and copy that data from the clean one to the corrupted one. That should resolve the issue.

    It usually would but i cant find the script that activates when After attempting to go in the tall grass oak stops you and bring you inside and the you know you and the oak walk to where Is the rival.that it the only One i cant find
     

    Dr. Seuss

    Will finish GS Chronicles, I swear!
    523
    Posts
    10
    Years
  • Open your game in A-map and look for the Oak's lab map. Click on the tab "header" and locate the map scripts. You need to look for the one that starts upon entering the lab and check that script with a vanilla ROM
     

    __fred__40

    fred
    277
    Posts
    4
    Years
  • Open your game in A-map and look for the Oak's lab map. Click on the tab "header" and locate the map scripts. You need to look for the one that starts upon entering the lab and check that script with a vanilla ROM

    Ok so if i got It right i should Press crtl+H and activate the professional view and there i found the map script but then It doesnt let me open It and if i try to Copy the offset in an XSE blank window with the rom loaded it gives me a Total no sense script like a warp or something
    Did i get It right or should It on the normal view of the header section?
     

    Dr. Seuss

    Will finish GS Chronicles, I swear!
    523
    Posts
    10
    Years
  • Ok so if i got It right i should Press crtl+H and activate the professional view and there i found the map script but then It doesnt let me open It and if i try to Copy the offset in an XSE blank window with the rom loaded it gives me a Total no sense script like a warp or something
    Did i get It right or should It on the normal view of the header section?
    Actually you need to look for the map scripts instead of the map script itself. These are the ones that have a button that says "open map script"
     

    __fred__40

    fred
    277
    Posts
    4
    Years
  • Actually you need to look for the map scripts instead of the map script itself. These are the ones that have a button that says "open map script"

    I copied every single script from the lab but it still aint working

    I believe that the problem is that the game cant connect the 2 following scripts

    this first one(which is an 03 script that activates on map entering/not menu close) which activates when Oak brings you into the lab after having tried to go on tall grass
    Spoiler:


    and the second one(which is a 02 script that SHOULD activates when you walk on a script box) which makes you and Oak walks up towards where the rival stands
    Spoiler:

    I have no idea how are the 2 supposed to be connected

    there is also a 3rd script that set the player face up when entering the map(IDK why did the creator put it)that i will put down below just in case
    Spoiler:


    I thought that maybe the fact that I changed the rival name into Gary in every text of the Lab may have a negative effect as flag 24F as something to do with a rival check Idk of what sort(I think is checking how did the player called him in the intro,but thanks to GBA intro manager I took out the possibility of selecting a name for the rival)
     
    Last edited:
    Back
    Top