• 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.

XSE Scripting Tutorial

Status
Not open for further replies.

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
1) You just need to use the applymovement command (plus waitmovement 0x0).
The applymovement command has 2 params. The first one is the people number, the second is the pointer to the movements. For movements, see the tutorials around here.

2) In this case you need to use checkflag/setflag.

I think that was a bit complicated... you might wanna try speaking... typing in a way that people can understand.. not everyone is as experienced in scripting or XSE as much as you or I....

To put what HackMew just said a bit simpler...

1) Try putting the applymovement command in your script, where you want it of course.
it looks like this. (In XSE)
applymovement 0 @pointer1

Applymovemnt is the command, and the 2 things after it are the parameters that are required to make the script work.

0 stands for the persons "People #" the People # can be found in Advance Map. when you click on a person.

the @pointer1 in the applymovement command is the thing that tells the command where to look for your movements.
You can type anything other than pointer1 if you want, so long as it does not have any spaces in it.

later in the script you have to type...

#org @pointer1

This is our movements!

underneath that, you would type #raw 00 FE

#raw tells XSE that you are typing in a line of raw code.
00 is the games movement code for the "Step one space down"
and FE tells the game to stop movements. If you don't have this, the game will freeze.

after your applymovemnt command is writen you need to put
waitmovement 0x0
or the script will freeze also...


alltogether, your applymovement would look like this....

Example:
#dynamic 0x800000

#org @start
lock
applymovement 0 @pointer1
waitmovement 0x0
release
end

#org @pointer1
#raw 00 FE


If you want that script to go away after you have done it, include the checkflag 0x1001 command before all of it...

it will check and see if flag # 1001 is set.
a flag is an in-game bit of information that tells tha game that something has happened, in short, it is a huge help in controlling in-game events.

We'll use 0x1001 as our flag, since I know for a fact it is safe.
(There are many flags, but some are used by the game, so you don't want to use them...)

so, add checkflag 0x1001 right after the lock command

Example:
lock
checkflag 0x1001


next, you need to tell the game what to check 1001 for...
after the line checkflag 0x1001, add if b_true goto @pointer2

this will make the game check to see if the flag is set, if it is, it will skip over whatever is underneath it, and move to a new section of the script.

We are not done yet... just activating the script wont set the flag, no, we need to set it maually, by adding a setflag command right under our waitmovement 0x0

Example:
waitmovement 0x0
setflag 0x1001


finally, we need to make a new section of the script, so, above the line
#org @pointer1

type in...
#org @pointer2

Example:
...
end

#org @pointer2

#org @pointer1
#raw 00 FE


now, if we do this, and we try activating the script twice, it will freeze, since the 2nd section of the script has no commands... so we want to add...

release
end

right under it.

all together, our script would look like this.
Spoiler:
 

Shadowlink77

WOW - LETHON - GANKEDD/ERASEDD
25
Posts
15
Years
  • Seen Aug 1, 2010
When i first started hacking pokemon roms I began with Pokescript what exactly are the Pros and Consof XSE?

It would be awasome if someone could list that for me. I need to know if i should be switching.
Please and Ty
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
When i first started hacking pokemon roms I began with Pokescript what exactly are the Pros and Consof XSE?

It would be awasome if someone could list that for me. I need to know if i should be switching.
Please and Ty

Pros of XSE:
  1. Over 200 listed commands
  2. A debugging app built in, so if there is an error in your script, it will tell you 99% of the time
  3. A De-Compiling engine that is much more accurate than Pokescript
  4. There are no Compiling errors in XSE
  5. A GUI (Graphical User Interface)
  6. A built in Hex-Decimal Calculator
  7. A text-adjuster to help you tell when your text is too large for the game's text boxes
  8. Correct De-compilation of level scripts
  9. You can use both Static offsets, and Dynamic offsets, even in the same script.
    Example:
    Static offset 0x8800000 Dynamic offset @start
  10. A live updat, so you can check for updates, without having to browse the internet!

Cons of XSE................. Hmm....... An un-editable database? heh, not that important...
_______________________________________________________________________
Pros of PokeScript........ Editable database? lol That is all I can think of...

Cons of Pokescript
  1. You have to type the script in notepad. (Or a similar program)
  2. Errors in the coding of hte program, leads to ROM corruption / ccrashing
  3. not having as many features and helpful stuff as XSE...

As you can clearly see, XSE out-classes Pokescript.

Make the switch, it is worth it.
 
12
Posts
15
Years
  • Seen Apr 17, 2011
I'm confused again. When I go to compile the Compiler Output pops up. I have tried to save it, but I'm unsure what to do. What am I messing up now?
 

Raizaiel

Well, I'll be conflabbed!
16
Posts
15
Years
Blaaaaaughhrhhghh scripting shenanigans.

Bah. I'm running XSE through Advance Map and I cannot get any of these damned scripts to work. The messages keep overriding the others and bleeding through, and half of the scripts decompile back into "checkobedience" after I compile them, therefore not doing anything when I walk up to some one and try to talk to them. Also, what XSE likes to do is alter my coding after I open the rom. It'll change my @talk or @speak or @garbledyflook to an offset number, which is fine...if it didn't duplicate a digit when it used that offset number again in the ending two lines of the script. Therefore, the message never pops up because, despite me doing everything exactly like the book, somehow my scripts mess up and change themselves into something that just doesn't work.

I've been stumped for hours. Could somebody help me?

An example of two message scripts, first is a person, second is another person.



#dynamic 0x16580B
#org @start
lock
faceplayer
message @text '"Technology is incredible!\pYou can ..." [THIS PART IS AUTOMATIC]
boxset 0x6
release
end

#org @text
= Technology is incredible!\pYou can now download and burn all\nsorts of movies via the Internet!



#dynamic 0x800323
#org @start
lock
faceplayer
message @text
boxset 0x6
release
end

#org @text
= The gym leader here is a secret./pI think it's someone from another town.
 
Last edited:

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Bah. I'm running XSE through Advance Map and I cannot get any of these damned scripts to work. The messages keep overriding the others and bleeding through, and half of the scripts decompile back into "checkobedience" after I compile them, therefore not doing anything when I walk up to some one and try to talk to them. Also, what XSE likes to do is alter my coding after I open the rom. It'll change my @talk or @speak or @garbledyflook to an offset number, which is fine...if it didn't duplicate a digit when it used that offset number again in the ending two lines of the script. Therefore, the message never pops up because, despite me doing everything exactly like the book, somehow my scripts mess up and change themselves into something that just doesn't work.

I've been stumped for hours. Could somebody help me?

An example of two message scripts, first is a person, second is another person.



#dynamic 0x16580B
#org @start
lock
faceplayer
message @text '"Technology is incredible!\pYou can ..." [THIS PART IS AUTOMATIC]
boxset 0x6
release
end

#org @text
= Technology is incredible!\pYou can now download and burn all\nsorts of movies via the Internet!



#dynamic 0x800323
#org @start
lock
faceplayer
message @text
boxset 0x6
release
end

#org @text
= The gym leader here is a secret./pI think it's someone from another town.

Well, your first problem is trying to compile a script while running through A-map... I suggest just writing the script you need, then compiling it to the rom, then trying it out.... It would save you the hassle of your problem. Just load up XSE, write your scripts, then save them into the same folder, then go to tools, and batch compiler... select your ROM< and the folder where your script are, then check the scripts you want and hit compile!
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
Bah. I'm running XSE through Advance Map and I cannot get any of these damned scripts to work. The messages keep overriding the others and bleeding through, and half of the scripts decompile back into "checkobedience" after I compile them, therefore not doing anything when I walk up to some one and try to talk to them. Also, what XSE likes to do is alter my coding after I open the rom. It'll change my @talk or @speak or @garbledyflook to an offset number, which is fine...if it didn't duplicate a digit when it used that offset number again in the ending two lines of the script. Therefore, the message never pops up because, despite me doing everything exactly like the book, somehow my scripts mess up and change themselves into something that just doesn't work.

I've been stumped for hours. Could somebody help me?
[...]

See my answer in the other thread.
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
I've been wondering this for a while, when you decompile a script, is there a way to recompile it into regular script form?

Let me say that what you get is the regular form. On the newest version, through, you will be able to refactor the script after decompiling aka converting it to dynamic.
 
Status
Not open for further replies.
Back
Top