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

Sierra's MEGA-HUGE XSE Scripting Tutorial

Echidna

i don't care what's in your hair
2,077
Posts
13
Years
I'm New

When I make a person it doesn't let me make a script unles I set an offset.

Whats offset mean?

When I put a random 1 in it crashs when I talk to the person?

Help?



OK first of all, advance map is the simplest program to be used in game hacking. ok visit the toolbox forum and open hackmew's toolbox and download hackmew's newest version of XSE. open advance map, goto settings\choose script editor\and make a path to the XSE you just downloaded. open XSE, write the script .I'll explain that because seeing that you don't know what an offset is, I can deduce that you have no idea what so ever about scripting, first off, a script is a list of commands and parameters written in a type of code, well two codes in eachother. a hex coding system which is represented by small units called bytes. an offset is a set of bytes. 4 to be exact, seeing that every byte is made of two numbers or letters making up a hex number, that gives us 8 letters and\or numbers. this set of numbers is an adress which is saved to a rom and which tells the game which script to work on when you talk to the person , or step on a script tile for that matter.to learn the commands you use in a script, you need months at a time. now you can simply get the hang of it by reading the guide that comes with the XSE program and then reading it again. you have to understand every word of the guide then start reading some of these more complex tutorials and then finally visit the toolbox forum and learn about all tools and download them because you're going to need all of them.then try some stuff and change some cities and test them out just to get the hang of it. now back to the topic. once you write the script, you'll have to compile it but not before you type in the dynamic adress and write down an empty offset at the top of the script.

But where to find an empty offset. for that you'll need fsf to find unoccupied offsets and assign them to your script then you click the open button and choose your rom and click compile and then click copy to copy the offset next to the start pointer. you'll find out what a pointer is when you read the guide. then open advance map and paste the offset you copied into the offset box of the person you want the script to be assigned to. OH and before all of this read the advanvce map tutorial in this forum for information on some applications.

for example: if you assign a script offset to a script tile in advance map, you need to type in 0003 in the unknown box (or 0300, both work) and 4050 into the var number box(or 4000 or 4051 all of these work but each for a specific version of advance map or the type of your rom) anyways be sure to download advance map 1.92 and the newest XSE and always the US version of your rom so that the 0003 unknown and 4050 var number work.
 
2
Posts
14
Years
  • Seen May 7, 2017
I'vr got a little problem I want to change the song when I start a trainerbattle. I knwo that I should put setvar 0x7033 0x129
setvar 0x7030 0x(song number). But it doen't work in my hack. (Fire Red) But when I compile it in a already hacked game like "Shiny Gold". The scripts work :S Why?
 

FrostPheonix

Eternity.
449
Posts
13
Years
Treecko

Hey can u help me ? :S i posted here few times....but no answer or help...Well my prob is that i wanted to change the event with poochyena at the start of game (R/S/E). I was looking for the right script and exact lines to change...but havent found any...Could u help me please ? i would rly like to change it, exactly..i wanted to change poochyena with treecko.

Spoiler:

Thats from the tut. now check this:
wildbattle 0x6 0x1E 0x8B
Look for that in the event. There is a list of pokemon offsets in the tut, at the give pokemon section. They tell you how to add a wild battle right after, and just check out the example, at the place that it says, 'wildbattle 0x6 0x1E 0x8B' change it to wildbattle 0x(treecko offset (which is 277)) 0x?? (lvl whateveryouwhant) 0x8B (Oran berry, offsets right under pokes offsets). You should know how to get the script. All of that was in the tut.
 

chriskid198

Happy New Year!
159
Posts
13
Years
What code do you use, to make a script only occur once?

Theres a script in my hack and I only want it to occur once?

And when I mean Script, I mean, when you step on the tile that it is located on.

Thanks in advanced :D

EDIT: I assume that it includes a Flag, but were would the flag goto?

How do you make a flag that goes to nowhere?
 
Last edited:
6
Posts
14
Years
  • Seen Jul 26, 2013
Hey, I'm having trouble trying to compile my scripts. When I search for free space it comes up with an error message when I try to compile it saying "Not enough free space. Cannot compile." Even though I copy and pasted from the Free Space Finder, but then when I try the 0x800000, it can compile, and I copy the new numerical offset and it's not the same as the one 0x800000 it changes to some random combination of numbers like 804826 or like 803B17 and it's not the same. I try it out in AM anyways, and when I load up the game it doesn't do anything. I talk with the person I assign it to, and they always turn to look, and it never says my script but sometimes it either freezes me in place; we either just stop talking and we go on our own business; or it freezes the game, but doesn't make the buzzing noise, music keeps playing but everything freezes. Anyone want to help? I've already assigned XSE as the script editor for AM, so what am I doing wrong?
 
67
Posts
15
Years
  • Seen Jan 24, 2015
I have two quick questions. They're both for Pokemon: Ruby Version.
1: Is there a "Remove Pokemon" function? If so, would someone be kind enough to show me how to use it in a script?
2: Exactly how do you check to see if a player has all eight badges/has defeated the Elite Four and the Champion?
Thanks in advance!
 

chriskid198

Happy New Year!
159
Posts
13
Years
I have two quick questions. They're both for Pokemon: Ruby Version.
1: Is there a "Remove Pokemon" function? If so, would someone be kind enough to show me how to use it in a script?
2: Exactly how do you check to see if a player has all eight badges/has defeated the Elite Four and the Champion?
Thanks in advance!

Q1: I believe there isn't, I am still new and don't know a lot.

Q2: I think it has something to do with flags, as you use certain flags to give the player badges.

And I have a question of my own; what do people mean when they say, "I have assigned XSE as the script editor for AM"?
 
67
Posts
15
Years
  • Seen Jan 24, 2015


Q1: I believe there isn't, I am still new and don't know a lot.

Q2: I think it has something to do with flags, as you use certain flags to give the player badges.

And I have a question of my own; what do people mean when they say, "I have assigned XSE as the script editor for AM"?
1. Oh.
2. I mean which flag it is.

Also, to answer you question, in AdvanceMap, go to Settings-> Choose Script Editor. Then find XSE.exe (or whatever it is) and answer yes to the question it acts you. Now you can open all the scripts that are already in the game.
 

Satoshi Ookami

Memento Mori
14,254
Posts
15
Years
What code do you use, to make a script only occur once?
Theres a script in my hack and I only want it to occur once?
And when I mean Script, I mean, when you step on the tile that it is located on.
Thanks in advanced :D
EDIT: I assume that it includes a Flag, but were would the flag goto?
checkflag 0x(random number)
if 0x0 goto @(something)
release
end

@(something)
script
.
.
.
setflag 0x(same random number)
release
end

How do you make a flag that goes to nowhere?
Well... define nowhere xD

Hey, I'm having trouble trying to compile my scripts. When I search for free space it comes up with an error message when I try to compile it saying "Not enough free space. Cannot compile." Even though I copy and pasted from the Free Space Finder, but then when I try the 0x800000, it can compile, and I copy the new numerical offset and it's not the same as the one 0x800000 it changes to some random combination of numbers like 804826 or like 803B17 and it's not the same. I try it out in AM anyways, and when I load up the game it doesn't do anything. I talk with the person I assign it to, and they always turn to look, and it never says my script but sometimes it either freezes me in place; we either just stop talking and we go on our own business; or it freezes the game, but doesn't make the buzzing noise, music keeps playing but everything freezes. Anyone want to help? I've already assigned XSE as the script editor for AM, so what am I doing wrong?
Well 804826 and offsets like that are good to be used. I don't really know what's the problem =D But that's of course if you are putting the 804826 offset into the Person's script.

I have two quick questions. They're both for Pokemon: Ruby Version.
1: Is there a "Remove Pokemon" function? If so, would someone be kind enough to show me how to use it in a script?
2: Exactly how do you check to see if a player has all eight badges/has defeated the Elite Four and the Champion?
Thanks in advance!
1. Metapod was able to do it in his AshGray hack. Of course that's Fire Red hack but you probably can ask him how he did it.
2. Check the first post. You probably will be needing to check all flags.
 
67
Posts
15
Years
  • Seen Jan 24, 2015
1. Metapod was able to do it in his AshGray hack. Of course that's Fire Red hack but you probably can ask him how he did it.
2. Check the first post. You probably will be needing to check all flags.
Thanks! But for the second one, it only has a list of flags, not what they do.
 
6
Posts
14
Years
  • Seen Jul 26, 2013
Well 804826 and offsets like that are good to be used. I don't really know what's the problem =D But that's of course if you are putting the 804826 offset into the Person's script.

Yeah, but shouldn't the offset be the same as the original offset that you put into XSE? Which would be 800000?
 

chriskid198

Happy New Year!
159
Posts
13
Years
checkflag 0x(random number)
if 0x0 goto @(something)
release
end

@(something)
script
.
.
.
setflag 0x(same random number)
release
end


Well... define nowhere xD
What does if 0x0 mean?

How do I 'Define nowhere'?

And another question xD
what does #dynamic *Random number* actually do?

And these are the flags for each badge:
Code:
0x820 – Activates First Badge
0x821 - Activates Second Badge
0x822 - Activates Third Badge
0x823 - Activates Fourth Badge
0x824 - Activates Fifth Badge
0x825 - Activates Sixth Badge
0x826 - Activates Seventh Badge
0x827 - Activates Eighth Badge
 
67
Posts
15
Years
  • Seen Jan 24, 2015
What does if 0x0 mean?

That means that if it is true, then go to @(insert something here).

And another question xD
what does #dynamic *Random number* actually do?

That's where it stores the memory for the script. 800000 and above are free in an unedited Ruby ROM, or so FSF says.

And these are the flags for each badge:
Code:
0x820 – Activates First Badge
0x821 - Activates Second Badge
0x822 - Activates Third Badge
0x823 - Activates Fourth Badge
0x824 - Activates Fifth Badge
0x825 - Activates Sixth Badge
0x826 - Activates Seventh Badge
0x827 - Activates Eighth Badge

Yeah, those activate the badges. I'm looking for something that sees if you have all the badges AND beaten the Champion.
 
6
Posts
14
Years
  • Seen Jul 26, 2013
Seriously though? Anyone know anything about my problem? I'm hacking on emerald if that helps at all.
 

Satoshi Ookami

Memento Mori
14,254
Posts
15
Years
Yeah, but shouldn't the offset be the same as the original offset that you put into XSE? Which would be 800000?
Nope ;) The offset you are using in #dynamic command is the one that tells ROM where to start looking for free space.

Yeah, those activate the badges. I'm looking for something that sees if you have all the badges AND beaten the Champion.
Decompile Champion's script and check if there are any setflag commands and that flag can be used for checking if you have beaten the Champ.

What does if 0x0 mean?
If statement is false ;) In our case it's: If flag isn't set scripts goes to @something

How do I 'Define nowhere'?
Oh... you did not get me xD You mentioned nowhere so I wanted to know what you meant by that.

And another question xD
what does #dynamic *Random number* actually do?
Tells XSE where to start looking for free space in ROM.
 

Kazbat028

The Only Guy With a Girlfriend
84
Posts
13
Years
  • Seen Sep 5, 2011
What is the significance of the '4050' variable in the applymovement command? I mean, it works for me, but why is it there? Does it have to be 4050?
 
6
Posts
14
Years
  • Seen Jul 26, 2013
Ok I'm still having a lot of trouble, is it just because I'm trying to hack emerald? Because I've heard that emerald is one of the worst games that you could possibly hack, is that my problem? It just has that many problems?
 
Back
Top