destinedjagold
Oh Hai Thar.
- 8,594
- Posts
- 17
- Years
- Stinky/Old/Fart
- On your ceiling...
- Seen Apr 17, 2025
~Understanding the Basics of Scripting~
by destinedjagold
by destinedjagold
Introduction...
Hello there pipz.
I'm destinedjagold, the maker of the Ruby Destiny series. This is my first scripting tutorial, so I hope this'll be useful for those who are new to hacking/modding...
Opening Message...
Okay, so I have read a comment where scripting tutorials were only understandable by those who already have experience in scripting/hacking.
So I decided to make a scripting tutorial that hopefully, will be easy to understand for those who are new to the fields of scripting...
Note...
- This tutorial is for those who are new to scripting/hacking...
- This tutorial uses HackMew's XSE tool...
I. The Syntax of Scripting
Code:
#dynamic 0x800000
#org @start
//commands here
end
To understand what those are, the commands #dynamic 0x800000 tells XSE where it'll store/write the script in your ROM.
#org @start is the beginning of your script. It's like a
front cover of a book. @start should not have any duplicates... It tells XSE that the script starts there.
The commands will be discussed later on...
And every book has a back cover, and that's what end is. It tells XSE that your script ends there.
II. A Simple Talking Script
Code:
#dynamic 0x800000
#org @start
lock
faceplayer
message @1 0x6
release
end
#org @1
= Hello World!
- lock - It locks the PLAYER in place...
- faceplayer - It makes the NPC face you if you talk to him...
- message - tells XSE that a message box will show up containing texts...
- @1 - the address of the message (remember that there shouldn't be any duplicates of any adress)
- 0x6 - a message type. This is just an ordinary message...
- release - tells XSE to unlock the PLAYER, so he can move again...
III. Addresses
And now, we have an address... If you recall, one of our commands in the example script is message @1 0x6 where @1 is an address of your message command.
Code:
#org @1
= Hello World!
- It tells XSE where to locate your messages, movements, or continuation scripts...
IV. Flow of Scripting
How does the ROM read the script?
Well, just like us, we read from top to bottom. The same towards scripts. XSE reads it from top to bottom...
Code:
#dynamic 0x800000
#org @start
lock
faceplayer
message @1 0x6
release
end
#org @1
= Hello World!
Let's not discuss about how XSE searches for free space... This is a scripting tutorial, anyways...
The script will be read in a top-bottom method. So...
- lock will be read first, which locks the PLAYER in place...
- faceplayer is read next, where the NPC will face the PLAYER...
- then the message...
- since the message tells the script a location address of it's content, it goes to the address, which is #org @1, and then goes back...
- and then the PLAYER's released...
- and the script ended...
- When you talk to an NPC, the PLAYER is locked...
- And then, the NPC will face the PLAYER...
- And then a message will display...
- And then, you are released...
- And the script ended...
[a id]putrom[/a id]
~Putting The Script In Our ROM~
Newly Added - July 26, 2010
Newly Added - July 26, 2010
Opening Message...
Now you understand the basics of scripting. But now comes the question: how to we put it into our ROMs...?
It's quite simple. Here's a step by step procedure on how to do so...
Note...
You will need the following...
- HackMew's XSE tool...
- LU-HO's Advance Map tool...
Step-by-Step Procedure...
I. Step 1...
1. Open XSE...
2. Press CTRL + O or go to 'File' and click 'Open'.
3. Select your ROM (the one with the .gba extension).
Spoiler:
![[PokeCommunity.com] Basics of Scripting [PokeCommunity.com] Basics of Scripting](https://i30.tinypic.com/20kbnyq.jpg)
II. Step 2...
1. Write your script...
2. After you are done, click the 'gears' icon...
Spoiler:
![[PokeCommunity.com] Basics of Scripting [PokeCommunity.com] Basics of Scripting](https://i32.tinypic.com/6r4x7o.jpg)
III. Step 3...
1. After clicking the gear icon, a pop-up will appear...
2. The first address is usually highlighted first, and is usually the one you'll need.
3. Click the 'Copy' button...
Spoiler:
![[PokeCommunity.com] Basics of Scripting [PokeCommunity.com] Basics of Scripting](https://i25.tinypic.com/16hq25d.jpg)
IV. Step 4...
1. Open Advance Map, and open your ROM through that tool...
2. Search for the event that you want your script to be inserted...
3. Write/paste the offset you copied from XSE onto the event's Script Offset in Advance Map (the '$' symbol should be there)...
Spoiler:
![[PokeCommunity.com] Basics of Scripting [PokeCommunity.com] Basics of Scripting](https://i29.tinypic.com/5vnj0l.jpg)
And voila~
You have inserted your script~
---o0o---
Scripting Tutorials...
added on February 11, 2013
- About Flags - post by .parado✗
- Make Trainer Battles 1 - a video tutorial
- Make Trainer Battles 2 - a video tutorial
- Make Wild Battles - a video tutorial
- Making NPC's Move Part 1 - a video tutorial
- Making NPC's Move Part 2 - a video tutorial
---o0o---
Ending Message...
Okay, so that's the basics of scripting...
If you need to learn more advance scripting, a lot of tutorials are available around here in the Documents and Tutorials...
I might add something else in this tutorial but for now...
Last edited: