Hey, there! I'm Percy, and I'm about to teach you scripting. Let's move on since I'm bad at introducing myself.
I'm pretty sure you already know the meaning of scripting, right? Well, then, soon-to-be-scripters. Let's start learning scripting!
Let me explain line by line.
#dynamic 0x(free space offset)
With #dynamic, you simply state a start offset, say 0x800000, and XSE will automatically insert it in the first suitable instance of free space past that offset. (Said by Spherical Ice) And, in order to have an offset, open FSF, and open your ROM with it. Click Search and you'll gonna have an offset that is safe to use, whatsoever.
#org @pointer
This part is the pointer. It can be anything:
@iamcool etc.
Just remember not to duplicate any pointers, and don't include spaces, too!
lock
Easy, it locks the player, so it can't move and such.
msgbox @hello 0x6
If you want a message box to appear use the msgbox command. The @hello part is where we'll gonna store our text. The 0x6 part decides what message box it will show. There are 5 kinds of message box:
Now, back to explaining:
release
It releases the player from the lock command so that you can move again.
end
It ends the script. You must include this in every script you make.
#org @hello
Pointer to your text.
= Hello to you!
Ta-da! This is the text. In your XSE, press CTRL + T. It opens up the Text adjuster so you don't need to add the \n, \l, or \p. If \n is used, the message box scrolls up, same as the \l, but you may only use \l if you have used \n. \p is for new textbox. Now make your own basic scri
This is the second part of scripting I learned, and when you learn it, you're gonna have fun with it. Anyway, let's start.
There! If you don't understand some of the old commands we've done last lesson, just scroll up, and you'll see.
Let's start explainin'
msgbox @1 0x5
Remember what 0x5 are for? Yes, for Yes/No message boxes. The message box is accompanied with one command ...
compare LASTRESULT 0x1
Get's the lastresult and the 0x1 beside it means yes. (said by tajaros)
if 0x1 goto @2
If you pressed yes, it will goto @2
If you pressed no, it will ignore this part, and continue to @3.
There!
Start making Yes/No scripts!
[a id]compilescript[/a id]
First, do your script
(Its made in XSE, I just don't want to reveal my name :P
And, hit compile.
Here's what the icon looks like:
And, then open up XSE, and focus on the NPC you want to put the script into
Put your script offset you just copied here
(Find the red circle)
Copy and paste of course:
(if you're using A-map 1.92, paste it all over)
Try it out in-game!
If you have some trouble please post it here!
PS: I'm gonna post lesson 3 soon enough! ;)
I'm pretty sure you already know the meaning of scripting, right? Well, then, soon-to-be-scripters. Let's start learning scripting!
Tools You're Gonna Need:
XSE
Advance Map 1.9.2
I think you can find the download links here: https://www.pokecommunity.com/showthread.php?t=341758
Be sure to get the 1.92 version of Advance Map.
Oh, yeah, you need FSF (Free Space Finder): https://www.dropbox.com/s/kni6u0mp2nxvs6z/Free%20Space%20Finder.zip?dl=0
It will find free space for you.
Lesson 1:
Basic Scripting
XSE
Advance Map 1.9.2
I think you can find the download links here: https://www.pokecommunity.com/showthread.php?t=341758
Be sure to get the 1.92 version of Advance Map.
Oh, yeah, you need FSF (Free Space Finder): https://www.dropbox.com/s/kni6u0mp2nxvs6z/Free%20Space%20Finder.zip?dl=0
It will find free space for you.
Lesson 1:
Basic Scripting
Code:
#dynamic 0x(free space offset)
#org @pointer
lock
faceplayer
msgbox @hello 0x6
release
end
#org @hello
= Hello to you!
Let me explain line by line.
#dynamic 0x(free space offset)
With #dynamic, you simply state a start offset, say 0x800000, and XSE will automatically insert it in the first suitable instance of free space past that offset. (Said by Spherical Ice) And, in order to have an offset, open FSF, and open your ROM with it. Click Search and you'll gonna have an offset that is safe to use, whatsoever.
#org @pointer
This part is the pointer. It can be anything:
@iamcool etc.
Just remember not to duplicate any pointers, and don't include spaces, too!
lock
Easy, it locks the player, so it can't move and such.
msgbox @hello 0x6
If you want a message box to appear use the msgbox command. The @hello part is where we'll gonna store our text. The 0x6 part decides what message box it will show. There are 5 kinds of message box:
Spoiler: 5 kinds of message box
0x2 - If you use this kind of message box, you don't need lock, faceplayer, release.
0x3 - For the sign posts. Like the 0x2 you don't need lock, faceplayer, and release.
0x4 - A normal message box, you can use lock, faceplayer, and release in this. Its like 0x6 but this doesn't close. Just stick closeonkeypress on your script when you use the 0x4 message box, and the message box will close.
0x5 - The Yes/No message box. Its kind of complicated to explain how this works right now, so maybe in Lesson 2 or something.
0x6 - Normal message box. You can use the lock, faceplayer, and release commands.
0x3 - For the sign posts. Like the 0x2 you don't need lock, faceplayer, and release.
0x4 - A normal message box, you can use lock, faceplayer, and release in this. Its like 0x6 but this doesn't close. Just stick closeonkeypress on your script when you use the 0x4 message box, and the message box will close.
0x5 - The Yes/No message box. Its kind of complicated to explain how this works right now, so maybe in Lesson 2 or something.
0x6 - Normal message box. You can use the lock, faceplayer, and release commands.
Now, back to explaining:
release
It releases the player from the lock command so that you can move again.
end
It ends the script. You must include this in every script you make.
#org @hello
Pointer to your text.
= Hello to you!
Ta-da! This is the text. In your XSE, press CTRL + T. It opens up the Text adjuster so you don't need to add the \n, \l, or \p. If \n is used, the message box scrolls up, same as the \l, but you may only use \l if you have used \n. \p is for new textbox. Now make your own basic scri
Lesson 2
Yes/No Messages
Yes/No Messages
This is the second part of scripting I learned, and when you learn it, you're gonna have fun with it. Anyway, let's start.
Code:
#dynamic 0x800000
#org @start
lock
faceplayer
msgbox @1 0x5
compare LASTRESULT 0x1
if 0x1 goto @2
msgbox @3 0x6
release
end
#org @1
= I am handsome?
#org @3
= No? What the [.]
#org @2
msgbox @4 0x6
release
end
#org @4
= Yes!
Let's start explainin'
msgbox @1 0x5
Remember what 0x5 are for? Yes, for Yes/No message boxes. The message box is accompanied with one command ...
compare LASTRESULT 0x1
Get's the lastresult and the 0x1 beside it means yes. (said by tajaros)
if 0x1 goto @2
If you pressed yes, it will goto @2
If you pressed no, it will ignore this part, and continue to @3.
There!
Start making Yes/No scripts!
[a id]compilescript[/a id]
Spoiler:
How to insert script
First, do your script
![[PokeCommunity.com] Percy's Scripting Guide [PokeCommunity.com] Percy's Scripting Guide](https://i58.tinypic.com/25u61z6.png)
(Its made in XSE, I just don't want to reveal my name :P
And, hit compile.
Here's what the icon looks like:
![[PokeCommunity.com] Percy's Scripting Guide [PokeCommunity.com] Percy's Scripting Guide](https://i.imgur.com/dyQxril.png)
And, then open up XSE, and focus on the NPC you want to put the script into
![[PokeCommunity.com] Percy's Scripting Guide [PokeCommunity.com] Percy's Scripting Guide](https://i.imgur.com/VZQCgwF.png)
Put your script offset you just copied here
![[PokeCommunity.com] Percy's Scripting Guide [PokeCommunity.com] Percy's Scripting Guide](https://i.imgur.com/bp54n4a.png)
(Find the red circle)
Copy and paste of course:
(if you're using A-map 1.92, paste it all over)
Spoiler:
![[PokeCommunity.com] Percy's Scripting Guide [PokeCommunity.com] Percy's Scripting Guide](https://i.imgur.com/DQwLVSW.png)
Try it out in-game!
If you have some trouble please post it here!
-Percy
Contact me if you have trouble with this tutorial, or just post it here.
PS: I'm gonna post lesson 3 soon enough! ;)
Last edited: