OK, here I'll explain what scripting is and what each script needs to work. First off, scripting is a lot like programming, it's a list of commands, except it has a defined number of commands that make the ROM do specific things like give the hero a pokemon or make an OW move, or start a wild battle, or even change the weather. Now each command, or at least most have parameters. But what are parameters. Well parameters are numbers that the script requires to be placed after it in order for it to work. For example, lets say you use the givepokemon command, well it's parameters are the pokemons number, level, and item to hold, and three buffers. The first three tell the command what pokemon to give and so on, the last three called buffers are there for unknow reasons and should always stay 0x0. But wait, why does it say 0x0 not just 0. Well the "0x" defines a parameter, so each and every parameter used has to have a 0x before the number itself. This is so the game knows that this is a parameter and not part of the command itself. So if the number that has to be placed in the parameters is 5, then it should be written 0x5. Here are commands necessary for almost every script:
OK the #dynamic teels the ROM the offset of this script, so instead of <FSF OFFSET>. Type in the offset of this script. I'll explain what an offset is. I'll use almost the same comparison used in the original XSE guide. Imagine the ROM as a book, and scripts as paragraphs, and commands as words. Now lets say you read a very good paragraph and told a friend to read it. Well how would you tell that person which paragraph to read. You would tell hime the page number and paragraph number. That's what an offset is. It's an adress for the script to tell the ROM what script to go to once a person event or anything else is activated. To find an offset, you need FSF. Open it and open the ROM and hit search and copy, then come to XSE and type #dyamic 0x<offset that you coppied>. Now if you pressed copy after search in FSF, all you have to do is paste the offset where it says
"<offset that you coppied>". Now we're done. Oh and if you want another offset but don't want to close FSF then open it again, just hit find next and hit copy and paste it for the next script.
#org @start is used to start the script. So always start the script with:
Yes it's better to have a line between these two commands, but don't put a line between any other commands. OH an there are other uses for #org. But I'll get to those is the messages section.
end is to end the script. If you son't use this at the end of a script, the game will go on to other offsets and crash. So use it.
The general composition of a script is:
of course command 1, 2, and 3 being substituted by real commands.
One more thing, humans use the numerical system right?? Well XSE uses the hexadecimal system which is used to represent number using the 10 digits and the letters A B C D E F. So instead of counting 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 in the numerical system, we count 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 17 18 19 1A 1B in the hexadecimal system. Now all numbers used in XSE are in the hexadecimal system, so to convert number from the original form to the hex form, use the calcuator on the right and choose decimal, type in the number, then choose hex and it should be converted, and Vice Versa. So lets say we want to use the give pokemon command and give chikorita, which has a number 152, and we want it level 20, and we want it to hold a berry which by the way has a number lets say 1(yeah items are represented by numbers, I'll give you a list of all items and their numbers later). Well first we change the numbers into hex. 152 in hex is 98, 20 in hex is 14, and 1 in hex is still 1. So the command would look like this:
Again the last three numbers are buffers and should stay 0.
Anyways, one more thing, once you've finished the script, hit open and open the rom, then hit compile, which are both on the tools bar, and then hit copy on the small window that appears, close that window, go to Advance Map and paste the offset in the offset box of the event you want it for. Save and it should work. Here are the Open and Compile button:
