diegoisawesome's MEGA-HUGE XSE Scripting Tutorial
(PokeScript tutorial originally by thethethethe)
Don't Take Or Modify Without Permission
Don't Take Or Modify Without Permission
I want to say thanks to thethethethe for letting me take this tutorial
and modify it for XSE compatibility. Also, I want to thank HackMew for
making XSE in the first place, and for Irish Witch and PokeScript for
getting me started on scripting. I also want to thank zel for making
the hack (ShinyGold) that started me on the road to hacking. Since this
is just a modification to thethethethe's original tutorial, you'll see
very many similarities.
XSE is a program created by Hackmew, as I've already said. This program
is, in my opinion, the best scripting program there is, having many
advantages over ScriptED, PokeScript, Diamond Cutter, and the likes.
Some of the important features of XSE are:
Dynamic Offsets
All you need to find is the starting offset. XSE will find the rest.
Less Raws, More Commands
It's to make it easier. Instead of having to use #raw 0x53 0x07, you can just use hidesprite 0x07.
This tutorial is going to cover a lot.
I'll show a script at the beginning and then explain everything "new" after it.
Please note that because I hack Fire Red, most scripts are written to suit Fire Red/Leaf Green, and NOT Ruby/Sapphire/Emerald.
I think I'll start with pointers.
Pointers
XSE is great in the way that it uses dynamic offsets. You just put the
starting offset (found in FSF {Free Space Finder}) and XSE will do the
rest.
You can use any random name for the pointer. It could be, for example...
@blah ; @iliketoeatcheese ; @1234567890
As long as there are no spaces in it, and there aren't two exact same pointers, the pointer will work.
So, for example, these won't work
@mr potato head ; @i like mews ; @pikachu rocks.
Message Scripts
Now I can move onto a normal message script.
Code:
#dynamic 0x(FSF Offset)
#org @start
lock
faceplayer
msgbox @1 0x6
release
end
#org @1
= Hi.\nMy name is Diego.
I'll begin at the top of the script and work my way down.
#dynamic 0x(FSF Offset) is the starting offset for your script. XSE will do the rest.
#org @start marks the start of the script, obviously. It shows that it's the beginning.
lock will lock your player so that while this script is "in motion" the player won't be able to move.
faceplayer is used to make the sprite you are talking with face you.
message is used when you want a message to display on the
screen. It's followed by a pointer that will be placed at the bottom as
shown.
The actual message will appear like this.
Quote:
| Hi. My name is Diego. |
I'll explain the other types, like \p and \l and others, a little later.
Now the number after the pointer. That number MUST follow a msgbox pointer. Without this, the message box won't appear. In this case, I've used 0x6. I'll cover more numbers later.
Now we use release. This will release the locked player.
end will end the script, stopping it from reading any bytes past it that could crash your game when used.
Extra Message Info
There are lots of other little add-ons that can be used with the message. Here's a short list of them:
Quote:
| \c \h \n \l \p \v |
I'll go in order of this list.
\c usually refers to a color.
This message:
Quote:
| \c\h01\h02You received a Pokémon! |
will appear in a black text. There's also a new way to write colors.
Here's a short list of the new ones:
Fire Red/Leaf Green
Spoiler:
- Spoiler:
Ruby/Sapphire
Spoiler:
- Spoiler:
Emerald
- Spoiler:
\h is used with hex values. Here's an example:
Quote:
| Here's \hB7100! |
That \hB7 is the currency sign of the Pokemon world.
So in this example, I'm going to use "$":
Quote:
| Here's $100! |
Here's a table of all the hex codes for each symbol:
- Spoiler:
Instead of using the codes below, I recommend using the Text Adjuster,
found under Tools>Text Adjuster. Just type it in, press "Convert",
and paste it in. It's that simple!
\n is used when we want to go to a new line. So this message:
Quote:
| Hi.\nWelcome. |
would appear like this:
Quote:
| Hi. Welcome. |
\l is used in text for a new line, but it can only be used after \n has already been used.
So this message:
Quote:
| Hi.\nI love my bed!\lDon't you dare sleep in\lit! |
will appear like this:
Quote:
| Hi. I love my bed! Don't you dare sleep in it! |
\p is used when we want the text to continue in a new box. This message:
Quote:
| ...\p...\p...\pYup! |
will appear like this: ------------ means a new box.
Quote:
| ... ------------------------------------------------ ... ------------------------------------------------ ... ------------------------------------------------ Yup! |
\v is used when we want display stored text. Here's an example:
Quote:
| Hello, \v\h01!\n\v\h06 is looking for you. |
This would appear like this.
Quote:
| Hello, [PLAYER's name]! [RIVAL's name] is looking for you. |
You could also do it like this:
Quote:
| Hello, [player]!\n[rival] is looking for you. |
Msgbox Numbers
Here are the many different types, taken directly from The ROM Hacking Newsletter, also located in the ROM Hacking section.
This week's tip comes from HackMew. This time, it's all about
msgboxes. Below is a description, script example and in-game shot of
the different msgbox types.
0x2
- Spoiler:
0x3
- Spoiler:
0x4
- Spoiler:
0x6
- Spoiler:
Flags
Flags are very useful when you need an event to only occur once or if you want a person to disappear.
Let's say you set flag 0x200. If you want an overworld to disappear, we
have to assign the set flag (in this example, 0x200) to the overworld's
people ID in Advance-Map. I'll go into more detail on that later.
Many flags are used within the game already. If you plan on leaving
scripts that are already in the ROM, you'll need to be more careful on
what flags you use, because flags can only really be used once.
If you want some flags that are used in the ROM already, here's a list: Taken directly from the XSE Comprehensive Scripting Guide, found here: Help>Guide










