• 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 places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Scripting Guide for Beginner Hackers

Status
Not open for further replies.
230
Posts
16
Years
  • Seen Jan 3, 2010
Scripting Guide for Beginner Hackers
Yep, that's what beginners were waiting for.


Introduction
Some welcome stuff...


Welcome to this guide!

What will we do here? We will learn basic scripting and maybe, only maybe, advanced bits. This is a document to help you create more complex hacks, not only plain map or graphics changing ones. You know, we all have seen them and they aren't good. It's now your turn to change it.
Every part of this guide will be in spoiler. If you need to e.g. go to bed cause it's too late, it's easier to just open a spoiler containing the desired section than scrolling whole page ;)

Contents
What will you learn here?
  • We will start with basic message displaying commands and later on we will progress to displaying player's and rival's name. We will learn to compare results in a YES/NO script. And we shall do a checkgender thingy, just for fun ;) This will be divided into two parts.
  • After that, we will start messing a bit with movement commands, meaning by explaining each and we will make a movement script.
  • As we want to make complex scripts we will start combinig our knowledge.
  • We will continue with flags. We will explain all three commands around flags. You will find out which ones they are down in the tutorial. We will also explain some pre-defined flags we will use in later scripts, as they will be unnecessary till you have Pokémon - we will use those flags when messing with giving a Pokémon.
  • We are almost in the giving item/Pokémon part, but we are still not there yet. Now we will play with special commands (and we will explain the national Pokédex trick) and then continue at the most anticipated part.
  • No, I won't let you go to giving Pokémon/item yet. We will have one feature not related to scripting before. Y ou will have the ability to test yourself after each section. You will get a task to make a script combining your current knowledge. You can complete each task and divide scripts into spoilers. I will check them later and tell you if you have the script correct. You may choose any of tthese tasks and let only one be reviewed. This is recommended.
  • Now you will learn about the part you've been waiting for: Giving a Pokémon. This is self explanatory, so I will give you further information in prper section.
  • We have the giving item part in fromt of us, we will mess with them a bit just for fun.
  • Now we will play with playing sounds. It will be fun and useful for a radio concept.
  • Now we will learn about changing weather. It will look dramatic ;) At least we should hope so :laugh:
  • Now you know everything you need for start, here is the final scripting task. It will be pretty hard, so you should be well-prepared and you will pass. I ask each of you who read this to make the script as a test after learning. If you complete the task well, you might earn a certificate of a well-trained beginner scripter. I will decide if I issue these as it may take more time than I planned, so I might only write it.
NOTE: For quick release of this guide, I did only a few things and released them immediately. I will add chapters and to easily recognize, finished parts will be in bold.

Introduction to scripting, basic message commands etc.
Our "Hello World!" tutorial ;)

Spoiler:
 
Last edited:

/Circa

a face in the clouds.
881
Posts
16
Years
These scripts work in both programs, though I think there a some different commands and styles.

This is very detailed for just the basic commands Martin, well done.
 

cooley

///Keepin' it simple
1,148
Posts
17
Years
Another scripting tutorial...If I was a Beginner I would Learn scripting that quick!
Good Job martin.
 

akash

Pikachu is the best.
21
Posts
16
Years
Hey martin well I gave the offset for my first script as 0x800000 and then for my second script I gave the offset 0x800101 but then when I play the game both the scripts get mixed. Well take a look at it-

Well this is my first script for a boy:-
#org 0x800000
lock
faceplayer
message 0x800100
boxset 0x02
end
#org 0x800100
= Hello.\n ha!\p Aren't you \v\h01!\p Wow its a great plessure\n to meet you.\p Could I get your autograph\n \v\h01!\p Well, we have many things in common\n like.....\p our face meet.\n The other thing is \p Even I am a new trainer.\p Well by the way\n I am mathew and \p This is my best friend\n Pikachu\p Well I call it sparkie.
release
end

And here is my second script for a signpost:-
#org 0x8000101
message 0x800200
boxset 0x02
#org 0x800200
= Beware of pokemon.

Well the thing is when I talk to the boy he says everything correctly but in the end instead of saying 'Could I get your autograph' he says 'Could I get your beware of pokemon'. And when I try to go near the signpost the game hangs. So whats the problem with it. Thanks in advance.
 
230
Posts
16
Years
  • Seen Jan 3, 2010
Nice introduction, this tutorials would be in ScriptEd? , or in PoketScript?

I have nothing against Irish Witch and her programming efforts, but the scripting language is too far from the common ScriptED one. This guide will be for ScriptED and for HackMew's upcoming script compiler, XSE. Because both will work with same scripting language, but XSE will have enhanced command database. I will transition to XSE when it comes to the store xD

These scripts work in both programs, though I think there a some different commands and styles.

This is very detailed for just the basic commands Martin, well done.

Thank you. This guide was meant to be really detailed, beginners would never know what are they doing if they didn't know deeper meaning of the command itself.

Another scripting tutorial...If I was a Beginner I would Learn scripting that quick!
Good Job martin.

Thank you for your support. I will make a little banner to promote this guide, if you want, you can put it into your signature then.

Hey martin well I gave the offset for my first script as 0x800000 and then for my second script I gave the offset 0x800101 but then when I play the game both the scripts get mixed. Well take a look at it-

Well this is my first script for a boy:-
#org 0x800000
lock
faceplayer
message 0x800100
boxset 0x02
end
#org 0x800100
= Hello.\n ha!\p Aren't you \v\h01!\p Wow its a great plessure\n to meet you.\p Could I get your autograph\n \v\h01!\p Well, we have many things in common\n like.....\p our face meet.\n The other thing is \p Even I am a new trainer.\p Well by the way\n I am mathew and \p This is my best friend\n Pikachu\p Well I call it sparkie.
release
end

And here is my second script for a signpost:-
#org 0x8000101
message 0x800200
boxset 0x02
#org 0x800200
= Beware of pokemon.

Well the thing is when I talk to the boy he says everything correctly but in the end instead of saying 'Could I get your autograph' he says 'Could I get your beware of pokemon'. And when I try to go near the signpost the game hangs. So whats the problem with it. Thanks in advance.

You don't pay attentťion to script formatting. It doesn't matter, cause I will explain now ;)

Your first script is formatted in a different way than it should be. Fixed scripts with comments are here:

#org 0x800000
lock
faceplayer
message 0x800100 *Doesn't make any difference, but I would recommend using commands stated in the tutorial. But it's a matter of what are you used to.
boxset 0x02 *Would recommend simple 0x2
end *It shouldn't be there.
release
end

*The message should be here. Don't put it into the center of script, but 1 line after the script.
#org 0x800100
= Hello.\n ha!\p Aren't you \v\h01!\p Wow its a great plessure\n to meet you.\p Could I get your autograph\n \v\h01!\p Well, we have many things in common\n like.....\p our face meet.\n The other thing is \p Even I am a new trainer.\p Well by the way\n I am mathew and \p This is my best friend\n Pikachu\p Well I call it sparkie.


#org 0x8000101 800200 - Always leave at least 100 between two scripts.
message 0x800200 800300 Just fixing the offsets.
boxset 0x02
#org 0x800200 800300
= Beware of pokemon.
 
Last edited:
1,104
Posts
16
Years
You don't pay attentťion to script formatting. It doesn't matter, cause I will explain now ;)

Your first script is formatted in a different way than it should be. Fixed scripts with comments are here:

#org 0x800000
lock
faceplayer
message 0x800100 *Doesn't make any difference, but I would recommend using commands stated in the tutorial. But it's a matter of what are you used to.
boxset 0x02 *Would recommend simple 0x2
end *It shouldn't be there.
release
end

*The message should be here. Don't put it into the center of script, but 1 line after the script.
#org 0x800100
= Hello.\n ha!\p Aren't you \v\h01!\p Wow its a great plessure\n to meet you.\p Could I get your autograph\n \v\h01!\p Well, we have many things in common\n like.....\p our face meet.\n The other thing is \p Even I am a new trainer.\p Well by the way\n I am mathew and \p This is my best friend\n Pikachu\p Well I call it sparkie.


#org 0x8000101 800200 - Always leave at least 100 between two scripts.
message 0x800200 800300 Just fixing the offsets.
boxset 0x02
#org 0x800200 800300
= Beware of pokemon.

I'll start with great tutorial Martin. It's really in depth and explains every clearly so that someone completely new to the concept of Hacking can understand.

Now onto akash's script, because of the bytes needed for the text, shouldn't the offsets you gave, be further apart?
The text of the first script would exceed that 100 gap that you made.
Sorry, about pointing this out, but I think it's better if you've actually given a working script, instead of a script with the same problem he had before.
I moved the message pointers to save a little more space.
Code:
#org 0x800000
lock
faceplayer
message 0x800010
boxset 0x02
release
end
#org 0x800010
= Hello.\n ha!\p Aren't you \v\h01!\p Wow its a great plessure\n to meet you.\p Could I get your autograph\n \v\h01!\p Well, we have many things in common\n like.....\p our face meet.\n The other thing is \p Even I am a new trainer.\p Well by the way\n I am mathew and \p This is my best friend\n Pikachu\p Well I call it sparkie.

Code:
#org 0x800150
message 0x800160
boxset 0x02
release
end
#org 0x800160
= Beware of pokemon.
 
230
Posts
16
Years
  • Seen Jan 3, 2010
Oh, sorry then, I just got used to putting 100 between each command... I usually don't pay closer attention to this... my fault. And thank you for support and fixing it :)


~Martin
 

s l u g

arriving somewhere but not here,
961
Posts
16
Years
  • Age 31
  • Seen Jan 2, 2023
Voila~~ Nice Tutorial i needed this will learn this soon~~ > lol :D
 

akash

Pikachu is the best.
21
Posts
16
Years
Thanks for the help. Well does anyone know how to make a give pokemon script and a trainer battle script in Script Ed using this tutorials commands.
 

TB Pro

Old-timer
2,708
Posts
19
Years
Ok here goes.
I am sooo a super n00b to scripting ^_^!
I tried out your tests and here they are
Spoiler:

Yes,
I know there is something wrong about it but....
I dont know what <_>!
So plz Help!
And my other one
Spoiler:

So if anything is wrong with this plz point it out!
 
230
Posts
16
Years
  • Seen Jan 3, 2010
@Blazikendude

Switch the $ sign with 0x and write in lowercase - commands.
And when writing out whole message offset, 0x01 isn't enough. You need to fill all out.

I will fix this for you, but last time. No one will get errors fixed before. You need to learn from other scripts too.

First, you need to put more space into your script. I think that for your script, 100 between offsets should do. Meaning that as a starting offset you would use 0x800000 and as a message offset you use 0x800100. And when you write the message, you must write out WHOLE offset: 0x800100, not 0x100 or 0x01 - the wrong one.

@akash

This will be explained in this guide, too, don't worry. But I have holidays and cannot stay on the computer for long - look, it's Christmas Eve and I am sitting in front of computer and answering questions.

The giving scripts and battling ones will be explained here, too, but those aren't a thing for beginner. Please don't try to ask in Script request forum, you will learn this with a bit of help in this guide, but I am planning to finish this guide in a month or more, but maybe sooner. And as those things you ask for belong to hardest scripting parts - mainly hardest to explain, you will have to wait a bit. Sorry.

@TotoMud

Thanks for support :)
 

akash

Pikachu is the best.
21
Posts
16
Years
Well thats ok Martin thanks and by the way MERY CHRISTMAS. And could you explain the yes/no script. I really didnt understand that. Well I saw the commands that came with elite map pack. In that I saw the give pokemon command. It was givepokemon iSpecies bLevel iItem. So should I just type that command in the script or should I give it some offset.
 
Last edited:
230
Posts
16
Years
  • Seen Jan 3, 2010
Dear akash,

as I said, I will make guide for the givepokemon command. I am pretty sure you don't know what to replace those variables with correct numbers. Anyway, you would have to add some blank binary data but I am not sure how many, so I will need to check when writing the specific part of guide.

The Yes/No script is pretty well explained in the first part of the guide, but I will make up one here for you. I will comment the Yes/No part, so you might understand better.

#org 0x800000
msgbox 0x800100
callstd 0x5

compare LASTRESULT 0x1 - if player chose yes.
if 0x1 goto 0x800200 - if he did so, he will be redirected to 0x800200
msgbox 0x800400
callstd 0x2
end

#org 0x800200
msgbox 0x800300
callstd 0x2
end

'-----------------------------------------------------------

#org 0x800100
= Pick of the two options.

#org 0x800300
= You chose YES.

#org 0x800400
= You chose NO.


Hope this will do. The script is pretty easy to make, but you shouldn't get confused with the compare command. Try to compile this script in ScriptED and see how it works, and if it works. Merry Christmas!

EDIT: Don't forget to delete comments and the divider to make script work properly.

EDIT2: Ah, I made a mistake and the person doesn't behave correctly. Who will fix this for me? ;) I will certify the first 5 people as an official guide users and I will provide more information about my progress to him/her ;)
 

akash

Pikachu is the best.
21
Posts
16
Years
Well thanks Martin. Well I have another question. In elite map it says Ctrl+click to view the script. Then when I ctrl+click the script ed opens but it will be totally blank. So can you help me with this.
 
230
Posts
16
Years
  • Seen Jan 3, 2010
ScriptED Troubleshooting

1. Help! My script doesn't compile/ When trying to load the script from game, it stays blank!

Simple solution. I guess you're using Windows (not Wine on Linux, I don't know a solution for that OS, although I know it a bit, used before). You need to open a folder. Any. Open Settings/Preferences - I don't know which one is correct translation - and choose Folder Options. There, click on the second tab. Find a checkbox "Hide extensions of registered file types" or something like that. Uncheck. Done. It should be okay now, worked for me since Win 2000.
 

akash

Pikachu is the best.
21
Posts
16
Years
Hey Martin its still not working. Well do you have any other ideas. I am using script ed. I have got windows XP.
 

akash

Pikachu is the best.
21
Posts
16
Years
Hi.

Hey well I found a script in my folder and then I just changed the offsets and tried to compile it. But it said "Type missmatch." So could anyone help me. Well here is the script.
Spoiler:


Thanks in advance.
 
1,104
Posts
16
Years
Hey well I found a script in my folder and then I just changed the offsets and tried to compile it. But it said "Type missmatch." So could anyone help me. Well here is the script.
Spoiler:


Thanks in advance.

You're better off learning to write your own scripts than just taking them from other places. I haven't checked all the offsets, but if they're all ok(since, they're all so far apart), the script should work now.
 
Last edited:
Status
Not open for further replies.
Back
Top