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

Extreme Scripting Tutorial

+Sneasel™

It's a meeee, itman!
1,032
Posts
16
Years
________________________
Hey, this is an extreme noob tutorial for scripting, ment for beginners.
This guide will cover:

1. Making a simple talking script
2. Burning the script to the ROM
3. Making a giveitem/givepokemon script
4. Making movement scripts
5. Color Messages
6. Trainer Battles

Well, here we go :)
________________________________
1. Making a simple talking script

First, open up notepad.
Type this onto notepad:
___________
#ORG $begin
lock
faceplayer
message $talk
boxset 6
release
end

#org $talk
$talk 1 = Hey, what's up?
______________

Ok, here is what all that means:

#ORG $begin is how you should start all your scripts with. You can also use #org, it doesn't matter, i just do it uppercase.

lock makes it so when your talking to the person, he can't move.
Example: If in Advance map, you set the guy for moving up and down, he won't move while your talking to him.

faceplayer makes it so when you talk to the person, he turns and faces you.

message $talk needs some explaining.
Whenever you want someone to talk, put message $
Then, after the $, put whatever you want. That $ is called an offset. In this case, i put $talk, to make it easy.

boxset 6 is something that should always be put after a message.
It makes it so the script is in a text box in the game. There are other boxsets, but for now, boxset 6 is what you should use.

release makes it so when the script is done, it unlocks the person you are talking to, so he can move.

end should always be put at the end of a script, and so should release^^
Otherwise, the script won't end, and that's not good!

Then, we come to the bottom, where it says:
#org $talk
$talk 1 = Hey, what's up?

This is what that means.
As you can see, it stars with #org, as all beginnings should.
But instead of $begin, there is $talk.
Look up, and it says message $talk.
That means, it goes to that part, where it will do what the bottom part says, since the two $ match up.
So then it goes $talk 1 = Hey, what's up?
Well, after that, always put the $ again, then put a space, then put a 1. Then another space, the equal sign, and another space. After that last space, put your message.

In this case, it's "Hey, what's up?"

But, what if the message was this?

#org $test
$test 1 = Hey, what's up? I'm good, thank you! Do you like animals? I do!

Well, if you don't realize, this goes in a text box. Open up your ROM in VBA and talk to someone, and you can see the box. That won't fit in the box, so what you do is this:
You use \n and \p. Here's an example:

#org $test
$test 1 = Hey, what's up? I'm good, \nthank you! Do you like \panimals? I do!

Notice how there is no space between the \n or \p and the next word, that is important. Always start with \n and then alternate.

And that, is a very simple talking script!
________________________
2. Burning the script to the ROM

Most people don't know how to do this, so here is how.
First, you need the programs Pokescript 1.00 and PokemonAdvanced 1.00

To get those, ask someone on PC to upload the programs to you, or search on a file sharing site like www.4shared.com

So, here is what to do:

Save your notepad with the script on it as this:

talk.rbc
all files

Make sure it is under all files, and it has to be .rbc!

Now, if you have the correct programs installed, go to open, all files. Right click on your script (test.rbc) and select "compile script" (it should be there if saved correctly)

Something will pop up and show words really fast, it will go away in a few quick seconds and another thing will pop up.

Look at the new thing that popped up and click the blue book.
Then, browse for your ROM and select it.

After that, yet another thing will pop up. Click the grey flashlight.
5 rows of numbers will show in the blank space.
Double click the first row.

On the bottom, it should appear.
Most likely, if you haven't ever inserted a script, it will show this:
&H800000 (not sure how many 0's, sorry if i'm wrong)

Highlight and copy only the numbers, not the &H.

Then, click assign.

Now, that window will dissapear, and the one with the blue book should be there.

Go to file - burn.

Then, after it's done burning it, close those windows and open Advance map. Make a new person in pallet town, and go to his "script offset"
It should say $000000 if its a new person.
Paste your numbers over those 0's.

Now, play it on your VBA.
It should work.

I know it seems like a lot of work (and it is) but as you get better, compiling it get's a lot faster, as you know how to do it.
_________________________
3. Making a giveitem/givepokemon script
_________________________
#ORG $begin
checkflag 0x200
lock
faceplayer
if B_true goto $done
message $giveitem
boxset 6
giveitem 0xD 1
setflag 0x200
release
end

#org $done
message $nomore
boxset 6
release
end

#org $nomore
$nomore 1 = Sorry, i'm all out!

#org $giveitem
$giveitem 1 = Here, take this potion!
________________________
Whoa, a lot of new stuff there!
Let's start with checkflag 0x200.
Look down and you will also se setflag 0x200.

Starting with checkflag, it means it's checking the event. Think of it like this:
Flag=Event

What flags basically do though is make it so an event can't repeat itself.
So you will only get 1 potion.

Set flag is at the end, so it will set the event, making it impossible to repeat.
0x200 is the event number. Every event should have a different number. That way, no event repeats themselves.

So, next giveitem/givepokemon script will have checkflag 0x201 and setflag 0x201

Start with 0x200 and work your way up.

Always check the flag after #ORG
and always set the flag before release + end.

if B_true goto $done.
Well, what does that mean?
This does not take effect until you have done the event once and have gotten the item.
This works just like message $ works.
It will go to the bottom and do what it says.
Well, it leads so this:

#org $done
message $nomore
boxset 6
release
end

That means, it will make the person who gave you the item say something different next time you talk to him.

So, that goes to this:

#org $nomore
$nomore 1 = Sorry, i'm all out!

So, next time you talk to him, he will say that, instead of giving you another item.

Last but not least, we have:
giveitem 0xD 1

This means after the person is done talking, he will give you an item. 0xD is the item code. Every item has a code. Here is the list:
Spoiler:

0xD happens to be a potion.
1 means it only gives you 1 potion

Now, for the givepokemon script :)
Everyone's favorite!

Well, i'll tell you the truth, it is the same exact thing as the giveitem script, but instead of giveitem, you put:

givepokemon 1 100 0

That means it will give you a Bulbasaur level 100 holding no item.
The first number is the pokemon's national dex number.
The second is the level.
The third is the item. (0 means no item)
So, if i wanted it to hold a potion, it would look like this:

givepokemon 1 100 0xD

But, you can make it so someone gives you both!
Here is a script, where a person will give you 2 potions, and Misdreavus level 65 holding a TM 50:
_________________________
#ORG $begin
checkflag 0x201
lock
faceplayer
if B_true goto $done
message $givestuff
boxset 6
giveitem 0xD 2
givepokemon 200 65 0x152
setflag 0x201
release
end

#org $done
message $nomore
boxset 6
release
end

#org $nomore
$nomore 1 = What more do you want? Gold? \nWell too bad!

#org $givestuff
$givestuff 1 = Here, take these!
__________________________
As you can see, its not too hard to combine them.
(I changed the flags, as you can see, to 0x201, since the last one was 0x200)

And that is how to make those, they may require some practice, but they're quite useful.
_________________________
4. Making movement scripts

These are a must have in hacks, as they are the main things that happen in events.

Here is a very basic movement script.
First, i tell you where to do it.

Go to the room where your mom is (your players house)
Go to events view, then go to scripts number.
Select 1 and one will appear in the corner.
Drag it down like this:
Turtial.jpg


So it is like that.

Now, there is one thing you need to do first:

Where the properties of the script are, it will show at the top:

Unown 00 00
Var numbers 00 00

The first two ^^ should look like this:

Unown 03 00
Var numbers 52 40

Ok, that makes it so the movement script doesn't freeze.

Finally, here's the script:
(i changed the flags again to 0x202)

__________________
#ORG $begin
checkflag 0x202
if B_true goto $done
applymovement 0x01 $momwalk
pausemove 0
message $momtalk
boxset 6
setflag 0x202
release
end

#org $done
release
end

#org $momwalk
$momwalk 1 ; 0x13 0xFE

#org $momtalk
$momtalk 1 = Hey \v\h01!
_______________________
3 new things.

1. if B_true goto $done.
Look at $done, and you will see all it says under it is:
release
end

This way, when you step on the script space again, the mom won't run over to you, it will just end, so its like a normal square.

2. applymovement 0x01 $momwalk
That shouldn't be too hard to understand, that means when you step on the script square, the mom will move. Applymovement is the command to make someone move on the map. 0x01 is the people number on advance map. The mom's people number is 1, so its 0x01. Make sure you use the people number, not the event number!!!

So, $momwalk.
That will go to the one at the bottom.

The one at the bottom says:

#org $momwalk
$momwalk 1 ; 0x13 0xFE

As usual, it says $momwalk 1, but, why is there a ; instead of an =?

You use ; for movements.
Then 0x13 means walk 1 to the right.
Here is a list of movements. Take note that the numbers after the commands are the speed, not the number.
Spoiler:

Note: Movements are for Fire Red only! I will post Ruby movements later.

These are the basic movements:
Up3 = 0x11
Left3 = 0x12
Right3 = 0x13
Down3 = 0x10

The 3 is actually the normal speed.

After your done listing movements, always put 0xFE at the end.
In this case, there is only one movement, 0x13. So after 0x13, you put 0xFE. 0xFE tells the script that the movements are over, and it can go to the message.

3. pausemove 0 is what you should always put after applymovement.
Just like boxset 6, always put it after it.
It makes it so the game waits for the person to move for the message to happen.

(note: in the message, it says \v\h01, that shows the name of your player)

But, there are problems with this script you should realize when you are doing it.

1. You don't face your mom when she talks to you.
2. She doesn't walk back to the table.

Well, let's start by making her walk back to the table, here is how you would do it:

________________
#ORG $begin
checkflag 0x202
if B_true goto $done
applymovement 0x01 $momwalk
pausemove 0
message $momtalk
boxset 6
applymovement 0x01 $momwalkback
pausemove 0
setflag 0x202
release
end

#org $done
release
end

#org $momwalk
$momwalk 1 ; 0x13 0xFE

#org $momtalk
$momtalk 1 = Hey \v\h01!

#org $momwalkback
$momwalkback 1 ; 0x12 0xFE
__________________
That was easy, all i did was add another applymovement. That makes the mom move again after she talks.
At the bottom, i put the movements that she should make. (1 left, back to the table)

Now, here is how to make your player face the mom when she walks to you.
__________________
#ORG $begin
checkflag 0x202
if B_true goto $done
applymovement 0x01 $momwalk
applymovement 0xFF $playerturn
pausemove 0
message $momtalk
boxset 6
applymovement 0x01 $momwalkback
pausemove 0
setflag 0x202
release
end

#org $done
release
end

#org $momwalk
$momwalk 1 ; 0x13 0xFE

#org $playerturn
$playerturn 1 ; 0x02 0xFE

#org $momtalk
$momtalk 1 = Hey \v\h01!

#org $momwalkback
$momwalkback 1 ; 0x12 0xFE
___________________
What i added is:
applymovement 0xFF $playerturn.

Notice how it is right next to the applymovement for the mom.
That means, they will both move at the same time.
So while she walks foward, you turn left.

(note: the movements with 0 after them are facing commands)

So, aslong as the applymovements share the same pausemove 0, they happen at the same time.

0xFF is the people number for your player, every movement works on yourself too!

$playerturn is the offset which is at the bottom part, you should get that part by now.

Now, you can combine these scripts with giveitem/givepokemon.

So, it would look like this (i'm going to make the mom give you a potion)
__________________________
#ORG $begin
checkflag 0x202
if B_true goto $done
applymovement 0x01 $momwalk
applymovement 0xFF $playerturn
pausemove 0
message $momtalk
boxset 6
giveitem 0xD 1
applymovement 0x01 $momwalkback
pausemove 0
setflag 0x202
release
end

#org $done
release
end

#org $momwalk
$momwalk 1 ; 0x13 0xFE

#org $playerturn
$playerturn 1 ; 0x02 0xFE

#org $momtalk
$momtalk 1 = Hey \v\h01! Take this potion!

#org $momwalkback
$momwalkback 1 ; 0x12 0xFE
______________________
It's that easy!
______________________
5. Color Messages

Let's start with the normal talking script again:
_______________________
#org $begin
lock
faceplayer
message $1
boxset 6
release
end

#org $1
$1 1 = Hi!
________________________
Now, what if i want that "Hi!" to be a different color? I would do it like this:
(This will make the "Hi!" dark green)

$1 1 = \c\h01\h06Hi!

That is how, it looks like the player code (\v\h01) but its not. It looks a bit hard, but actaully, the numbers after the last 'h' (06) are all you have to change.

Here is the list of colors:
00 - white
02 - black
03 - gray
04 - red
05 - orange
06 - dark green
07 - cyan
08 - dark blue
09 - lighter blue
0b - bluish grey

Its not too hard to do!
Don't put spaces between the color code and your first word!
______________________
6. Trainer Battles

These scripts allow you to battle any trainer in the game that can be found in PET.
Here is an example script:
_____________________
#ORG $begin
trainerbattle 1 0x001 $1 $2
message $lost
boxset 6
release
end

#org $1
$1 1 = I'm going to beat you!

#org $2
$2 1 = No fair! You cheated!

#org $lost
$lost 1 = Go away you cheater!!!
_____________________
Well, that didn't look to hard, did it?
1. First, to get this working, go to advance map.
2. Check off the "trainer" box on the guy you want to have this script.
3. Change his view range to the number you want.

This way, he will have a '!' on his head and run over to you when he sees you.

Now, first, this script automatically does these things:
1. Make a '!' on their heads
2. Make them run over to you
3. Say something
4. Battle
5. Say something after you win
6. If you talk to them, they will say something else.

Let's start with the most important line: trainerbattle 1 0x001 $1 $2

trainerbattle is (or should) be very easy to understand. Its almost like the command 'applymovement'. After it is 1. Always put the 1 there, enough said.

0x001 - just like in applymovement, but instead of the people number in advance map, its the persons' number in PET. I chose 0x001 as an example of coarse...

$1 and $2. There are two offsets after trainerbattle. $1 and $2 can also be said as $beforebattle and $afterbattle.

So, when the person runs up to you, they will say $1. In this case, it is "I'm going to beat you!"
and after the battle it goes to $2, which says "No fair! You cheated!"

Now, let's say you wanted to put this in a normal script, like after you win, the you beat someone in a battle, you get a pokemon.
Here is how you would do that:
______________________
#ORG $begin
checkflag 0x200
lock
facplayer
if B_true goto $done
message $1
boxset 6
trainerbattle 1 0x001 $2 $3
message $4
boxset 6
givepokemon 200 10 0xD
setflag 0x200
release
end

#org $done
message $no
boxset 6
release
end

#org $no
$no 1 = Hey, how's my pokemon doing?

#org $1
$1 1 = Hey, my name is Bob. If \nyou beat me, I will give \pyou a prize!

#org $2
$2 1 = Here we go!

#org $3
$3 1 = Congratulations, you win the prize!

#org $4
$4 1 = Here you go!
______________________
Now, was that too hard to do? Just add it in to any regular script. That line is all you need to make it happen. Also, for the normal trainer battle, there is one more thing you need to know. You see how in the above one, after the battle it will say another message? Well, how would you do that in a regular trainer battle? Here is how:
______________________
#ORG $begin
trainerbattle 1 0x001 $1 $2 $3
message $lost
boxset 6
release
end

#org $1
$1 1 = I'm going to beat you!

#org $2
$2 1 = No fair! You cheated!

#org $lost
$lost 1 = Go away you cheater!!!

#org $3
message $more
boxset 6
release
end

#org $more
$more 1 = Wow, you are really good!
_________________________
All i did was add $3 to the trainerbattle line, and brought it down to the bottom.
Last but not least, the trainerbattle colors!!!
____________________
00 - transparent
01 - white
02 - red
03 - solid gray
04 - bluish
07 - light gray
09 - black
0a - reddish pink
0b - lighter gray
0c - pink
0d - brown
0e - lighter brown
13 - bluish solid gray

^^Yes, they are different than regular message ones^^

Well, that's it for now!
I hope this helped!

If you have any questions, PM me and i will answer them.
 
Last edited by a moderator:

TB Pro

Old-timer
2,708
Posts
19
Years
Nice!
This is very helpful man!
Especially the Movement commands!

I'll be sure to refer to this if I ever need any help with these kinds of scripts!

I hope you make a guide for more advanced scripts later!
BOL!
 

Piplup-Trainer

This is my custom user title.
228
Posts
16
Years
Thank you to give this tutorial.
Irish Witch's tutorial is old, too long and it hasn't been updated for a long time ago.
Your tutorial is short and easy to understand.
I hope that many hackers who hack Ruby/Sapphire will use this tutorial.
 
Last edited:

+Sneasel™

It's a meeee, itman!
1,032
Posts
16
Years
Nice!
This is very helpful man!
Especially the Movement commands!

I'll be sure to refer to this if I ever need any help with these kinds of scripts!

I hope you make a guide for more advanced scripts later!
BOL!
I may add to this on some other types of scripts, but not for a while, if i even get to it at all.

Thank you to give this tutorial.
Irish Witch's tutorial is old, too long and it hasn't been updated for a long time ago.
Your tutorial is short and easy to understand.
I hope that many hackers who hack Ruby/Sapphire will use this tutorial.

Thanks for the comment! :)
 
1,104
Posts
16
Years
It's looking all right. Not too much there, but I'm sure your still going to add a lot more to it.
I was going to write a long scripting tutorial, but I feel there's no need anymore. There's so many here at PC, it would be like 'flogging a dead horse'.
Also, you might want to add that the movements in your post are for Fire Red Only.
 

/Circa

a face in the clouds.
881
Posts
16
Years
Oh, since this tutorial has come up, mine wont be needed, i'll close it down ;)
I'm adding this to the resource list, since it's so simple and easy to understand.
 

+Sneasel™

It's a meeee, itman!
1,032
Posts
16
Years
It's looking all right. Not too much there, but I'm sure your still going to add a lot more to it.
I was going to write a long scripting tutorial, but I feel there's no need anymore. There's so many here at PC, it would be like 'flogging a dead horse'.
Also, you might want to add that the movements in your post are for Fire Red Only.
good idea, and thanks for the comment!
Oh, since this tutorial has come up, mine wont be needed, i'll close it down ;)
I'm adding this to the resource list, since it's so simple and easy to understand.
Thanks, thats really nice!
 
3
Posts
16
Years
  • Seen Dec 24, 2008
Your tutorial is so good! It is easy to understand, not like other.
Please update it reuglarly. Thank you.
 
3
Posts
16
Years
  • Seen Dec 24, 2008
Good job, I have tried and now I understand the movement scripts. It's so cool. Could you update the trainer battle and wild pokemon battle scripts please? I like your lessons! :)
 

kebbles

Rom Hacker.
616
Posts
16
Years
Itman, what can I say...
You pretty much saved me from quitting hacking all together.
You taught me how to script, your tut is awesome and easy to understand and its all up to date.
Dosnt get much better then this.
I cant wait for the Trainer scripts, I can already do wild battles, but Im sure everyone else cant wait for them!
Best of luck, Kebbles!​
 

Jack of Bl♠des

Former goderator
194
Posts
16
Years
Sweet, trainer battles are exactly what I need to work on next. Well, that and Yes/No+Give pokemon scripts. Could somebody help me out with this script I'm doing.

I'm trying to make it so that if you say yes to this question, you'll receive Skarmory (which is renamed Rebellion in my hack). Currently I've gotten the givepokemon command to work, but not the message display part. After I say yes, I want him to say something, then give me Rebellion. But all I do is receive the Pokemon. The same goes for me if I say no (though I don't get the Pokemon).

Spoiler:



EDIT: Now I've managed to get a response from the person, but I get the same response whether I pick yes or no.

Spoiler:


EDIT: fixed it. It's amazing what you can do if you look back at something after learning.
 
Last edited:

mistersmeargle

is a scatman.
229
Posts
16
Years
  • Seen Oct 26, 2017
Your tuts are awesome man, yesterday I couldn't do a simple message, now, thanks to you, the EON TICKET is in my hack. I need to know how to do legendary battles and um, how do i put it...
Y'know the way you can't get to the Battle Tower unless you beat the Elite Four and you can't leave Lilycove until Maxie (or is it Max?) goes off in the submarine? I need to know how to do that.
 

mistersmeargle

is a scatman.
229
Posts
16
Years
  • Seen Oct 26, 2017
How do you do scripts that prevent you from leaving the start town without a Pokémon?
 
230
Posts
16
Years
  • Seen Jan 3, 2010
Ask in the proper thread. Anyway. I am not sure if this thread should be called EXTREME when those are things that many people knew. My opinion. The thing can be useful, of course. but it shouldn't have such name. And with the project HackMew has prepared, Pokéscript and it's scripting language will be outdated. I think it would be better to use ScriptED language, as it will make a comeback and will be even better!
 
1,104
Posts
16
Years
Ask in the proper thread. Anyway. I am not sure if this thread should be called EXTREME when those are things that many people knew. My opinion. The thing can be useful, of course. but it shouldn't have such name. And with the project HackMew has prepared, Pokéscript and it's scripting language will be outdated. I think it would be better to use ScriptED language, as it will make a comeback and will be even better!

The name is a little misleading, but until XSE is actually released, people are just going to expect this to be a pokescript Tutorial.
Why will pokescript's language be outdated? I'd say Diamond cutter is outdated, but would you say ScriptED is? Probably not.... People who have learnt to script in one "Langauage", aren't going to change over and alter their scripting styles. I know I'm going to keep using Pokescript But I'll be, hopefully, taking commands out of XSE and adding them into my Pokescript. I can script in ScripED, but I find pokescript, to be a simpler "language" of scripting.
 
Back
Top