- 31
- Posts
- 18
- Years
- Seen Mar 8, 2024
ScriptDec, as the title implies, is a program used to reverse compiled scripts into something a bit more viewable by humans. Unlike ScriptED or Pokescript, it actually does a decent job at doing this (no offense to the authors of those programs, but the decompilers are pretty unreliable, not that I'd ever want to be tasked with writing one). But being a DOS command line program, its use may confuse some people, so I compiled this small tutorial.
If you're a relative newbie to scripting, stop here. This tutorial isn't for you - it will not help you learn scripting. If you want to duplicate the effect of an existing script, you're better off just using that script as it is and changing the text.
Download ScriptDec: here
ScriptDec is made by loadingNOW, not me. As such, I cannot answer questions about it, or fix any bugs. I am simply providing a tutorial for its use, as when used properly, it is a valuable resource to hackers seeking to add new features to their scripts. To my knowledge, the last release of the program was in 2005, so the likelihood of an update is very small, though the source was included with the release.
There are two ways to use ScriptDec, one is actually notoriously easy which involves using EliteMap, and one slightly more difficult, but more reliable.
The Easy Way:
The Other Way: (for if you dont like EliteMap, or it crashes when using your rom, etc)
ScriptDec can decode level scripts, but is not very good at doing so as it does not recognize the 02 structure that is used for the bulk of the script. If you want to actually view a level script, interpret the structure according to Baro's tutorial in order to find the offset of the main bulk of the script, and view it as a non-level script.
Sometimes, the script may appear blank or incomplete in your browser. Don't worry, this isn't a sign of failure, it just means ScriptDec opened the web browser before it finished decompiling the script. So just wait a couple of seconds, then refresh the page. The script should appear in its entirety, or at least up until the point which ScriptDec can decode (it seems to stumble on the hex command C7, but I haven't found any other problems yet).
ScriptDec is not a miracle program. It will not solve the problem of making custom trading scripts, or doing anything you want in a script. It is, however, very useful for finding new commands and specials to use in one's scripting.
If you understand scripting to a good extent, I recommend looking through the source-code of ScriptDec (provided in the zip) as it has several commands not found in the ScriptED or PokeScript command databases that can be useful to your scripts.
Tutorial by Dabomstew. Not to be copied without permission.
If you're a relative newbie to scripting, stop here. This tutorial isn't for you - it will not help you learn scripting. If you want to duplicate the effect of an existing script, you're better off just using that script as it is and changing the text.
Download ScriptDec: here
ScriptDec is made by loadingNOW, not me. As such, I cannot answer questions about it, or fix any bugs. I am simply providing a tutorial for its use, as when used properly, it is a valuable resource to hackers seeking to add new features to their scripts. To my knowledge, the last release of the program was in 2005, so the likelihood of an update is very small, though the source was included with the release.
There are two ways to use ScriptDec, one is actually notoriously easy which involves using EliteMap, and one slightly more difficult, but more reliable.
The Easy Way:
- Download ScriptDec from the above link, and extract it to a folder.
- Rename the main ScriptDec EXE file to scripted.exe
- Replace the scripted.exe in the folder of EliteMap with your renamed ScriptDec (remember to replace scripted with the original if you actually want to make a script using it!)
- Make sure your ROM doesn't have any spaces in the filename! (Preferably no special characters at all, but I know it doesn't work with spaces.)
- Open your ROM in EliteMap, find the event you want to see the script of, and Ctrl+click it.
- Press N and then Enter, as it is not a level script.
- The script will appear in your internet browser as a htm file.
The Other Way: (for if you dont like EliteMap, or it crashes when using your rom, etc)
- Download ScriptDec from the above link, and extract it to a folder.
- Copy the rom you want to view the script from into its directory.
- Find the offset of the script you want to view in AdvanceMap or EliteMap, and make note of it.
- Run the DOS command prompt, navigating to the directory with scriptdec in it, and run the command:
Code:scriptdec romname.gba:offsetinhex
Code:scriptdec firered.gba:169595
If your rom name has spaces in it, make sure to put quotes around the rom name (but not anything else), like so:
Code:scriptdec "Fire Red.gba":169595
- Press N and then Enter, as it is not a level script.
- The script will appear in your internet browser as a htm file
ScriptDec can decode level scripts, but is not very good at doing so as it does not recognize the 02 structure that is used for the bulk of the script. If you want to actually view a level script, interpret the structure according to Baro's tutorial in order to find the offset of the main bulk of the script, and view it as a non-level script.
Sometimes, the script may appear blank or incomplete in your browser. Don't worry, this isn't a sign of failure, it just means ScriptDec opened the web browser before it finished decompiling the script. So just wait a couple of seconds, then refresh the page. The script should appear in its entirety, or at least up until the point which ScriptDec can decode (it seems to stumble on the hex command C7, but I haven't found any other problems yet).
ScriptDec is not a miracle program. It will not solve the problem of making custom trading scripts, or doing anything you want in a script. It is, however, very useful for finding new commands and specials to use in one's scripting.
If you understand scripting to a good extent, I recommend looking through the source-code of ScriptDec (provided in the zip) as it has several commands not found in the ScriptED or PokeScript command databases that can be useful to your scripts.
Tutorial by Dabomstew. Not to be copied without permission.
Last edited by a moderator: