Free Forums with no limits on posts or members.
zIFBoards - Free Forum Hosting
Welcome to Diamondpearlhacking. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Name:   Password:


 

 Foullump's Scripting Tutorial, Provided by DP Master...
DP Master
Posted: Oct 28 2007, 11:28 PM


hai
Group Icon

Group: Admin
Posts: 271
Member No.: 4
Joined: 30-September 07



Scripting Tutorial
I'm going to try making an easy-to-understand-tutorial.

All of this will be done on POKESCRIPT, the program created by Irish
Witch.
Note: This tutorial was transfered from pc, and may have a few text errors. But, the information is correct.


Now then, let's begin.

Starting Off

The first thing needed to know about scripting is how to write text.
It can't simply be written as "blah blah blah",
It needs to be written in a special format.

Let's just say for all intentional purposes, we want to say this text.


CODE
"Hello, my name is Joe. I am a pokemon trainer from Pallet
Town.



Now, we need to write it using slashes (\) and a certain character to
indicate where that is in the talking. Observe.

CODE
"Hello,\n my name is Joe.\pI am a pokemon trainer from
Pallet\nTown.  



You can see the "\n" and the "\p". \n represents something like
"continues on next half of box".
For example, it would look like:


CODE
Hello,
My name is Joe.



\p represents "new box"



CODE
Hello,
My name is Joe.


I am a pokemon trainer from Pallet
Town.



There is also "\l" which is kind of the same as \p, but you will notice
the difference when you actually make a script.

Now then, we seem to be done with that. Moving on.


Simple Script

For this tutorial, when I say simple script, I mean something not too
compicated, but still includes a little bit complication. (For
beginners)

Okay, when I say simple script, I always think of the professor Oak's
aid script.
It works like this:
-when you talk to the aid, he will say hello, and give you an item
(potion)

Now then, on to your first script.
To begin, we must open notepad, and type the following:


CODE
#ORG


That small bit of code represents the beginning of a script.
ALWAYS PUT THAT!

After that, place an offset.

CODE
$begin



It really does not matter what you write there, but I usually say
something like that.

Okay, so we want the aid to talk to you, so we have it say a message.
But before that, we need to put the following:

CODE
lock
faceplayer


The lock means that the character will not move around while they're
talking to you.
Faceplayer is self-explanitary. (Face the player)

So, on to the message.


CODE
message $aidtalk



(again, the offset does not matter.)

We shall have the aid say:


CODE
Oh, hello [PLAYER]. Here, take this potion!



[PLAYER] shows the name of the player.
HOWEVER
Only use [PLAYER] in a program called advance text.
When making an actual script, we use the offset "\v\h01" That will make
the name show up.
So, this is what it will look like:


CODE
message $aidtalk
$aidtalk 1 = Oh, hello \v\h01.\pHere, take this potion!
boxset 6




Okay, the "$aidtalk 1 = " is to represent that that offset is this
text.
The boxset 6 means that it is a normal text box.
(If you wanted a yes\no script, use boxset5)

Now, for the potion.
We will use the giveitem command to give it.
The offset for the item potion is

CODE
0xD


.
before using an offset for an item, song, pokemon, character, or warp,
use 0x.

So, we use

CODE
giveitem 0xD 1



The 1 just tells that we're getting 1 potion.

But there is one more thing we need. To prevent this event from being
repeated, we must use flags. Flags basicly tell whether or
not this has happened.
A flag is written in the form of: < 0xFLAG > Where it says FLAG, we
must replace it with a number. The numbers between 200-299, and 800-899
are okay to use.
EG. 0x200

But we can't simple write "flag 0x200", we need to say what about it we
want. Setflag, Clearflag, and Checkflag are the only things we can do.
(so far as I know) Setflag means that the player has done the event.

And, this is our complete script:



CODE
#ORG $begin
lock
faceplayer
checkflag 0x200
if B_true goto $done
message $aidtalk
boxset 6
giveitem 0xD
setflag 0x200
release
end

#org $done
message $aidtalk2
boxset 6
release
end

#org $aidtalk
$aidtalk 1 = Oh, hello \v\h01.\pHere, take this potion!

#org $aidtalk2
$aidtalk2 1 = Hello.  




The reason we put the aidtalk at the bottom is becuase it compiles
better, and there usually aren't any glitches. Do that with all of your
scripts. EVERYTHING WITH AN OFFSET $ GOES AT THE BOTTOM.

And that, is a simple script!
Now you can write it to your rom using pokescript.
(See Irish Witch's tutorial for explanation)

Now then, you have made your first simple script!

Now, let's get a little more complex.
We'll use this same script, just edit it.

Now, let's say we want the aid to be activated by instead of being
talked to, when the player steps in a certain spot. The way we will do this
is by adding "Applymovement" to our script. So, instead of putting
"Faceplayer" we will put "Applymovement".

Like this:

CODE
#ORG $begin
checkflag 0x200
if B_true goto $done
applymovement 0x01 $aidwalk1
pause 0x30
message $aidtalk
boxset 6
giveitem 0xD
setflag 0x200
release
end





Now, the fist thing you may notice is that we no longer have the Lock
command. The reason being is that is we lock the person, well, really he
can't move if we lock him.

Next, you'll notice that we put an 0x01 after applymovement. That
indicates that the person with the people number 1 in advance map will move.

Then we have our offset. It's just a randomly defined thing, as usual.

And last, we have our Pause 0x30. That represents that the script will
wait for the aid to take three steps before continuing. Use 0x10 to
represent one step, 0x20 for two, and 0x30 for three.

As usual, we have Release. Like any script, end it with release. If I
haven't already said it, END EVERY SCRIPT WITH
release
end

But just "Applymovement" won't do everything. We need to fill it in.

Here is a list of all the movements in fire red.




S
CODE
IZE=1]' Specials
0x4A ' Face player
0x4B ' Face against player
0x60 '  Disappear (removes the sprite, but the person can still be
interacted with)
0x62 ' "!" pops up
0x63 ' "?" pops up
0x64 ' "X" pops up (vs-seeker cant fight)
0x65 ' "!!" pops up (vs-seeker can fight)
0x66 ' "" pops up

' walking
0x01 ' step Up0
0x02 ' step Left0
0x03 ' step Right0
0x04 ' step Down0
0x08 ' step down1
0x09 ' step up1
0x0A ' step left1
0x0B ' step right1
0x0C ' step down2
0x0D ' step up2
0x0E ' step left2
0x0F ' step right2
0x10 ' step down3
0x11 ' step up3
0x12 ' step left3
0x13 ' step right3
0x1D ' step down4
0x1E ' step up4
0x1F ' step left4
0x20 ' step right4

' jump in place looking where it says
0x52 ' jump0 down
0x53 ' jump0 up
0x54 ' jump0 left
0x55 ' jump0 right

' jump in place looking in the order it says
0x56 ' jump0 down/up
0x57 ' jump0 up/down
0x58 ' jump0 left/right
0x59 ' jump0 right/left

' Jump Direction
0x4E ' jump1 down
0x4F ' jump1 up
0x50 ' jump1 left
0x51 ' jump1 right

0x14 ' jump2 down
0x15 ' jump2 up
0x16 ' jump2 left
0x17 ' jump2 right

0x46 ' jumpLookingLeft1 down
0x47 ' jumpLookingDown1 up (jump backwards)
0x48 ' jumpLookingUp1 left
0x49 ' jumpLookingLeft right (jump backwards)[/SIZE]




These are the offsets for basic movement:
CODE
UP = 0x11
DOWN = 0x10
LEFT = 0x12
RIGHT = 0x13

So, for this script, we'll have the aid move three steps right over to
the player.
And since we'll be using items, we'll need a list of them.




CODE
SIZE=1]
#define ITEM_MASTERBALL  0x1
#define ITEM_ULTRABALL  0x2
#define ITEM_GREATBALL  0x3
#define ITEM_POKEBALL  0x4
#define ITEM_SAFARIBALL  0x5
#define ITEM_NETBALL  0x6
#define ITEM_DIVEBALL  0x7
#define ITEM_NESTBALL  0x8
#define ITEM_REPEATBALL  0x9

#define ITEM_TIMERBALL  0xA
#define ITEM_LUXURYBALL  0xB
#define ITEM_PREMIERBALL 0xC
#define ITEM_POTION  0xD
#define ITEM_ANTIDOTE  0xE
#define ITEM_BURNHEAL  0xF
#define ITEM_ICEHEAL  0x10
#define ITEM_AWAKENING  0x11
#define ITEM_PARLYZHEAL  0x12

#define ITEM_FULLRESTORE 0x13
#define ITEM_MAXPOTION  0x14
#define ITEM_HYPERPOTION 0x15
#define ITEM_SUPERPOTION 0x16
#define ITEM_FULLHEAL  0x17
#define ITEM_REVIVE  0x18
#define ITEM_MAXREVIVE  0x19
#define ITEM_FRESHWATER  0x1A
#define ITEM_SODAPOP  0x1B

#define ITEM_LEMONADE  0x1C
#define ITEM_MOOMOOMILK  0x1D
#define ITEM_ENERGYPOWDER 0x1E
#define ITEM_ENERGYROOT  0x1F
#define ITEM_HEALPOWDER  0x20
#define ITEM_REVIVALHERB 0x21
#define ITEM_ETHER  0x22
#define ITEM_MAXETHER  0x23
#define ITEM_ELIXIR  0x24

#define ITEM_MAXELIXIR  0x25
#define ITEM_LAVACOOKIE  0x26
#define ITEM_BLUEFLUTE  0x27
#define ITEM_YELLOWFLUTE 0x28
#define ITEM_REDFLUTE  0x29
#define ITEM_BLACKFLUTE  0x2A
#define ITEM_WHITEFLUTE  0x2B
#define ITEM_BERRYJUICE  0x2C
#define ITEM_SACREDASH  0x2D

#define ITEM_SHOALSALT  0x2E
#define ITEM_SHOALSHELL  0x2F
#define ITEM_REDSHARD  0x30
#define ITEM_BLUESHARD  0x31
#define ITEM_YELLOWSHARD 0x32
#define ITEM_GREENSHARD  0x33
#define ITEM_HENTAIMAG  0x34
#define ITEM_NAMETAG  0x35
#define ITEM_HPUP  0x3F

#define ITEM_PROTEIN  0x40
#define ITEM_IRON  0x41
#define ITEM_CARBOS  0x42
#define ITEM_CALCIUM  0x43
#define ITEM_RARECANDY  0x44
#define ITEM_PPUP  0x45
#define ITEM_ZINC  0x46
#define ITEM_PPMAX  0x47
#define ITEM_GUARDSPEC.  0x49

#define ITEM_DIREHIT  0x4A
#define ITEM_XATTACK  0x4B
#define ITEM_XDEFEND  0x4C
#define ITEM_XSPEED  0x4D
#define ITEM_XACCURACY  0x4E
#define ITEM_XSPECIAL  0x4F
#define ITEM_POKEDOLL  0x50
#define ITEM_FLUFFYTAIL  0x51
#define ITEM_SUPERREPEL  0x53

#define ITEM_MAXREPEL  0x54
#define ITEM_ESCAPEROPE  0x55
#define ITEM_REPEL  0x56
#define ITEM_SUNSTONE  0x5D
#define ITEM_MOONSTONE  0x5E
#define ITEM_FIRESTONE  0x5F
#define ITEM_THUNDERSTONE 0x60
#define ITEM_WATERSTONE  0x61
#define ITEM_LEAFSTONE  0x62

#define ITEM_TINYMUSHROOM 0x67
#define ITEM_BIGMUSHROOM 0x68
#define ITEM_PEARL  0x6A
#define ITEM_BIGPEARL  0x6B
#define ITEM_STARDUST  0x6C
#define ITEM_STARPIECE  0x6D
#define ITEM_NUGGET  0x6E
#define ITEM_HEARTSCALE  0x6F
#define ITEM_ORANGEMAIL  0x79

#define ITEM_HARBORMAIL  0x7A
#define ITEM_GLITTERMAIL 0x7B
#define ITEM_MECHMAIL  0x7C
#define ITEM_WOODMAIL  0x7D
#define ITEM_WAVEMAIL  0x7E
#define ITEM_BEADMAIL  0x7F
#define ITEM_SHADOWMAIL  0x80
#define ITEM_TROPICMAIL  0x81
#define ITEM_DREAMMAIL  0x82

#define ITEM_FABMAIL  0x83
#define ITEM_RETROMAIL  0x84
#define ITEM_CHERRY  0x85
#define ITEM_CHESTNUT  0x86
#define ITEM_PEACH  0x87
#define ITEM_RAWSTBERRY  0x88
#define ITEM_ASPEARBERRY 0x89
#define ITEM_LEPPABERRY  0x8A
#define ITEM_ORANGE  0x8B

#define ITEM_PERSIMMON  0x8C
#define ITEM_LUMBERRY  0x8D
#define ITEM_CITRUS  0x8E
#define ITEM_FIGYBERRY  0x8F
#define ITEM_KIWI  0x90
#define ITEM_MANGO  0x91
#define ITEM_AGUAVBERRY  0x92
#define ITEM_PAPAYA  0x93
#define ITEM_RAZZBERRY  0x94

#define ITEM_BLUKBERRY  0x95
#define ITEM_BANANA  0x96
#define ITEM_WEPEARBERRY 0x97
#define ITEM_PINEAPPLE  0x98
#define ITEM_POMEGRANITE 0x99
#define ITEM_KELPSYBERRY 0x9A
#define ITEM_QUALOTBERRY 0x9B
#define ITEM_HONEYDEW  0x9C
#define ITEM_GRAPE  0x9D

#define ITEM_TOMATO  0x9E
#define ITEM_CORNNBERRY  0x9F
#define ITEM_MAGOSTBERRY 0xA0
#define ITEM_RABUTABERRY 0xA1
#define ITEM_LEMON  0xA2
#define ITEM_SPELONBERRY 0xA3
#define ITEM_PAMTREBERRY 0xA4
#define ITEM_WATERMELON  0xA5
#define ITEM_DURINBERRY  0xA6

#define ITEM_BELUEBERRY  0xA7
#define ITEM_LICHEE  0xA8
#define ITEM_GANLONBERRY 0xA9
#define ITEM_SALACBERRY  0xAA
#define ITEM_PETAYABERRY 0xAB
#define ITEM_APRICOT  0xAC
#define ITEM_LANSATBERRY 0xAD
#define ITEM_STARFBERRY  0xAE
#define ITEM_ENIGMABERRY 0xAF

#define ITEM_BRIGHTPOWDER 0xB3
#define ITEM_WHITEHERB  0xB4
#define ITEM_MACHOBRACE  0xB5
#define ITEM_EXP.SHARE  0xB6
#define ITEM_QUICKCLAW  0xB7
#define ITEM_SOOTHEBELL  0xB8
#define ITEM_MENTALHERB  0xB9
#define ITEM_CHOICEBAND  0xBA
#define ITEM_KINGSROCK  0xBB

#define ITEM_SILVERPOWDER 0xBC
#define ITEM_AMULETCOIN  0xBD
#define ITEM_CLEANSETAG  0xBE
#define ITEM_SOULDEW  0xBF
#define ITEM_DEEPSEATOOTH 0xC0
#define ITEM_DEEPSEASCALE 0xC1
#define ITEM_SMOKEBALL  0xC2
#define ITEM_EVERSTONE  0xC3
#define ITEM_FOCUSBAND  0xC4

#define ITEM_LUCKYEGG  0xC5
#define ITEM_SCOPELENS  0xC6
#define ITEM_METALCOAT  0xC7
#define ITEM_LEFTOVERS  0xC8
#define ITEM_DRAGONSCALE 0xC9
#define ITEM_LIGHTBALL  0xCA
#define ITEM_SOFTSAND  0xCB
#define ITEM_HARDSTONE  0xCC
#define ITEM_MIRACLESEED 0xCD

#define ITEM_BLACKGLASSES 0xCE
#define ITEM_BLACKBELT  0xCF
#define ITEM_MAGNET  0xD0
#define ITEM_MYSTICWATER 0xD1
#define ITEM_SHARPBEAK  0xD2
#define ITEM_POISONBARB  0xD3
#define ITEM_NEVERMELTICE 0xD4
#define ITEM_SPELLTAG  0xD5
#define ITEM_TWISTEDSPOON 0xD6

#define ITEM_CHARCOAL  0xD7
#define ITEM_DRAGONFANG  0xD8
#define ITEM_SILKSCARF  0xD9
#define ITEM_UPGRADE  0xDA
#define ITEM_SHELLBELL  0xDB
#define ITEM_SEAINCENSE  0xDC
#define ITEM_LAXINCENSE  0xDD
#define ITEM_LUCKYPUNCH  0xDE
#define ITEM_METALPOWDER 0xDF

#define ITEM_THICKCLUB  0xE0
#define ITEM_STICK  0xE1
#define ITEM_REDSCARF  0xFE
#define ITEM_BLUESCARF  0xFF
#define ITEM_PINKSCARF  0x100
#define ITEM_GREENSCARF  0x101
#define ITEM_YELLOWSCARF 0x102
#define ITEM_SKATEBOARD1 0x103
#define ITEM_COINCASE  0x104

#define ITEM_ITEMFINDER  0x105
#define ITEM_OLDROD  0x106
#define ITEM_GOODROD  0x107
#define ITEM_SUPERROD  0x108
#define ITEM_S.S.TICKET  0x109
#define ITEM_CONTESTPASS 0x10A
#define ITEM_SQUIRTBOTTLE 0x10C
#define ITEM_AMULET  0x10D
#define ITEM_SOOTSACK  0x10E

#define ITEM_BASEMENTKEY 0x10F
#define ITEM_SKATEBOARD2 0x110
#define ITEM_POROKCASE  0x111
#define ITEM_LETTER  0x112
#define ITEM_EONTICKET  0x113
#define ITEM_REDORB  0x114
#define ITEM_BLUEORB  0x115
#define ITEM_SCANNER  0x116
#define ITEM_GOGOGGLES  0x117

#define ITEM_METEORITE  0x118
#define ITEM_RM1KEY  0x119
#define ITEM_RM2KEY  0x11A
#define ITEM_RM4KEY  0x11B
#define ITEM_RM6KEY  0x11C
#define ITEM_STORAGEKEY  0x11D
#define ITEM_ROOTFOSSIL  0x11E
#define ITEM_CLAWFOSSIL  0x11F
#define ITEM_DEVONSCOPE  0x120

#define ITEM_TM01  0x121
#define ITEM_TM02  0x122
#define ITEM_TM03  0x123
#define ITEM_TM04  0x124
#define ITEM_TM05  0x125
#define ITEM_TM06  0x126
#define ITEM_TM07  0x127
#define ITEM_TM08  0x128
#define ITEM_TM09  0x129

#define ITEM_TM10  0x12A
#define ITEM_TM11  0x12B
#define ITEM_TM12  0x12C
#define ITEM_TM13  0x12D
#define ITEM_TM14  0x12E
#define ITEM_TM15  0x12F
#define ITEM_TM16  0x130
#define ITEM_TM17  0x131
#define ITEM_TM18  0x132

#define ITEM_TM19  0x133
#define ITEM_TM20  0x134
#define ITEM_TM21  0x135
#define ITEM_TM22  0x136
#define ITEM_TM23  0x137
#define ITEM_TM24  0x138
#define ITEM_TM25  0x139
#define ITEM_TM26  0x13A
#define ITEM_TM27  0x13B

#define ITEM_TM28  0x13C
#define ITEM_TM29  0x13D
#define ITEM_TM30  0x13E
#define ITEM_TM31  0x13F
#define ITEM_TM32  0x140
#define ITEM_TM33  0x141
#define ITEM_TM34  0x142
#define ITEM_TM35  0x143
#define ITEM_TM36  0x144

#define ITEM_TM37  0x145
#define ITEM_TM38  0x146
#define ITEM_TM39  0x147
#define ITEM_TM40  0x148
#define ITEM_TM41  0x149
#define ITEM_TM42  0x14A
#define ITEM_TM43  0x14B
#define ITEM_TM44  0x14C
#define ITEM_TM45  0x14D

#define ITEM_TM46  0x14E
#define ITEM_TM47  0x14F
#define ITEM_TM48  0x150
#define ITEM_TM49  0x151
#define ITEM_TM50  0x152
#define ITEM_HM01  0x153
#define ITEM_HM02  0x154
#define ITEM_HM03  0x155
#define ITEM_HM04  0x156

#define ITEM_HM05  0x157
#define ITEM_HM06  0x158
#define ITEM_HM07  0x159
#define ITEM_HM08  0x15A



As we see, potion is 0xD

It will look like this:



CODE
#ORG $begin
checkflag 0x200
if B_true goto $done
applymovement 0x01 $aidwalk1
pause 0x30
message $aidtalk
boxset 6
giveitem 0xD
setflag 0x200
release
end

#org $done
release
end

#org $aidwalk1
$aidwalk1 1; #binary 0x13 0x13 0x13 0xFE

#org $aidtalk
$aidtalk 1 = Oh, hello \v\h01.\pHere, take this potion!





At this point, you may be a little confused. We put the 1 for the same
reason that we do in a text script.

The simicolon ( is the same thing as and equals. (=) We just use
simicolons in movement scripts.

The #binary is just how we begin a list of movements. EG. 0x13 0x13
0x13

And last, the 0xFE. That's how we end a list of movements. 0x13 0x13
0x13 0xfe
IT MUST BE AT THE END OF EVERY LIST OF MOVEMENTS.

You may aso be wondering why we changed the $done sequence to just a
release end.
The reason for that is because now, we're not talking to the aid. We're
stepping on a certain point on the map that will activate the script.
And we don't want for it to be that we step in the spot and all of the
sudden, the text "Hello" shows up on the screen! So, we just replace it
with release, and end. That will make it so nothing happens when we
step there.

Now it's done! The event with the number 1 will move. Just set this
script in advance map, and for the var values, put 03 in the fist one, 50
in the third one, and 40 in the fourth one. That will make your script
run correctly.


Follow me Script
Those simple commands are nice and all, but a game gets boring when you
use all simple scripts. So, let's get a little more difficult.

Let's take for example, one of the fist scripts in gold & silver. The
one where if you try to leave, the lady, Mary I think, will walk over to
you and stop you and make you come with her back to her original
location until you see the professor. And when this script happens, the
follow me song plays.

The way that this is done, would look kinda like this.


CODE
checkflag 0x200
if B_true goto $done
playsound 0x13B
#raw 0x33
applymovement 0x01 $mw1
pause 0x50
message $mt1
boxset 6
applymovement 0x01 $mw2
applymovement 0xFF $mw2
pause 0x50
fadesound
release
end



So, there's our music script. Applymovement 0xFF will move the player.
We have $mw2 for the player's move because we want the player to follow
mary, so we give it the same movement. The #raw 0x33 after playsound
is there just to prevent the game from freezing. And just for your
knowledge, 'fadesound' makes the song fade to the map's original song. If
you don't put fadesound, the song will continue playing even when the
script ends.

For everyone reading the tutorial, if you want an actual follow me
script, you can use this.



CODE
#org $begin
checkflag 0x200
if B_true goto $done
playsound 0x13B
#raw 0x33
applymovement 0x01 $mw1
pause 0x50
message $mt1
boxset 6
applymovement 0x01 $mw2
applymovement 0xFF $mw2
pause 0x50
fadesound
release
end

#org $done
release
end

#org $mw1
$mw1; #binary 0x12 0x12 0x12 0x12 0x12 0xFE SIZE=1]left left left
left left[/SIZE]

#org $mt1
$mt1 1 = Hold on, \v\h01!\nProf. Elm wants to see you!

#org $mw2
$mw2 1; #binary 0x13 0x13 0x13 0x13 0x13 0xFE SIZE=1]Right right
right right right[/SIZE]


You can compile that into your game, and it will work.
Just take out the 'right's and 'left's

.......well..... what now?........ I guess a really complex script....
But, what else is there to cover?.....
Have I mentioned giving pokemon?.....
No, I don't think I have.

Very well, Giving Pokemon
First, we need our list of pokemon.




CODE
#define PKMN_MISSINGNO 0

'.-------------------------.
'|         KANTO           |
''-------------------------'
#define PKMN_BULBASAUR 1
#define PKMN_IVYSAUR 2
#define PKMN_VENUSAUR 3
#define PKMN_CHARMANDER 4
#define PKMN_CHARMELEON 5
#define PKMN_CHARIZARD 6
#define PKMN_SQUIRTLE 7
#define PKMN_WARTORTLE 8
#define PKMN_BLASTOISE 9
#define PKMN_CATERPIE 10
#define PKMN_METAPOD 11
#define PKMN_BUTTERFREE 12
#define PKMN_WEEDLE 13
#define PKMN_KAKUNA 14
#define PKMN_BEEDRILL 15
#define PKMN_PIDGEY 16
#define PKMN_PIDGEOTTO 17
#define PKMN_PIDGEOT 18
#define PKMN_RATTATA 19
#define PKMN_RATICATE 20
#define PKMN_SPEAROW 21
#define PKMN_FEAROW 22
#define PKMN_EKANS 23
#define PKMN_ARBOK 24
#define PKMN_PIKACHU 25

#define PKMN_RAICHU 26
#define PKMN_SANDSHREW 27
#define PKMN_SANDSLASH 28
#define PKMN_NIDORAN_F 29
#define PKMN_NIDORINA 30
#define PKMN_NIDOQUEEN 31
#define PKMN_NIDORAN_M 32
#define PKMN_NIDORINO 33
#define PKMN_NIDOKING 34
#define PKMN_CLEFAIRY 35
#define PKMN_CLEFABLE 36
#define PKMN_VULPIX 37
#define PKMN_NINETALES 38
#define PKMN_JIGGLYPUFF 39
#define PKMN_WIGGLYTUFF 40
#define PKMN_ZUBAT 41
#define PKMN_GOLBAT 42
#define PKMN_ODDISH 43
#define PKMN_GLOOM 44
#define PKMN_VILEPLUME 45
#define PKMN_PARAS 46
#define PKMN_PARASECT 47
#define PKMN_VENONAT 48
#define PKMN_VENOMOTH 49
#define PKMN_DIGLETT 50

#define PKMN_DUGTRIO 51
#define PKMN_MEOWTH 52
#define PKMN_PERSIAN 53
#define PKMN_PSYDUCK 54
#define PKMN_GOLDUCK 55
#define PKMN_MANKEY 56
#define PKMN_PRIMEAPE 57
#define PKMN_GROWLITHE 58
#define PKMN_ARCANINE 59
#define PKMN_POLIWAG 60
#define PKMN_POLIWHIRL 61
#define PKMN_POLIWRATH 62
#define PKMN_ABRA 63
#define PKMN_KADABRA 64
#define PKMN_ALAKAZAM 65
#define PKMN_MACHOP 66
#define PKMN_MACHOKE 67
#define PKMN_MACHAMP 68
#define PKMN_BELLSPROUT 69
#define PKMN_WEEPINBELL 70
#define PKMN_VICTREEBEL 71
#define PKMN_TENTACOOL 72
#define PKMN_TENTACRUEL 73
#define PKMN_GEODUDE 74
#define PKMN_GRAVELER 75

#define PKMN_GOLEM 76
#define PKMN_PONYTA 77
#define PKMN_RAPIDASH 78
#define PKMN_SLOWPOKE 79
#define PKMN_SLOWBRO 80
#define PKMN_MAGNEMITE 81
#define PKMN_MAGNETON 82
#define PKMN_FARFETCHED 83
#define PKMN_DODUO 84
#define PKMN_DODRIO 85
#define PKMN_SEEL 86
#define PKMN_DEWGONG 87
#define PKMN_GRIMER 88
#define PKMN_MUK 89
#define PKMN_SHELLDER 90
#define PKMN_CLOYSTER 91
#define PKMN_GASTLY 92
#define PKMN_HAUNTER 93
#define PKMN_GENGAR 94
#define PKMN_ONIX 95
#define PKMN_DROWZEE 96
#define PKMN_HYPNO 97
#define PKMN_KRABBY 98
#define PKMN_KINGLER 99
#define PKMN_VOLTORB 100

#define PKMN_ELECTRODE 101
#define PKMN_EXEGGCUTE 102
#define PKMN_EXEGGUTOR 103
#define PKMN_CUBONE 104
#define PKMN_MAROWAK 105
#define PKMN_HITMONLEE 106
#define PKMN_HITMONCHAN 107
#define PKMN_LICKITUNG 108
#define PKMN_KOFFING 109
#define PKMN_WEEZING 110
#define PKMN_RHYHORN 111
#define PKMN_RHYDON 112
#define PKMN_CHANSEY 113
#define PKMN_TANGELA 114
#define PKMN_KANGASKHAN 115
#define PKMN_HORSEA 116
#define PKMN_SEADRA 117
#define PKMN_GOLDEEN 118
#define PKMN_SEAKING 119
#define PKMN_STARYU 120
#define PKMN_STARMIE 121
#define PKMN_MR_MIME 122
#define PKMN_SCYTHER 123
#define PKMN_JYNX 124
#define PKMN_ELECTABUZZ 125

#define PKMN_MAGMAR 126
#define PKMN_PINSIR 127
#define PKMN_TAUROS 128
#define PKMN_MAGIKARP 129
#define PKMN_GYARADOS 130
#define PKMN_LAPRAS 131
#define PKMN_DITTO 132
#define PKMN_EEVEE 133
#define PKMN_VAPOREON 134
#define PKMN_JOLTEON 135
#define PKMN_FLAREON 136
#define PKMN_PORYGON 137
#define PKMN_OMANYTE 138
#define PKMN_OMASTAR 139
#define PKMN_KABUTO 140
#define PKMN_KABUTOPS 141
#define PKMN_AERODACTYL 142
#define PKMN_SNORLAX 143
#define PKMN_ARTICUNO 144
#define PKMN_ZAPDOS 145
#define PKMN_MOLTRES 146
#define PKMN_DRATINI 147
#define PKMN_DRAGONAIR 148
#define PKMN_DRAGONITE 149
#define PKMN_MEWTWO 150

#define PKMN_MEW 151

'.-------------------------.
'|         JOHTO           |
''-------------------------'
#define PKMN_CHIKORITA 152
#define PKMN_BAYLEEF 153
#define PKMN_MEGANIUM 154
#define PKMN_CYNDAQUIL 155
#define PKMN_QUILAVA 156
#define PKMN_TYPHLOSION 157
#define PKMN_TOTODILE 158
#define PKMN_CROCONAW 159
#define PKMN_FERALIGATR 160
#define PKMN_SENTRET 161
#define PKMN_FURRET 162
#define PKMN_HOOTHOOT 163
#define PKMN_NOCTOWL 164
#define PKMN_LEDYBA 165
#define PKMN_LEDIAN 166
#define PKMN_SPINARAK 167
#define PKMN_ARIADOS 168
#define PKMN_CROBAT 169
#define PKMN_CHINCHOU 170
#define PKMN_LANTURN 171
#define PKMN_PICHU 172
#define PKMN_CLEFFA 173
#define PKMN_IGGLYBUFF 174
#define PKMN_TOGEPI 175

#define PKMN_TOGETIC 176
#define PKMN_NATU 177
#define PKMN_XATU 178
#define PKMN_MAREEP 179
#define PKMN_FLAAFFY 180
#define PKMN_AMPHAROS 181
#define PKMN_BELLOSSOM 182
#define PKMN_MARILL 183
#define PKMN_AZUMARILL 184
#define PKMN_SUDOWOODO 185
#define PKMN_POLITOED 186
#define PKMN_HOPPIP 187
#define PKMN_SKIPLOOM 188
#define PKMN_JUMPLUFF 189
#define PKMN_AIPOM 190
#define PKMN_SUNKERN 191
#define PKMN_SUNFLORA 192
#define PKMN_YANMA 193
#define PKMN_WOOPER 194
#define PKMN_QUAGSIRE 195
#define PKMN_ESPEON 196
#define PKMN_UMBREON 197
#define PKMN_MURKROW 198
#define PKMN_SLOWKING 199
#define PKMN_MISDREAVUS 200

#define PKMN_UNOWN 201
#define PKMN_WOBBUFFET 202
#define PKMN_GIRAFARIG 203
#define PKMN_PINECO 204
#define PKMN_FORRETRESS 205
#define PKMN_DUNSPARCE 206
#define PKMN_GLIGAR 207
#define PKMN_STEELIX 208
#define PKMN_SNUBBULL 209
#define PKMN_GRANBULL 210
#define PKMN_QWILFISH 211
#define PKMN_SCIZOR 212
#define PKMN_SHUCKLE 213
#define PKMN_HERACROSS 214
#define PKMN_SNEASEL 215
#define PKMN_TEDDIURSA 216
#define PKMN_URSARING 217
#define PKMN_SLUGMA 218
#define PKMN_MAGCARGO 219
#define PKMN_SWINUB 220
#define PKMN_PILOSWINE 221
#define PKMN_CORSOLA 222
#define PKMN_REMORAID 223
#define PKMN_OCTILLERY 224
#define PKMN_DELIBIRD 225

#define PKMN_MANTINE 226
#define PKMN_SKARMORY 227
#define PKMN_HOUNDOUR 228
#define PKMN_HOUNDOOM 229
#define PKMN_KINGDRA 230
#define PKMN_PHANPY 231
#define PKMN_DONPHAN 232
#define PKMN_PORYGON2 233
#define PKMN_STANTLER 234
#define PKMN_SMEARGLE 235
#define PKMN_TYROGUE 236
#define PKMN_HITMONTOP 237
#define PKMN_SMOOCHUM 238
#define PKMN_ELEKID 239
#define PKMN_MAGBY 240
#define PKMN_MILTANK 241
#define PKMN_BLISSEY 242
#define PKMN_RAIKOU 243
#define PKMN_ENTEI 244
#define PKMN_SUICUNE 245
#define PKMN_LARVITAR 246
#define PKMN_PUPITAR 247
#define PKMN_TYRANITAR 248
#define PKMN_LUGIA 249
#define PKMN_HO-OH 250

#define PKMN_CELEBI 251

'.-------------------------.
'|         HOENN           |
''-------------------------'
#define PKMN_TREECKO 277
#define PKMN_GROVYLE 278
#define PKMN_SCEPTILE 279
#define PKMN_TORCHIC 280
#define PKMN_COMBUSKEN 281
#define PKMN_BLAZIKEN 282
#define PKMN_MUDKIP 283
#define PKMN_MARSHTOMP 284
#define PKMN_SWAMPERT 285
#define PKMN_POOCHYENA 286
#define PKMN_MIGHTYENA 287
#define PKMN_ZIGZAGOON 288
#define PKMN_LINOONE 289
#define PKMN_WURMPLE 290
#define PKMN_SILCOON 291
#define PKMN_BEAUTIFLY 292
#define PKMN_CASCOON 293
#define PKMN_DUSTOX 294
#define PKMN_LOTAD 295
#define PKMN_LOMBRE 296
#define PKMN_LUDICOLO 297
#define PKMN_SEEDOT 298
#define PKMN_NUZLEAF 299
#define PKMN_SHIFTRY 300

#define PKMN_NINCADA 301
#define PKMN_NINJASK 302
#define PKMN_SHEDINJA 303
#define PKMN_TAILLOW 304
#define PKMN_SWELLOW 305
#define PKMN_SHROOMISH 306
#define PKMN_BRELOOM 307
#define PKMN_SPINDA 308
#define PKMN_WINGULL 309
#define PKMN_PELIPPER 310
#define PKMN_SURSKIT 311
#define PKMN_MASQUERAIN 312
#define PKMN_WAILMER 313
#define PKMN_WAILORD 314
#define PKMN_SKITTY 315
#define PKMN_DELCATTY 316
#define PKMN_KECLEON 317
#define PKMN_BALTOY 318
#define PKMN_CLAYDOL 319
#define PKMN_NOSEPASS 320
#define PKMN_TORKOAL 321
#define PKMN_SABLEYE 322
#define PKMN_BARBOACH 323
#define PKMN_WHISCASH 324
#define PKMN_LUVDISC 325

#define PKMN_CORPHISH 326
#define PKMN_CRAWDAUNT 327
#define PKMN_FEEBAS 328
#define PKMN_MILOTIC 329
#define PKMN_CARVANHA 330
#define PKMN_SHARPEDO 331
#define PKMN_TRAPINCH 332
#define PKMN_VIBRAVA 333
#define PKMN_FLYGON 334
#define PKMN_MAKUHITA 335
#define PKMN_HARIYAMA 336
#define PKMN_ELECTRIKE 337
#define PKMN_MANECTRIC 338
#define PKMN_NUMEL 339
#define PKMN_CAMERUPT 340
#define PKMN_SPHEAL 341
#define PKMN_SEALEO 342
#define PKMN_WALREIN 343
#define PKMN_CACNEA 344
#define PKMN_CACTURNE 345
#define PKMN_SNORUNT 346
#define PKMN_GLALIE 347
#define PKMN_LUNATONE 348
#define PKMN_SOLROCK 349
#define PKMN_AZURILL 350

#define PKMN_SPOINK 351
#define PKMN_GRUMPIG 352
#define PKMN_PLUSLE 353
#define PKMN_MINUN 354
#define PKMN_MAWILE 355
#define PKMN_MEDITITE 356
#define PKMN_MEDICHAM 357
#define PKMN_SWABLU 358
#define PKMN_ALTARIA 359
#define PKMN_WYNAUT 360
#define PKMN_DUSKULL 361
#define PKMN_DUSCLOPS 362
#define PKMN_ROSELIA 363
#define PKMN_SLAKOTH 364
#define PKMN_VIGOROTH 365
#define PKMN_SLAKING 366
#define PKMN_GULPIN 367
#define PKMN_SWALOT 368
#define PKMN_TROPIUS 369
#define PKMN_WHISMUR 370
#define PKMN_LOUDRED 371
#define PKMN_EXPLOUD 372
#define PKMN_CLAMPERL 373
#define PKMN_HUNTAIL 374
#define PKMN_GOREBYSS 375

#define PKMN_ABSOL 376
#define PKMN_SHUPPET 377
#define PKMN_BANETTE 378
#define PKMN_SEVIPER 379
#define PKMN_ZANGOOSE 380
#define PKMN_RELICANTH 381
#define PKMN_ARON 382
#define PKMN_LAIRON 383
#define PKMN_AGGRON 384
#define PKMN_CASTFORM 385
#define PKMN_VOLBEAT 386
#define PKMN_ILLUMISE 387
#define PKMN_LILEEP 388
#define PKMN_CRADILY 389
#define PKMN_ANORITH 390
#define PKMN_ARMALDO 391
#define PKMN_RALTS 392
#define PKMN_KIRLIA 393
#define PKMN_GARDEVOIR 394
#define PKMN_BAGON 395
#define PKMN_SHELGON 396
#define PKMN_SALAMENCE 397
#define PKMN_BELDUM 398
#define PKMN_METANG 399
#define PKMN_METAGROSS 400

#define PKMN_REGIROCK 401
#define PKMN_REGICE 402
#define PKMN_REGISTEEL 403
#define PKMN_KYOGRE 404
#define PKMN_GROUDON 405
#define PKMN_RAYQUAZA 406
#define PKMN_LATIAS 407
#define PKMN_LATIOS 408
#define PKMN_JIRACHI 409
#define PKMN_DEOXYS 410
#define PKMN_CHIMECHO 411




Okay, whew! There's our list.
So, if we want the player to recieve a pokemon from a certain pokemon,
we need to do it like this.
givepokemon 0x[pokemon] 0x[level] 0x[held item]
of course you need to fill in what I put in []
HOWEVER, IF YOU PUT 0x BEFORE YOUR NUMBER, YOUR RESULT MAY BE SOMETHING
OTHER THAN YOU EXPECTED.
I RECOMMEND JUST PUTTING THE PLAIN NUMBER OF THE POKEMON.
givepokemon 394 50 8B
That will give me a level 50 gardevoir that's holding an oran berry.




Sample:

CODE
#org $begin
lock
faceplayer
checkflag 0x232
if B_true goto $gotit
message $q
boxset 6
givepokemon 398 5 0
setflag 0x232
release
end

#org $gotit
message $hi
boxset 6
release
end

#org $hi
$hi 1 = Hello, how's my old BELDUM?

#org $q
$q 1 = I have this BELDUM, but I feel\nlike a lousy TRAINER.\pYou can
have it.



And that's how you do a givepokemon script. Note: Generally, you will
want to put the command 'givepokemon' towards the end of the script to
ensure success.
Also: When you get the pokemon, there will not be a small message
saying "You obtained a Squirtle" or anything like that. If

you want that, you should make a message saying that.
And for now, I suppose that's it.
I already have a tutorial on trainer battles, so maybe I don't need it
here.

Well, I guess.

Trainer Battles


CODE
Sample:

#org $go
trainerbattle 1 0x001 $before $after
message $beaten
boxset 6
release
end

#org $before
$before 1 = Let's battle!

#org $after
$after 1 = I lost...

#org $beaten
$beaten 1 = You already won, why are you\nstill bothering me?!




That script would be a perfect trainerbattle script. The '1' after
trainerbattle I just always put there. 0x001 is for the
PET ID of the trainer. $before is what the trainer says before the
fight, and $after is what they say when they lose. If you
want the script to continue after the battle, do this:




CODE
#org $go
trainerbattle 1 0x001 $before $after $further
message $beaten
boxset 6
release
end

#org $before
$before 1 = Let's battle!

#org $after
$after 1 = I lost...

#org $beaten
$beaten 1 = You already won, why are you\nstill bothering me?!

#org $further
message $beaten
boxset 6
release
end



You can pretty much do anything you want with the after sequence. Of
course, it does NOT NEED to be "further". It could be
anything you want.

So for now, that's my whole tutorial. If there's something I missed,
let me know, and I'll cover it.
Hope this helps!

Warping

To warp the player to another location, simply put the command:
CODE

warp 0x[map bank] 0x[map] 0x[warp]


However, the script will usually end after a warp is done.

Egg Script
To give the player an egg of a specific pokemon, the command is


CODE
#binary 31 72 00 67 EA C2 16 08 32 66 7A Pk2 Pk1



Replace the pk1&2 with the pokemon's hex number.



******************NOTICE******************

This tutuorial was made by Foullump, i DID NOT make this, i just posted it here to help people understand Scripting..

~~Scripting Tutorial ©2007 Foullump~~

This post has been edited by DP Master on Oct 28 2007, 11:35 PM
Top
loganmaster123
Posted: Oct 28 2007, 11:36 PM


Favored Member... I think...
Group Icon

Group: Members
Posts: 93
Member No.: 7
Joined: 30-September 07



Thanks for posting this! Now I can fulfill my dream to become a scripter.
Top
Hiidoran
Posted: Oct 29 2007, 12:37 AM


Site Owner
Group Icon

Group: Admin
Posts: 446
Member No.: 1
Joined: 15-September 07



Yes, I do believe this will help many new hackers! Congratulations on the tutorial DP.
Top
zIFBoards - Free Forum Hosting
Create a free forum in seconds.
Learn More · Register Now

Topic Options



Hosted for free by zIFBoards* (Terms of Use: Updated 2/10/2010) | Powered by Invision Power Board v1.3 Final © 2003 IPS, Inc.
Page creation time: 0.0628 seconds | Archive
Skin created by Tue of Self Concept.