Tutorial XSE Scripting Tutorial

Started by Darthatron February 23rd, 2008 11:12 PM
  • 120062 views
  • 467 replies

Darthatron

巨大なトロール。

Age 28
Male
Melbourne, Australia
Seen February 2nd, 2015
Posted October 28th, 2014
1,152 posts
14.5 Years
Hello, welcome to my XSE Tutorial, I hope some people ind it helpful. XSE is the revolutionary Script Editing Tool by - HackMew -. Please leave comments on how helpful this was to you. :) Here is a quick OverVeiw of XSE:


XSE will be available for download in the ToolBox shortly, I have the Release Candidate version and it is simply fantastic. When you all have the chance to download XSE I'm sure you'll fall in love with it as much as I did. :D Look in the spoiler for the very basics of scripting in XSE.

Spoiler:
XSE has a new Automatic Offset Location system, not unlike PokeScript. But instead of using the "$" sign it uses the "@" sign, in my eyes it makes more sense to use the "@" sign because it is "at" the location. Anyway, it is farely simple to use and I will just give you a brief description on it.

Basically, if you used PokeScript you will get the gist of this system. At the start of your script put something like this:
#Dynamic 0xOffset
but replace the word "Offset" with the Hexadecimal offset with free space (FF for FireRed and LeafGreen, 00 for Ruby and Sapphire).

Example: In FSF (Free Space Finder) you have to find a certain amount of "Free Space", depending on how large your script is. For simplicity just search for a large number, something between 100 and 300 should be plenty. Next click the "Search" button in the ListBox you should see something like this:

Click the "Copy" button and replace the word "Offset", in our script above, with that Value.

So far our script should look something like this:
#Dynamic 0x3B4D84
Ok, next we are going to get to the actual scripting! Ho-rah!

Ok, to start a script you must put the following line of code, no matter what kind of script you are doing:
#ORG @Start
Feel free to replace the word "Start" with any other word, it really doesn't matter what word you use, it is just for reference. Anyway, so far the script should look something like this:
#Dynamic 0x3B4D84

#ORG @Start
It doesn't have to look exactly like that, but it should look similar.

Presuming you already know the basics I will start explaining how the actual scripting works, it is nearly completely the same as ScriptEd and PokeScript but with some differences that you will find out during this tutorial.

1. A basic talking script!
________________________


Ok, as usual we will start with the Important parts, the begining. So, your script should look something like this:
#Dynamic 0x800000

#ORG @Main
In talking scripts, and in some others, you must have these 2 lines.
Lock
FacePlayer
I'll now explain what these lines of code do...
Spoiler:
"Lock" = Makes it so the Player can't move and the NPC you are talking to also won't be able to move.
"FacePlayer" = This code makes it so the NPC you are talking to looks at the Player.


So now your script should look something like this:
#Dynamic 0x800000

#ORG @Main
Lock
FacePlayer
Next we will be adding the "Offset" where the text is "Saved". So add these 2 lines of code and then I will explain them shortly:
Message @Speak
BoxSet 0x6
Once again, you may replace the word "Speak" with any other word as it is just for reference. Now to explain to you what these lines of code mean...
Spoiler:
"Message" = This is just a simple word that allows you to incert a message, this would have to be one of the most used functions in Pokemon Scripting.
"@Speak" = This is the offset at which the "Message" will be saved, of course you can use any word instead of "Speak" as it is just for reference.
"BoxSet 0x6" = This is merely a function used to show you how the message is shown in the game. The "0x6" means it is just a normal TextBox, you can also use "0x5" which is a "Yes/No" Box, I will go into more detail for that at a later time.


So now your script should look similar to this:
#Dynamic 0x800000

#ORG @Main
Lock
FacePlayer
Message @Speak
BoxSet 0x6
Rightio, next we are going to add 2 more new lines, get ready:
Release
End
Now these 2 lines are very important, especially the later. Now, once more I will explain what these lines mean!
Spoiler:
"Release" = This function give your Player the ability to move again, it also allows the NPC you are talking to the ability to walk around as well.
"End" = This simply means that it is the End of the script and makes it so the Game doesn't continue to read the data.
Don't worry, we are almost finished, just 2 more lines of code.

Your Script should look something like this now:
#Dynamic 0x800000

#ORG @Main
Lock
FacePlayer
Message @Speak
BoxSet 0x6
Release
End
Now we are going to put what the actual Message is, this is the part we have all been waiting for! Put these 2 lines of code at the bottom of your script:
#ORG @Speak
= This is a message!
And for the last time today I will explain what there lines of code mean!
Spoiler:
"#ORG @Speak" = This is merely the place that you pointed to earlier in the script, if you didn't use the word "Speak" before, you must change this "Speak" to the same word.
"= This is a message!" = This the message that will be displayed in-game. Feel free to change the "This is a message!" text to whatever you want the person you are talking to, to say.


Well, that's all I have time for today, but I will edit this post and add some more tutorials in the future. Until then, I'll be programming. :D

2. Compiling the script!
________________________


To compile a script into a ROM you just have to follow 3 simple steps.
  1. Make sure the script you want to compile is open in XSE.
  2. Go into the "File" menu and click "Open...", select the ROM you want to compile the script into.
  3. Then click the Compile button , and that's it. Your script is comiled into your ROM.
あなた は しきしゃ です
わたし は ばか です

Darthatron

巨大なトロール。

Age 28
Male
Melbourne, Australia
Seen February 2nd, 2015
Posted October 28th, 2014
1,152 posts
14.5 Years
You got this up quick. Maybe a little too early, but still good.
Hmmm. A tool, that a tool maker loves.
If you're writing this one up, you've got a lot of commands to work with. I wish I'd seen it sooner, I couldn't figure out the dynamic offset thing on my own.
Yes, I realize it's out early but I want whoever else who might test it to be able to do it well, right?
I love all - HackMew -'s tools, I also have no doubt that he is a best programmer than myself. :D

Thanks for commenting. :)

Great Darthathron cause in XSE, some commands have new parameters like wildbattle
Anyways great job putting this up!!!
Looking forward to see it completed
I have realized that too. I won't be doing anymore of this tutorial tonight however, I think I should find my Visual Basic install disk and release the new PEP... Thanks for commenting.
あなた は しきしゃ です
わたし は ばか です

Darthatron

巨大なトロール。

Age 28
Male
Melbourne, Australia
Seen February 2nd, 2015
Posted October 28th, 2014
1,152 posts
14.5 Years
Yeah, LowerCase still works, infact that's how it descripts it. I just think it is easier to read and learn with UpperCase in the right positions. :) I plan to update this later in the week, by the way.
あなた は しきしゃ です
わたし は ばか です
Age 29
Male
London, UK
Seen December 14th, 2016
Posted December 14th, 2016
438 posts
12.9 Years
#ORG $begin
lock
faceplayer
checkflag 0x200
if B_true goto $done
message $person
boxset 6
givepokemon 1 5 0
setflag 0x200
release
end

#org $done
message $person2
boxset 6
release
end

#org $person
$person = Hello,

I have done this to get give pokemon

but what do i put for the players name is it h01?
This signature has been disabled.
Bottom images make your signature just a bit too tall :(
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.

Darthatron

巨大なトロール。

Age 28
Male
Melbourne, Australia
Seen February 2nd, 2015
Posted October 28th, 2014
1,152 posts
14.5 Years
#ORG $begin
lock
faceplayer
checkflag 0x200
if B_true goto $done
message $person
boxset 6
givepokemon 1 5 0
setflag 0x200
release
end

#org $done
message $person2
boxset 6
release
end

#org $person
$person = Hello,

I have done this to get give pokemon

but what do i put for the players name is it h01?
That is a pokescript script, this tutorial is for XSE. Plus this should go into the Script Help thread anyway.
あなた は しきしゃ です
わたし は ばか です
Age 29
Male
London, UK
Seen December 14th, 2016
Posted December 14th, 2016
438 posts
12.9 Years
This looks much more easy where can i donwload this
This signature has been disabled.
Bottom images make your signature just a bit too tall :(
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.

/Circa

a face in the clouds.

Male
Melbourne, Victoria
Seen August 11th, 2018
Posted July 29th, 2010
881 posts
12.6 Years
I beleive he released it, but you need an activation key?
I have a script i'm having problems with, when I land on the tile, the game freezes.
All I have to click is compile, and put the dynamic offset into A map right?

#dynamic 0x800000

#org @begin
lock
checkflag 0x200
if 1 goto @done
message @stop
boxset 0x6
applymovement 0x3 @coming
waitmovement 0
message @dontgo
boxset 0x6
applymovement 0x3 @going
applymovement 0xFF @follow
waitmovement 0
message @dangerous
boxset 6
release
end

#org @stop
= Wait \v\h01!

#org @dontgo
= Don't go out there!

#org @dangerous
= Wild Pokemon jump out of\n the grass on the way\p to the next town.

#org @coming
#raw 0A
#raw 0A
#raw 0A
#raw 0A
#raw FE

#org @going
#raw 0B
#raw 0B
#raw 0B
#raw 0B
#raw 02
#raw FE

#org @follow
#raw 0B
#raw 0B
#raw 0B
#raw FE

#org @done
release
end
dragging himself, forw
ard again, the pain has
still not diminished. E
ventually though, he e
merges inside a v
ery large room w

here everything about

the house

suddenly

changes.
Seen January 3rd, 2010
Posted November 22nd, 2009
230 posts
12.6 Years
I thought it was a rumour (it wasn't there in early beta versions) but you need to get an activation key from HackMew but you won't get it if you aren't chosen as a beta tester.

Anyway, I had a chance to test it out in early beta stages and later when Andrea added dynamic offsets (which are better than Pokéscript's - you can even use mixed offsets - dynamic AND static) and I am happy with it. This tutorial is neat and I like it.

Keep it up!

Offtopic comment:
Why do you write some words weird way, Darthatron? In scripting editor or sometimes in post... For example BoxSet or LowerCase, it looks silly. Sorry :x
If you remeber me, feel free to send me a PM ;-)

HackMew

Mewtwo Strikes Back

Seen October 26th, 2011
Posted October 15th, 2010
1,314 posts
14 Years
Well, thanks for your efforts Darthatron. Anyway, I'd like to say I'm already preparing a complete readme/guide for XSE (which will be included in the final release, obviously) to explain all the features and commands XSE has. And since you're not the programmer you would sure miss a lot of hidden or kinda "undocumented" features.
Feel free to continue your tutorial as long as you won't blame me to make something more complete.

/Circa

a face in the clouds.

Male
Melbourne, Victoria
Seen August 11th, 2018
Posted July 29th, 2010
881 posts
12.6 Years
I just noticed, basic scriptEd works in XSE aswell.
And the dynamic offset really isn't needed, a scriptEd script would work fine.
For instance using a basic pointer would work.

#org 0x800000
Good tut though.
dragging himself, forw
ard again, the pain has
still not diminished. E
ventually though, he e
merges inside a v
ery large room w

here everything about

the house

suddenly

changes.

Darthatron

巨大なトロール。

Age 28
Male
Melbourne, Australia
Seen February 2nd, 2015
Posted October 28th, 2014
1,152 posts
14.5 Years
Hey Darthatron, where can i download XSE script editor
i'm a n00b scripter so ow bout telling me where to download
it.
It's not available for download yet. I just have the BETA. :) It should be released soon.
あなた は しきしゃ です
わたし は ばか です

Jawash

<Beat EVERY SINGLE DragonQuest

Age 28
Seen February 27th, 2010
Posted April 19th, 2009
37 posts
12.2 Years
It's not available for download yet. I just have the BETA. :) It should be released soon.
really now?
there is only a beta. interesting =]
where is that even?
but i've heard news on this, only a teency bit, but is sounds like it'll be worth while.
i REALLY look forward to it's completion ;D