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

Penguin’s Super Uber Mega Awesome Scripting Tutorial

5
Posts
13
Years
  • Seen Jul 2, 2010
Penguin's Super Uber Mega Awesome Scripting Tutorial

Hello there I am going to teach you how to write a script so hopefully at the end you will know enough to write your own script.
So let us begin the super scripting experience.

STEP 1 Basic Scripting

See that is just an easy script to write so let's begin.

#org $script
lock
faceplayer
message $talk
$talk 1 = Hi there.
boxset 6
release
end

See just a quick script. Take not wherever you see it say $ you can put whatever you want after the $.

Recap Time
So you always start a script off with #org and then $ whatever you named it. Then you put lock so you cannot move. Afterwards you put faceplayer so the person looks at you. Then you put message $ whatever because that is called a offset which is what the name of that part of the script is called so you can identify between parts of the script. After that is $ whatever 1 = (your script) which tells the game to goto your script because it is called a pointer which points the game to the script. Then boxset 6 for a basic script. Then release makes it so you can walk around again and end ends the script.

List of all boxsets in game
boxset 4 does not close you will be stuck
boxset 5 a question box and yes or no option appears
boxset 6 basic script

You can only put 30 spaces on a line so you can use special commands to put more spaces

List of commands that change the box
\p clears everything on the line and starts rewriting again
\n goes down a line because you have two lines on a box
\l shifts all of the box up

Example

#org $script
lock
faceplayer
message $talk
$talk 1 = Hi there I love hotdogs and\ncheese and food because it is\lso yummy in my tummy.
boxset 6
release
end



STEP 2 Yes/No Questions


Now let's start the script

#org $script
lock
faceplayer
message $question
$question 1 = Do you like pie?
boxset 5
compare 0x800D 0x0001
if 0x01 goto $yes
message $no
$no 1 = Well, I do.
boxset 6
release
end

#org $yes
message $yay
$yay 1 = Me too!
boxset 6
release
end

Recap Time
OK so it is the same until you put boxset 5 which is a question boxset. Afterwards you put compare 0x800D 0x0001 which tells the game to check whether or not you pressed yes or no. Then if 0x01 goto $ whatever tells the game to skip all of the rest of the script and go to your yes message. Then you put your no message and then release end. Then at the bottom you put your yes script.

STEP 3 Giving and Taking Items and Giving Pokemon

These scripts are quite easy to make but they will keep happening until we put a command which we will go over in step 4.
Spoiler:


Ok now to start the script.

#org $script
lock
faceplayer
message $here
$here 1 = Here you go!
boxset 6
giveitem 0x01 0x01
release
end

Recap Time
The new command is giveitem which gives the player an item. My script gives the player a masterball. Use my list to find the item you want to give and put it in the first 0x space like me. The second 0x is the amount of the item to give.

Now to take the item away

#org $script
lock
faceplayer
message $take
$take 1 = I steal yo item!
boxset 6
removeitem 0x01 0x01
release
end

Recap Time
It is the same as giveitem except you put removeitem.

Now for giving pokemon.

#org $script
lock
faceplayer
message $here
$here 1 = Take this pokemon!
boxset 6
givepokemon 2 5 0x8B
release
end

Recap Time
New command givepokemon. Now the first number is the pokemon's number which I so nicely gave you a list of. The second number is the level. The third number has to have 0x and it is the item to hold. If you do not want the pokemon to hold an item put 0x00. That script would give me a level 5 ivysaur holding an oran berry.

STEP 4 Flags
Flags make it so an event happens only once.
Spoiler:


#org $script
lock
faceplayer
checkflag 0x(flag number)
if 0x01 goto $done
message $giver
$giver 1 = Here
boxset 6
givepokemon 4 5 0x00
setflag 0x(flag number)
release
end

#org $done
message $noob
$noob 1 = I gave you one.
boxset 6
release
end

Recap Time
Checkflag 0x yout flag checks to see if the flag has been set which means it checks if the event is already done. Then setflag makes it so the event does not happen again. Then if you put a checkflag you put your done script. Also you have to do something else I will put a link to the video.

Set person ID as flag number

STEP 5 Movement
This one is a bit tricky to write.

Spoiler:


Time for the script

#org $script
lock
faceplayer
message $talk
$talk 1 = I will move
boxset 6
applymovement person number $move
$move 1 ; #binary 0x12 0xFE
pausemove 0x0000
release
end




Recap Time
First new command applymovement then you put their person number. That tells the game who is going to move. Then you put $ whatever.
Then $ whatever 2 ; take not that is a semicolon which is right next to the L key on the keyboard. That is followed by #binary which tells the game we are to move. Then you put the movement values and then after the movbement values you have to put 0xFE otherwise the game will crash. Afterwards you put pausemove 0x0000 so the game finishes the movement values

STEP 6 Trainer Battles
For this part you will need a tool called PET or A-Trainer
There are a few different trainer battle types I will make a list.

List of trainerbattle types

trainerbattle 0x00
trainerbattle 0x01
trainerbattle 0x03
trainerbattle 0x09

#org $script
lock
faceplayer
trainerbattle 0x00 0xPET or A-Trainer number $aha $own
$aha 1 = I see you battle!
$own 1 = you beat me.
boxset 6
release
end

#org $script
lock
faceplayer
trainerbattle 0x01 0xPET or A-Trainer number $aha $own
$aha 1 = I see you battle!
$own 1 = you beat me.
message $later
$later 1 = You are good.
boxset 6
release
end

#org $more
message $more1
$more 1 = Billy!
boxset 6
release
end


#org $script
lock
faceplayer
trainerbattle 0x03 0xPET or A-Trainer number $own
$own 1 = you beat me.
message $later
$later 1 = You are good.
boxset 6
release
end


#org $script
lock
faceplayer
trainerbattle 0x09 0xPET or A-Trainer number $own $beat
$own 1 = you beat me.
$beat 1 = I won yeah!
boxset 6
release
end

A-Trainer
Recap Time
New command trainerbattle which is pretty self-explanatory.

STEP 7 Wild Pokemon Battles
This script is a little long but makes your hack a lot more fun.

#org $script
lock
faceplayer
cry 0xA1 1
#raw 0x33
pause 0x30
message $bio
$bio 1 = I am a BULBASAUR!
boxset 6
wildbattle 1 5 0
pause 0x70
fadescreen 1
removesprite 0x800F
setflag 0x1200
pause 0x10
fadescreen 0
release
end

Recap Time
Cry 0xA1 says we are going to play a cry. Then after cry 0xA1 you put the pokemon number. Then you put #raw 0x33 which tells the game to finish the cry. Then you put a little pause. Then your message for what they are to say before the battle but this is not needed. Then wildbattle. After wildbattle you put pokemon number then the level and the third number tells the game whether or not it is a legendary 0 for normal 1 for legendary. Then a pause then fadescreen which turns the screen black or white then you put removesprite 0x800F which removes the sprite that last played a part in the event. Set your flag fadescreen again to bring the screen back and release end.

STEP 8 Script Boxes

#org $script
jingle
message $talk
$talk 1 = I will move
boxset 6
applymovement person number $move
$move 1 ; #binary 0x12 0xFE
pausemove 0x0000
setflag 0x1200
setvar 0x6000 0x0001
release
end


Set unknow to 3
and set your var

Recap Time
Jingle stops all movement. Then you setflag so the event does not happen again and you have to put a var number for the script box.

STEP 9 Weather
Spoiler:


#org $script
setweather 0x4
nop
doweather
release
end

Recap Time
Setweather tells the game which weather to do. Nop does absolutely nothing nut is needed. Doweather does the weather a no bainer.

Special Commands

#define SPECIAL_HEALPKMN 0x0
#define SPECIAL_CHOOSEPOKEMON 0x9C
#define SPECIAL_PKMNCATCH 0x9D
\v\h01 makes it say player name
\v\h06 makes it say rival name
\hb0 makes it say ......................

STEP 10 Move Camera

#org $script
jingle
special 0x113
applymovement 0x7F $move
$move 1 ; #binary 0x13 0xFE
pausemove 0x0000
applymovement 0x7F $goback
$goback 1 ; #binary 0x12 0xFE
pausemove 0x0000
special 0x114
setvar 0x6000 0x0001
release
end

Recap Time
Special 0x113 tells the game we are making the camera move. Applymovement 0x7F makes the camera move. Then special 0x114 tells the game no more move camera. If you ndo not want the event to happen again set your flag.

This is the end of my Tutorial. I hope you can now make a script. This tutorial belongs to me do not take anything without my permission.
 

Tropical Sunlight

The Faltine
3,476
Posts
16
Years
A Pokescript tutorial in the age of XSE.
There's nothing wrong with the tutorial, except that Pokescript is really outdated.
 

Souls1996

The guy who loves Eevees
25
Posts
15
Years
how will i make a trainer that has radius?
pls help!

Just write a normal Trainer Script. Then when you put the offset in on Advance Map, Check off the "Trainer" Box. Then under that change the "View radius" to how ever far you want the Trainer to see.
 
7
Posts
14
Years
  • Seen Aug 24, 2010
I tried this script and it' not working: #org $script lock faceplayer message $talk $talk 1 = Hi there. boxset 6 release end But, this script is working: #dyn 0x740000 #org @start lock faceplayer msgbox @text ' Hi there. callstd MSG_NORMAL release end #org @text = Hi there. What is the problem?
 
79
Posts
13
Years
  • Seen Aug 27, 2014
I have a lot of events in my hack and i was wondering how to make on script after another specific one. i have my game so far starting in kanto and you get your starter and the pokedex like normal but i want my script for oaks aide to give you the national dex exactly after you get the pokedex in oaks lab if somebody could help with this i would be very grateful!
 
79
Posts
13
Years
  • Seen Aug 27, 2014
How can i change the hex value to make that possible? i have hex workshop 6 what would i have to do?
 
Back
Top