• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[TehTehTehTeh's] XSE Basic/Medium tutorial

Status
Not open for further replies.

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
-Outdated-
May update soon with new XSE commands etc,

[TehTehTehTeh's] XSE Basic/Medium tutorial

Table of Contents

Part 1, Dynamic's
Part 2, Basic Message
Part 3, a yes/no basic script
Part 4, Flags
Part 5, givepokemon

More to come

Part 6, specials
Part 7, movement


To start us off we need to open up XSE and have a blank script tab. Now we may start scripting

Part 1, dynamic's

At the start of any script you must place your dynamic offset to start your script.

A dynamic offset is the hexidecimal your whole script is going to rely on,
Here is how you should place it at the top of your script.

Code:
#dynamic 0x800000

800000 = Your offset, it must be an open offset. Use a free space finder to find your offsets. Advance Map has a built in one.

Part 2, A Basic Message

Now before we start remember to include your dynamic.
After this here we place a line of code that states you are making a new script.

Code:
#ORG @start

Explanations of these 2 words.

Spoiler:


Now if we want this event to work properly as a message from a person we must include these two lines

Code:
lock
faceplayer

Explanations of these 2 words.

Spoiler:


Our next step will be the actual pointer to the message. All we have to type is this...

Code:
Message @tutorial

Explanations of these 2 words.

Spoiler:


^This line of code is neccesary or your script wont ever do anything.

Next we type this to signify what kind of message it is.

Code:
boxset 6

No need to explain this, now to close of the end of this offset.

Code:
release
end

Here is what we should have so far!

Code:
#dynamic 0x800000 'or any offset there you want it to be thats open

#org @start
lock
faceplayer
Message @tutorial
boxset 6
release
end

Don't get all happy at your first XSE script yet, we still have to make your message say something.

Code:
#org @tutorial
= This is my first script!

Tada, here is the "final" script!

Code:
#dynamic 0x800000 'or any offset there you want it to be thats open

#org @start
lock
faceplayer
Message @tutorial
boxset 6
release
end

#org @tutorial
= This is my first script!

Now load your rom in XSE, and press compile. On the pop-up windo press copy, now in Adv-Map make a new person and put the offset you copied in the new person's offset box.

Tada, now we can test it out.

Part 3, is it just me or does it smell like yes/no box time?

Starting us off for a yes/no script we must still place our dynamic offset, our #org @start, and our lock and faceplayer.

You should have this to start off then.

Code:
#dynamic 0x800000

#org @start
lock
faceplayer

Now put in a new message offset pointer, and copy the rest, I will explain everything next.

Code:
message @tutorial
boxset 5
compare LASTRESULT 1
if b_true goto @yes
compare LASTRESULT 0
if b_true goto @no

We know the first line of code but what do the 5 other's mean?

Definitions

Spoiler:


Then place a release and an end and here is what we should have so far, the basis offset point

Code:
#dynamic 0x800000

#org @start
lock
faceplayer
message @tutorial
boxset 5
compare LASTRESULT 1
if b_true goto @yes
compare LASTRESULT 0
if b_true goto @no
release
end

Now to place our offsets from the pointer's, lets start out with the messages.

Just like a basic message script and with the pointer provided.
The Message should look like this.

Code:
#org @tutorial
= Yes or no?

Now for the offset pointer's yes and no, let's start with yes.

Code:
#org @yes
message @pressyes
boxset 6
release
end

That looks familiar, well it is. you really just revert to another message or anything you want it to do! Now for no, if you think you can try it yourself dont look!

Code:
#org @no
message @pressno
boxset 6
release
end

Now to make the message's pressyes and no, simple here is what you should get with them!

Code:
#org @pressyes
= You pressed YES!

#org @pressno
= You pressed NO!

here should be your final script!

Code:
#dynamic 0x800000

#org @start
lock
faceplayer
message @tutorial
boxset 5
compare LASTRESULT 1
if b_true goto @yes
compare LASTRESULT 0
if b_true goto @no
release
end

#org @tutorial
= Yes or no?

#org @yes
message @pressyes
boxset 6
release
end

#org @no
message @pressno
boxset 6
release
end

#org @pressyes
= You pressed YES!

#org @pressno
= You pressed NO!


Chapter 4, Flags

Finally the flags tut is here.

Ok lets start off, flags are based off into 3 basics groups

Code:
setflag
checkflag
clearflag

Most of the time you don't see clearflag come up... it is needed sometimes though. You will understand how to use the flags after this!

Lets start with something way simple. Code the normal base to your script from the other parts of the tut.

Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer

Now for the flags. add these lines of code

Code:
checkflag 0x200
if b_true goto @flag

This is to check if the flag 0x200 is set and if so going to @flag
Now enter a simple message line in.. whatever the message may be just add it after this. After that we will add our setflag, before that here is how far we should be in the script...

Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6

Now for the setflag... for flags do not use any number but the flags 200 and up and 900 and up.

Add this line of code now!

Code:
setflag 0x200

now we should have


Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6
setflag 0x200

Now end this part of the scrip and now add your message for hi.

Time for the @flag part. before this here is what you should have...

Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6
setflag 0x200
release
end

#org @hi
= Hello there.

Now after that add the #org @flag part of this part of the script.

Time for what we want the flag to go to.
Lets make it a message

Code:
#org @flag
message @woot
boxset 6
release
end

#org @woot
= What you want????

Now for the finished product!

Code:
#dynamic 0xOFFSET HERE

#org @start
lock
faceplayer
checkflag 0x200
if b_true goto @flag
Message @hi
boxset 6
setflag 0x200
release
end

#org @hi
= Hello there.

#org @flag
message @woot
boxset 6
release
end

#org @woot
= What you want????

Chapter 5, GivePokemon

The givepokemon script, a very simple one... i won't go in to as much detail as the other sections since you should now know how to add these commands.

The command itself should be Very Very self explanatory. Of course if you did not get it, it gives a pokemon!

Ok now to show you how it works.

Code:
givepokemon [Pokemon no.] [Pokemon lvl.] [item being held] 0 0 0

So here is the code for a level 5 bulbasaur holding nothing.

Code:
givepokemon 1 5 0 0 0 0

There you are, the givepokemon script. I would advise using flags if you use this script to avoid gaining infinite items

POkemon no.'s Thanks TheTheTheThe
Spoiler:


More to Come, parts 6, and 7!
 
Last edited:

Charliezard

A wild shroomish appeared!
1,276
Posts
16
Years
Thanks, but...now I feel like an idiot cuz yes/no is so simple n I couldn't get it. :P

Edit- With the givepokemon, what aspects of it do you plan to cover? The nickname option? Also, in the begining where you don't have the Pokemon option in the start menu, would u show how to make it add that? :P Just a question :P
 
Last edited:

Ninja Caterpie

AAAAAAAAAAAAA
5,979
Posts
16
Years
Hmmm...flag 0x828 opens the POKEMON menu I think...
XSE is awesome but...I'm too used to Pokescript..until some more tuts come out...I'll still be da fail...
Good work getting one up like this...hope more comes fast!
 

Charliezard

A wild shroomish appeared!
1,276
Posts
16
Years
Hmmm...flag 0x828 opens the POKEMON menu I think...
XSE is awesome but...I'm too used to Pokescript..until some more tuts come out...I'll still be da fail...
Good work getting one up like this...hope more comes fast!

So use setflag 0x828 when I recieve the pokemon? I'll try it :)
And haha lol I started at the perfect time...when xse was released :P

Edit- Thanks man it worked!!!!! :D
 

Charliezard

A wild shroomish appeared!
1,276
Posts
16
Years
Well I just read bout the yes/no and it worked fine. Didn't try any of the b_true so yeh :D...yay
I'm reading around, and they all seem pretty much the same, with slight diffrences that can be easily overcome...Least at the level I am now and the stuff I'm lookin at.
 

/Circa

a face in the clouds.
881
Posts
16
Years
o.o deleted my post for some reason. I have to retype it xD

Your commands are wrong hockeypanda, you need to learn to use XSE yourself.
There is no such thing as boxset in XSE, it's callstd.

Also, theres no such thing as b_true, it is used as 0x? instead.
You need some serious revision.

This should be locked, I thought HackMew was writing up a tut.
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
o.o deleted my post for some reason. I have to retype it xD

Your commands are wrong hockeypanda, you need to learn to use XSE yourself.
There is no such thing as boxset in XSE, it's callstd.

Also, theres no such thing as b_true, it is used as 0x? instead.
You need some serious revision.

What the? Of course there's boxset - all those callstd that is used alongside message is boxset.

here:

#define BOXSET_OBTAIN 0x0
#define BOXSET_FIND 0x1
#define BOXSET_STANDARD 0x2
#define BOXSET_SIGNPOST 0x3
#define BOXSET_DONTCLOSE 0x4
#define BOXSET_YESNO 0x5
#define BOXSET_NORMAL 0x6
The define is for people who use boxset over callstd.

And the b_true thingy-it is included for all noobs. check the std.rbh or something.

@hockeypanda - no offense or something - this is like the 60th scripting tut. Ok, this goes for the rest, there's really no need for a lot of scripting tuts, a gigantic version is coming.
 

xqnp7

Infinite HP
4
Posts
15
Years
While HackMew is making a tutorial, is it so wrong for some people to make basic tutorials beforehand so people can at least learn a little before tutorial arrives? The tutorial will be massive, so it's not like it'll be here tomorrow.

I liked the tutorial. I'm new to scripting myself, and this goes into Yes/No messages, unlike Darthatron's.
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
While HackMew is making a tutorial, is it so wrong for some people to make basic tutorials beforehand so people can at least learn a little before tutorial arrives? The tutorial will be massive, so it's not like it'll be here tomorrow.

I liked the tutorial. I'm new to scripting myself, and this goes into Yes/No messages, unlike Darthatron's.
It's not wrong - yes, I agree, I know what its like to wait, but its not like there aren't any tuts on scripting - there are loads. Why don't you use those(ever heard of waste of space) all you've got to do is replace all $ with @. As for other commands that aren't covered check the command database, once you know one or two commands the rest are cake - just need some practice ;)
 

Darthatron

巨大なトロール。
1,152
Posts
18
Years
It's not wrong - yes, I agree, I know what its like to wait, but its not like there aren't any tuts on scripting - there are loads. Why don't you use those(ever heard of waste of space) all you've got to do is replace all $ with @. As for other commands that aren't covered check the command database, once you know one or two commands the rest are cake - just need some practice ;)

I totally agree with you, hence why my short tutorial only explains the very basics. :P

Anyway, it's just the same as every other tutorial, but thanks I guess... Someone might use it.
 

xqnp7

Infinite HP
4
Posts
15
Years
From what I've read, it's not just replacing the $ with @, in fact didn't someone try that and it didn't work? I checked the command help, and help it did. I just believe that these tutorials belong here as much as the PokeScript or whatever tutorials.
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
Well, pretty basic I would say.. :P
Anyway, I'll give you a tip: save bytes whenever possible.

Example:

...
compare LASTRESULT 0x1
if B_TRUE goto @yes
compare LASTRESULT 0x0
if B_TRUE goto @no
...

It doesn't make a lot of sense to compare the LASTRESULT variable two times, indeed. It can be only 0x0 or 0x1 (using callstd/boxset 0x5, of course). So, if it's 0x0 it can't be 0x1 and vice-versa. The optimized version would be:

...
compare LASTRESULT 0x1
if B_TRUE goto @yes
goto @no
...

Since you're using XSE you can even do this, if you want:

...
compare LASTRESULT 1
if b_true goto @yes
else goto @no
...

Basically it's just the same once compiled, but I think it makes more sense then a simple goto when reading the scipt.
 

ZodiacDaGreat

Working on a Mobile System
429
Posts
17
Years
From what I've read, it's not just replacing the $ with @, in fact didn't someone try that and it didn't work? I checked the command help, and help it did. I just believe that these tutorials belong here
as much as the PokeScript or whatever tutorials.

You're so naive, you just don't understand the parameters but if you do, then its a different case. The only differences between XSE and other tools are:

-daynamic offsets
-commands
-constructs

The older tuts teach almost everything, with only little error due to the older Toolmakers failed to interpret the commands nicely - so here you go.
 

Charliezard

A wild shroomish appeared!
1,276
Posts
16
Years
I'm learnin the basics of flags and stuff from thethethe's tutorial, that ain't for xse but it doesn't take a genious to see a few obvious diffrences and change them. I've learnt...now the hard part is to learn again...? To remember -_- :P Suck at that
 

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
Thanks, but...now I feel like an idiot cuz yes/no is so simple n I couldn't get it. :P

Edit- With the givepokemon, what aspects of it do you plan to cover? The nickname option? Also, in the begining where you don't have the Pokemon option in the start menu, would u show how to make it add that? :P Just a question :P

Regarding your edit questions,

1. I might add this, not sure yet but I think i will.
2. Yes and i will for pokedex too! All you have to do is set a flag for each.
 

Charliezard

A wild shroomish appeared!
1,276
Posts
16
Years
Regarding your edit questions,

1. I might add this, not sure yet but I think i will.
2. Yes and i will for pokedex too! All you have to do is set a flag for each.

Cool, I've learnt the flags for the pokedex and pokemon options. The nickname stuff is still unknown to me though.
I noticed in the givepokemon command there was no gender part. Is there a way around that?
 

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
Cool, I've learnt the flags for the pokedex and pokemon options. The nickname stuff is still unknown to me though.
I noticed in the givepokemon command there was no gender part. Is there a way around that?

About the givepokemon, i actually do not know, I haven't ever tried to fiddle around with the lasr three integers, maybe you could do it like that?!
 
5,814
Posts
16
Years
  • Age 30
  • Seen May 19, 2021
Hey, could u plz put up a signpost script?
I used to be able to do it, but now I'm having a little trouble.
 

Charliezard

A wild shroomish appeared!
1,276
Posts
16
Years
About the givepokemon, i actually do not know, I haven't ever tried to fiddle around with the lasr three integers, maybe you could do it like that?!

Maybe, but you'd think gender would be a slightly more important thing then to be described as a byte filler in the command guide?

Edit Signpost script
Code:
'-----------------------
#org 0x165862
msgbox 0x817D895 '"PALLET TOWN\nShades of your journey..."
callstd 0x3
end


'---------
' Strings
'---------
#org 0x17D895
= PALLET TOWN\nShades of your journey await!

The only diffrence I can see is the callstd 0x3 Guess 0x3 means signpost.
 

~Teh Panda~

Back in hacktion
918
Posts
16
Years
  • Seen Jul 20, 2022
Hey, could u plz put up a signpost script?
I used to be able to do it, but now I'm having a little trouble.

Ya here is one

Code:
#dynamic 0x

#org @sign
lock
Message @sign
boxset 6
release
end

#org @sign
= This is a signpost script!
 
Status
Not open for further replies.
Back
Top