• 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

5
Posts
14
Years
  • Seen Aug 28, 2013
Hey, ive got a problem...ive tried to change R/S event with poochyena, u know this one at the start...well i tried to change it into treecko, but i dont know where to find a line to change in scripts... :S seriously i need help, please ? .w.
 
28
Posts
13
Years
  • Seen Apr 6, 2013
OH and when i open advance map and choose xse as my script editor via "settings" "choose script editor" it says "are offsets seperated from the rom name by ":" (default) or " " in the preffered script editor?? => Yes for ":" : No for " "." WHAT IS THIS??????? WHAT DO I CHOOSE AND HOW DOES THIS AFFECT MY SCRIPTING ???? PLEASE HELP ME!!!!!!!!

Don't worry about that, it just means that anything to the right of those marks is a comment in the script meaning when the script editor compiles the scripts it will pass over it. XSE recognizes both of those, so it doesn't matter which one you use.

can someone tell me what i did wrong im trying to enter a city & then have a pokemon notice me run away from me.

The question has already kinda been answered but here is what I would do. "%" will stand in for any numbers or flags that you would use. Also obvious stuff like offsets are omitted. For the applymovement commands 0x1 will be the pokemon and obviously the hero would be 0xFF:
Code:
checkflag %
if 0x1 goto @done
applymovement 0x1 @move1
applymovement 0xFF @move2 'if there is anything you want the hero to do like look at the pokemon
waitmovement 0x0
msgbox 'if you want anything to be said
setflag %
release
end

#org @move1
#raw 0x% 'direction of the player for the pokemon to look
#raw 0x62 'makes "!" thought bubble appear over pokemon, 0x65 is "!!"
#raw 'here you would put whatever movements required to make the pokemon flee
#raw 0xFE 'ends movement

#org @move2
#raw 0x% 'direction hero looks if you want
#raw 0xFE 'ends movement
Add the msg if you want a message to display but you really don't need it.

What should happen is when you step on the tile the script is assigned to the pokemon should look at you (and you at him if you assign the player a movement), a thought bubble should appear over the pokemon, and then it will flee. You could tweak it a bit, for instance move the fleeing movements to after the waitmovement so that it isn't an instant movement.

If you need the movement hex codes they are in the help document for XSE although I am sure you could find them somewhere in these forums, maybe even this thread. I didn't check this script because I am working on my own scripts right now.

Hope this helps a bit. There may be a better way to do this but this should work well enough.
---------------------
You also mentioned message box problems. I don't know what type of message box you are using but try 0x6, that at least works for me. It may be a bit long and boring but the help document I mentioned earlier might help a bit with the more simple commands. I know it took me a while to force myself to read it.
---------------------
Wow this is turning into quite the post I am separating all of my help requests from my help offerings

I guess I have a question of my own as well. In my hack of FR I want to have a Mew in the overworld but the sprite for Mew apparently isn't meant for walking, when I applymovement it doesn't turn in the direction of movement, it just moves. That's fine for me, to get around that I need to know a way I can get it to blink before disappearing (like it was teleporting). I was hoping there was an easier way than sequencing some hidesprite/showsprite commands. If anybody knows the offset for the teleport script in FireRed that should suffice.

Okay I have continued working on the above script, using a simple hidesprite as a placeholder until I figure out what to do with Mew. I have run into a strange problem though. In an effort to avoid having to keep changing the offset every time I compile a new version of my script I compiled it once and used the Open Script button in AdvanceMap to edit the compiled script. However when I open the script the end of my script is replaced with this
applymovement 0xC2BD 0xC3CAC7BB
cmdc9
cmdc8
The sprite I am trying to move is 0xD and that is the longest offset I have ever seen (aren't they only 6 digits?). I don't even know what the cmdc commands are supposed to be. Also the movement I am trying to apply to 0xD is removed from the script as is the ending of the script. Help would be just grand.
 
Last edited:
3
Posts
14
Years
  • Seen Aug 19, 2010
Good day. I have a some problem with this script :

#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 goto @done
msgbox @1 0x06
applymovement 0x4 @move1
waitmovement 0x0
applymovement 0x4 @move2
pause 0x30
msgbox @2 0x06
givepokemon 0x14C 0x5 0x0
msgbox @3 0x06
applymovement 0xFF @move3
waitmovement 0x0
msgbox @4 0x06
applymovement 0xFF @move4
fadescreen 0x1
hidesprite 0x4
fadescreen 0x0
setflag 0x828
release
end

#org @done
release
end

#org @move1
#raw 0x2
#raw 0x3
#raw 0x2
#raw 0x0
#raw 0x62
#raw 0xFE

#org @move2
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE

#org @move3
#raw 0x63
#raw 0xFE

#org @move4
#raw 0x65
#raw 0xFE

#org @1
= ???: ...

#org @2
= ???: Hmmm... \nSorry, but can you take care of my friend ?

#org @3
= You received Trapinch from ???.

#org @4
= I will be assume that you agree...

When it started, text not displayed, movement were working, sprite of ??? is "hided", but, when i go up or down for "S" on the Advance map, sprite of ??? is show, and when i step again on the "S" or talking with showen sprite of ??? game crashed.
Please, somebody help me.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Good day. I have a some problem with this script :

#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 goto @done
msgbox @1 0x06
applymovement 0x4 @move1
waitmovement 0x0
applymovement 0x4 @move2
waitmovement 0x0
pause 0x30
msgbox @2 0x06
givepokemon 0x14C 0x5 0x0
msgbox @3 0x06
applymovement 0xFF @move3
waitmovement 0x0
msgbox @4 0x06
applymovement 0xFF @move4
fadescreen 0x1
setflag 0x???
hidesprite 0x4
fadescreen 0x0
setflag 0x828
release
end

#org @done
release
end

#org @move1
#raw 0x2
#raw 0x3
#raw 0x2
#raw 0x0
#raw 0x62
#raw 0xFE

#org @move2
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE

#org @move3
#raw 0x63
#raw 0xFE

#org @move4
#raw 0x65
#raw 0xFE

#org @1
= ???: ...

#org @2
= ???: Hmmm... \nSorry, but can you take care of my friend ?

#org @3
= You received Trapinch from ???.

#org @4
= I will be assume that you agree...

When it started, text not displayed, movement were working, sprite of ??? is "hided", but, when i go up or down for "S" on the Advance map, sprite of ??? is show, and when i step again on the "S" or talking with showen sprite of ??? game crashed.
Please, somebody help me.

Changes are in BOLD RED.
You forgot 1 Waitmovement
Also, if you want the sprite of ??? to remain hidden, you need to replace the extra 'setflag 0x???' to the flag number of the sprites ID, then it'll stay hidden.

One more small thing, I don't mean to be rude, but your grammar seems to be a bit... bad...
 
Last edited:
5
Posts
14
Years
  • Seen Aug 28, 2013
Hey, ive got a problem...ive tried to change R/S event with poochyena, u know this one at the start...well i tried to change it into treecko, but i dont know where to find a line to change in scripts... :S seriously i need help, please ? .w.

bump ? i srsly need help, guyyysss .ww.
 

N.D.

Cossack
4
Posts
13
Years
Welcome from Ukraine. I started create my hack of Fire Red, and everything was fine, before appeared one problem with script for National PokeDex. This is it:

#dynamic 0x800000

#org @start
checkflag 0x700
if 0x1 goto @done
msgbox @1
boxset 0x6
applymovement 0x2 @move1
waitmovement 0x0
msgbox @2
boxset 0x6
~The game frozen~
setflag 0x829
special 0x16F
waitstate
msgbox @3
boxset 0x6
giveitem 0x4 0x5 0x1 MSG_OBTAIN
msgbox @4
boxset 0x6
fadescreen 0x1
setflag 0x0123
hidesprite 0x2
fadescreen 0x0
setflag 0x700
release
end

#org @done
release
end

#org @move1
#raw 0x10
#raw 0x10
#raw 0x62
#raw 0x10
#raw 0x10
#raw 0xFE

#org @1
= Devidson: "[player] !

#org @2
= Devidson: Welcome to the Arhus. \pI'm Prof.Devidson. \nI see that you have partner pokemon. \pYou also must have a pokedex. \nThis pokedex...

#org @3
= [player] obtained PokeDex \nfrom Prof.Devidson

#org @4
= Good luck, [player].

I will be glad for any help.
 

Sierraffinity

Desperately trying to retire from ROM hacking
1,069
Posts
16
Years
Welcome from Ukraine. I started create my hack of Fire Red, and everything was fine, before appeared one problem with script for National PokeDex. This is it:

#dynamic 0x800000

#org @start
checkflag 0x700
if 0x1 goto @done
msgbox @1
boxset 0x6
applymovement 0x2 @move1
waitmovement 0x0
msgbox @2
boxset 0x6
setflag 0x829
special 0x16F
waitstate ~Actually, the game froze here~
msgbox @3
boxset 0x6
giveitem 0x4 0x5 0x1 MSG_OBTAIN
msgbox @4
boxset 0x6
fadescreen 0x1
setflag 0x0123
hidesprite 0x2
fadescreen 0x0
setflag 0x700
release
end

#org @done
release
end

#org @move1
#raw 0x10
#raw 0x10
#raw 0x62
#raw 0x10
#raw 0x10
#raw 0xFE

#org @1
= Devidson: "[player] !

#org @2
= Devidson: Welcome to the Arhus. \pI'm Prof.Devidson. \nI see that you have partner pokemon. \pYou also must have a pokedex. \nThis pokedex...

#org @3
= [player] obtained PokeDex \nfrom Prof.Devidson

#org @4
= Good luck, [player].

I will be glad for any help.
You're not supposed to put waitstate after EVERY special, and special 0x16F is one that doesn't need it.
Remove that, recompile, and test it out.
 
28
Posts
13
Years
  • Seen Apr 6, 2013
Anybody know how to make an overworld sprite/npc blink before disappearing? I'm thinking of the reverse of how Keckleon (or however you spell it) appears in R/S/E.

Also, if anyone knows where to change the map that the opening points to, where you start out, that would be great as well.
 
Last edited:
6
Posts
13
Years
  • Seen Jul 19, 2011
Hello, I'm new here, and literally just got into this a couple of days ago. I've been looking around at some tutorials and stuff, especially for scripting, and this tutorial was very helpful. I have a question about a script in my game's first town.

This is my script:
Spoiler:


This script is used when the player is talking to their father, and I want him to say the first part the first time the player talks to him. Every time after, the second part should be said.

It works alright except that when you exit and re-enter the house, the flag is reset, so he tells you the bit about Jirachi again. How can I make it so that he tells you this once, then switches to the good luck message for the rest of the game rather than just until you leave the house?

I've looked at the scripts for other events in game that only happen once for clues, but can't find anything. I also tried to search for it, but can't find anything. I'm sure it's something stupid that I just can't find, but there will likely be a lot of one-time only events in my game and I need to know how to make the flags stick.. so any help would be appreciated, please and thank you.
 

colcolstyles

Yours truly
1,588
Posts
15
Years
If I had to guess, I'd say that the problem occurs because of the flag that you are using. I'm not 100% sure about 0x7 but I know that flags like 0x12 are cleared upon changing maps. This is because they are assigned to Cut trees and Rock Smash rocks. If you use a different flag (I think one in the 0x200s will do), it should work as intended.
 
6
Posts
13
Years
  • Seen Jul 19, 2011
If I had to guess, I'd say that the problem occurs because of the flag that you are using. I'm not 100% sure about 0x7 but I know that flags like 0x12 are cleared upon changing maps. This is because they are assigned to Cut trees and Rock Smash rocks. If you use a different flag (I think one in the 0x200s will do), it should work as intended.

Yup, I just tried using 0x200 instead and it works perfectly. Thanks!
 
5
Posts
14
Years
  • Seen Aug 28, 2013
If I had to guess, I'd say that the problem occurs because of the flag that you are using. I'm not 100% sure about 0x7 but I know that flags like 0x12 are cleared upon changing maps. This is because they are assigned to Cut trees and Rock Smash rocks. If you use a different flag (I think one in the 0x200s will do), it should work as intended.

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.
 
1
Posts
13
Years
  • Seen Sep 4, 2010
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?
 
6
Posts
13
Years
  • Seen Jul 19, 2011
I'm sure that answer's kicking around somewhere, but an offset is basically like a page number in a book. It tells the game where to look for the proper script when an event happens.

What I do, and I'm sure there's more efficient ways but I just started a couple days ago too so my knowledge isn't exactly advanced, but first I write my script with no offset and save it somewhere, then I check the size of the script, then I use Free Space Finder to find that much free space in the game. Enter the size of the script in the box for how many bytes you need, click find, and the 6 digit code that appears is your starting offset.. then from there, open up the rom from XSE/whatever script editor, copy/paste your saved script, put that offset in at the top and compile it into the rom.. then open up advance map and put that offset as the one to whichever event it's supposed to be.

Like I said, I'm sure there's more efficient ways to do it, but it works at least.
 

Binary

え?
3,977
Posts
16
Years
  • Age 29
  • Seen Apr 7, 2014
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.
If you want to edit a particular script, open up Advance Map. Click on the Script tile of the script you want to edit, and click on "Open Script" on the bar on the right side (You should first set your script editor as XSE, if you haven't).
It'll open up XSE, then click on the decompile button and edit. But remember that the modified script should have equivalent or less than the number of bytes of the original script. Then Compile.

But If you want to change the Poochyena to a Treecko, it would require some hex editing, though I'm not sure how.
 
Back
Top