PDA

View Full Version : [Tutorial] thethethethe's Scripting Tutorial


Pages : [1] 2

thethethethe
February 29th, 2008, 09:44 PM
thethethethe's Pokescript Scripting Tutorial

Do Not Take Without Permission

Before I begin, I'd like to give thanks, to Dabomstew, Irish Witch, Foullump, Earthsvisitor, Mastermind X, loading_NOW, score_under and The Rom Raiders team (namely Hackmew, D-Trough and Wuggles); for commands, that I've found out about through tutorials and programs, and even just asking things, thanks.
Now a little background into why I'm writing this. I wrote a scripting tutorial to post at Phcompany, and I was looking at it and I thought, WOW, this is really outdated. Some of the stuff, was even wrong. Then I looked over at PC, and I saw the stacks and stacks of scripting tutorials, all covering the same basic commands over and over and over again. So I decided I'll make ammends for my poor tutorial and fix it up with this new one, and also end the trend of scripting tutorials posting the same things over and over.
Also please note. I won't be including all commands, because first of all, not all are known, and second of all, I consider some of them useless. Ones I consider useless will NOT be included with an explanation.

I think since, it's a Pokescript tutorial, I should give a little info on Pokescript.
Pokescript is a program created by Irish Witch. This program is, in my opinion, easier to use than other scripting programs like scriptED and Diamond Cutter.
Some important features of Pokescript are:
Dynamic offsets
You don't need to assign the hex pointer. It will do that for you.
Option of Using Decimal and Hex Values.
To make it easier. Instead of having to use 0x64, you can just use 100. But remember, if "0x" is infront of the number, it's a hex number.

This tutorial is going to cover a lot in detail.
The way I'll explain everything is, to show a script at the beginning and then explain everything "new" after it.
Please note, because I prefer to hack Fire Red over Ruby, some scripts are written to suit Fire Red/Leaf Green, and NOT Ruby/Sappire/Emerald.

I think I'll start with pointers.

Pointers

Pokescript automatically assigns the script to the rom, therefore, unlike it's opposition; ScriptED and Diamond Cutter, you can just use a random name for each pointer.
So we can use any random name for the pointer. It could be, for example...
$aaaaaaa ; $hellomynameisthethethethe ; $1234567890
As long as there are no spaces in it, and pointers aren't "doubled up" the pointer will work.
So as an example these won't work
$a a a a a a ; $hello my name is thethethethe.

Message Script

Now I can move onto a normal message script.
#org $start
lock
faceplayer
message $1
boxset 6
release
end

#org $1
$1 1 =Hi.\nWelcome to my tutorial!I'll begin at the top of the script and work my way down.
#org $start marks the beginning of the script. It shows that it's the beginning.
lock will lock your player so that while this script is "in motion" the player won't be able to move.
faceplayer is used to make the sprite you are interacting with, face you.
message is used when you want a message to display on the screen. It is followed by a pointer that will be placed at the bottom as shown.
The actual message will appear like this.

Hi.
Welcome to my tutorial. I'll explain the other types, like \p and \l and others, a little later.

Now the boxset. Boxset MUST follow a message. Without this the message box, wont appear. In this case I've used boxset 6. I'll cover more later. boxset may also appear as callstd.
Now we use release. This will release the locked player.
And end will do what it's name says, and end the script.

Extra Message Info

There are lots of other little add ons that can be used with the message. Here's a short list, before I explain them.
\c
\h
\n
\l
\p
\vI'll go in order of this list.
\c usually refers to a colour.
So in this type of message
\c\h01\h02You recieved a PokemonWill appear in a black text. But there are some more colours.
Here's a short list.
Fire Red/Leaf Green
White - \c\h01\h00
Black - \c\h01\h02
Grey - \c\h01\h03
Red - \c\h01\h04
Orange - \c\h01\h05
Dark Green - \c\h01\h06
Cyan - \c\h01\h07
Blue - \c\h01\h08
Light Blue - \c\h01\h09
Ruby/Sapphire I'd assume that they work for Emerald too, but I haven't actually tested it yet.
White - \c\h01\h01
Red - \c\h01\h02
Grey - \c\h01\h03
Blue - \c\h01\h04
Black - \c\h01\h09
Pink - \c\h01\h0C
Brown - \c\h01\h0D

\h is used with hex values. Here's an example.
Here's \hB7100That \hB7 is the currency sign of the Pokemon world.
So in this example, I'm goint to use "$", here's an example.
Here's $100Here's a Table for all the hex codes of each symbol.
00=
01=À
02=Á
03=Â
04=Ç
05=È
06=É
07=Ê
08=Ë
09=Ì
0B=Î
0C=Ï
0D=Ò
0E=Ó
0F=Ô
10=Æ
11=Ù
12=Ú
13=Û
14=Ñ
15=ß
16=à
17=á
19=ç
1A=è
1B=é
1C=ê
1D=ë
1E=ì
20=î
21=ï
22=ò
23=ó
24=ô
25=æ
26=ù
27=ú
28=û
29=ñ
2A=º
2B=ª
2C=·
2D=&
2E=+
34=[Lv]
35==
36=;
51=¿
52=¡
53=[PK]
54=[MN]
55=[PO]
56=[Ke]
57=
58=[OC]
59=[K]
5A=Í
5B=%
5C=(
5D=)
68=â
6F=í
79=[U]
7A=[D]
7B=[L]
7C=[R]
A1=0
A2=1
A3=2
A4=3
A5=4
A6=5
A7=6
A8=7
A9=8
AA=9
AB=!
AC=?
AD=.
AE=-
AF=·
B0=[...]
B1="
B2=["]
B3='
B4=[']
B5=[m]
B6=[f]
B7=$
B8=,
B9=[x]
BA=/
BB=A
BC=B
BD=C
BE=D
BF=E
C0=F
C1=G
C2=H
C3=I
C4=J
C5=K
C6=L
C7=M
C8=N
C9=O
CA=P
CB=Q
CC=R
CD=S
CE=T
CF=U
D0=V
D1=W
D2=X
D3=Y
D4=Z
D5=a
D6=b
D7=c
D8=d
D9=e
DA=f
DB=g
DC=h
DD=i
DE=j
DF=k
E0=l
E1=m
E2=n
E3=o
E4=p
E5=q
E6=r
E7=s
E8=t
E9=u
EA=v
EB=w
EC=x
ED=y
EE=z
EF=[>]
F0=:
F1=Ä
F2=Ö
F3=Ü
F4=ä
F5=ö
F6=ü
F7=[u]
F8=[d]
F9=[l]
FA=\l
FB=\p
FC=\c
FD=\v
FE=\n
FF=\x

\n is used in text when we want to go to a new line. So in this message line.
Hi.\nWelcome.It would appear like this.

Hi.
Welcome.\l is used in text for a new line. But it can only be used after \n has already been used.
So in this message line.
Hi.\nWelcome home.\lPlease put your bags up-\lstairs.This will appear like this.

Hi.
Welcome home.
Please put your bags up-
stairs.\p is used when we want the text to continue in a new box. So in this message line.
...\p...\p...\pThat's Right!This will appear like this. An empty line means a new box.

...

...

...

That's Right!\v is used when we want display stored text. So here's an example.
Hi \v\h01!\n\v\h06 is looking for you.This would appear like this.
Hi [PLAYER'S NAME]
[RIVAL'S NAME] is looking for you.Flags

Before I continue. I'm going to just add something on flags.
Flags are very useful when you need an event to only occur once or if you want a person to disappear.
We can set a flag, and if we want an overworld, to dissappear we have to assign the set flag to the OW's, people ID in advancemap. But I'll go into more detail on that later.
Many flags are used within the game already. So if you plan on leaving scripts that are already in the rom, you'll need to be more careful on what flags you use, because flags can only really be used once.
If you want some flags that are not used in the rom as a start, here's a few. 0x200 - 0x29F, 500-79F, 1000-109F. But you'll find more if you experiment with them.

I'll have to do a bit of explaining here, so I'll start with preventing events to happen.
#org $start
lock
faceplayer
checkflag 0x200
if b_true goto $done
message $1
boxset 6
setflag 0x200
release
end

#org $done
message $2
boxset 6
clearflag 0x200
release
endWe've already covered lock and faceplayer, so we'll go to checkflag.
checkflag checks if a flag has been set. Checkflag is usually followed by an if line.
When using the if line after checkflag it contains either a b_true or b_false. b_true, meaning, that if the flag is set goto ${pointer}, and if not it will continue with the script. Similiarly, b_false checks if the flag is NOT set, and if it isn't it will goto ${pointer}, and if the flag is set, the script will continue without going to the pointer.
This pointer used in if b_true goto $done it points to another part of the script as you can see in the script.

As you can see the if b_true goto $done points to a different part of a script as shown with the #org $done
Here we have a message and a new command, clearflag.
Once flags are set they can be "unset" with the command clearflag.
Clearflag has to be followed by the flag number.
And here we are at the end of the script.

But there is more than one way to use a flag. Some flags have some sort of game function. I'll explain that in the next part.

Givepokemon

Givepokemon does exactly what it says. It gives the player a Pokemon. Here's my example script. There will be quite a few new commands here.
#org $start
checkflag 0x828
if b_true goto $done
message $1
boxset 5
compare LASTRESULT 0x1
if b_true goto $take
message $2
boxset 6
release
end

#org $take
givepokemon 4 5 0
fanfare 0x13E
message $3
boxset 4
waitfanfare
#raw 0x68
setflag 0x828
message $4
boxset 5
compare LASTRESULT 0x1
if b_true gosub $name
message $5
boxset 6
release
end

#org $name
call 0x1A74EB
return

#org $done
message $6
boxset 6
release
end

#org $1
$1 1 =I'm sorry, I can't take care\nof my Charmander.\pCan you take care of it for me?

#org $2
$2 1 =That's okay. I'm sure someone\nelse will take it.

#org $3
$3 1 =\c\h01\h02You received a Charmander!

#org $4
$4 1 =\c\h01\h02Would you like to rename Charmander?

#org $5
$5 1 =Take Care of Charmander.

#org $6
$6 1 =I hope you're taking good care of\nCharmander. Okay. There's a lot here I need to explain.
I guess I'll start from the top.

checkflag and the if line, we have already covered.
Message has also been covered, but boxset 5hasn't.
boxset 5 does a similar job to boxset 6, but this box also gives us the option of a Yes/No box on the screen aswell. Obviously this would be used if you want to ask someone a question.
boxset 5 is usually followed by a compare line.
compare needs the variable, which in this case is LASTRESULT and also a value, which in this case is 1.
LASTRESULT is a useful variable that most commands store values in.
When using compare after a boxset 5, you only have two options for the value, 0, which is NO and 1, which is YES.
This compare LASTRESULT 0x1, will check if you pressed YES and of course, compare LASTRESULT 0x0 will check if you pressed NO.
This if line that follows the compare line does the same thing as what it does for checkflag. if b_true will check if the button pressed matches the compared value and if it is, it will goto ${pointer} and if not, it will continue the script.
Then we have a Normal Message and the end of the script. So I'll now move onto the next part.

The first new command here is givepokemon.
givepokemon uses three values. The first is the Pokemon, the second being the level and the third being the Item Held.
So in the script above, mine shows....
givepokemon (Charmander) (Level 4) (No Item)[/i]
Just in case, you don't already have one, here's a list of Pokemon and Items.

[B]Pokemon
BULBASAUR 1
IVYSAUR 2
VENUSAUR 3
CHARMANDER 4
CHARMELEON 5
CHARIZARD 6
SQUIRTLE 7
WARTORTLE 8
BLASTOISE 9
CATERPIE 10
METAPOD 11
BUTTERFREE 12
WEEDLE 13
KAKUNA 14
BEEDRILL 15
PIDGEY 16
PIDGEOTTO 17
PIDGEOT 18
RATTATA 19
RATICATE 20
SPEAROW 21
FEAROW 22
EKANS 23
ARBOK 24
PIKACHU 25
RAICHU 26
SANDSHREW 27
SANDSLASH 28
NIDORAN|w| 29
NIDORINA 30
NIDOQUEEN 31
NIDORAN|m| 32
NIDORINO 33
NIDOKING 34
CLEFAIRY 35
CLEFABLE 36
VULPIX 37
NINETALES 38
JIGGLYPUFF 39
WIGGLYTUFF 40
ZUBAT 41
GOLBAT 42
ODDISH 43
GLOOM 44
VILEPLUME 45
PARAS 46
PARASECT 47
VENONAT 48
VENOMOTH 49
DIGLETT 50
DUGTRIO 51
MEOWTH 52
PERSIAN 53
PSYDUCK 54
GOLDUCK 55
MANKEY 56
PRIMEAPE 57
GROWLITHE 58
ARCANINE 59
POLIWAG 60
POLIWHIRL 61
POLIWRATH 62
ABRA 63
KADABRA 64
ALAKAZAM 65
MACHOP 66
MACHOKE 67
MACHAMP 68
BELLSPROUT 69
WEEPINBELL 70
VICTREEBEL 71
TENTACOOL 72
TENTACRUEL 73
GEODUDE 74
GRAVELER 75
GOLEM 76
PONYTA 77
RAPIDASH 78
SLOWPOKE 79
SLOWBRO 80
MAGNEMITE 81
MAGNETON 82
FARFETCH'D 83
DODUO 84
DODRIO 85
SEEL 86
DEWGONG 87
GRIMER 88
MUK 89
SHELLDER 90
CLOYSTER 91
GASTLY 92
HAUNTER 93
GENGAR 94
ONIX 95
DROWZEE 96
HYPNO 97
KRABBY 98
KINGLER 99
VOLTORB 100
ELECTRODE 101
EXEGGCUTE 102
EXEGGUTOR 103
CUBONE 104
MAROWAK 105
HITMONLEE 106
HITMONCHAN 107
LICKITUNG 108
KOFFING 109
WEEZING 110
RHYHORN 111
RHYDON 112
CHANSEY 113
TANGELA 114
KANGASKHAN 115
HORSEA 116
SEADRA 117
GOLDEEN 118
SEAKING 119
STARYU 120
STARMIE 121
MR. MIME 122
SCYTHER 123
JYNX 124
ELECTABUZZ 125
MAGMAR 126
PINSIR 127
TAUROS 128
MAGIKARP 129
GYARADOS 130
LAPRAS 131
DITTO 132
EEVEE 133
VAPOREON 134
JOLTEON 135
FLAREON 136
PORYGON 137
OMANYTE 138
OMASTAR 139
KABUTO 140
KABUTOPS 141
AERODACTYL 142
SNORLAX 143
ARTICUNO 144
ZAPDOS 145
MOLTRES 146
DRATINI 147
DRAGONAIR 148
DRAGONITE 149
MEWTWO 150
MEW 151
CHIKORITA 152
BAYLEEF 153
MEGANIUM 154
CYNDAQUIL 155
QUILAVA 156
TYPHLOSION 157
TOTODILE 158
CROCONAW 159
FERALIGATR 160
SENTRET 161
FURRET 162
HOOTHOOT 163
NOCTOWL 164
LEDYBA 165
LEDIAN 166
SPINARAK 167
ARIADOS 168
CROBAT 169
CHINCHOU 170
LANTURN 171
PICHU 172
CLEFFA 173
IGGLYBUFF 174
TOGEPI 175
TOGETIC 176
NATU 177
XATU 178
MAREEP 179
FLAAFFY 180
AMPHAROS 181
BELLOSSOM 182
MARILL 183
AZUMARILL 184
SUDOWOODO 185
POLITOED 186
HOPPIP 187
SKIPLOOM 188
JUMPLUFF 189
AIPOM 190
SUNKERN 191
SUNFLORA 192
YANMA 193
WOOPER 194
QUAGSIRE 195
ESPEON 196
UMBREON 197
MURKROW 198
SLOWKING 199
MISDREAVUS 200
UNOWN 201
WOBBUFFET 202
GIRAFARIG 203
PINECO 204
FORRETRESS 205
DUNSPARCE 206
GLIGAR 207
STEELIX 208
SNUBBULL 209
GRANBULL 210
QWILFISH 211
SCIZOR 212
SHUCKLE 213
HERACROSS 214
SNEASEL 215
TEDDIURSA 216
URSARING 217
SLUGMA 218
MAGCARGO 219
SWINUB 220
PILOSWINE 221
CORSOLA 222
REMORAID 223
OCTILLERY 224
DELIBIRD 225
MANTINE 226
SKARMORY 227
HOUNDOUR 228
HOUNDOOM 229
KINGDRA 230
PHANPY 231
DONPHAN 232
PORYGON2 233
STANTLER 234
SMEARGLE 235
TYROGUE 236
HITMONTOP 237
SMOOCHUM 238
ELEKID 239
MAGBY 240
MILTANK 241
BLISSEY 242
RAIKOU 243
ENTEI 244
SUICUNE 245
LARVITAR 246
PUPITAR 247
TYRANITAR 248
LUGIA 249
HO-OH 250
CELEBI 251
TREECKO 277
GROVYLE 278
SCEPTILE 279
TORCHIC 280
COMBUSKEN 281
BLAZIKEN 282
MUDKIP 283
MARSHTOMP 284
SWAMPERT 285
POOCHYENA 286
MIGHTYENA 287
ZIGZAGOON 288
LINOONE 289
WURMPLE 290
SILCOON 291
BEAUTIFLY 292
CASCOON 293
DUSTOX 294
LOTAD 295
LOMBRE 296
LUDICOLO 297
SEEDOT 298
NUZLEAF 299
SHIFTRY 300
NINCADA 301
NINJASK 302
SHEDINJA 303
TAILLOW 304
SWELLOW 305
SHROOMISH 306
BRELOOM 307
SPINDA 308
WINGULL 309
PELIPPER 310
SURSKIT 311
MASQUERAIN 312
WAILMER 313
WAILORD 314
SKITTY 315
DELCATTY 316
KECLEON 317
BALTOY 318
CLAYDOL 319
NOSEPASS 320
TORKOAL 321
SABLEYE 322
BARBOACH 323
WHISCASH 324
LUVDISC 325
CORPHISH 326
CRAWDAUNT 327
FEEBAS 328
MILOTIC 329
CARVANHA 330
SHARPEDO 331
TRAPINCH 332
VIBRAVA 333
FLYGON 334
MAKUHITA 335
HARIYAMA 336
ELECTRIKE 337
MANECTRIC 338
NUMEL 339
CAMERUPT 340
SPHEAL 341
SEALEO 342
WALREIN 343
CACNEA 344
CACTURNE 345
SNORUNT 346
GLALIE 347
LUNATONE 348
SOLROCK 349
AZURILL 350
SPOINK 351
GRUMPIG 352
PLUSLE 353
MINUN 354
MAWILE 355
MEDITITE 356
MEDICHAM 357
SWABLU 358
ALTARIA 359
WYNAUT 360
DUSKULL 361
DUSCLOPS 362
ROSELIA 363
SLAKOTH 364
VIGOROTH 365
SLAKING 366
GULPIN 367
SWALOT 368
TROPIUS 369
WHISMUR 370
LOUDRED 371
EXPLOUD 372
CLAMPERL 373
HUNTAIL 374
GOREBYSS 375
ABSOL 376
SHUPPET 377
BANETTE 378
SEVIPER 379
ZANGOOSE 380
RELICANTH 381
ARON 382
LAIRON 383
AGGRON 384
CASTFORM 385
VOLBEAT 386
ILLUMISE 387
LILEEP 388
CRADILY 389
ANORITH 390
ARMALDO 391
RALTS 392
KIRLIA 393
GARDEVOIR 394
BAGON 395
SHELGON 396
SALAMENCE 397
BELDUM 398
METANG 399
METAGROSS 400
REGIROCK 401
REGICE 402
REGISTEEL 403
KYOGRE 404
GROUDON 405
RAYQUAZA 406
LATIAS 407
LATIOS 408
JIRACHI 409
DEOXYS 410
CHIMECHO 411


Items
Master Ball 1
Ultra Ball 2
Great Ball 3
Poké Ball 4
Safari Ball 5
Net Ball 6
Dive Ball 7
Nest Ball 8
Repeat Ball 9
Timer Ball 10
Luxury Ball 11
Premier Ball 12
Potion 13
Antidote 14
Burn Heal 15
Ice Heal 16
Awakening 17
Parlyz Heal 18
Full Restore 19
Max Potion 20
Hyper Potion 21
Super Potion 22
Full Heal 23
Revive 24
Max Revive 25
Fresh Water 26
Soda Pop 27
Lemonade 28
Moomoo Milk 29
Energypowder 30
Energy Root 31
Heal Powder 32
Revival Herb 33
Ether 34
Max Ether 35
Elixir 36
Max Elixir 37
Lava Cookie 38
Blue Flute 39
Yellow Flute 40
Red Flute 41
Black Flute 42
White Flute 43
Berry Juice 44
Sacred Ash 45
Shoal Salt 46
Shoal Shell 47
Red Shard 48
Blue Shard 49
Yellow Shard 50
Green Shard 51
HP Up 63
Protein 64
Iron 65
Carbos 66
Calcium 67
Rare Candy 68
PP Up 69
Zinc 70
PP Max 71
Guard Spec. 73
Dire Hit 74
X Attack 75
X Defend 76
X Speed 77
X Accuracy 78
X Special 79
Poké Doll 80
Fluffy Tail 81
Super Repel 83
Max Repel 84
Escape Rope 85
Repel 86
Sun Stone 93
Moon Stone 94
Fire Stone 95
Thunderstone 96
Water Stone 97
Leaf Stone 98
Tinymushroom 103
Big Mushroom 104
Pearl 106
Big Pearl 107
Stardust 108
Star Piece 109
Nugget 110
Heart Scale 111
Orange Mail 121
Harbor Mail 122
Glitter Mail 123
Mech Mail 124
Wood Mail 125
Wave Mail 126
Bead Mail 127
Shadow Mail 128
Tropic Mail 129
Dream Mail 130
Fab Mail 131
Retro Mail 132
Cheri Berry 133
Chesto Berry 134
Pecha Berry 135
Rawst Berry 136
Aspear Berry 137
Leppa Berry 138
Oran Berry 139
Persim Berry 140
Lum Berry 141
Sitrus Berry 142
Figy Berry 143
Wiki Berry 144
Mago Berry 145
Aguav Berry 146
Iapapa Berry 147
Razz Berry 148
Bluk Berry 149
Nanab Berry 150
Wepear Berry 151
Pinap Berry 152
Pomeg Berry 153
Kelpsy Berry 154
Qualot Berry 155
Hondew Berry 156
Grepa Berry 157
Tamato Berry 158
Cornn Berry 159
Magost Berry 160
Rabuta Berry 161
Nomel Berry 162
Spelon Berry 163
Pamtre Berry 164
Watmel Berry 165
Durin Berry 166
Belue Berry 167
Liechi Berry 168
Ganlon Berry 169
Salac Berry 170
Petaya Berry 171
Apicot Berry 172
Lansat Berry 173
Starf Berry 174
Enigma Berry 175
Brightpowder 179
White Herb 180
Macho Brace 181
Exp. Share 182
Quick Claw 183
Soothe Bell 184
Mental Herb 185
Choice Band 186
King's Rock 187
Silverpowder 188
Amulet Coin 189
Cleanse Tag 190
Soul Dew 191
Deepseatooth 192
Deepseascale 193
Smoke Ball 194
Everstone 195
Focus Band 196
Lucky Egg 197
Scope Lens 198
Metal Coat 199
Leftovers 200
Dragon Scale 201
Light Ball 202
Soft Sand 203
Hard Stone 204
Miracle Seed 205
Blackglasses 206
Black Belt 207
Magnet 208
Mystic Water 209
Sharp Beak 210
Poison Barb 211
Nevermeltice 212
Spell Tag 213
Twistedspoon 214
Charcoal 215
Dragon Fang 216
Silk Scarf 217
Up-grade 218
Shell Bell 219
Sea Incense 220
Lax Incense 221
Lucky Punch 222
Metal Powder 223
Thick Club 224
Stick 225
Red Scarf 254
Blue Scarf 255
Pink Scarf 256
Green Scarf 257
Yellow Scarf 258
Mach Bike 259
Coin Case 260
Itemfinder 261
Old Rod 262
Good Rod 263
Super Rod 264
S.S. Ticket 265
Contest Pass 266
Wailmer Pail 268
Devon Goods 269
Soot Sack 270
Basement Key 271
Acro Bike 272
PokéBlock Case 273
Letter 274
Eon Ticket 275
Red Orb 276
Blue Orb 277
Scanner 278
Go-goggles 279
Meteorite 280
Rm. 1 Key 281
Rm. 2 Key 282
Rm. 4 Key 283
Rm. 6 Key 284
Storage Key 285
Root Fossil 286
Claw Fossil 287
Devon Scope 288
TM01 289
TM02 290
TM03 291
TM04 292
TM05 293
TM06 294
TM07 295
TM08 296
TM09 297
TM10 298
TM11 299
TM12 300
TM13 301
TM14 302
TM15 303
TM16 304
TM17 305
TM18 306
TM19 307
TM20 308
TM21 309
TM22 310
TM23 311
TM24 312
TM25 313
TM26 314
TM27 315
TM28 316
TM29 317
TM30 318
TM31 319
TM32 320
TM33 321
TM34 322
TM35 323
TM36 324
TM37 325
TM38 326
TM39 327
TM40 328
TM41 329
TM42 330
TM43 331
TM44 332
TM45 333
TM46 334
TM47 335
TM48 336
TM49 337
TM50 338
HM01 339
HM02 340
HM03 341
HM04 342
HM05 343
HM06 344
HM07 345
HM08 346
Oak's Parcel 349
Poké Flute 350
Secret Key 351
Bike Voucher 352
Gold Teeth 353
Old Amber 354
Card Key 355
Lift Key 356
Helix Fossil 357
Dome Fossil 358
Silph Scope 359
Bicycle 360
Town Map 361
VS Seeker 362
Fame Checker 363
TM Case 364
Berry Pouch 365
Teachy TV 366
Tri-pass 367
Rainbow Pass 368
Tea 369
Mysticticket 370
Auroraticket 371
Powder Jar 372
Ruby 373
Sapphire 374

Now we have fanfare 0x13E. This is a jingle. It's a short bit of music that is played when you recieve something like a Pokemon or an item.
Then we have a message. The only difference here is that we have used boxset 4. Boxset 4 is different to boxset 6, because it will not close. But if it doesn't close, why would I use it? You'll just have to keep reading to find out.
waitfanfare will do what it's name displays. It will wait for the fanfare to finish, before it allows the script to continue. This boxset 4 has left the box open while we wait for the fanfare to end.
#raw 0x68, a very useful command in my script. This is a very useful command with boxset 4. It will basically, make the boxset 4 act as a boxset 6, so that it can now close when you press a button.
setflag 0x828... I wonder what this is for. In Fire Red and Leaf Green, this is very useful, as it activates the Pokemon option on Start Button Menu.
Here's a Short list of some of them. That's pretty much all thats needed, don't you think?
Flags
Fire Red:
0x820 - First Badge
0x821 - Second Badge
0x822 - Third Badge
0x823 - Fourth Badge
0x824 - Fifth Badge
0x825 - Sixth Badge
0x826 - Seventh Badge
0x827 - Eighth Badge
0x828 - Pokemon Menu
0x829 - Pokedex Menu
0x82F - Running Shoes

Ruby/Sapphire:
0x800 - Pokemon Menu
0x801 - Pokedex Menu
0x802 - Pokenav Menu
0x807 - First Badge
0x808 - Second Badge
0x809 - Third Badge
0x80A - Fourth Badge
0x80B - Fifth Badge
0x80C - Sixth Badge
0x80D - Seventh Badge
0x80E - Eighth Badge
0x860 - Running Shoes

Emerald:
0x860 - Pokemon Menu
0x861 - Pokedex Menu
0x862 - Pokenav Menu
Now we have the boxset 5
compare LASTRESULT 0x1
if b_true gosub $nameBut look! We have something slightly different there. Instead of, if b_true goto $name, we have if b_true gosub $name.
If you use ScriptED this, is would just be if2 to you. Gosub, is somthing used in other programming languages, and is just used to say, "go there but you have to come back."
So let's look at what we have there, gosub $name, I guess that means that we are going to go look at $name
Here we have call 0x1A74EB. Call is used to call some other script within a rom. It can also call a part of your script, in that case it would appear, call ${pointer}But, I know what you're asking, what's at 0x1A74EB? Some people use the command namepokemon, but that isn't the most reliable command. So we use the namepokemon already in the rom, which is if you haven't figured it out yet, is at 0x1A74EB.
Now we have return, but what's that do, it just returns to wherevere it was called from or gosubed from. I didn't mention it earlier, but call should have a return wherever it is called from.
That return has brought us back to message $5. The rest is already explained, so now we can move onto the next part.

I think we'll move onto something similiar and go to...

Wildbattle

#org $start
lock
faceplayer
message $1
boxset 6
cry 0xA1 6
nop
nop
wildbattle 6 30 0x8B
fadescreen 0
#raw 0x53 0x0F 0x80
setflag 0x200
release
end

#org $1
$1 1 =CHARIZARD: Raaarrgghh!I guess, now I can just not mention messages and boxsets, so I'll just start straight with cry.
Sorry but I have to get a little "advanced" here, but hopefully, I'll explain it well enough so that it sounds simple. When we script cry in hex it takes 6 bytes,
[cry] [pkmn] [pkmn] [buffer] [buffer]
In pokescript unfortunately it's only coded 4 of those six bytes, so now we need to add two bytes, which will act as those buffers. So I chose to just use two nops. To cover those buffers.
Oh wait, I forgot to explain Cry. First we have the command, and then it's followed by the bank. 0xA1, is the Pokemon cry bank. Then that is followed by the Pokemon, which in this case, is a Charizard.
Now Wildbattle. So in my script, we have.
[code]wildbattle {Charizard} {Level 30} {Oran Berry}So from there, I can explain, the first one is the Pokemon, the second is the level, and finally, the third is the item.
fadescreen is a command that is used to make the screen fade to black, and sometimes back. fadescreen 0x0 will create a blinking effect which will make it seem as if the Pokemon is there one second, and gone the next. There are more different fadescreen's but I'll cover some of those later in the tutorial.
Now we can move onto #raw 0x53 0x0F 0x80. This is very useful, as it makes the Overworld your interacting with dissappear. I'll go into a little more detail on #raw 0x53 0x0F 0x80 below in the spoiler, because it will be a little more complex than where we are at, at the moment.
When we interact/talk with an OW, the people number is assigned to the variable 0x800F. So in the case of #raw 0x53 0x0F 0x80, it's showing, "remove sprite, (variable) 0x800F" It isn't actually a people no. 0x800F, it's just that the people no. is assigned to the variable.
#raw 0x53 can also be used a little differently and I'll explain that also a little later in the tutorial.
Remeber how I mentioned in Flags, how I mentioned something about the people id, in advancemap. This is where I'll be explaining that. Here, we've used the flag 0x200, so we are going to change the Overworld that this script is assigned to's people id to 0200. The people id, is used to make sure that the Overworld, doesn't continue to re-appear, but that is easier to learn via experience.
and that's it, I guess we can now move onto something else.

Checkgender

#org $start
lock
faceplayer
checkgender
compare LASTRESULT 0x0
if b_true goto $boy
compare LASTRESULT 0x1
if b_true goto $girl
end

#org $boy
message $1
boxset 6
release
end

#org $girl
message $2
boxset 6
release
end

#org $1
$1 1 =Hello Mr. \v\h01.

#org $2
$2 1 =Hello Ms. \v\h01.So Checkgender, huh? I guess there isn't too much for me to explain here.
So we have the command Checkgender. Like most commands, it assigns a value to LASTRESULT. We check what this value is with compare LASTRESULT 0x*. The asterix just stands for what we are checking for. With checkgender, it assigns 0x0 to LASTRESULT for a male, and it assigns 0x1 to LASTRESULT for a female.
I've used two compare's but it can be alternitavely my script could also have been written like this.
#org $start
lock
faceplayer
checkgender
compare LASTRESULT 0x0
if b_true goto $boy
message $2
boxset 6
release
end

#org $boy
message $1
boxset 6
release
end

#org $1
$1 1 =Hello Mr. \v\h01.

#org $2
$2 1 =Hello Ms. \v\h01.Or like this...
#org $start
lock
faceplayer
checkgender
compare LASTRESULT 0x1
if b_true goto $girl
message $1
boxset 6
release
end

#org $girl
message $2
boxset 6
release
end

#org $1
$1 1 =Hello Mr. \v\h01.

#org $2
$2 1 =Hello Ms. \v\h01.It really just comes down to preference. Nothing is set in stone when it comes to scripting, there's always more than one way to do something, and I'll show some more examples of this later.
It think that's all that I need to explain for this.

Giveitem

#org $start
lock
faceplayer
checkflag 0x200
if b_true goto $done
message $1
boxset 5
compare LASTRESULT 0x1
if b_true goto $take
message $2
boxset 6
release
end

#org $done
message $3
boxset 6
release
end

#org $take
giveitem 13 1
message $3
boxset 6
setflag 0x200
release
end

#org $1
$1 1 =Hi I'm from the Cherrygrove\nPokemart.\pWhy don't you take this free\nsample.

#org $2
$2 1 =That's okay, I'm sure someone\nelse might enjoy it.

#org $3
$3 1 =If you want more you'll have\nto go to the pokemart to\lbuy them.One thing you may notice about this script is that I've pointed to different parts of the script to the same pointer. This is not a mistake, you can do this. I added that here because I think it's a good thing for someone to know about.
Now onto the new things in this script. We have the giveitem command.
Giveitem will take two values, the item no. and the amount.
In my script I have used these.
giveitem {Potion} {One of them}
That's actually all you need to do for this command. It will automatically play a jingle, and it will automatically display a message saying "You recieved ............" That's actually all I need to explain.
WARNING: The most common mistake when people use this, is that they leave off the second number and forget about it. This will make the game go to a Red Screen, which you will not be able to come back from. Make sure you have both numbers used with this command.
How about we move onto some simple specials now.

Special

#org $start
lock
faceplayer
message $10
boxset 4
#raw 0x68
fadescreen 0x1
fanfare 0x100
special 0x0
waitfanfare
fadescreen 0x0
message $11
boxset 6
release
end

#org $10
$10 1 =What wonderful Pokèmon you\nhave there but they look like\lthey could use a break.

#org $11
$11 1 =Now they look better.\nDon't forget to visit.For those who might be interested, this is actually part of a script from my hack.
Looks like I've used boxset 4 and #raw 0x68 again. I've also used fadescreen 0x1 aswell as fadescreen 0x0, another fanfare and special 0x0.
I'm going to do something different here. I'm going to start with the fadescreens? Do you still remember what fadescreen 0x0 does?That's right, it creates a blinking effect.
Fadescreen 0x1 is of course not the same as fadescreen 0x0, it actually fades the screen out to completely black. But I can guess what you're asking, how do we turn it back? We of course use fadescreen 0x0 to reverse the process, and return the screen to it's normal state.
Now that you should have an understnding of fadescreen 0x1, we can move backwards, and look at "Why I used boxset 4 instead of boxset 6.
I will be fully truthful with you on this. For some reason, that I can't explain, if we use boxset 6 before we use fadescreen 0x1 the box will remain open until we return to our normal screen with fadescreen 0x0, and once we are there we will see it close but I don't want that. It doesn't look very good. We want it to close before we come back from our black screen. I can't explain this, but for some reason, when we use boxset 4 and #raw 0x68, it does just that. So whenever you have a script like this, use boxset 4 before, we go to a fadescreen.
The fanfare is very useful in this script. In theory I could have used pause[size="1"](which is a command I have not covered yet), but I wanted to use the combination of fanfare 0x100 and waitfanfare.
For those who don't know, fanfare 0x100 is the healing jingle that is played when your mother heals your Pokemon. So now, with the help of waitfanfare, the screen will not return to normal until that jingle is completed.
Now all that's left is of course, special 0x0. This is a special command that will fully heal the Pokemon within your party. Useful isn't it?
I'm also going to include a short list of specials in spoiler right here, for whoever may want it.
[B]Specials
special 0x0 - Heal Pokemon
special 0x3C - Acess Bill's PC (FR/LG)
special 0x98 - Going up to Mountain (R/S)
special 0x9C - Wally Catch (R/S)
special 0x9F - choose A Pokemon (R/S)
special 0xE0 - Pokeblock Case (R/S)
special 0x10F - Restart Game
special 0x110 - Hall of Fame and Credits
special 0x111 - Elevator Animation
special 0x119 - Groudons Orb effect (R/S)
special 0x131 - Earthquake (R/S)
special 0x132 - Show Floors
special 0x136 - Earthquake (FR/LG)
special 0x137 - Lava Battle
special 0x156 - Battle with Ghost (FR/LG)
special 0x157 - Get on Bike (FR/LG)
special 0x161 - Start Surfing (FR/LG)
special 0x166 - Nickname
special 0x16F - Activate National Dex (FR/LG)
special 0x17B - Seagallop Animation
special 0x191 - SS. Anne Leaving
special 0x1F3 - Activate National Dex (Emerald)

Applymovement

#org $start
checkflag 0x828
if b_true goto $done
message $1
boxset 6
applymovement 0x04 $move
pausemove 0x0
applymovement 0xFF $move2
pause 0x30
message $2
boxset 6
playsound 0x13E
nop
applymovement 0x04 $move3
applymovement 0xFF $move3
pausemove 0
fadesound 0x12C
nop
release
end

#org $done
release
end

#org $move
#raw 0x62 0x12 0x12 0x12 0x12 0xFE

#org $move2
#raw 0x03 0xFE

#org $move3
#raw 0x13 0x13 0x13 0x13 0xFE

#org $1
$1 1 =Waaaiiiitttt!!!

#org $2
$2 1 =You can't go out there\nwithout your own Pokemon.\pWild Pokemon will hurt you.What's new here? Applymovement, pausemove, pause, playsound and fadesound. I guess I'll explain them all in that order.
Applymovement is a very useful command that allows to show an overworld walking or running depending on what we want.
When we use applymovement, it has to be followed by a People Number, which is found here...

http://pixloads.com/public/49845/tutorial.PNG?no_history

and a pointer to where our movements are. An overworld with a people number of "4", seems normal doesn't it? But what about one with 0xFF(256). There's never 256 Overworlds on the one map. 0xFF is the "Hero's" people number.
Now let's look at this movements in a simpler view.But First I'll have to give you a movements list won't I?
Ruby/Sapphire
0x54 ' Hide
0x55 ' Show
0x56 ' Alert
0x57 ' Question
0x58 ' Love
0x5A ' Pokeball
0x10 ' Delay0
0x11 ' Delay1
0x12 ' Delay2
0x13 ' Delay3
0x14 ' Delay4

' Step
0x00 ' Down0
0x01 ' Up0
0x02 ' Left0
0x03 ' Right0
0x04 ' Down1
0x05 ' Up1
0x06 ' Left1
0x07 ' Right1
0x08 ' Down2
0x09 ' Up2
0x0A ' Left2
0x0B ' Right2
0x17 ' Left3
0x18 ' Right3
0x15 ' Down3
0x16 ' Up3
0x2D ' Down4
0x2E ' Up4
0x2F ' Left4
0x30 ' Right4

' Running
0x35 ' RunDown
0x36 ' RunUp
0x37 ' RunLeft
0x38 ' RunRight
0x7E ' RunDown2
0x7F ' RunUp2
0x80 ' RunLeft2
0x81 ' RunRight2

' Hop & Jump
0x0C ' HopTileDown
0x0D ' HopTileUp
0x0E ' HopTileLeft
0x0F ' HopTileRight
0x3A ' HighHopDown
0x3B ' HighHopUp
0x3C ' HighHopLeft
0x3D ' HighHopRight
0x46 ' HopDown
0x47 ' HopUp
0x48 ' HopLeft
0x49 ' HopRight
0x4A ' HopDown180
0x4B ' HopUp180
0x4C ' HopLeft180
0x4D ' HopRight180
0x42 ' JumpDown
0x43 ' JumpUp
0x44 ' JumpLeft
0x45 ' JumpRight

' Straf (May have glitches)
0x19 ' StDown1
0x1A ' StUp1
0x1B ' StLeft1
0x1C ' StRight1
0x1D ' StDown2
0x1E ' StUp2
0x1F ' StLeft2
0x20 ' StRight2
0x21 ' StDown3
0x22 ' StUp3
0x23 ' StLeft3
0x24 ' StRight3
0x25 ' StDown4
0x26 ' StUp4
0x27 ' StLeft4
0x28 ' StRight4
0x6A ' StDown1i
0x6B ' StUp1i
0x6C ' StLeft1i
0x6D ' StRight1i
0x6E ' StDown5
0x6F ' StUp5
0x70 ' StLeft5
0x71 ' StRight5

'Special
0x31 ' SlideFaceDown
0x32 ' SlideFaceUp
0x33 ' SlideFaceLeft
0x34 ' SlideFaceRight
0x86 ' IceSlideDown
0x87 ' IceSlideUp
0x88 ' IceSlideLeft
0x89 ' IceSlideRight

' Glitchy
0x3E ' Up0A
0x3F ' Down0A
0x4E ' Down0B
0x63 ' Up0B
0x65 ' Right0A
0x66 ' RunStopLoopDown
0x67 ' RunStopLoopUp
0x68 ' RunStopLoopLeft
0x69 ' RunStopLoopRight
0x72 ' Down15
0x73 ' Up15
0x74 ' Left15
0x75 ' Right15
0x7A ' Down6
0x7B ' Up6
0x7C ' Left6
0x7D ' Right6
0x82 ' Down7
0x83 ' Up7
0x84 ' Left7
0x85 ' Right7

' EXIT
0xFE
Fire Red/Leaf Green
Face Down 0x00
Face Up 0x01
Face Left 0x02
Face Right 0x03
Step Down (Very Slow) 0x08
Step Up (Very Slow) 0x09
Step Left (Very Slow) 0x0A
Step Right (Very Slow) 0x0B
Step Down (Slow) 0x0C
Step Up (Slow) 0x0D
Step Left (Slow) 0x0E
Step Right (Slow) 0x0F
Step Down (Normal) 0x10
Step Up (Normal) 0x11
Step Left (Normal) 0x12
Step Right (Normal) 0x13
Jump Down 2 Squares 0x14
Jump Up 2 Squares 0x15
Jump Left 2 Squares 0x16
Jump Right 2 Squares 0x17
Step Down (Fast) 0x1D
Step Up (Fast) 0x1E
Step Left (Fast) 0x1F
Step Right (Fast) 0x20
Step on the Spot Down 0x21
Step on the Spot Up 0x22
Step on the Spot Left 0x23
Step on the Spot Right 0x24
Step on the Spot Down (Fast) 0x25
Step on the Spot Up (Fast) 0x26
Step on the Spot Left (Fast) 0x27
Step on the Spot Right (Fast) 0x28
Step on the Spot Down (Very Fast) 0x29
Step on the Spot Up (Very Fast) 0x2A
Step on the Spot Left (Very Fast) 0x2B
Step on the Spot Right (Very Fast) 0x2C
Face Down (Non-Instant) 0x2D
Face Up (Non-Instant) 0x2E
Face Left (Non-Instant) 0x2F
Face Right (Non-Instant) 0x30
Slide Down 0x31
Slide Up 0x32
Slide Left 0x33
Slide Right 0x34
Slide Down On Right Foot 0x3D
Slide Up On Right Foot 0x3E
Slide Left On Right Foot 0x3F
Slide Right On Right Foot 0x40
Slide Down On Left Foot 0x41
Slide Up On Left Foot 0x42
Slide Left On Left Foot 0x43
Slide Right On Left Foot 0x44
Face Player 0x4A
Face Away from Player 0x4B
Jump Down 1 Square 0x4E
Jump Up 1 Square 0x4F
Jump Left 1 Square 0x50
Jump Right 1 Square 0x51
Jump in Place (Facing Down) 0x52
Jump in Place (Facing Up) 0x53
Jump in Place (Facing Left) 0x54
Jump in Place (Facing Right) 0x55
Jump in Place (Facing Down->Up) 0x56
Jump in Place (Facing Up->Down) 0x57
Jump in Place (Facing Left->Right) 0x58
Jump in Place (Facing Right->Left) 0x59
Disappear 0x60
Reappear 0x61
"!" box popup 0x62
"?" box popup 0x63
"X" box popup 0x64
"!!" box popup 0x65
"^_^" box popup 0x66

Before we look at the movements in a different view, I should explain the layout of the movements at the pointer. It is set out in a similiar way to a message. We have #org $pointer first and then what's being written to the rom below that. So we add #raw and then the movements that we want. But remember, that if you forget to add 0xFE to the end of the movements, your script will not work.
Actually, you know what? I changed my mind, before we look at the movements we're going to look at pausemove and pause.
pausemove is one of the best commands that you will ever find. This isn't a command in scriptED, so I've heard it refered to as the "perfect pause" and that is exactly what it is. When used as pausemove 0x0, it will wait for the exact amount of time that it takes for the movements to end. Really helpful isn't it?
Now we have pause. pause will wait for a set amount of time. You have to actually add the amount that it will wait for. The way we work out how long we should pause for is,
{Let "a" be the amount of movements}
Pause time = 0x10 + 0x10a
Personally, I don't use this very often, I prefer to use pausemove almost all of the time. But later on I might show where using pause instead of pausemove can be better.

Okay now, no more sidetracking, let's look at the movements.Lets look at the script withouta anything but the applymovements, pause and pausemoves. This leaves us with this.
#org $start
applymovement 0x04 $move
pausemove 0x0
applymovement 0xFF $move2
pause 0x30
applymovement 0x04 $move3
applymovement 0xFF $move3
pausemove 0
release
end

#org $move
#raw 0x62 0x12 0x12 0x12 0x12 0xFE

#org $move2
#raw 0x03 0xFE

#org $move3
#raw 0x13 0x13 0x13 0x13 0xFEThe first two applymovements are in a completely normal setup.
ie. applymovement 0xXX $YYYYYY
pausemove/pause
But let's look at the next set of movements. It's set up differently. We have two applymovements before we have some sort of pause. What would happen if I did that? They would both move at the same time. This is sometimes referred to as "follow-me." With a "follow-me" we can use as many applymovements before the pause as we want. This can be useful if we wanted a "group" to walk together. We can have three, four, five, six, however many you want.I think that's all there is to the applymovement command.

Now we can move onto that playsound. Doesn't something look a little familiar about this? It is followed by a nop. Similiar to cry, isn't it? So I guess I'll explain in a similiar way, why the nop is there.
When we script playsound in hex we need 4 bytes to get it to work. Here's a short summary of what we need:
[playsound] [song] [song]
Pokescript is missing that buffer. So we add nop for that buffer.
So now as you can see from the playsound in the script, we only to add one value after it, the Song number. If you're hacking Fire Red, you're in luck... I have a short list of song numbers in Fire Red. So sorry to R/S/E hackers but you can find the song numbers in A-Map.
[B]Fire Red Songs
Fire Red
0x108 - Safari Zone
0x112 - Team Rocket Celadon Hideout, Bruno
0x113 - Elite 4
0x117 - Cinnabar Island
0x118 - Lavender Town
0x11F - Viridian Forest, Diglett Cave, Seafoam Islands
0x120 - Mt Moon, Victory Road, Rock Tunnel
0x121 - Power Plant, Pokemon Mansion
0x123 - Route Song 2
0x124 - Route Song 1
0x125 - Route Song 3
0x126 - Route Song 4
0x127 - Elite 4, Champion
0x12C - Pallet Town
0x12F - Pokemon Center, Mart
0x130 - S.S. Anne
0x132 - Pokemon Tower, Agatha
0x133 - Team Rocket Silph Co.
0x134 - Cerulean City, Fushia
0x135 - Celadon
0x139 - Vermillion
0x13A - Viridian, Pewter, Saffron
0x14B - Mt.Ember/Icefall Cave
0x14D - Island Routes
0x14E - Dotted Hole
0x14F - Island 1-3
0x150 - Island 4-5
0x151 - Island 6-7
0x158 - Trainer Tower
Now we have fadesound. What's that do? It's set up similiar to playsound and it will fade into the sound displayed. Since it is set up in a similiar way to playsound, it has a nop at the end of it so that it works. If you want more detail on how it works, just refer back to playsound.
Hmmmm... Is that it? No.
I thought I might point out something about the checkflag in this script. We actually have no setflag in this script. So why do I have a checkflag? We can actually check in one script if a flag was set in a different script. So in this script shown in this section, we check if the Pokemon menu has been activated before the script will go to it's end ($done).

Okay, I'm also going to ask you to compile the script, assign it to an event and not a person, and test it in the rom. Then look at this spoiler.
Didn't work, did it? Froze on the spot. You're going to need to change this...

http://pixloads.com/public/49842/tutorial2.PNG?no_history

to this....

http://pixloads.com/public/49843/tutorial3.PNG?no_history

Try it now. Worked perfectly, didn't it?


So what's next.

Countpokemon

I'm going to do something different here. I'm not going to show a script. There's too much to explain to show in just one script.
Here's the most basic example.
countpokemon
compare LASTRESULT 0x6
if b_true goto $continueThis is the most basic form.
Before I explain this fragment of a script, I should go into a little more detail, on the command countpokemon itself.
countpokemon checks how many pokemon are in your party and writes the value to LASTRESULT. So if we have six Pokemon in our party, it would assign 0x06 to LASTRESULT, and if we had 3 pokemon in our party it would assign 0x03 to LASTRESULT.
Now back to that cut out part of a script.
With compare LASTRESULT 0x6 we are checking if they're are six Pokemon in our party. And then with if b_true goto $continue, it displays "if there is six pokemon in your party go to $continue."
That is the simplest form of countpokemon.
Let's get a little more complicated. Let's try this.
countpokemon
compare LASTRESULT 0x1
if b_>> goto $continuecompare LASTRESULT 0x1 checks for one Pokemon in your party. But what's this b_>> thing supposed to do. It checks if what's in our party is greater than what is being compared. So according to this fragment of a script, if we have more than one pokemon in our party the script will continue.
Here's a short table of some different possibities for the b_??.
B_<< Lower Than
B_== Equals
B_>> Greater Than
B_<= Lower than or Equal to
B_>= Greater than or Equal to
B_!= Not exactly equal to

So I'll add one more example, just to help the information sink in.
countpokemon
compare LASTRESULT 0x2
if b_!= goto $continueIn this example, it checks if you have two Pokemon, and if you have a number of Pokemon other than two, the script won't continue to $continue.

thethethethe
March 1st, 2008, 02:23 PM
Trainerbattle 0
Just a simple trainerbattle script...
#org $start
trainerbattle 0 0x001 $before $after
message $beaten
boxset 6
release
end

#org $before
$before 1 = Aren't bugs great?

#org $after
$after 1 = Nooo! My bugs!

#org $beaten
$beaten 1 = How could you squash my\npoor bugs?
Obviously, trainerbattle is just a battle with a trainer. Trainerbattle is great because the game will actually keep track of whether you have beaten a trainer or not. So in this script we have no need for a checkflag/setflag situation.
Now to explaining these values after the trainerbattle. These are:
[trainerbattle] [Type of battle] [Trainer ID] [Message Before Battle] [Message if you Win]
So I'll guess I'll explain the type of battle. The type of battle, just displays whether it is a double battle, Gym Leader Battle, and some more. When you just use "0", it is just a normal trainerbattle. One that you would just see in a route, or even a gym trainer. It will, "Spot you," beginning message, battle, Message when win.
Now we'll move onto the Trainer ID. I don't have a list of these sorry. But what I can do, is tell you that these are the ID's of trainers that are found in PET. For Example, Brock can be found with with a Trainer ID of 0x19E, and Blaine can be found at 0x1A3.
Now we see two pointers. $before & $after. I've labeled these to help display what they are for. The first pointer, $before displays is the pointer to the message displayed before the battle.
$after, can you guess what this does? That's right it's the pointer to the message after the battle. This message appears while we are still in the batte event. Remember the colours that were mentioned towards the beginning of this tutorial. Well, we can use colours with this too, but they are different.
Here's a list.
Fire Red
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
Sorry Ruby hackers, I don't have a list for those values.
Now if I were to test it in a rom, guess what happens after the trainerbattle? Nothing... The script ends. So, why do I have a message after it?
Remember how I talked about trainerbattle keeping track of whether you have beaten them or not. Once you beat the trainer, the trainer battle will be skipped. So when you speak to them after beating them in a battle, it will be treated like a normal message script.
So wait! Why don't I have a lock and faceplayer there after the trainerbattle? The reason is that once you have beaten that trainer, it will act as the lock/faceplayer combo, and you don't have to worry about them in this script.
That's the scripting side of this command done. Now the A-Map side. Now compile this script, and test it in a rom. Did it work like a normal trainerbattle? I bet your answer is No.
You'll need to fill in these boxes.

http://pixloads.com/public/49844/tutorial4.PNG?no_history

Trainerbattle 1
#org $start
lock
faceplayer
checkflag 0x820
if b_true goto $done
message $2
boxset 6
trainerbattle 1 0x001 $before $after $later
end

#org $before
$before 1 =Show me what you've got!

#org $after
$after 1 =Congratulations.

#org $later
message $3
boxset 6
fanfare 0x13E
message $4
boxset 4
waitfanfare
#raw 0x68
message $5
boxset 6
giveitem 0x147 1
setflag 0x820
release
end

#org $done
message $1
boxset 6
release
end

#org $1
$1 1 =You should travel to Cerulean Town\nto get your next badge.

#org $2
$2 1 =Wecome to Pewter City Gym.\nYou want to challenge me?

#org $3
$3 1 =Congratulations! Here I must reward\nyou with this badge.

#org $4
$4 1 =You recieved a badge!

#org $5
$5 1 =Oh, and please take this.

Remember that image, that was used with the previous script. Ignore that, for this kind of script, the "trainer" box doesn't need to be checked.
This script is a little longer than the previous trainerbattle script.
You'll see that the "0" in the previous script, has become a "1." There is also a third pointer.
If it shows a "1," it means that it needs three pointers after the trainerbattle command. The first two are the same as in the previous script, one for before the battle, and one for after the battle. But you'll see the third pointer doesn't point to a message. It points to $later. It's a seperate part of the script, where it allows the script to continue after you have won the trainerbattle.
If you refer to the flag section, you'll be able to see what the setflag 0x820 is. It's to activate the first badge on the trainercard.
I think that's about all I need to add on trainerbattle's.

Warp
I think I'm st the stage in this tutorial, where I don't need to show an example script of every command. This is one of those cases.
So now, we have warp. Warp is there to allow the player to warp to a different map. Warp is used like this.
[warp] [map bank] [map number] [warp number]
Let's say we wanted to warp to the front of Oak's Lab in Pallet Town.
So open a Fire Red/Leaf Green Rom in Advance Map, and open the Pallet town map.To the far left of the program's window, you'll see an orange box next to the current open map. If you've clicked Pallet Town, it should say Pallet Town (3.0).
The "3" is the map bank, and the "0" is the map number. Now we need to click on the warp on the door of Oak's Lab. It should have "Event Number: 2". Now we have our three values.
So we write our warp command.
warp 0x3 0x0 0x2
Ta-dah! There's our warp. Except you know what the problem with warp is, once you use it, the script ends. But you might say... "How come when you warp to Oak's Lab in Fire Red, the script still continues?" That involves some of the more difficult parts of scripting. Level Scripts. Since these are a little difficult, I'll explain these towards the end of the tutorial.

Warp to Position
#org $start
message $1
boxset 6
warp 0x4 0x1 0xFF
#raw 0x02 0x00 0x06 0x00
end

#org $1
$1 1 =I'm going to warp you to\nyou're bed.
This is something that quite a few people don't know about. It's something that a lot of scripters were 'in the dark' about it.
Well, I want this to warp straight to your bed in your room. This is in map PALLET TOWN (4.1). So what is the 0xFF for? The 0xFF is what tells the command that it is going to warp to a certain postion. But wait, didn't I just say that after the warp command, the script ends? That is true. So why do I have the #raw's there?
If we were to script that warp to position in hex it would appear.
39 04 01 FF 02 00 06 00
So even though the #raw's on a different line, the #raw's still part of the warp command. But wait, I haven't explained what the #raw's are for yet...
Let's look at the locations of the bed in your room. (X=2)(Y=6). So they are 0002 & 0006. Now we have to reverse these values. I'll explain how to do this.
If we have 0002, we'll seperate that into 2 bytes, 00 02, and then we reverse it.... 02 00
IF we do the same thing for Y=6, we get 06 00. We have our #raw's.
So it's that simple. We can now warp to a certain postion.

Weather Commands
When we want to change the weather in a script there are two commands that we need to know about, Setweather and doweather.
Setweather will set a certain type of weather to be activated by doweather.
So this is how we set up our setweather command.
[setweather] [weather type 2 bytes]
Here's a list of the different weather types. This applys to all third Generation games.
None = 0x0
Reflected Clouds = 0x1
Normal = 0x2
Rain = 0x3
3 Snowflakes = 0x4
Thunderstorm = 0x5
Fog = 0x6
Snow = 0x7
Sandstorm = 0x8
Diagonal Fog = 0x9
Thin Fog = 0xA
Bit Dark = 0xB
Overheat = 0xC
Thunderstorm2 = 0xD
None = 0xE
So if we wanted to have rainy weather, we would have.
setweather 0x3
Doweather is used to activate the weather. So let's show a script to display these in use.
#org $start
checkflag 0x200
if 0x1 goto $next
setweather 0x3
#raw 0x00
doweather
setflag 0x200
release
end

#org $next
setweather 0x2
#raw 0x00
doweather
clearflag 0x200
release
end
But let's look at this. There is a reason behind it. We have a #raw 0x00 after setweather. That's right, it's like cry and playsound it isn't coded correctly. So why didn't I use nop. Nop is either coded by pokescript as two different bytes 00 & 01. We just don't want to take that chance and have it use 01 instead of the 00, that is needed.
As you can see, doweather doesn't need any values after it. It's simply just doweather on it's own.

There is one more somewhat useful #raw 0xA3.
This command will prepare the game to return back to it's default map weather. Since this only prepares the rom for it, it still needs to be followed by doweather.

Pokemart
Here's just a basic script. By now, you should be able to add to it, pretty easily.
#org $start
lock
faceplayer
pokemart $values
release
end

#org $values
#binary int 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8
#binary int 0x9 0xA 0xB 0xC 0x13 0x14 0x0
Well, we have the pokemon command. It is simply followed by a pointer. This will point to the values of the items that will appear in the pokemart screen. The #binary are set up differently. They're set up like this.
#binary int 0x(value)
In this case, we have the these items respectively:
Master Ball 0x1
Ultra Ball 0x2
Great Ball 0x3
Poké Ball 0x4
Safari Ball 0x5
Net Ball 0x6
Dive Ball 0x7
Nest Ball 0x8
Repeat Ball 0x9
Timer Ball 0xA
Luxury Ball 0xB
Premier Ball 0xC
Parlyz Heal 0x13
Full Restore 0x14
But why is there no 0x0 item. 0x0 marks the end of the item line. Without this, the command will NOT work. You don't have to have two lines of items, it could appear like this.
#binary int 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x0
or even like this.
#binary int 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8
#binary int 0x7 0xA 0xB 0xC 0xD 0xE 0xF 0x10
#binary int 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x0

#raw's
I know we've covered a few of these, but I think I should go into a little more detail on these. When we script in #raw, we're just scripting in hex. As an example script.
#org $start
#raw 0x6A
#raw 0x5A
#raw 0xA4 0x01 0x00
#raw 0xA5
#raw 0x6C
#raw 0x02
This script in a pokescript language would appear like this.
#raw $start
lock
faceplayer
setweather 0x1
#raw 0x00
doweather
release
end
#raw's also give us the option of using commands, that aren't coded into pokescript. You've already seen some of them. #raw 0xA3, #raw 0x68, and #raw 0x53. These are just what we have already covered. From this point on there, more and more will appear.


Hidesprite and Showsprite
These two commands are #raw's. Showsprite is the #raw 0x53 command that we covered in a little detail earlier. We used it as this, #raw 0x53 0x0F 0x80, which will make the last person we talked to disappear. But, what if we wanted a certain person to dissappear?
Remember the reversing of values that we covered in the warp to position section.
Let's look at the locations of the bed in your room. (X=2)(Y=6). So they are 0002 & 0006. Now we have to reverse these values. I'll explain how to do this.
If we have 0002, we'll seperate that into 2 bytes, 00 02, and then we reverse it.... 02 00
IF we do the same thing for Y=6, we get 06 00. We have our #raw's.
We're going to do this with the people numbers of the OW. A common mistake is confusing the people id[/i] with the [b]event id.[/i]. Make sure you get the people Id. If forgot to show how the command is set out didn't I?
#raw 0x53 0x(people no. reverersed) 0x(people no. reverersed)
So lets use an example. People No. = 4. Here's how it will appear.
#raw 0x53 0x04 0x00
And maybe one more if it's needed. People No = 12.
#raw 0x53 0x0C 0x00
Now you should have a pretty full understanding of the #raw 0x53 command, so let's move onto showsprite.

Showsprite, can make an OW re-appear.
Showsprite is set out in the exact same way as #raw 0x53. And if you haven't guessed already, Showsprite isn't a command coded in pokescript it is #raw 0x55.
So here's some complimentary examples from when I explained #raw 0x53
[b]Example 1. People No. = 4.
#raw 0x55 0x04 0x00
Example 2. People No = 12.
#raw 0x55 0x0C 0x00
If you wanted to keep the person viewable:
If you remember back to wildbattle, you'll see that you need to use a setflag to keep the person hidden. So if we were to keep them viewable after using #raw 0x55, we would need to use clearflag.


Giveegg
Yet another #raw command. #raw 0x7A. A relatively simple command to use. All we need is to add the pokemon number reveresed after it.
So as an example, let's give a Pikachu Egg. Pikachu's Pokemon number is 25. So let's convert that to hex; 0x0019. Now just like with people numbers, we reverse it. and it gives us 19 00.
So our giveegg, command would appear like this.
#raw 0x7A 0x19 0x00
Just incase, you need some more explanation, let's use Treecko as an extra example. Treecko is number 277. So we convert it to hex; 0x0115; and then reverse it; 15 01. So our line appears like this;
#raw 0x7A 0x15 0x01
Pretty easy, huh?

Change Message Colour
YAY! Another #raw. #raw 0xC7. We had an older way of changing the text colour with the message. Let's do it in the script. We have three usefule colours here.
Blue = 0x00
Red = 0x01
Black = 0x02
Since they're short I'll show examples of all three of them.
Black Text
#org $start
lock
faceplayer
#raw 0xC7 0x02
message $1
boxset 6
release
end

#org $1
$1 1 =This is black Text.
Blue Text
#org $start
lock
faceplayer
#raw 0xC7 0x00
message $1
boxset 6
release
end

#org $1
$1 1 =This is blue Text.
Red Text
#org $start
lock
faceplayer
#raw 0xC7 0x01
message $1
boxset 6
release
end

#org $1
$1 1 =This is Red Text.

Setmaptile
I'll show a script and explain it for this one. You'll also be glad, it's not a #raw.
#org $start
setmaptile 0xA 0xD 0x1 0x0
special 0x8E
release
end
Nice and short. setmaptile is set out like this.
[setmatile] [X-Co-ordinate] [Y-Co-ordinate] [Tile Number] [Movement allowed?]
So in my short script, we have:
X Co-ordinate = 10 or 0xA
Y-Co-ordinate = 13 or 0xD
Tile = Noramal Grass(in tileset 0 [Fire Red]) or 0x1
Movement Allowed = Yes or 0x0

WE can find our X and Y Co-ordinates in Advance map, which has been shown earlier. We can also find our tile number in Advancemap. the number depends on what tileset we are using aswell. So Hold your mouse over a tile in the right pane. In the little status bar at the bottom on the far left, you should have Block: XX Offset: XXXXXX
Movement allowed has two possible options.
0x0 = Passable
0x1 = Blocked off
So what's the special there for?
This special will reset the map so that it allows the tile to set. Without this, you'll have to leave the screen and come back before it will actually work.

Special Trainer Commands
We've got three commands here, all #raw's.
First is Checktrainer - #raw 0x60
Second is disable trainer - #raw 0x61
Last is is Enable Trainer - #raw 0x62
All these three commands are set out in the same way.
[command] [pet id reversed] [pet id reversed]
Some more reversing. Maybe you've figured this out by now, but whenever we have 2 or more bytes, the bytes are reversed. This is also the case for pointers, and money values, but I'll be covering them in more detail a little later.
For all three examples I'm going to use, the trainer "Gym Leader Brock." Which in Fire Red, the Pet ID, is 0x19E. So let's reverse it now, so that I don't have to do it later. 0x019E, is 9E 01.
Now let's work with checktrainer. So since we're checking for something, the answer or result is going to have to be stored somewhere. Like most commands, the result is stored into LASTRESULT. So here's the example.
#raw 0x60 0x9E 0x01
compare LASTRESULT 0x1
if b_true goto $alreadybattled
Pretty straightforward, isn't it? It's simply followed by the compare and if statements. If you thought this was easy, the next two are even easier.
Here's Disabletrainer. Again, we'll be using Brock for the example.
#raw 0x61 0x9E 0x01
That's it. If were supposed to battle Brock, it won't battle anymore. The trainerbattle is disabled.
But now we want to re-enable the trainerbattle. We're still using Brock.
#raw 0x62 0x9E 0x01
How's that? The trainerbattle 0x19E, has now been re-enabled.

Checkitem/removeitem
This time only part #raw. It's like Cry and Playsound, its not coded correctly into the pokescript database. These are probably easier to view through an example.
#org $start
lock
faceplayer
message $1
boxset 5
compare 0x800D 0x1
if 0x1 goto $check
message $2
boxset 6
release
end

#org $check
checkitem 0xD
#raw 0x01 0x00
compare 0x800D 0x1
if 0x4 goto $got
message $2
boxset 6
release
end

#org $got
removeitem 0xD 0x1
giveitem 0x4 0x1
message $3
boxset 6
release
end

#org $1
$1 1 =Would you like to trade this\npokeball for your potion?

#org $2
$2 1 =Ohhh. That's too bad.

#org $3
$3 1 =Yay! Thanks a lot!
We've got a few new things here. We've got:
compare 0x800D 0x1
if 0x1 goto $pointer
[checkitem 0xD] [#raw 0x01 0x00]
if 0x4 goto $pointer
removeitem 0x4 0x1
A bit more than usual. I'll start at the top of my list. This looks a little familiar doesn't it.
compare LASTRESULT 0x1
compare 0x800D 0x1
Guess, why they look similiar, they're the same thing.
0x800D = LASTRESULT
I'm going to be using this type of thing from now on. I'm not going to be "babying" anyone with LASTRESULT anymore.Vrey soon, we're going to start moving into variables. So I'll start introdusing you into them now, so I'm not just introducing you into a new wway of thinking straight away.

if 0x1 goto $pointer, I'll include if 0x4 goto $pointer in this explanation aswell. Up to date, Up to date, we've only used these.
B_<< Lower Than (b_false)
B_== Equals (b_true)
B_>> Greater Than
B_<= Lower than or Equal to
B_>= Greater than or Equal to
B_!= Not exactly equal to

But now I'm going to add to that. Other than what we have here, we can also use values, like 0x1, 0x2, 0x3 etc. I'll propoose a new "table"
B_<< Lower Than (0) (b_false)
B_== Equals (1) (b_true)
B_>> Greater Than (2)
B_<= Lower than or Equal to (3)
B_>= Greater than or Equal to (4)
B_!= Not exactly equal to (5)
Now we can see what each value represents. This is also another way to save time. So instead of writing;
if b_!= goto $notequal
we can just write;
if 0x5 goto $notequal

Saving some time. Pretty useful, huh? From this point on, I'll only be using 0xX, with the if line. I thought I'd warn you, just so it doesn't look like I've totally changed the way I script without notice.

Now checkitem. Another command, not correctly coded. In pokescript its coded like this.
[checkitem] [item number]
But it should be like this;
[checkitem] [item] [amount]
So can you guess what the #raw's are for?
The amount! As always, it's reversed.
As an example, let's say we wan't to check for 10 Masterballs. It would appear like this.
checkitem 0x1
#raw 0x0A 0x00
compare 0x800D 0x1
if 0x4 goto $got
But wait, I haven't explained the compare yet, have I? The compare checks for "Yes, you've got item(0x1)" or "No you don't(0x0)"
And by now you should be able to tell what the if should do by now.

Now, removeitem. It obviously removes an item from your bag. Like giveitem and checkitem, it is set out in the same way.
[removeitem] [amount to remove]
Do I need to give any more explanation? This should be enough info on it.

Copyvar
A little command that's pretty easy to explain. It just copies what's stored in one variable to another variable. Which we will use more and more often, as we progress through the tutorial.
Here's the explanation.
Let's let 0x8008, be "A" ; and let 0x800D, be "B"
[code]copyvar 0x8008 0x800D[/v]
Variable "B" copies onto variable "A"
I know, it's reversed, and the second variable copies to the first variable, but as long as you can remember it. You'll be fine.

Copyvarifnotzero
Here is what some might say, a little "add-on" to the copyvar command. The name says it all doesn't it. Copy Variables, if not equal to zero.
But we can also use this like [i]setvar.
Example 1(Variable Copy)
copyvarifnotzero 0x800D 0x8004
Example 2(Value Copy)
This example I use is actually, what's behind the give item command.
copyvarifnotzero 0x8000 0xD
copyvarifnotzero 0x8001 0x1
boxset 0x0
That's about it. Pretty basic?

Setvar
Since this is a pretty complicated command, and has a lot of uses. I'm just going to give an explanation of the command, but not give examples of the different ways to use it. In the following few sections you'll see some way's of using it.
Setvar is pretty simple naming, set to variable. It sets a certain value, ranging from 0x0 to 0xFFFF, to a certain valuable. It's just set out simply like this.
[setvar] [variable] [value]
Here's just a sample view of how the command appears.
setvar 0x8008 0x1
If it's still hard to think about, try thinking of it as a boxset 5. Depending on whether or not we choose "Yes" or "No" it assigns a certain value to 0x800D. With setvar we can choose the variable and the value that is assigned.
You'll see more of this from this point on.

Randomisation
Another #raw. #raw 0x8F. With this command, the rom will choose a random number depending within the range of 0x0 to the value you set with the arguement, and then assign it to 0x800D (LASTRESULT). So here's a little example.
#raw 0x8F 0x03 0x00
compare 0x800D 0x0
if 0x1 goto $option1
compare 0x800D 0x1
if 0x1 goto $option2
compare 0x800D 0x2
if 0x1 goto $option3
So again, you may have noticed, the value after #raw 0x8F is reversed!.
By now, I shouldn't need to explain this anymore. That should be about it. I'll show an extra example if you need, but I shouldn't need to explain anymore.
#raw 0x8F 0x0A 0x00
compare 0x800D 0x0
if 0x1 goto $1
compare 0x800D 0x1
if 0x1 goto $2
compare 0x800D 0x2
if 0x1 goto $3
compare 0x800D 0x3
if 0x1 goto $4
compare 0x800D 0x4
if 0x1 goto $5
compare 0x800D 0x5
if 0x1 goto $6
compare 0x800D 0x6
if 0x1 goto $7
compare 0x800D 0x7
if 0x1 goto $8
compare 0x800D 0x8
if 0x1 goto $9
compare 0x800D 0x9
if 0x1 goto $10
That should be about it.

Special2
I'll show an example script fragment. This is a "checkpokemon" only usable for Fire Red.
setvar 0x8004 0x19
special2 0x800D 0x17C
compare 0x800D 0x1
if b_true goto $have
Luckily, we've also got lesson 1 on setvar.
First we assign the value to the variable 0x8004. Using this command, this value is the Pokemon we want to check for. In this case it's Pikachu.
Now we have special2. special2 is set out like this.
[special2] [Variable to store value] [event to call]
The event we use is 0x17C; this checks if the Pokemon that we have set to 0x8004, is in our party. If it is in our party, a 0x1 is assigned to the variable, which in this case is 0x800D(LASTRESULT) ; if it's not in our party 0x0 is assigned to the variable, thich in this case is 0x800D(LASTRESULT).
Now the following compare and if act in the same way as the compare and if used with the checkitem. If you've forgotten, here's a quote of myself.
The compare checks for "Yes, you've got item(0x1)" or "No you don't(0x0)"
And by now you should be able to tell what the if should do by now.
There you go, Lesson 1 on setvar, and special2.

Special PART 2
That's right, we're adding to the special[i/] command. Well, actually, not really, I'm just going to tell you about waitspecial command, which is of course, a #raw.
[i]#raw 0x27. Wooohoooo! Another #raw.
Let's just use special 0x9D, which in Fire Red, shows the "Old Man Cathes Weedle" scene. But look at how we are going to use it.
special 0x9D
#raw 0x27
Simple as that. No arguments, just #raw 0x27

Movesprite
This will obviously move a sprite from one place to another instantaneously.
It's set out like this.
[movesprite] [People Number] [X Co-ordinate] [Y co-ordinate]
So the people number is the same as it ahs been since the beginning of this tutorial.
The X co-ordinate is the X co-ordinate of the tile that we want to move the Overworld to.
Now obviously, The Y co-ordinate is the Y co-ordinate of the tile that we want to move the Overworld to.
Here's just a simple example of the command. We'll use, people number = 4; X co-ordinate = 12; Y co-ordinate = 5
movesprite 0x4 0x0C 0x5
And if you want another example. People Number = 9; X co-ordinate = 3; Y co-ordinate = 10
movesprite 0x9 0x3 0xA
That's all there is to it.

Setvar Lesson 2
I'll show an example of this command, that I have used in my hack Legend of Dragons. It's three scripts.
Script 1 (Right) tile
#org $start
setvar 0x4003 0x2
goto $script
end

#org $script
checkflag 0x20A
if 1 goto $done
compare 0x4003 0x0
if 1 goto $left
compare 0x4003 0x1
if 1 goto $middle
compare 0x4003 0x2
if 1 goto $right
end

#org $left
applymovement 0xFF $move
applymovement 0x08 $move4
pausemove 0
applymovement 0xFF $move3
goto $cont
end

#org $middle
applymovement 0xFF $move
applymovement 0x08 $move5
pausemove 0
applymovement 0xFF $move3
goto $cont
end

#org $right
applymovement 0xFF $move
applymovement 0x08 $move2
pausemove 0
applymovement 0xFF $move3
goto $cont
end

#org $cont
message $1
boxset 5
compare 0x800D 1
if 0x1 goto $100
message $2
boxset 6
goto $100
end

#org $100
message $3
boxset 5
compare 0x800D 1
if 0x1 goto $101
message $4
boxset 6
goto $102
end

#org $101
message $5
boxset 6
goto $102
end

#org $102
setflag 0x20A
setflag 0x20B
applymovement 0x08 $move6
pausemove 0
#raw 0x53 0x08 0x00
release
end

#org $done
release
end

#org $move
#raw 0x62 0x03 0xFE

#org $move2
#raw 0x62 0x12 0x12 0x12 0x12
#raw 0x10 0x12 0x12 0x12 0x12
#raw 0x01 0xFE

#org $move3
#raw 0x04 0xFE

#org $move4
#raw 0x62 0x12 0x12 0x12 0x12
#raw 0x10 0x12 0x12 0x12 0x12
#raw 0x12 0x12 0x01 0xFE

#org $move5
#raw 0x62 0x12 0x12 0x12 0x12
#raw 0x10 0x12 0x12 0x12 0x12
#raw 0x12 0x01 0xFE

#org $move6
#raw 0x13 0x13 0x13 0x13 0x13
#raw 0x13 0x13 0x13 0x13 0x11
#raw 0x13 0x13 0x13 0xFE

#org $1
$1 1 =\c\h01\h08I see you're up early this\nmorning. I guess this means\lyou're excited.\pI need to tell you something\nIs that okay?

#org $2
$2 1 =\c\h01\h08Too bad. I'm going to tell\nyou anyway.

#org $3
$3 1 =\c\h01\h08Unfortunately, I'm going to be a\nbit late.\pI need to take care of a few\nthings before I can go to the\lthe Dragon's Den.\pWhy don't you go ahead\nand I'll meet you there?

#org $4
$4 1 =\c\h01\h08Well, you have no choice\nin this.

#org $5
$5 1 =\c\h01\h08I'll meet you at the front\nof the room.
Script 2 (Middle) tile
#org $start
setvar 0x4003 0x1
goto 0x8017CC
end

Script 1 (Left) tile
#org $start
setvar 0x4003 0x0
goto 0x8017CC
end


You'll see the beginning of every script is this.
#org $start
setvar 0x4003 0x[value]
goto $pointer
end
So What we're doing here is we are assigning a certain value depending on which tile we stand on, that we will be able to call upon later.
I'll explain the goto a little later. But for now, let's look at what's in Script 1 under $script. We've got the usual, checkflag 0x[flag] to prevent the event from repeating itself.
Now we've got some compare lines.
compare 0x4003 0x0
if 0x1 goto $left
compare 0x4003 0x1
if 0x1 goto $middle
compare 0x4003 0x2
if 0x1 goto $right
The pointers give away what they are there for, don't they? They're checking depending on which value was set, we will go to a different set of movements. This is a great way to save space, and instead of us compiling that big ugly script 3 times, with slightly altered movements, we can compile that once, and two neat scripts. Also that value will not change until you set a different value to that variable. The rest of Script 1 is pretty straightforward. Let's get back to that goto.
I haven't actually explained goto yet, have I? We've only seen it with if. Well at this point, if you've followed the rest of this tutorial, it should be obvious what the command does. It will goto a specified point, whether is be a $pointer or a 0x[hex address]. The command is set out like this.
[goto] [pointer]
Now we've covered that, let's get back to what we were looking at. The beginning of scripts 1, 2 and 3.
Look at the similiarities between each one.
#org $start
setvar 0x4003 0x0
goto 0x8017CC
end

#org $start
setvar 0x4003 0x1
goto 0x8017CC
end

#org $start
setvar 0x4003 0x2
goto $script
end

Obviously, 0x8017CC, is $script. But how did I get that pointer.
Let's compile script 1 into the rom. After it's been burnt to the rom, in bufrite, we should see a list of the different names between the pointers.
We should have something like this.
- Pushed multi test.$start to 8007E6
- Pushed multi test.$script to 80083C
- Pushed multi test.$done to 80086D
- Pushed multi test.$left to 80089E
- Pushed multi test.$middle to 8008CF
...etc....

We need to take that pointer that is after $script. That is our pointer that we will use with script 2 and script 3.
So if I were to use these pointers as an example, my Script 2 would be this.
#org $start
setvar 0x4003 0x2
goto 0x80083C
end

I'd say that's all on setvar.... for now.

Resetvars
Another #raw. This command doesn't reset every variable, just 0x8000, 0x8001 and 0x8002.
It's just a little command #raw 0x2E. It doesn't need any extra arguments. All it needs it this:
#raw 0x2E

Money Commands
This is a pretty big section, so I'll split it up into 6 sections for each of the money related commands, all #raw's.
givemoney [#raw 0x90]
takemoney [#raw 0x91]
checkmoney [#raw 0x92]
Showmoneybox [#raw 0x93]
Hidemoneybox [#raw 0x94]
updatemoneybox [#raw 0x95]
I'll explain them in the order they were listed order listed.
Givemoney
The "name" gives it away. This command, #raw 0x90, will give the player a designated amount of money. The command is set out like this.
Let XX, be the money value reversed
[#raw 0x90] [XX] [XX] [XX] [XX] [#raw 0x00]
The final [#raw 0x00] actually determines whether it updates your money account. The reason I've left it at [#raw 0x00], and not a simple explanation of what it is, is because if it were changed to #raw 0x01, the money balance does not change and therefore defeats the purpose of the giving the player money. I'll move onto explaining the money now.
I'll give you an example to show what's happening. We'll use the amount 10,000. so let's convert 10000 to Hex, which gives us 0x2710. Since we need four bytes, let's write 2710 as 00 00 27 10, and now reverse it, to get 10 27 00 00.
So here's our command.
#raw 0x90 0x10 0x27 0x00 0x00 0x00
That's a long line but you should be able to understand what's happening. I'll give another example, just incase you need it.
Money amount = 500 [hex = 0x1F4]
#raw 0x90 0xF4 0x01 0x00 0x00 0x00
I'd say that's enough information on #raw 0x90.

Takemoney
Like, the givemoney, the name gives the function away. This command takes money from the player.
Takemoney, of course, is a #raw command. It's #raw 0x91. The command is set up in an almost identicle manner to the #raw 0x90. I'll show the setup again, just incase you forgot already.
Let XX, be the money value reversed
[#raw 0x91] [XX] [XX] [XX] [XX] [#raw 0x00]
The final [#raw 0x00] has the same function as what it does with #raw 0x90.
Just incase you wanted it, here's an example.
Money amount = 600 [Hex = 258]
#raw 0x91 0x58 0x02 0x00 0x00 0x00
Tadah. You've now learnt the give, and takemoney commands.

Checkmoney
This command of course checks if your account for a designated amount of money. Ofcourse Checkmoney isn't a coded command, and is #raw 0x92. It's set up in the same way as the previous two commands, but there is a defference. I'll show how it's set up.
[#raw 0x92] [XX] [XX] [XX] [XX] [#raw 0x00]
Looks the same, doesn't it? That's because it does look exactly the same. The difference is the reason for the [#raw 0x00] at the end is for something different than the other two.
[#raw 0x00] would mean "Check Money account," [#raw 0x01] would mean "Don't check Money account". So if you were to use [#raw 0x01], it just defeats the purpose of the command, and there would be no point to it.
Now, how do we call upon the amount. Remember the countpokemon command? We check in that same way. Using the compare and if lines.
Here's also a little example, just in case that wasn't explained very well.
Conditions:
Money amount = 1000 [Hex = 3E8] ;
Need at least 1000 to continue in script
#raw 0x92 0xE8 0x03 0x00 0x00 0x00
compare 0x800D 0x1
if 0x4 goto $continue
message $notenough
boxset 6
Just incase, you feel that you need another example. Here it is.
Conditions:
Money amount = 20,000 [Hex = 4E20] ;
Need at less than 20,000 to continue in script
#raw 0x92 0x20 0x4E 0x00 0x00 0x00
compare 0x800D 0x1
if 0x0 goto $continue
message $toomuch
boxset 6

ShowMoneyBox
This breaks away from the style that the other money commands are written in. This command is #raw 0x93. It' set out like this.
[#raw 0x93] [X co ordinate] [Y-co-ordinate] [#raw 0x00]
Okay, of course the first byte is always the command. Then it's followed by the X co-ordinate and the Y-co-ordinate on the screen. Personally, I just the co-ordinates, (0,0). I think by now, you can just trust me and just use [#raw 0x00] for that last byte. There is a reason. But if you remember the reasons for the previous commands, just believe me and use the [#raw 0x00].
Here's a little example of what how it is set out.
X and Y co-ordinates - (0,0)
#raw 0x93 0x00 0x00 0x00
This box will appear in the top left hand corner of the screen.

HideMoneyBox
This one is also different from the rest of them. This command is #raw 0x94, and it's set out like this.
[#raw 0x94] [X co ordinate] [Y-co-ordinate]
First byte, obviously the command. The second and third arguements, are just the co-ordinates of the shown money box.
If I were to write this to counter-act the effect of my previously shown script, my hidemoneybox line would appear like this.
#raw 0x94 0x00 0x00
Nice and Simple.

UpdateMoneybox
Last money command. #raw 0x95. It's simply set out like this.
[#raw 0x95] [X-Co-ordinate] [Y-co-ordinate] [#raw 0x00]
Like the #raw 0x94 command, the X & Y co-ordinates need to compliment the co-ordinates of the #raw 0x93. And since, I feel there is now no point in explaining this last command, let's just call it a buffer. Well, I guess, I'll just show an example.
#raw 0x95 0x00 0x00 0x00
I guess, now I can move onto some differnt commands now.

Addvar
"Add to Variable" yet another #raw. Before I explain what it does, I'll show you how it's set out.
[#raw 0x17] [Variable Reversed] [Variable Reversed] [Value Reversed] [Value Reversed]
#raw 0x17 will add the designated value to the value that is already stored within the designated variable. What a mouthful. If that's a little complicated I'll simplify it.
As an example, let's say the varaible 0x4036 already has the value 0x1 stored into it, and we want to add 0x3 to it, to make it 0x4.
So I'll put it into a scripted example.
setvar 0x4036 0x1
#raw 0x17 0x36 0x40 0x01 0x00
You'll notice all the reversing. Of course, Everything is reversed within a byte value.
That's pretty much all there is to it, it's up to you to find a use for it.

Subvar
Of course, since we can add to a variable, we must be able to subtract from the variable. It's set out in the exact same way as #raw 0x17. The only difference, subvar is #raw 0x18
[#raw 0x18] [Variable Reversed] [Variable Reversed] [Value Reversed] [Value Reversed]
Since, it's just the opposing function to #raw 0x17, I think I can just go straight through to the example.
setvar 0x4004 0x6
#raw 0x18 0x04 0x40 0x03 0x00
In the example, it takes 0x3 from what is stored in the variable 0x4004.

DontFaceplayer
A relatively useless command. But I thought, it migh be worth knowing.
It's just #raw 0x69. There's no other arguments. As I said, it's an almost useless command. But just something to add to your memory banks.

Pokepic
#raw 0x75. The name may be a little misleading. This command, can bring up an image of a designated Pokemon. The command is set out like this.
[#raw 0x75] [PokemonNo. reversed] [Pokemon No. reversed] [X-coordinate] [Y-co-ordinate]
Okay. We obviously need to begin with the command. It's then followed by the Pokemon number, which needs to be in hex and then converted. This is then followed by the X and Y co-ordinates of where you want the image of the pokemon to appear. So here's a little example to help clarify things.
Conditions:
Pokemon = Dratini
Co-ordinates = (10,3) Center of Screen.
#raw 0x75 0x93 0x00 0x0A 0x03
I'd say that's about it for now but I'll show a bigger example, in the next section.

ClosePokepic
Without using this, you're Pokepic Box, will remain open until you leave the map, and the map has time to reload.
The command is just #raw 0x76. There's no need for any arguments.
Well, here's an example of the two commands combined in a fragment of a script.
#raw 0x75 0x01 0x00 0x0A 0x03
message $1
boxset 5
compare 0x800D 0x1
if 0x1 goto $seen
#raw 0x76
message $2
.....
.....etc.

#org $seen
#raw 0x76
message $3
boxset 6
.........
.........etc.

#org $1
$1 1 =Have you seen this pokemon?

#org $2
$2 1 =That's too bad.

#org $3
$3 1 =That's cool. I wish I could\nsee it.
The #raw 0x76 just closes the pokepic box.

Door Commands
There are three door related commands.
#raw 0xAC [prepare to open door]
#raw 0xAD [prepare to close door]
#raw 0xAE [activate door animation]

I guess we'll start with #raw 0xAC.
Open Door
This obviously opens doors on a map. It's set out like this.
[#raw 0xAC] [X co-ordinate reversed] [X co-ordinate reversed] [Y co-ordinate reversed] [Y co-ordinate reversed]
Here's an example. Oak's Lab's Door, in Pallet towns co-ordinates are (16,13) [hex (10,0D]
So here's the example.
#raw 0xAC 0x10 0x00 0x0D 0x00
So try it in a rom. Did it work?
It didn't, did it?
Here's the reason why. It need to be followed by this command.

Doorwait
This command needs to follow both #raw 0xAC and #raw 0xAD. Without this command following, they don't work. this command, #raw 0xAE doesn't need any arguments. Here's an example, with the "Door open" command.
#raw 0xAC 0x10 0x00 0x0D 0x00
#raw 0xAE

Door Close
This is ofcourse, #raw 0xAD. It's set out in the same way as the #raw 0xAC command. I'll show you the set-up again, just in case you've already forgotten.
[#raw 0xAD] [X co-ordinate reversed] [X co-ordinate reversed] [Y co-ordinate reversed] [Y co-ordinate reversed]
I'm going to show an example of using all three commands.
#raw 0xAC 0x10 0x00 0x0D 0x00
#raw 0xAE
applymovement 0xFF $move
pausemove 0
#raw 0xAD 0x10 0x00 0x0D 0x00
#raw 0xAE
warp 0x4 0x3 0x0

Coin Commands
There are 6 coin commands, and they are very closely "related" to the money commands, as they have similiar arguments. Well, I'd better list the different commands.
Check Coins
Give Coins
Take Coins
Show coin counter
Hide Coin Counter
Update Coin counter
I'll work my way from the top down, I guess.

Check Coins
This is a pretty simple command, and isn't as difficult as long as the check money. It checks to see if you have a certain amount of coins. It's set out like this.
[#raw 0xB3] [Amount reversed] [Amount reversed]
Since we can only hold a maximum of 9999 [hex = 0x270F] coins we only need to use the double byte value (word). So here's a short little example.
Check for 3000 coins ; If higher than, continue
#raw 0xB3 0xB8 0x0B
compare 0x800D 0x1
if 0x4 goto $continue

Give Coins/Take coins
Since they have similiar aguments, I thought I'd just put these two together. The command for givecoins is #raw 0xB4 and the command for Take Coins is #raw 0xB5.
This is how they are set out.
[command] [Amount reversed] [Amount reversed]
I guess, I'll give an example of both and we can move onto the other three commands.
Give Coins
Give 1000 coins
#raw 0xB4 0xE8 0x03
and
Take Coins
Take 1000 coins
#raw 0xB5 0xE8 0x03

Show coin Counter
This command, will display a little box with your coin count. The command for this is #raw 0xC0. It's set out in a similiar way, to the "show money box," except you can drop off the last argument. If you wanted to see it again, this is how the command is set out.
[#raw 0xC0] [X-Co-ordinate] [Y-co-ordinate]
As an example, the co-ordinates (0,0) will appear like this.
#raw 0xC0 0x00 0x00
Not that hard, is it?

Hide coin Counter
This command obviously hides the coin counter that was brought up with the #raw 0xC0 command. This command is #raw 0xC1. It's set out in the same way as #raw 0xC0. But if you want to see it again, here it is.
[#raw 0xC1] [X-Co-ordinate] [Y-co-ordinate]
Just remember that without this command, the counter will remain, until the map is reset.
I might save the example for the next section.

Update coin Counter
This will of course update the coin counter, and show any changes within your "coin balance." This is done with the #raw 0xC2 command. How's this set out? I bet you would be able to guess correctly. The same way as the #raw 0xC1 and #raw 0xC2, and just for the fun of it, I'll show the example again.
[#raw 0xC2] [X-Co-ordinate] [Y-Co-ordinate]
So here's that I promised. I'll make it a little bigger than what I normally do. I should n't have to explain out this script, you should be able to understand it.
#raw 0xC0 0x00 0x00
#raw 0xB5 0xE8 0x03
#raw 0xC2 0x00 0x00
message $1
boxset 5
compare 0x800D 0x1
if 0x1 goto $begin
#raw 0xC1 0x00 0x00
message $2
boxset 6
release
end

#org $1
$1 1 =Is there anything else?

#org $2
$2 1 =Thank you, please come again.
There, I've used four of the six in a few lines of one script.

I'm going to need to wait for someone to post before I post the rest, to stop the merging of my posts.

thethethethe
March 1st, 2008, 02:50 PM
Displaying Names/Values
Okay, the title may be a little hard to understand. This section is dedicated to assigning Names of Pokemon, Names of Items and Numbers to \v\h02 and others of the sort.
Okay here's a list of the commands, that we will go over.
Display Pokemon Name [#raw 0x7D]
Display First Pokemon Name [#raw 0x7E]
Display Item Name [#raw 0x80]
Display Attack [#raw 0x82]
Display Value of Variable [#raw 0x83]
Like always, I'll start at the top and work my way down.

Display Pokemon Name
With this, we will assign a certain Pokemon's name to a\v\hXX. To do this, we will need the command setvar. That's right, we are going over another use of the command. As you should ave read in the list this command is #raw 0x7D.
It's set out like this.
[#raw 0x7D] [\v\hXX] [Variable reversed] [Variable Reversed]
So how's setvar involved? We need to assign the Pokemon's Number to the variable, that we plan on using with the command. I'm going to use 0x800D. Just to refresh your memories, what is 0x800D?
LASTRESULT
So here's the example. We are going to assign Charizard's name to \v\h02.
setvar 0x800D 0x6
#raw 0x7D 0x00 0x0D 0x80
message $1
boxset 6
release
end

#org $1
$1 1 =How is \v\h02?
Nice and basic, but just incase you wanted a second example, I'll 'chuck' one more below.
Pokemon = Chikorita ; Storing to? = \v\h03
setvar 0x4002 151
#raw 0x7D 0x01 0x0D 0x80
message $1
boxset 6
release
end

#org $1
$1 1 =How's \v\h03 going?
Now the next command.

Display First Pokemon Name
This command is set out a little differently, to the one above. Since we are just getting the name of you First Pokemon in your party, there is no need for the variable. We can just set it out like this.
[#raw 0x7E] [\v\hXX]
There's just two bytes needed for it to work.
So since it's such a short command. I'll just show an example. In the example, we're going to show how to assign the First Pokemon in party's name to \v\h02.
#raw 0x7E 0x00
message $1
boxset 6
....
....

#org $1
$1 1 =Let me give \v\h02 a haircut.

Display Item Name
This command is #raw 0x80. It's set out in the exact same way that #raw 0x7D. But it's still worth showing. In case you've forgotten how #raw 0x7D is set out, here's how #raw 0x80 is set out.
[#raw 0x80] [\v\hXX] [Variable reversed] [Variable Reversed]
Since, there really sn't too much need for a second explanation, I'll move straight into the example.
setvar 0x800D 0x4
#raw 0x80 0x00 0x0D 0x80
message $doyou
boxset 5
....
....
....

#org $doyou
$doyou 1 =Do you have any \v\h02s?
Notice how I've added "s" straight after \v\h02. If you don't know why, it's so that the message will appear like this.
Do you have any Pokeballs?

Display Attack
I bet you could probably guess how this command is set out. It's done the same way as #raw 0x80 and #raw 0x7D. It's set out like this.
[#raw 0x82] [\v\hXX] [variable reversed] [Variable Reversed]
I think the only things is, I haven't given you a list of the attacks yet, have I?
Anyway, here's the list. This will come in more handy a little later.
HEX Values
001 Pound
002 Karate Chop
003 DoubleSlap
004 Comet Punch
005 Mega Punch
006 Pay Day
007 Fire Punch
008 Ice Punch
009 ThunderPunch
00A Scratch
00B ViceGrip
00C Guillotine
00D Razor Wind
00E Swords Dance
00F Cut
010 Gust
011 Wing Attack
012 Whirlwind
013 Fly
014 Bind
015 Slam
016 Vine Whip
017 Stomp
018 Double Kick
019 Mega Kick
01A Jump Kick
01B Rolling Kick
01C Sand-Attack
01D Headbutt
01E Horn Attack
01F Fury Attack
020 Horn Drill
021 Tackle
022 Body Slam
023 Wrap
024 Take Down
025 Thrash
026 Double-Edge
027 Tail Whip
028 Poison Sting
029 Twineedle
02A Pin Missile
02B Leer
02C Bite
02D Growl
02E Roar
02F Sing
030 Supersonic
031 SonicBoom
032 Disable
033 Acid
034 Ember
035 Flamethrower
036 Mist
037 Water Gun
038 Hydro Pump
039 Surf
03A Ice Beam
03B Blizzard
03C Psybeam
03D BubbleBeam
03E Aurora Beam
03F Hyper Beam
040 Peck
041 Drill Peck
042 Submission
043 Low Kick
044 Counter
045 Seismic Toss
046 Strength
047 Absorb
048 Mega Drain
049 Leech Seed
04A Growth
04B Razor Leaf
04C SolarBeam
04D PoisonPowder
04E Stun Spore
04F Sleep Powder
050 Petal Dance
051 String Shot
052 Dragon Rage
053 Fire Spin
054 ThunderShock
055 Thunderbolt
056 Thunder Wave
057 Thunder
058 Rock Throw
059 Earthquake
05A Fissure
05B Dig
05C Toxic
05D Confusion
05E Psychic
05F Hypnosis
060 Meditate
061 Agility
062 Quick Attack
063 Rage
064 Teleport
065 Night Shade
066 Mimic
067 Screech
068 Double Team
069 Recover
06A Harden
06B Minimize
06C SmokeScreen
06D Confuse Ray
06E Withdraw
06F Defense Curl
070 Barrier
071 Light Screen
072 Haze
073 Reflect
074 Focus Energy
075 Bide
076 Metronome
077 Mirror Move
078 Selfdestruct
079 Egg Bomb
07A Lick
07B Smog
07C Sludge
07D Bone Club
07E Fire Blast
07F Waterfall
080 Clamp
081 Swift
082 Skull Bash
083 Spike Cannon
084 Constrict
085 Amnesia
086 Kinesis
087 Softboiled
088 Hi Jump Kick
089 Glare
08A Dream Eater
08B Poison Gas
08C Barrage
08D Leech Life
08E Lovely Kiss
08F Sky Attack
090 Transform
091 Bubble
092 Dizzy Punch
093 Spore
094 Flash
095 Psywave
096 Splash
097 Acid Armor
098 Crabhammer
099 Explosion
09A Fury Swipes
09B Bonemerang
09C Rest
09D Rock Slide
09E Hyper Fang
09F Sharpen
0A0 Conversion
0A1 Tri Attack
0A2 Super Fang
0A3 Slash
0A4 Substitute
0A5 Struggle
0A6 Sketch
0A7 Triple Kick
0A8 Thief
0A9 Spider Web
0AA Mind Reader
0AB Nightmare
0AC Flame Wheel
0AD Snore
0AE Curse
0AF Flail
0B0 Conversion 2
0B1 Aeroblast
0B2 Cotton Spore
0B3 Reversal
0B4 Spite
0B5 Powder Snow
0B6 Protect
0B7 Mach Punch
0B8 Scary Face
0B9 Faint Attack
0BA Sweet Kiss
0BB Belly Drum
0BC Sludge Bomb
0BD Mud-Slap
0BE Octazooka
0BF Spikes
0C0 Zap Cannon
0C1 Foresight
0C2 Destiny Bond
0C3 Perish Song
0C4 Icy Wind
0C5 Detect
0C6 Bone Rush
0C7 Lock-On
0C8 Outrage
0C9 Sandstorm
0CA Giga Drain
0CB Endure
0CC Charm
0CD Rollout
0CE False Swipe
0CF Swagger
0D0 Milk Drink
0D1 Spark
0D2 Fury Cutter
0D3 Steel Wing
0D4 Mean Look
0D5 Attract
0D6 Sleep Talk
0D7 Heal Bell
0D8 Return
0D9 Present
0DA Frustration
0DB Safeguard
0DC Pain Split
0DD Sacred Fire
0DE Magnitude
0DF DynamicPunch
0E0 Megahorn
0E1 DragonBreath
0E2 Baton Pass
0E3 Encore
0E4 Pursuit
0E5 Rapid Spin
0E6 Sweet Scent
0E7 Iron Tail
0E8 Metal Claw
0E9 Vital Throw
0EA Morning Sun
0EB Synthesis
0EC Moonlight
0ED Hidden Power
0EE Cross Chop
0EF Twister
0F0 Rain Dance
0F1 Sunny Day
0F2 Crunch
0F3 Mirror Coat
0F4 Psych Up
0F5 ExtremeSpeed
0F6 AncientPower
0F7 Shadow Ball
0F8 Future Sight
0F9 Rock Smash
0FA Whirlpool
0FB Beat Up
0FC Fake Out
0FD Uproar
0FE Stockpile
0FF Spit Up
100 Swallow
101 Heat Wave
102 Hail
103 Torment
104 Flatter
105 Will-O-Wisp
106 Memento
107 Facade
108 Focus Punch
109 SmellingSalt
10A Follow Me
10B Nature Power
10C Charge
10D Taunt
10E Helping Hand
10F Trick
110 Role Play
111 Wish
112 Assist
113 Ingrain
114 Superpower
115 Magic Coat
116 Recycle
117 Revenge
118 Brick Break
119 Yawn
11A Knock Off
11B Endeavor
11C Eruption
11D Skill Swap
11E Imprison
11F Refresh
120 Grudge
121 Snatch
122 Secret Power
123 Dive
124 Arm Thrust
125 Camouflage
126 Tail Glow
127 Luster Purge
128 Mist Ball
129 FeatherDance
12A Teeter Dance
12B Blaze Kick
12C Mud Sport
12D Ice Ball
12E Needle Arm
12F Slack Off
130 Hyper Voice
131 Poison Fang
132 Crush Claw
133 Blast Burn
134 Hydro Cannon
135 Meteor Mash
136 Astonish
137 Weather Ball
138 Aromatherapy
139 Fake Tears
13A Air Cutter
13B Overheat
13C Odor Sleuth
13D Rock Tomb
13E Silver Wind
13F Metal Sound
140 GrassWhistle
141 Tickle
142 Cosmic Power
143 Water Spout
144 Signal Beam
145 Shadow Punch
146 Extrasensory
147 Sky Uppercut
148 Sand Tomb
149 Sheer Cold
14A Muddy Water
14B Bullet Seed
14C Aerial Ace
14D Icicle Spear
14E Iron Defense
14F Block
150 Howl
151 Dragon Claw
152 Frenzy Plant
153 Bulk Up
154 Bounce
155 Mud Shot
156 Poison Tail
157 Covet
158 Volt Tackle
159 Magical Leaf
15A Water Sport
15B Calm Mind
15C Leaf Blade
15D Dragon Dance
15E Rock Blast
15F Shock Wave
160 Water Pulse
161 Doom Desire
Now I guess I could jump into an example now, coudn't I?
setvar 0x4001 0x13B
setvar 0x4002 0x6
#raw 0x82 0x00 0x01 0x40
#raw 0x7D 0x01 0x02 0x40
message $1
boxset 5
...
...

#org $1
$1 1 =Can \v\h03 use \v\h02?
I just thought, I'd make it a little more confusing.
The message actually says:Can Charizard use Overheat?

Display Value in Variable
This is just used to display a number. Its set out the same way as three, of the previous four commands.
So it's set out like this.
[#raw 0x83] [\v\hXX] [Variable reversed] [Variable Reversed]
But the downside of this command is that it can only display a numbers from 0-65535 [Hex = 0x0 - 0xFFFF]. There is a limit.
So let's show an example. We're going to show, the number 50000 in \v\h02.
setvar 0x800D 50000
#raw 0x83 0x00 0x0D 0x80
message $1
boxset 6
....
....
....

#org $1
$1 1 =Account Balance: \hB7: \v\h02
That's all there is to it.

Signpost box
This is a fun little command. #raw 0xCA. This will turn your normal boxset into a Signpost Box. Well, here's the example.
#org $start
message $1
boxset 6
#raw 0xCA
message $1
boxset 6
#raw 0xCB
message $1
boxset 6
release
end

#org $1
$1 1 =Test.
Try this in a rom.
The first message should appear as a normal boxset 6. But then we use #raw 0xCA. This makes our second boxset 6 become a signpost box. But what's this #raw 0xCB doing here? #raw 0xCB converts the box back into a normal boxset 6. This is just a little playful command, that gave us a break from the commands that are having four and five arguments.

Callasm
This command, is used to call an ASM function that you have added to the rom. I'm not going to write an example, I'm going to use the example of the command used with Mastermind X's "Shiny Hack".
This is his hex script:
0071b7a0h: 23 71 B7 71 08 00 B6 82 00 1E 00 00 00 25 38 01 ; #q·q..¶‚.....%8.
0071b7b0h: 28 01 01 23 71 B7 71 08 02 FF FF FF FF FF FF FF ; (..#q·q..ÿÿÿÿÿÿÿ
With his exaplanation.
[23] //asm call
[XXXXXXXX] //pointer to thumb-sub+1
[00] //filler
[B6] //define wild pokemon
[XXXX] //pokemon-id (INGAME)
[XX] //level
[XXXX] //held Item
[00]
[25] //special-event
[3801] //wild pokemon battle!
[28] //wait
[0101] //a second
[23] //asm call
[XXXXXXXX] //pointer to thumb-sub+1
[02] //end
Now here's my version of his script in a Pokescript Language.
#org $start
callasm 0x71B771
#raw 0x00
wildbattle 0x82 0x1E 0x0
special 0x138
pause 0x101
callasm 0x71B771
end
with a bit more of an explanation.
He has called the ASM function twice. Once, to turn it on, and once to turn it off.
To turn it on, it needs that buffer following the command, and to turn it off, it isn't needed. I think he's explained everything else.

Okay, it's been a while, but here's some more that I've decided to add.

Get Player Position
#raw 0x42, can be used to get the player's X and Y poitions on the map stored into designated variables.
The command is set out like this:
[42] [xxyy] [aabb]
xxyy: Variable for x position
aabb: Variable for y position

So here's an example. With this we'll store the Player's X Position to 0x4000, and the Player's Y position into 0x4001.
....
#raw 0x42 0x00 0x40 0x01 0x40
....

Repeat Trainer Battle
This is a simple command that will begin the Last Trainer battle commenced. It's done simply with command #raw 0x5D.
So we can easily use this in a script by simply doing:
#raw 0x5D

Lock All
Okay, here's a little fix to an error I've made earlier in this tutorial. This command was described as 'Don't Face Player', which is incorrect. This command is similar to lock, only it locks down everyperson on the map.
We use this command with:
#raw 0x69

Release All
This command is used as the opposite to 'Lock All'. It's simply used only with #raw 0x6B. This command will release all sprites on the current map.
Here's how it can be used:
#raw 0x6B

Wait Until Key Pressed
This command can be used as a pause. The command #raw 0x6D is used as a wait until a key is pressed before it continues.
It's used like this:
#raw 0x6D

Display Yes/No Box
This command, #raw 0x6E is somewhat pointless when there is boxset 0x5. It acts in the same way as boxset 0x5 where with a compare, yes = 1 and no = 0. It's only reason for use might be to have some flexibility as to where you want the box to be placed.
The command is set out like this.
[6E] [xx] [yy]
xx: X co-ordinate
yy: Y co-ordinate
So in our script, we might use it like this.
message $1
boxset 0x4
#raw 0x6E 0x0 0x0
#raw 0x68
compare 0x800D 0x1
if 0x1 goto $yes

Multi, msgbox2, waitmsgbox2
Yes, it's something people want to use. So here's a brief guide on the multi, and two other commands that normally accompany it.
I'll show an example first, which will make it easier for me to explain how it's used.
#raw 0x67 0x32 0x12 0x16 0x08
#raw 0x66
multi 0xE 0x0 0x1E 0x0
copyvar 0x8000 0x800D
compare 0x8000 0x0
if 0x1 goto $option1
compare 0x8000 0x1
if 0x1 goto $option2
compare 0x8000 0x2
if 0x1 goto $option3
compare 0x8000 0x3
if 0x1 goto $option4
compare 0x8000 0x4
if 0x1 goto $option5
compare 0x8000 0x5
if 0x1 goto $option6
compare 0x8000 0x7F
if 1 goto $canceled
end

Okay, so #raw 0x67 is usually referred to as msgbox2. The following four bytes refer to the pointer to text. You'll have to look at a later section to know how you can add extra commadn to a default Pokescript.
#raw 0x66 is similiar to command #raw 0x68. This command is special and is used with #raw 0x67 to close it.
Now onto the multi command. YAY! Well, it's set out like this:
[6F] [xx] [yy] [zz] [aa]
xx: X co-ordinate
yy: Y co-ordinate
zz: Multi ID. Refer Multi list
aa: Determines if B = Cancel. 0 means B = Cancel.
So the first two parameters are easy to use. Simply like other commands, they are just the X and Y co-ordinates on the screen.
The third parameter is the options that appear on the multi list. Sorry, it's for Fire Red...
[00] - Yes
No
[01] - Eevee
Flareon
Jolteon
Vaporeon
Quit looking.
[02] - Normal
Black
Pink
Sepia
[03] - Hall of Fame
Quit
[04] - Eggs
Quit
[05] - Victories
Quit
[06] - Hall of Fame
Eggs
Quit
[07] - Hall of Fame
Victories
Quit
[08] - Eggs
Victories
Quit
[09] - Hall of Fame
Eggs
Victories
Quit
[0A] - Exit
[0B] - Exit
[0C] - Exit
[0D] - Bicycle $1,000,000
No Thanks
[0E] - Abra 180 coins
Clefairy 500 coins
Dratini 2,800 coins
Scyther 5,500 coins
Porygon 9,999 coins
No Thanks
[0F] - SLP
PSN
PAR
BRN
FRZ
EXIT
[10] - Yes
No
Info
[11] - Single battle
Double battle
Multi battle
Info
Exit
[12] - Yes
No
Info
[13] - Make a Challenge
Info
Exit
[14] - Rooftop
B1F
Exit
[15] - Helix Fossil
Exit
[16] - Dome Fossil
Exit
[17] - Old Amber
Exit
[18] - Helix Fossil
Old Amber
Exit
[19] - Dome Fossil
Old Amber
Exit
[1A] - Fresh Water $200
Soda Pop $300
Lemonade $350
Exit
[1B] - 50 coins $1,000
500 coins $10,000
Exit
[1C] - Excellent
Not So Bad
[1D] - Right
Left
[1E] - TM13 4,000 coins
TM23 3,500 coins
TM24 4,000 coins
TM30 4,500 coins
TM35 4,000 coins
No Thanks
[1F] - 5F
4F
3F
2F
1F
Exit
[20] - Fresh Water
Exit
[21] - Soda Pop
Exit
[22] - Fresh Water
Soda Pop
Exit
[23] - Lemonade
Exit
[24] - Fresh Water
Lemonade
Exit
[25] - Soda Pop
Lemonade
Exit
[26] - Fresh Water
Soda Pop
Lemonade
Exit
[27] - Trade Center
Colosseum
Exit
[28] - Game Link Cable
Wireless
Exit
[29] - Smoke Ball 800 coins
Miracle Seed 1,000 coins
Charcoal 1,000 coins
Mystic water 1,000 coins
Yellow flute 1,600 coins
No Thanks
[2A] - B1F
B2F
B4F
Exit
[2B] - Linked game play
Direct Corner
Union Room
Quit
[2C] - Two Island
Three Island
Exit
[2D] - One Island
Three Island
Exit
[2E] - One Island
Two Island
Exit
[2F] - Trade Center
Colosseum
Berry Crush
Exit
[30] - Nada
Nada
Exit
[31] - Pokemon Jump
Dodrio Berry-Picking
Exit
[32] - Trade Center
Colosseum
Exit
[33] - 2 Tinymushrooms
1 Big Mushroom
[34] - Trade Center
Colosseum
Berry Crush
Exit
[35] - Trade Center
Colosseum
Exit
[36] - Sevii Islands
Navel Rock
Exit
[37] - Sevii Islands
Birth Island
Exit
[38] - Sevii Islands
Navel Rock
Birth Island
Exit
[39] - One Island
Two Island
Three Island
Exit
[3A] - Vermilion
Two Island
Three Island
Exit
[3B] - Vermilion
One Island
Three Island
Exit
[3C] - Vermilion
One Island
Two Island
Exit
[3D] - Vermilion
Exit
[3E] - Nada
Nada
Exit
[3F] - Join Group
Become Leader
Exit
[40] - Single
Double
Knockout
Mixed
Exit
Now from the example script, you should be able to tell that the selected result from the multi is stored into the variable 0x800D.
Which you should be able to see I copied to variable 0x8000, to see if it would confuse anyone. I hope it didn't. Note that the copyvar was not needed and you can just compare with 0x800D. But you should already know that.
The following compares should be fairly obvious as to what they do. They compare what option has been selected. 0x0 = is the highest option, 0x1 the second highest, and so on until the final option.

How about a string now.
Name Pokemon
Okay, here's a working name Pokemon sequence. Although this one will only work if the Pokemon is given into the party. Okay so here's a script where it can be used. I'll explain it in the code.
But before I do that, Pokemon's party position is [Position] - 1. Okay. So first in line is 0x0. And Sixth would be 0x5. Okay now the script...
countpokemon
compare 0x800D 0x6 'If you have 6 Pokemon, don't continue.
if 0x1 goto $toomany
givepokemon 0x1 0x5 0x0 'Gives a Pokemon
message $2
boxset 0x5 'the obligatory, "Would you like to rename....
compare 0x800D 0x1
if 0x1 gosub $name 'If yes call
....
.... 'Who cares about this part?

#org $name
countpokemon 'Counts Pokemon
#raw 0x18 0x0D 0x80 0x01 0x00 'Takes one away from 0x800D. Reason Above.
copyvar 0x8004 0x800D 'copies over to 0x8004 which is used by special 0x166
fadescreen 0x1 'Fade Screen to black
special 0x166 'Name Pokemon, Party number at 0x8004
#raw 0x27 'Wait for Special
return 'Returns

#org $toomany
message $1
boxset 0x6
release
end

#org $1
$1 1 =Your party is full, deposit one to\nmake room.

#org $2
$2 1 =Would you like to rename this\nPokemon?
Hope that helped.

Store Pokemon to Pokedex
Okay, so here's another string like the Name Pokemon above. It simply adds a Pokemon to the 'Seen' section of your Pokedex.
This one is fairly easy to do. Here's the script, it'll make it easier for me to explain.
setvar 0x8004 0x5
special 0x163
See nice and short.
Pretty basic too. We prepare the Pokemon we want to set to 'Seen' to 0x8004. So in this case, I'm preparing Charmeleon to appear as Seen.
Special 0x163 only finishes the job and actually sets it as Seen in your Pokedex.

Okay, only a little Command update, but the main reason for the update was to give some information on editing the Pokescript commands Database.
Editing the Database
Ever wondered whats included in the folder where Pokescript is installed, or more importantly, whats in the PkmAdv Folder.
We should have 6 files... includes.psh; install.psc; items.psh; stdpoke.psh; texttable.psh and Commands.psh.
Okay, of these files, I only wouldn't touch Install.psc. Don't touch it.
See those .psh files, we can open those in Notepad. So let's open stdpoke.psh. We have a file 'defining' a lot of Pokemon. Well these actually mean that we can use some commands like this.
givepokemon pkmn_Raichu 0x5 0x0
And if we wanted to look at items.psh, and now we know we can write that previous line as this.
givepokemon pkmn_Raichu 0x5 item_netball
You can edit these files to allow these items to be controlled as whatever you want them to be. You could just rename item_pokeball to simply pball.

Okay, well that's all a bit of fun, but let's now open up commands.psh in notepad.
As soon as it's opened you'll have some information on how commands have been written by Pokescript.
Well here's my basic rundown on the different possibilities.
addcmmd [Command Name] [Hex Value]
alias [Command Name] $options
addparm [Type] [Data]
Okay these well make more sense the more you read through the file.
you may even come across something like this.
alias TIF $1
addparm 7 if1
addparm 0 mask(#01) 'A mask which makes it automatically 0x1
addparm 3 'Pointer

If you can understand any of that, you can edit the database.
If not, here's mine, with lots of changes. You'll have to look at all the files to see exactly what I've done, as I've changed and added quite a bit.

Download (http://fs03n5.sendspace.com/dl/d610a7ec48d1cde138d21cdf5020f882/48cba73b5467c753/o04fx5/PkmAdv.rar)
Mirror (http://www.pokecommunity.com/attachment.php?attachmentid=42795&stc=1&d=1221306391)
Instructions:
Download File.
Paste into folder where Pokescript is stored.
Extract Zip File to that place.
Replace existing files in PkmAdv.

NOTE:There will be no more added after this.
I won't be adding anymore to this tutorial after this point.

destinedjagold
March 1st, 2008, 03:15 PM
a VERY useful tutorial.
A helpful thread for hackers, indeed.

Great work, thethethethe! I'll be visiting this thread more often then! :D

derv1205
March 1st, 2008, 03:31 PM
Awesome thex4, i havent read the las two you post, but i'm sure it will
be fantastic, it's just too long xD lol Good job bud ;)

ZodiacDaGreat
March 1st, 2008, 03:34 PM
Wow! Really nice and detailed tut! Covers alot!
So it would useless to post new scripting tutorials, even for XSE, as this is the best tut
Goodluck in covering all the commands!!!

/Circa
March 1st, 2008, 05:20 PM
I see why this took you so long, it's a very handy tutorial, and explains alot of things.
I got a few pm's about adding this to the tutorials list, which i'm going to, plus add a bold and underline :P. It's very helpful.

Dr.Garchomp
March 1st, 2008, 08:42 PM
Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!This makes ALOT more sense now. Scripting is my one hacking nightmare, but I feel a lot more familiar with it now. I can actually get work done now... >_>

Darkrai☻
March 2nd, 2008, 02:19 AM
And you're the one saying they're was too much pokescript tutorials?

hi sir tomato my password is syvniti
March 2nd, 2008, 02:27 AM
And you're the one saying they're was too much pokescript tutorials?I think he said, there were to many "Empty" tutorials?

Anyway Thex4 this guide is great, Im far from have been reading it all but it's relly good... It's nice whith a guide that eksplain more then just the flag, tekst couler and aplymovemnet... Great job!

thethethethe
March 2nd, 2008, 03:39 AM
Thanks Christos for moving my posts together.

I'm glad people are finding this useful.

And you're the one saying they're was too much pokescript tutorials?

Sorry if my statement in my signature had room for misinterpretation. I merely meant that the flood of new tutorials had nothing new to offer. They only covered the general commands like messages/movements/giving pokemon/giving items. They didn't offer any new ideas, or in this case, "new" commands. I admit, I've added to the 'pile' of scripting tutorials here at PC, but I've offered up lots more here than what any of the others did. Hopefully you see where I'm coming from now.

EarthsVisitor
March 2nd, 2008, 10:42 AM
I'd like to see some more, unusaul commands explained.

Like, Multi-Choice, Set Healing Place, Pokemart, Create Sprite, End Trainer Battles, Obediences, etc
:]
Good work so far.

derv1205
March 2nd, 2008, 05:39 PM
Hi bud, hey, when i put setflag 0x829 for the PokeDex Menu, all the script works perfectly, but
when i put start, and try to enter the PokeDex it doens open :S

thethethethe
March 2nd, 2008, 09:26 PM
I'd like to see some more, unusaul commands explained.

Like, Multi-Choice, Set Healing Place, Pokemart, Create Sprite, End Trainer Battles, Obediences, etc
:]
Good work so far.
Always a perfectionist...
Pokemart's there.
I think you showed me that, didn't you?
I was going to include Multi with what I've posted, but then I thought I'd cover a few more things before I got to it. Actually, I might write that part up now. I've yet to play around with some of the commands, like all the warps which I'm testing out, get player position, the casino, create sprite,etc. I've still got to test a few of these out. But don't worry, I will get to them.

Hi bud, hey, when i put setflag 0x829 for the PokeDex Menu, all the script works perfectly, but
when i put start, and try to enter the PokeDex it doens open :S
Ummm. I'm not too sure why that would happen. Maybe if you don't have a pokemon it won't work. I'm not too sure, I'd need to know a little more...

xFailed_Mutationx
March 3rd, 2008, 06:50 PM
How come when ever I use the Shop or save in an area around Event placed people, My character turns into that person and I can only control it? My Regular character becomes immobile and I'm controlling the shop keeper o_o;

derv1205
March 4th, 2008, 05:16 PM
Hi, you where right bud xD lol, I have to have a pokemon for the Dex to open ^^
...
hey, i insert this in PokeScript and put it in a minisprite, but when i talk him the game restarts :S
I tried it in Ruby and FireRed
#org $start
callasm 0x71B771
#raw 0x00
wildbattle 0x151 30 0x0
special 0x138
pause 0x101
callasm 0x71B771
end


What else i have to put for the ASM ?

Erick
March 13th, 2008, 08:42 PM
Here's a Table for all the hex codes of each symbol.

01=À
02=Á
03=Â
04=Ç
05=È
06=É
07=Ê
08=Ë
09=Ì
0B=Î
0C=Ï
0D=Ò
0E=Ó
0F=Ô
10=Æ
11=Ù
12=Ú
13=Û
14=Ñ
15=ß
16=à
17=á
19=ç
1A=è
1B=é
1C=ê
1D=ë
1E=ì
20=î
21=ï
22=ò
23=ó
24=ô
25=æ
26=ù
27=ú
28=û
29=ñ
2A=º
2B=ª
2C=·
2D=&
2E=+
34=[Lv]
35==
36=;
51=¿
52=¡
53=[PK]
54=[MN]
55=[PO]
56=[Ke]
57=[BL]
58=[OC]
59=[K]
5A=Í
5B=%
5C=(
5D=)
68=â
6F=í
79=[u]
7A=[D]
7B=[L]
7C=[R]
A1=0
A2=1
A3=2
A4=3
A5=4
A6=5
A7=6
A8=7
A9=8
AA=9
AB=!
AC=?
AD=.
AE=-
AF=·
B0=[...]
B1="
B2=["]
B3='
B4=[']
B5=[m]
B6=[f]
B7=$
B8=,
B9=[x]
BA=/
BB=A
BC=B
BD=C
BE=D
BF=E
C0=F
C1=G
C2=H
C3=I
C4=J
C5=K
C6=L
C7=M
C8=N
C9=O
CA=P
CB=Q
CC=R
CD=S
CE=T
CF=U
D0=V
D1=W
D2=X
D3=Y
D4=Z
D5=a
D6=b
D7=c
D8=d
D9=e
DA=f
DB=g
DC=h
DD=i
DE=j
DF=k
E0=l
E1=m
E2=n
E3=o
E4=p
E5=q
E6=r
E7=s
E8=t
E9=u
EA=v
EB=w
EC=x
ED=y
EE=z
EF=[>]
F0=:
F1=Ä
F2=Ö
F3=Ü
F4=ä
F5=ö
F6=ü
F7=[u]
F8=[d]
F9=[l]
FA=\l
FB=\p
FC=\c
FD=\v
FE=\n
FF=\x



Which of these one are for the arrows [UP, LEFT, DOWN, RIGHT]?
For example to put them on a signpost?

Thanks ^^

derv1205
March 14th, 2008, 10:23 PM
Hi dude, i made this for the ASM Script:
First, script:
#org $start
callasm 0x71B7A0
#raw 0x00
wildbattle 0x82 0x1E 0x0
special 0x138
pause 0x101
callasm 0x71B7A0
end

And in the Hex Editor (I use HexWorkShop)
http://img175.imageshack.us/img175/171/muestrahexworkshopasmmiwu1.png
LINK: http://img228.imageshack.us/img228/9154/muestrahexworkshopasmbl4.png

So...what's going on =S When i talk to the guy or the pokemon that has to battle, the
game freezes...

Dan13x
March 14th, 2008, 11:54 PM
Wow thethethethe! I never knew you were such a talented scripter! Excellent!

thethethethe
March 15th, 2008, 06:43 PM
Sorry, I kinda, forgot about this thread.

[/spoiler]

Which of these one are for the arrows [UP, LEFT, DOWN, RIGHT]?
For example to put them on a signpost?

Thanks ^^

Am I too late?
It's these ones.
79=[u]
7A=[D]
7B=[L]
7C=[R]

U for Up
D for Down
L for Left
R for Right
Hi dude, i made this for the ASM Script:
First, script:
#org $start
callasm 0x71B7A0
#raw 0x00
wildbattle 0x82 0x1E 0x0
special 0x138
pause 0x101
callasm 0x71B7A0
end

And in the Hex Editor (I use HexWorkShop)
http://img175.imageshack.us/img175/171/muestrahexworkshopasmmiwu1.png
LINK: http://img228.imageshack.us/img228/9154/muestrahexworkshopasmbl4.png

So...what's going on =S When i talk to the guy or the pokemon that has to battle, the
game freezes...

Honestly, I don't know what the problem is. The "Shiny Hack" isn't something I've done lately. Sorry.

Jack of Bl♠des
March 15th, 2008, 08:45 PM
Hey the4 , I was reading through this tut on the special2 section, but there was one question I had to post. Is there a way to remove a pokemon from your party? Not just relocating them to your PC , but basically removing them from the game. There was something going on in my hack where I wanted to imput the option to choose between keeping or releasing a pokemon that you've already purchased, but I now realize removing a pokemon isn't the same as releasing an item.

/Circa
March 15th, 2008, 09:31 PM
I don't actually think you can remove a Pokemon, I remember in shinygold you cant access your pokemon anymore, but that was just a simple command. If this was possible I would be interested in it aswell. But since there is nothing identical to that feature in an actual game, it would be extremely hard to decipher.

Jack of Bl♠des
March 15th, 2008, 09:57 PM
It would be a shame if that wasn't possible. If not, then is there a way to simulate trading with NPC's in the games? I'm not sure if it was in R/S, but I remember being able to do that in the Color/Metal Generations (I've never played FR or LG, so I dunno if it was there).

cooley
March 18th, 2008, 11:53 AM
Hey thethethethe, Its been awhile.

I was doing some setvar scripts but they don't work.
Everything is correct, its just that I think it has something to do with the advance map values,
like var number, var value and unknowns.

I'd upload the script but, I don't want to spoil anything for my hack, so PM me instead.
Great Tutorial, Learned a lot by the way.

-cooley

thetribemaster
March 18th, 2008, 07:02 PM
Very nice, this covers the basics and the semi-advanced things in an easy to understand manner. 'Grats to you and keep it up.

EDIT: This is my script, It wont work. It is for a lady that keeps you from leaving without a pokemon. It freezes when you step on it.
#org $start
checkflag 0x828
if B_true goto $done
message $wait
boxset 6
applymovement 0x01 $move
pausemove 0x0
applymovement 0xFF $youmove
pausemove 0x0
message $poke
boxset 6
applymovement 0x01 $move2
release
end

$done
release
end

#org $move
#raw 0x1F 0x1F 0x1F 0x1D 0xFE

#org $youmove
#raw 0x17 0xFE

#org $move2
#raw 0x20 0x20 0x20 0x1E 0xFE

#org $wait
$wait 1 = WAIT!!!!

#org $poke
$poke 1 = You need a pokemon to go\nout!

derv1205
March 20th, 2008, 12:29 PM
Sorry, I kinda, forgot about this thread.



Am I too late?
It's these ones.
79=[u]
7A=[D]
7B=[L]
7C=[R]

U for Up
D for Down
L for Left
R for Right


Honestly, I don't know what the problem is. The "Shiny Hack" isn't something I've done lately. Sorry.
Ok, no prob, i will use "Pokemons Tools" that adds the shiny hack in the hex automatically Lol ^^

Dan13x
March 20th, 2008, 04:18 PM
thethethethe, for the MoveSprite, how can you get the Player to move?

greenozano
March 20th, 2008, 07:41 PM
how do I Set flags so An event can happen even after not having it in the same script. Like meeting your friend then being able to access a certain area

Tyrantrum
March 20th, 2008, 08:10 PM
thethethethe, for the MoveSprite, how can you get the Player to move?

I think it's 0xFF.
Not too sure.

Master_Track
March 21st, 2008, 02:42 AM
you can be sure, it IS 0xFF. Like explained in the tut ;)

(btw don't forget the 0xFE after the movements, I did this xD)

how do I Set flags so An event can happen even after not having it in the same script. Like meeting your friend then being able to access a certain area

Well, you have to set a free setflag (not used in the original game) into the script (meeting your friend).
Then you set a checkflag at the begin of the script of the area entrace (checkflag needs the same number as setflag in the other script).

Hope I'm right, correct if I' wrong ^^

Pokepal2007
March 21st, 2008, 12:45 PM
Wow this is the best tut i have been on just one question will this script work?

#org $begin
lock
faceplayer
checkflag 0x200
if b_true goto $done
applymovement 0x06 $move
pausemove
message $cele
boxset 6
Wildbattle 251 5 0
fadescreen 0
#raw 0x53 0x0F 0x80
Setflag 0x200
release
end

#org $done
release
end

#org $move
#raw 0x10 0x10 0x10 0xFE

#org $cele
$cele 1 =Biiiii.

hi sir tomato my password is syvniti
March 21st, 2008, 12:52 PM
Wow this is the best tut i have been on just one question will this script work?

I don't think cause the
#org $move
#raw 0x10 0x10 0x10 0xFE

But always try it...XD

Pokepal2007
March 21st, 2008, 01:19 PM
ok

but this script has gone strange

#org $start
lock
faceplayer
checkflag 0x200
if b_true goto $done
message $1
boxset 5
compare 0x800D 0x1
if 0x1 goto $check
message $2
boxset 6
release
end

#org $check
checkitem 0x4
#raw 0x05 0x00
compare 0x800D 0x1
if 0x4 goto $got
message $2
boxset 6
release
end

#org $got
message $3
boxset 6
warp 0x2 0x60 0x1
setflag 0x200
release
end

#org $done
message $4
boxset 5
compare 0x800d 0x1
message $3
boxset 6
warp 0x2 0x60 0x1
release
end

#org $1
$1 1 =Would you like to goto\nCinnabar island?

#org $2
$2 1 =Ohhh. Sorry you can't go yet.

#org $3
$3 1 =ALL ABOARD!!!

#org $4
$4 1 =Would you like to goto\nCinnabar island?

on this script instead of warping to map 2.60 warp number 1 (i made a warp and map) but instead The screen just turns blank Why might this be?

Also how do i make a script which gives yo a badge without having to battle so it will be you goup to a guy who says your a new trainer so you wont be strong enough for a battle so he just gives you the badge how can i do this??

thethethethe
March 21st, 2008, 06:08 PM
thethethethe, for the MoveSprite, how can you get the Player to move?

Like they said, you use the people no. of the Player which is 0xFF

ok

but this script has gone strange

#org $start
lock
faceplayer
checkflag 0x200
if b_true goto $done
message $1
boxset 5
compare 0x800D 0x1
if 0x1 goto $check
message $2
boxset 6
release
end

#org $check
checkitem 0x4
#raw 0x05 0x00
compare 0x800D 0x1
if 0x4 goto $got
message $2
boxset 6
release
end

#org $got
message $3
boxset 6
warp 0x2 0x3C 0x1
setflag 0x200
release
end

#org $done
message $4
boxset 5
compare 0x800d 0x1
message $3
boxset 6
warp 0x2 0x3C 0x1
release
end

#org $1
$1 1 =Would you like to goto\nCinnabar island?

#org $2
$2 1 =Ohhh. Sorry you can't go yet.

#org $3
$3 1 =ALL ABOARD!!!

#org $4
$4 1 =Would you like to goto\nCinnabar island?

on this script instead of warping to map 2.60 warp number 1 (i made a warp and map) but instead The screen just turns blank Why might this be?

Also how do i make a script which gives yo a badge without having to battle so it will be you goup to a guy who says your a new trainer so you wont be strong enough for a battle so he just gives you the badge how can i do this??

I can't remember if I mentioned converting values to hex. Maybe I should have.
But You have two options with that warp command.
warp 2 60 1
or
warp 0x2 0x3C 0x1

If there's a "0x" in front of it, then you have to make it a hexadecimal value, if it isn't in front of the number it's a decimal number or a 'normal' number.

greenozano
March 21st, 2008, 06:54 PM
How do I have The script react to another I didn't get it in the flags part of you tutorial

Jimleko
March 21st, 2008, 07:24 PM
OK, I feel really noobish for saying this...but HOW do you make scripts in the first place?

I looked all over the place to do it, and I couldn't find it out....so I just started typing in the window that pops up when I double click on Poket Script...and it starts giving me error messages!

Could someone please help me?

EDIT: Never mind, I figured out how to do it...

ShyRayq
March 21st, 2008, 08:05 PM
use notepad
if you don't have notepad wellllllllll
well your done for
so its NOTEPAD!

Jimleko
March 21st, 2008, 09:56 PM
Yeah, I figured that out (thanks anyway).

I'm trying to implement this into a game, so I can test it out...but I'm not sure how. I looked at other tutorials, but no one was really clear about it. Could someone please explain it?

GMuser
March 21st, 2008, 10:23 PM
http://www.pokecommunity.com/showthread.php?t=81691

Save you script as a .rbc file, then right click and "compile". Alternatively, you can open "BufRite.exe", file->import->find you script. Then you follow the instructions in the above thread (first tut) on how to Assign to the rom and then Burn (save) to the rom.

It would be at this point that you open Advance Map and set the script offset on an event (character).

Pokepal2007
March 22nd, 2008, 12:36 AM
Like they said, you use the people no. of the Player which is 0xFF



I can't remember if I mentioned converting values to hex. Maybe I should have.
But You have two options with that warp command.
warp 2 60 1
or
warp 0x2 0x3C 0x1

If there's a "0x" in front of it, then you have to make it a hexadecimal value, if it isn't in front of the number it's a decimal number or a 'normal' number.

i will test it out and see if any changes

also how do you make someone give you a badge without battleing?

Dan13x
March 22nd, 2008, 12:58 AM
Like they said, you use the people no. of the Player which is 0xFF

Thanks anyway, I'll see if it works.

thethethethe
March 22nd, 2008, 01:00 AM
i will test it out and see if any changes

also how do you make someone give you a badge without battleing?

Do you remember this list from the first post?
Fire Red:
0x820 - First Badge
0x821 - Second Badge
0x822 - Third Badge
0x823 - Fourth Badge
0x824 - Fifth Badge
0x825 - Sixth Badge
0x826 - Seventh Badge
0x827 - Eighth Badge
0x828 - Pokemon Menu
0x829 - Pokedex Menu
0x82F - Running Shoes

Ruby/Sapphire:
0x800 - Pokemon Menu
0x801 - Pokedex Menu
0x802 - Pokenav Menu
0x807 - First Badge
0x808 - Second Badge
0x809 - Third Badge
0x80A - Fourth Badge
0x80B - Fifth Badge
0x80C - Sixth Badge
0x80D - Seventh Badge
0x80E - Eighth Badge
0x860 - Running Shoes

Emerald:
0x860 - Pokemon Menu
0x861 - Pokedex Menu
0x862 - Pokenav Menu
Just set the flag for the badge that you want the player to recieve.

For example, in Fire Red/Leaf Green, if you wanted the player to recieve the first badge, all you need is this line.
setflag 0x820

Pokepal2007
March 22nd, 2008, 01:43 AM
Do you remember this list from the first post?

Just set the flag for the badge that you want the player to recieve.

For example, in Fire Red/Leaf Green, if you wanted the player to recieve the first badge, all you need is this line.
setflag 0x820

ok then i understand but on morwe question this script keeps freexing btw i did change the unknown and var number to 03 00 and 40 50 so whats wrong with this

#org $begin
checkflag 0x201
if b_true goto $done
applymovement 0x14 $move
pausemove 0
message $hey
boxset 6
applymovement 0x14 $move2
pausemove 0
setflag 0x201
release
end

#org $done
release
end

#org $move
#raw 0x20 0x20 0x20 0x20 0x20 0x62 0xFE

#org $hey
$hey 1 =Hey there, I am one of the\nthree dancers, come by our gym later.

#org $move2
#raw 0x1F 0x1F 0x1F 0x1F 0x1F 0x1E 0x1E 0x1F 0x1F 0x60 0xFE

destinedjagold
March 22nd, 2008, 01:49 AM
erm, try this..?
#org $begin
checkflag 0x201
if b_true goto $done
applymovement 0x14 $move
pausemove 0
message $hey
boxset 6
applymovement 0x14 $move2
pausemove 0
setflag 0x201
release
end

#org $done
release
end

#org $move
$move 1 ; #binary 0x20 0x20 0x20 0x20 0x20 0x62 0xFE

#org $hey
$hey 1 =Hey there, I am one of the\nthree dancers, come by our gym later.

#org $move2
$move2 1 ; #binary 0x1F 0x1F 0x1F 0x1F 0x1F 0x1E 0x1E 0x1F 0x1F 0x60 0xFE

Pokepal2007
March 22nd, 2008, 01:59 AM
not even that every time i walk ove it nothing happens

Master_Track
March 22nd, 2008, 02:09 AM
ok then i understand but on morwe question this script keeps freexing btw i did change the unknown and var number to 03 00 and 40 50 so whats wrong with this

#org $begin
checkflag 0x201
if b_true goto $done
applymovement 0x14 $move
pausemove 0
message $hey
boxset 6
applymovement 0x14 $move2
pausemove 0
setflag 0x201
release
end

#org $done
release
end

#org $move
#raw 0x20 0x20 0x20 0x20 0x20 0x62 0xFE

#org $hey
$hey 1 =Hey there, I am one of the\nthree dancers, come by our gym later.

#org $move2
#raw 0x1F 0x1F 0x1F 0x1F 0x1F 0x1E 0x1E 0x1F 0x1F 0x60 0xFE

I can't see anything wrong in this script.
Which Advance Map are you using?
I am using 1.90, and there the fields "unknown" and "variable number" looks like this:
Unknown: 0003
Var.Number:4051

And it works!
Hope that's the problem.

Pokepal2007
March 22nd, 2008, 02:22 AM
no that dosen't work.

would it be the check flag

Master_Track
March 22nd, 2008, 02:24 AM
no that dosen't work.

would it be the check flag
Only if you have used setflag 0x201 before in another script, then checkflag 0x201 would see : "the script with setflag 0x201 was already activated" and go to the end of the script, so
release
end

Try using another set and checkflag you SURE didn't use before, than it should work.

destinedjagold
March 22nd, 2008, 02:25 AM
I tested the script myself and it worked fine.
I'll put up a video when YouTube finishes uplaoding it. ;)

and yeah, I guess it's because of the setflag...

Pokepal2007
March 22nd, 2008, 02:27 AM
no i haven't used 201 yet

Master_Track
March 22nd, 2008, 02:28 AM
Maybe it's used in an original script, so just try some other flag ;)

edit:
Well, now I have a problem -.-
I made two scripts: One should activate 'till the hero got the Pokedex fromr Oak. Then it should just release,
It's this one:

#org $begin
checkflag 0x829
compare lastresult 0x1
if B_true goto $release
applymovement 0x05 $move
pause 0x30
applymovement 0x05 $move2
pausemove 0x0
applymovement 0xFF $move4
pausemove 0x0
message $arbeiten
$arbeiten 1 = Du kannst hier jetzt nicht\ndurch. Vor dem Vertania-Wald wird\lgerade aufgeräumt, der starke Regen\lhat eine Erdschicht abrutschen lassen.
boxset 6
applymovement 0xFF $move5
pausemove 0x0
applymovement 0x05 $move3
pausemove 0x0
release
end

#org $release
release
end

#org $move
#raw 0x65 0xFE

#org $move2
#raw 0x11 0x11 0x13 0x13 0x00 0xFE

#org $move5
#raw 0x10 0x10 0x10 0xFE

#org $move3
#raw 0x12 0x12 0x10 0x10 0xFE

#org $move4
#raw 0x01 0xFE
Everything works fine with this script, It does what it is supposed to do, and after getting the pokedex ist doesn't anything.
But now I have the second script, it should bar the hero from going into the arena 'till he received the 7th badge.
There ist is:
#org $begin
checkflag 0x826
compare lastresult 0x1
if B_true goto $continue
lock
applymovement 0xFF $move
pausemove 0x0
message $stop
$stop 1 = Die Türen der Arena sind fest\nverschlossen.
boxset 6
applymovement 0xFF $move2
pausemove 0x0
release
end

#org $move
#raw 0x01 0xFE

#org $move2
#raw 0x12 0x12 0xFE

#org $continue
release
end
Works fine too, but this script releases after I got the Pokedex, though the checkflag 0x826 checks for the 7th badge, doesn't it?
Pls help ^^

destinedjagold
March 22nd, 2008, 03:34 AM
I tested the script myself and it worked fine.
I'll put up a video when YouTube finishes uplaoding it. ;)

and yeah, I guess it's because of the setflag...

here's the video of the script... (http://www.youtube.com/watch?v=mzT3O_IK1eA)

Pokepal2007
March 22nd, 2008, 05:57 AM
what should change the flag to?

or is it the event number will i need to change it to D or something?

thetribemaster
March 22nd, 2008, 08:27 AM
Okay, this script works well up until when you get the DEX, and Pokemon. Then it skips right to $adventure when it should give message $mission

I also have a script on the first page that doesnt work.


#org $start
lock
faceplayer
checkflag 0x201
if B_false goto $news
checkflag 0x828
if B_false goto $flags
checkflag 0x829
if B_false goto $flags
checkflag 0x202
if B_true goto $missionfinish
checkflag 0x203
if B_true goto $bosses
checkflag 0x205
if B_true goto $adventure
message $mission
setflag 0x205
release
end

#org $mission
$mission 1 =Your mission, should you choose\nto accept it is:\pI need you to find the source of\ldarkness in this world.\pIt may sound a daunting task\lbut I think you can do it!\pI think you should visit my friends\l across Johto, they will train you\lto find and destroy the darkness\lhaunting this world.\pReturn here when you have\l seen all 8 of them.

#org $news
message $1
boxset 6
setflag 0x201
release
end

#org $1
$1 1 =Hello! I am Prof. XANU\pI have a proposition for you.\pBut first you need a pokemon\land a pokedex.\p Go grab them off of that table.

#org $flags
message $2
boxset 6
release
end

#org $2
$2 1 =Did you get them yet?

#org $missionfinish
message $3
boxset 6
setflag 0x204
release
end

#org $3
$3 1 =So you finished?\pGreat!!!\nYour mom has something for\l you.\lGo get it!

#org $bosses
checkflag 0x207
message $4
boxset 6
setflag 0x206
release
end

#org $4
$4 1 =We have discovered the source\nof darkness.\pIt is a pokemon called DARKRAI.\p We must find a way to destroy it.\pGo find him at his fortress.

#org $adventure
message $5
boxset 6
release
end

#org $5
$5 1 =How's the mission coming?\p...\pOh thats wonderful!\lKeep it up!

Help me plz, and with my script on the first page

Master_Track
March 22nd, 2008, 10:56 AM
@pokepal2007: Just try another number, like checkflag 0x240 and later in the script setflag 0x240.

#org $start
checkflag 0x828
if B_true goto $done
message $wait
boxset 6
applymovement 0x01 $move
pausemove 0x0
applymovement 0xFF $youmove
pausemove 0x0
message $poke
boxset 6
applymovement 0x01 $move2
release
end

$done
release
end

#org $move
#raw 0x1F 0x1F 0x1F 0x1D 0xFE

#org $youmove
#raw 0x17 0xFE

#org $move2
#raw 0x20 0x20 0x20 0x1E 0xFE

#org $wait
$wait 1 = WAIT!!!!

#org $poke
$poke 1 = You need a pokemon to go\nout!

Maybe it will work if you write it like this:

#org $start
checkflag 0x828
if B_true goto $done
message $wait
$wait 1 = WAIT!
boxset 6
applymovement 0x01 $move
pausemove 0x0
applymovement 0xFF $youmove
pausemove 0x0
message $poke
$poke 1 = You need a pokemon to go\nout!
boxset 6
applymovement 0x01 $move2
pausemove 0x0
release
end

#org $move
#raw 0x1F 0x1F 0x1F 0x1D 0xFE

#org $move2
#raw 0x20 0x20 0x20 0x1E 0xFE

#org $youmove
#raw 0x17 0xFE

#org $done
release
end
It's your script from the first page, don't know what to do in the one you just postet. You wrote it too complicated, if you write all the ckeckflags in a row it's more complicated. It could be easier ^^

But I hope at least this will work.
If not, check if the unknown and the var.number in AM are REALLY right.
It should work.

Pokepal2007
March 22nd, 2008, 11:05 AM
ok i will try that then :) :)

thetribemaster
March 22nd, 2008, 12:18 PM
Also the

#org $name
call 0x1A74EB
return

just changed a couple of tiles... and namepokemon doesnt work

Master_Track
March 22nd, 2008, 12:40 PM
Also the

#org $name
call 0x1A74EB
return

just changed a couple of tiles... and namepokemon doesnt work
I'm not sure what the problem is but...did you write gosub $name or goto $name
afaik you have to write gosub.

Pokepal2007
March 22nd, 2008, 01:53 PM
im gunna start a game for script testing.

thetribemaster
March 22nd, 2008, 02:50 PM
I did, this is the script I'm using it in:


#org $start
lock
checkflag 0x201
if B_false goto $done
checkflag 0x828
if B_true goto $1
#raw 0x75 0x98 0x00 0x0A 0x03
message $info
boxset 6
message $takeit
boxset 5
compare LASTRESULT 1
if B_true goto $getpoke
#raw 0x76
release
end

#org $info
$info 1 = Its the Leaf Pokemon Chikorita!

#org $takeit
$takeit 1 = Take the grass type Chikorita?

#org $getpoke
setflag 0x828
givepokemon 152 5 0
#raw 0x76
fanfare 0x13E
message $recieved
boxset 4
waitfanfare
#raw 0x68
message $rename
boxset 5
compare LASTRESULT 1
if B_true gosub $name
#raw 0x53 0x0F 0x80
release
end

#org $recieved
$recieved 1 =You got a CHIKORITA!

#org $rename
$rename 1 = Rename Chikorita?

#org $name
call 0x1A74EB
return

#org $1
message $gotit
boxset 6
release
end

#org $gotit
$gotit 1 =You already have a Pokemon!

#org $done
message $pokeball
boxset 6
release
end

#org $pokeball
$pokeball 1 =It's a pokeball!

/Circa
March 23rd, 2008, 01:42 AM
I don't want to go over the whole script, because I myself might make some errors. (i've been using scriptEd)

But your main problem is your paragraphs.
Messages always go after the main scripts, so you might want to re arrange everything.

Dingo01930
March 24th, 2008, 02:08 AM
What a comprehensive thread on Pokescript!!
Well Done!!

And I've a very basic problem.......
I try to add a persion on PALLET TOWN and involves only simple dialogue,
But the result shown is not my expectation.... My script is


#org $start
lock
faceplayer
message $1
boxset 6
release
end

#org $1
$1 1 =Hi.\nWelcome to our town!


But the result comes is a dialogue with unidentified symbol(attachment shown).......

~~ HELP ME PLZ ~~

Master_Track
March 24th, 2008, 03:04 AM
It's NOT a mistake in the script, I'm sure.
You made a mistake compiling it into the script.

First, rightclick on the rubikon file.
Click compile
Klick destination and choose you Rom
Then click the blue book or whatever
Klick the searching symbol
Then click the FIRST of the five numbers shown
klick assign
Then, there should be your $s, all marked blue.
Klick file-burn
Scroll up to the first number shown (should be"pushed $start to NUMBER)
Copy the number and insert it in AM as offset


If you did this correct it should work, there is no mistake in your script.

e: did you use a japanese version? I'm not sure if it works with those.

Shadow Arcanine
March 24th, 2008, 03:51 AM
hm, i've got a very big problem, all scripts that i made turns always into a red screen, so i tested it by coping exectly the give pokemon script of thex4 in the first post. but when i click burn, there is a message (attachement) and i don't know what to do. this come for every script from $done to $5. i think maybe that's my problem, could someone help me please?
and sry for my bad english...

Master_Track
March 24th, 2008, 03:58 AM
well maybe just a grammatical mistake ;)
The problem is, no pointer leads to the $ in your image.
If you post the whole script here I may be able to tell you whats wrong. But this IS a mistake inside the script.

well maybe just a grammatical mistake ;)
The problem is, no pointer leads to the $ in your image.
If you post the whole script here I may be able to tell you whats wrong. But this IS a mistake inside the script.

edit:
i found a mistake inside the script :
#org $start
checkflag 0x828
if b_true goto $done
message $1
boxset 5
compare LASTRESULT 0x1
if b_true goto $take
message $2
boxset 6
release
end

#org $take
givepokemon 4 5 0
fanfare 0x13E
message $3
boxset 4
waitfanfare
#raw 0x68
setflag 0x828
message $4
boxset 5
compare LASTRESULT 0x1
if b_true gosub $name
message $5
boxset 6
release
end

#org $name
call 0x1A74EB
return

#org $1
$1 1 =I'm sorry, I can't take care\nof my Charmander.\pCan you take care of it for me?

#org $2
$2 1 =That's okay. I'm sure someone\nelse will take it.

#org $3
$3 1 =\c\h01\h02You received a Charmander!

#org $4
$4 1 =\c\h01\h02Would you like to rename Charmander?

#org $5
$5 1 =Take Care of Charmander.

There is no #org $done existing.
So add at the end just an

#org $done
message $gotit
$gotit 1 = Is Charmander allright?
boxset 6
release
end

Shadow Arcanine
March 24th, 2008, 04:05 AM
ok my script looks now like this after i rename it to .rbc:

checkflag 0x828\par
if b_true goto $done\par
message $1\par
boxset 5\par
compare LASTRESULT 0x1\par
if b_true goto $take\par
message $2\par
boxset 6\par
release\par
end\par
\par
#org $take\par
givepokemon 4 5 0\par
fanfare 0x13E\par
message $3\par
boxset 4\par
waitfanfare\par
#raw 0x68\par
setflag 0x828\par
message $4\par
boxset 5\par
compare LASTRESULT 0x1\par
if b_true gosub $name\par
message $5\par
boxset 6\par
release\par
end\par
\par
#org $name\par
call 0x1A74EB\par
return\par
\par
#org $1\par
$1 1 =I'm sorry, I can't take care\\nof my Charmander.\\pCan you take care of it for me?\par
\par
#org $2\par
$2 1 =That's okay. I'm sure someone\\nelse will take it.\par
\par
#org $3\par
$3 1 =\\c\\h01\\h02You received a Charmander!\par
\par
#org $4\par
$4 1 =\\c\\h01\\h02Would you like to rename Charmander?\par
\par
#org $5\par
$5 1 =Take Care of Charmander.\par
}

like i said before, it's exectly the script like in the first post, the givepokemon script. thank you for helping me!

Edit: ok thank you very much, i'll try it out!

Master_Track
March 24th, 2008, 04:07 AM
write this:

#org $start
checkflag 0x828
if b_true goto $done
message $1
boxset 5
compare LASTRESULT 0x1
if b_true goto $take
message $2
boxset 6
release
end

#org $take
givepokemon 4 5 0
fanfare 0x13E
message $3
boxset 4
waitfanfare
#raw 0x68
setflag 0x828
message $4
boxset 5
compare LASTRESULT 0x1
if b_true gosub $name
message $5
boxset 6
release
end

#org $name
call 0x1A74EB
return

#org $1
$1 1 =I'm sorry, I can't take care\nof my Charmander.\pCan you take care of it for me?

#org $2
$2 1 =That's okay. I'm sure someone\nelse will take it.

#org $3
$3 1 =\c\h01\h02You received a Charmander!

#org $4
$4 1 =\c\h01\h02Would you like to rename Charmander?

#org $5
$5 1 =Take Care of Charmander.

#org $done
message $gotit
$gotit 1 = Is Charmander allright?
boxset 6
release
end

Und btw, wenn dus auf deutsch suchst: Ich habs in einem andren Forum übersetzt ^^
Ich brauch aber noch einen beitrag um links schreiben zu dürfen...
äh I mean, if you need it I translated it with permission of thethethethe into german on another board, but I'm not allowed to give links until I wrote 15 posts ^^

Shadow Arcanine
March 24th, 2008, 04:21 AM
ok, thank you it works perfekt! maybe thethethethe should chance this script on the first post to the correct one! and no, thank you, but i don't need the scripts in german, but it's a good idea for german hackers like myself!^^

Dingo01930
March 24th, 2008, 04:22 AM
It's NOT a mistake in the script, I'm sure.
You made a mistake compiling it into the script.

First, rightclick on the rubikon file.
Click compile
Klick destination and choose you Rom
Then click the blue book or whatever
Klick the searching symbol
Then click the FIRST of the five numbers shown
klick assign
Then, there should be your $s, all marked blue.
Klick file-burn
Scroll up to the first number shown (should be"pushed $start to NUMBER)
Copy the number and insert it in AM as offset


If you did this correct it should work, there is no mistake in your script.

e: did you use a japanese version? I'm not sure if it works with those.

I've followed your step but still the unidentified symbol has shown..... = ="
Maybe my ROM has problem??
My ROM is Fire Red (U).......
Or my PkmAdv database has problem??
Many Thx for your help~

Master_Track
March 24th, 2008, 04:32 AM
ok, thank you it works perfekt! maybe thethethethe should chance this script on the first post to the correct one! and no, thank you, but i don't need the scripts in german, but it's a good idea for german hackers like myself!^^
(I think you didn't understand me right, not the scripts are in german but the tutorial itself, so only the explanation. It may be easier for german /austrian people (like me ^^).And if you understood me right...well, doesn't matter huh?xD)

@ dingo:
I had the same problem, my person always said " ÁÈ Ì

Make sure there aren't any spaces between the $ and the numbers (in Advance Map, the offset).
And no Space before the $ too.
My problem was solved when I really focused on the spaces and the steps when compiling the script.

Shadow Arcanine
March 24th, 2008, 04:41 AM
oh man, i've got the same problem over and over again.. now i've put a simple script:

#org $start
lock
faceplayer
message $goodday
boxset 6
release
end

#org $goodday
$goodday 1 =Hi.\nit's a good day, isn't it?
and now the same problem: floating pointer must be pushed, is there any mistake in this script? i can't found anyone.

Dingo01930
March 24th, 2008, 04:57 AM
I've checked my script very carefully whether there are mistakes on spaces.
but my problem still exists.......
Very desperate.......

Master_Track
March 24th, 2008, 05:02 AM
oh man, i've got the same problem over and over again.. now i've put a simple script:

#org $start
lock
faceplayer
message $goodday
boxset 6
release
end

#org $goodday
$goodday 1 =Hi.\nit's a good day, isn't it?
and now the same problem: floating pointer must be pushed, is there any mistake in this script? i can't found anyone.
the script is right, I can't see a mistake -.-'
If you followed the steps I wrote before (compiling) and didn't do any spaces when inserting the offset, it really should work.
Maybe you should re-install Pokescript and the PkmnAdv?

@dingo:
oh man, don't have an idea of what could be wrong now -.-
Sorry but it seems I can't help you with that.

thethethethe
March 24th, 2008, 05:08 AM
Sorry, my internet is playing up and I can't multiquote.

@Master_Track:
Thanks for spotting the error, it's fixed now. In all that typing, I was bound to make at least one. Also, thanks for answering people's questions.

@Dingo01930:
I'd say re-install pokescript. I compiled and tried your script, without any troubles.

@Shadow Arcanine
Ummm... same as Dingo01930, I compiled your script, and it worked fine. All I can say is just try and re-install pokescript.

Shadow Arcanine
March 24th, 2008, 05:31 AM
ok thank you thex4, i reinstalled pokescript, now it works perfectly, thank you very much!

Dingo01930
March 24th, 2008, 05:54 AM
I reinstalled pkescript twice,
the same problem still exists.......
Maybe my computer is not suitable for hacking pokemon.....
Anyway , thx all of your reply~~~

Khalil
March 24th, 2008, 07:02 PM
um i made a script and it wont work
here it is

#org $begin
lock
faceplayer
message $w
applymovement 0x04 $move
pausemove 0x0
applymovement 0xFF $move2
pause 0x30
applymovement 0x04 $move3
applymovement 0xFF $move3
pausemove 0
release
end

#org $w
$w 1 = Come with me\Jon:For what?\p???:no reason\nJon:k

#org $move
#raw 0x62 0x12 0x12 0x11 0x11 0xFE

#org $move2
#raw 0x03 0xFE

#org $move3
#raw 0x11 0x11 0x11 0x13 0xFE

oh and by the way very nice Tutorial the best i have seen out of all i see

greenozano
March 24th, 2008, 07:21 PM
I tried to compile my script but when I walked over It didn't work correctly It was suppose to swich to bit dark
here it is
#org $start
setweather 0x11
doweather
release
end

what is wrong with it.

greenozano
March 24th, 2008, 08:21 PM
I tried to compile my script but when I walked over It didn't work correctly It was suppose to swich to bit dark

Blitzballer
March 24th, 2008, 08:28 PM
I have but one question. If I wanted to change the color of some text, but just two words in a sentence, how could I use the color code to do this "This is the new Train Depot. It's still in construction so nobody's allowed past this point." I'm using fire red, although I'm not sure if you need to know that.

Master_Track
March 25th, 2008, 01:12 AM
um i made a script and it wont work
here it is

#org $begin
lock
faceplayer
message $w
boxset 6
applymovement 0x04 $move
pausemove 0x0
applymovement 0xFF $move2
pause 0x30
applymovement 0x04 $move3
applymovement 0xFF $move3
pausemove 0x0
release
end

#org $w
$w 1 = Come with me\Jon:For what?\p???:no reason\nJon:k

#org $move
#raw 0x62 0x12 0x12 0x11 0x11 0xFE

#org $move2
#raw 0x03 0xFE

#org $move3
#raw 0x11 0x11 0x11 0x13 0xFE

oh and by the way very nice Tutorial the best i have seen out of all i see

I changed it a little, you forgot the boxset 6, so the message can't appear.
And you should set a ceckflag and a setflag so the script can't activate again and again.

I tried to compile my script but when I walked over It didn't work correctly It was suppose to swich to bit dark
here it is
#org $start
setweather 0x11
doweather
release
end

what is wrong with it.

I never used set- and doweather, but maybe the new script wasn't changed in advance map?
You know, variable number etc... it's written in the tutorial at APPLYMOVEMENT. If you don't change it it won't work.

I have but one question. If I wanted to change the color of some text, but just two words in a sentence, how could I use the color code to do this "This is the new Train Depot. It's still in construction so nobody's allowed past this point." I'm using fire red, although I'm not sure if you need to know that.

You have to write it like this:
This is the new \c\h01\h05Train Depot\c\h01\h02. It's still in construction so nobody's allowed past this point.
(not sure if it's the right colour code, but you know the right...I hope^^)

Explanation:
First you write the normal black text, and if you write a colour code, ALL letters after the code will be in that colour. But if you choose another colour code, black, the rest will change to black again ^^

Shadow Arcanine
March 25th, 2008, 03:35 AM
i'm really tired now, i tried a message script about 100 times, and all worked, i compiled the script, i burned it to the rom, i put the offset in advancemap, but every time i try to talk to that person, it turns to a red screen and the game froze, i re-installed pokescript twice, the givepokemonscript works, but not my messagescript, like i just said, it's the same like in the first post and i couldn't see any mistakes, what's wrong with my script? or why it turns to a red screen? please i need help

Master_Track
March 25th, 2008, 04:26 AM
well I can only repeat this:
Look carefully at spaces.
I can't say more to that, 'cause that was the reason why my screen turned read at my very first tries.
When you copy the offset from bufrite, it happens that you copy a space. And when you insert it in Advance Map and the space is in the screen turns red or something else happens.
If that's not the reason then I'm sry, I don't know.

Shadow Arcanine
March 25th, 2008, 04:52 AM
hm, thx, but this doesn't seem to be my problem, so i have to edit my text with a-text, i couldn't do anything else, if someone know something about my problem, please post, i'll try now if applymovements and trainerbattles work, if not, i'll post xD

SwanteR
March 25th, 2008, 12:10 PM
Hi the
thethethethe! I saw your script school and made a wildbattle script.
When i talk to "venusaur" everything just stopps and does not do anything. I write down the script


#org $start
lock
faceplayer
message $1
boxset 6
cry 0xA13
nop
nop
Wildbattle 3 36 0
fadescreen 0
#raw 0x53 0x0F 0x80
setflag 0x200
release
end

#org $1
$1 1 =VENUSAUR:Venu-Venu SAUR!!

I also made a video. Search on youtube after sethHack and take by my things Pl0x help Anyone especialy thethethethe!!

destinedjagold
March 25th, 2008, 03:21 PM
try this...

#org $start
lock
faceplayer
message $1
boxset 6
cry 0xA1 0x03
pause 0x28
Wildbattle 3 36 0
fadescreen 0
#raw 0x53 0x0F 0x80
setflag 0x200
release
end

#org $1
$1 1 =VENUSAUR:Venu-Venu SAUR!!

Khalil
March 25th, 2008, 06:03 PM
Originally Posted by Khalil
um i made a script and it wont work
here it is

#org $begin
lock
faceplayer
message $w
boxset 6
applymovement 0x04 $move
pausemove 0x0
applymovement 0xFF $move2
pause 0x30
applymovement 0x04 $move3
applymovement 0xFF $move3
pausemove 0x0
release
end

#org $w
$w 1 = Come with me\Jon:For what?\p???:no reason\nJon:k

#org $move
#raw 0x62 0x12 0x12 0x11 0x11 0xFE

#org $move2
#raw 0x03 0xFE

#org $move3
#raw 0x11 0x11 0x11 0x13 0xFE

oh and by the way very nice Tutorial the best i have seen out of all i see

I changed it a little, you forgot the boxset 6, so the message can't appear.
And you should set a ceckflag and a setflag so the script can't activate again and again.

well when i put the code in to the advance map on the script thing which will work won't it and i put Unknown:01 00 and Varnumber:50 40 it doesn't work what do i need to do inorder to activate it

thethethethe
March 25th, 2008, 10:11 PM
um i made a script and it wont work
here it is

#org $begin
lock
faceplayer
message $w
boxset 6
applymovement 0x04 $move
pausemove 0x0
applymovement 0xFF $move2
pause 0x30
applymovement 0x04 $move3
applymovement 0xFF $move3
pausemove 0
release
end

#org $w
$w 1 = Come with me\Jon:For what?\p???:no reason\nJon:k

#org $move
#raw 0x62 0x12 0x12 0x11 0x11 0xFE

#org $move2
#raw 0x03 0xFE

#org $move3
#raw 0x11 0x11 0x11 0x13 0xFE

oh and by the way very nice Tutorial the best i have seen out of all i see

well when i put the code in to the advance map on the script thing which will work won't it and i put Unknown:01 00 and Varnumber:50 40 it doesn't work what do i need to do inorder to activate it
Could you tell me a little more? Like does the script actually start, if so, where did it stuff up. Does the script compile? A little more information might be helpful. Also, I just fixed a little error I noticed, but that's all I can do with this information you've given me.

I tried to compile my script but when I walked over It didn't work correctly It was suppose to swich to bit dark
here it is
#org $start
setweather 0x11
#raw 0x00
doweather
release
end

what is wrong with it.
Look through my tutorial for the workings of setweather next time. If you had looked at it, you would have seen the problem.

I have but one question. If I wanted to change the color of some text, but just two words in a sentence, how could I use the color code to do this "This is the new Train Depot. It's still in construction so nobody's allowed past this point." I'm using fire red, although I'm not sure if you need to know that.
Knowing it's fire red helps.
Like this. Here's some example text.

#org $1
$1 1 =Hello. Welcome to the \c\h01\h05Depot\c\h01\h02.\nSorry we aren't open yet.

i'm really tired now, i tried a message script about 100 times, and all worked, i compiled the script, i burned it to the rom, i put the offset in advancemap, but every time i try to talk to that person, it turns to a red screen and the game froze, i re-installed pokescript twice, the givepokemonscript works, but not my messagescript, like i just said, it's the same like in the first post and i couldn't see any mistakes, what's wrong with my script? or why it turns to a red screen? please i need help

I'm really not too sure. Sorry.

Hi the
thethethethe! I saw your script school and made a wildbattle script.
When i talk to "venusaur" everything just stopps and does not do anything. I write down the script


#org $start
lock
faceplayer
message $1
boxset 6
cry 0xA1 0x3
nop
nop
Wildbattle 3 36 0
fadescreen 0
#raw 0x53 0x0F 0x80
setflag 0x200
release
end

#org $1
$1 1 =VENUSAUR:Venu-Venu SAUR!!

I also made a video. Search on youtube after sethHack and take by my things Pl0x help Anyone especialy thethethethe!!

One little error.
cry 0xA13 will stuff up the compiling process.
It should have been
cry 0xA1 0x3

SwanteR
March 26th, 2008, 12:59 AM
Could you tell me a little more? Like does the script actually start, if so, where did it stuff up. Does the script compile? A little more information might be helpful. Also, I just fixed a little error I noticed, but that's all I can do with this information you've given me.


Look through my tutorial for the workings of setweather next time. If you had looked at it, you would have seen the problem.


Knowing it's fire red helps.
Like this. Here's some example text.

#org $1
$1 1 =Hello. Welcome to the \c\h01\h05Depot\c\h01\h02.\nSorry we aren't open yet.



I'm really not too sure. Sorry.



One little error.
cry 0xA13 will stuff up the compiling process.
It should have been
cry 0xA1 0x3Thx m8 i reaky needed it. XD!! THX.....

EDIT:I tried but it still doesnt work... It keeps sound like mew and glitch and freeze.

Khalil
March 26th, 2008, 08:08 AM
Could you tell me a little more? Like does the script actually start, if so, where did it stuff up. Does the script compile? A little more information might be helpful. Also, I just fixed a little error I noticed, but that's all I can do with this information you've given me.
accually it doesn't start when i put into the script form on the advance map it doesn't work could u tell me what i did wrong when i put it in?

Blitzballer
March 26th, 2008, 10:43 AM
I've been trying to do an applymovement script, but it doesn't compile. It starts the log and then the log goes blank. Any ideas? Also I've noticed that other tutorials use #binary instead of #raw. Is there any difference? Which one works better?

Master_Track
March 26th, 2008, 11:19 AM
I haven't tried binary yet, so I can't answer you question completly.
But one problem could be that the #raw is too long, for example:

#raw 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0xFE

this could cause problems when compiling, I got errors, so I split it up.

ksunwoo6
March 26th, 2008, 07:10 PM
Um... Well I got it... But how do I actually put it in the game??? I don't know HOW......

Jack of Bl♠des
March 26th, 2008, 07:27 PM
Um... Well I got it... But how do I actually put it in the game??? I don't know HOW......

If you want to add a script to the game, you'd have to compile the script and burn it to the ROM. You'll be able to find that in one of the other Pokescript tutorials (it's kind of ironic that that's the only thing here that's missing)

ksunwoo6
March 26th, 2008, 07:44 PM
One more THING, I tried your tutorial and wrote:

#org $start
lock
faceplayer
message $1
boxset 6
cry 0xA1 151
nop
nop
wildbattle 151 30 0x8B
fadescreen 0
#raw 0x53 0x0F 0x80
setflag 0x200
release
end
#org $1
$1 1 =MEW: Mew! Mew!

But When I apply it on the game, It freezes or the mew go, YES, NO question....

If you want to add a script to the game, you'd have to compile the script and burn it to the ROM. You'll be able to find that in one of the other Pokescript tutorials (it's kind of ironic that that's the only thing here that's missing)
Thanks a lot... Now I know how.. (ALTHOUGH It didn't work)

ANOTHER QUESTION, When you apply the script, What do you do about the PERSON ID in ADVANCE MAP???

Master_Track
March 27th, 2008, 02:57 AM
ANOTHER QUESTION, When you apply the script, What do you do about the PERSON ID in ADVANCE MAP???
Sorry I can't help with you script, my wildbattles went wrong too ^^'

If you change the person ID to the number of the setflag of a script, the Overworld Sprite will dissappeare after the script was activated.

frank$or
March 28th, 2008, 02:47 AM
I have made a rather large script and I got a few things which don't work.
Perhaps somebody could help. It's a fire red rom btw.
Everything in red does not work.


Part 1 - team red vs team blue (outside)

#org $start
lock
message $grunt
$grunt 1 = Grunt: Piplups go away!
callstd 6
message $puplip
$puplip 1 = Piplup: Piplup pip!
callstd 6
message $grut7
$grut7 1 = Grunt: I Said go away!\nWe rule this town!
callstd 6
applymovement 2 $boo
applymovement 4 $boo
$boo 1 ; #binary 0x62 0xFE
Pausemove 0
message $grut6
$grut6 1 = Grunt: Who's that?
callstd 6
applymovement 2 $walk
$walk 1 ; #binary 0x09 0x03 0xFE
Pausemove 0
applymovement FF $walk2
$walk2 1 ; #binary 0x02 0xFE
Pausemove 0
message $grut5
$grut5 1 = Grunt: ...
callstd 6
message $grut9
$grut9 1 = Grunt: Who are you kid?
callstd 6
trainerbattle 0 0x001 $before $after $go --> doesn't go to $go
$before 1 =Grunt: We cannot stand intruders!
$after 1 =Grunt: My rattata!
release
end

#org $go
message $omg
$omg 1 =Grunt: ... ... ...\lGrunt: It doesn't matter anyways.\lGrunt: We have what we wanted!
callstd 6
message $gruts5
$gruts5 1 = Piplup: Piplup PIP!
callstd 6
#raw 0x75 0x04 0x00 0x0A 0x03
message $char
$char 1 =Charmander: CHAR! CHAR!
callstd 6
cry 0xA1 4
nop
nop
#raw 0x76
message $gone
$gone 1 =Grunt: Hmph. Let's get going!
callstd 6
applymovement 3 $going
applymovement 4 $going
applymovement 5 $going
$going 1 ; #binary 0x20 0x20 0x34 0x34 0x60 0xFE
pausemove 0
applymovement 2 $going2
applymovement 6 $going2
applymovement 7 $going2
applymovement 8 $going2
$going2 1 ; #binary 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x10 0x10 0x60 0xFE
pausemove 0
applymovement 9 $going3
$going3 1 ; #binary 0x62 0x10 0x10 0x10 0x10 0x10 0x10 0x60 0xFE
pausemove 0
applymovement 10 $present
$present 1 ; #binary 0x13 0x13 0x13 0x13 0x13 0x13 0x13 0xFE
Pausemove 0
message $guy
$guy 1 = Pfew. They're gone.\nYour sister said she has something\lfor you.\pPerhaps you should visit her.\nI'll show you the way.
callstd 6
warp 4 0 1
setflag 0x25E
release
end

Part 2 - sister (inside)

#org $start
lock
faceplayer
checkflag 0x25E
if B_true goto $poke - does not work
message $bro
$bro 1 =Hi \v\h01,\nthere some piplups and charmanders\lfighting outside.\pPerhaps you should have a look.
callstd 6
release
end

#org $poke
message $pokem
$pokem 1 =Mom asked me to pick up\nyour stuff for your journey.\lAnyways, here you go!
callstd 6
setflag 0x828
setflag 0x829
message $dex
$dex 1 =You received a pokedex!
callstd 6
fanfare 0x012
message $poke
$poke 1 =You received an PokeBall!
callstd 6
fanfare 0x012
message $explain
$explain 1 =Professor Ray didn't want to say\nwhat Pokemon is inside there.\lI guess it's a cool Pokemon!\pAnyways I got to go now.
callstd 6
applymovement 2 $movemove
$movemove 1 ; #binary 0x11 0x62 0x00 0xFE
pausemove 0
message $before
$before 1 =Almost forgotten!\nI also got a few Empty PokeBalls!\lThese will help you to catch wild\lPokemons.\pI'm sure they will come handy!
callstd 6
giveitem 0x4
applymovement 2 $movemove2
$movemove2 1 ; #binary 0x11 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0x10 0x10 0x10 0x60 0xFE
pausemove 0
setflag 0x20C
release
end

Perhaps anyone could help me?

Thanks in advance,
frank

liuyanghejerry
March 28th, 2008, 09:12 PM
Ah...!Thanks god ,thank you, thethethethe, I find the commends about money and coins!!!!!!
You are so great~~

destinedjagold
March 28th, 2008, 10:05 PM
frank$sor, the script is fine, but the only thing that cause that one not to work is because of the trainerbattle command you gave.

It should not be trainerbattle 0, but it should be trainerbattle 1. ;)
and put setflag 0x25E before warp.
Warp ends the script, therefore, in your script, it no longer reads the setflag.
so exchange their places.

ice2128
March 31st, 2008, 07:19 PM
i've read through the whole thread, and no one seems to have this problem, so i'm a little embarassed by it, but i can get basic text, give item/pokemon, and movement scripts to work, but for some reason i cannot get the yes/no text script to work. the yes message works, but if i answer no, i still get the yes messge. does anyone have an idea of what i could possibly be doing because i've checked the script to where it is exactly the same as the example

Yoshimi
March 31st, 2008, 07:43 PM
sorry i can't help you there.
I forgot almost everything about scripting.
and for the rest of you guys...
i'm sure thethethethe enjoys finding the problems in your script(and outscripting everyone) but maybe you could post the scripts in the "script help" thread?
just a suggestion though.

Hellsing
April 2nd, 2008, 05:05 PM
A great tutorial. I'm very eager to see the Multi Choice command.

Piplup-Trainer
April 4th, 2008, 02:34 PM
Cool! Your tutorial has got everything what you need for a hack!

greenozano
April 4th, 2008, 06:55 PM
can someone tell me what I did wrong the boy in my map just moves and the just goes screen red. He doesn't even talk. I followed thethethethe's tutorial correctly and even used his program to script it and this one still didn't even work. Is it the flag?

#org $start
checkflag 0x203
if 0x1 goto $end
applymovement 0xFF $move1
$move1 1 ; #binary 0x62 0xFE
pause 0x20
applymovement 0x1 $move2
$move2 1 ; #binary 0x61 0x1D 0x1D 0x1D 0x1F 0x1F 0x20 0x20 0x02 0xFE
pause 0x40
message $MESSAGE1
$MESSAGE1 1 =OMG!\nI can't beleive that you are finally\l14.\nI feel angery and happy because\nI can now get your room, but\nstill you get a pokemon and I dont.\nanyway come on down\n the professor is here.
applymovement 0x1 $move3
$move3 1 ; #binary 0x1E 0x1E 0x1E 0xFE
pause 0x40
message $message 2
$message 2 1 =\v\h01:Man is my little brother always this\nenergetic.\nJason:Yeah, I am!\n\v\h01:??? He heared me? I was just thinking.\n It wasn't even out loud \nJason:\nMom: Hurry Up!!!\n\v\h01:Ok coming!
#raw 0x53 0x01 0x00
setflag 0x203
release
end


#org $end
release
end

DarkFear
April 5th, 2008, 08:50 PM
Ok, I've got one problem. After I've compiled the script, when I go and talk to the person in the game, a weird symbol appears in the top right of the game screen. Then after that, the screen goes blank.

?

Tré
April 8th, 2008, 06:37 AM
hey thex4. thx for making this thread. this will really help me to script a game...

destinedjagold
April 8th, 2008, 07:55 PM
can someone tell me what I did wrong the boy in my map just moves and the just goes screen red. He doesn't even talk. I followed thethethethe's tutorial correctly and even used his program to script it and this one still didn't even work. Is it the flag?

#org $start
checkflag 0x203
if 0x1 goto $end
applymovement 0xFF $move1
$move1 1 ; #binary 0x62 0xFE
pause 0x20
applymovement 0x1 $move2
$move2 1 ; #binary 0x61 0x1D 0x1D 0x1D 0x1F 0x1F 0x20 0x20 0x02 0xFE
pause 0x40
message $MESSAGE1
$MESSAGE1 1 = OMG!\nI can't beleive that you are finally\l14.\nI feel angery and happy because\nI can now get your room, but\nstill you get a pokemon and I dont.\nanyway come on down\n the professor is here.
boxset 6
applymovement 0x1 $move3
$move3 1 ; #binary 0x1E 0x1E 0x1E 0xFE
pause 0x40
message $message 2
$message 2 1 =\v\h01:Man is my little brother always this\nenergetic.\nJason:Yeah, I am!\n\v\h01:??? He heared me? I was just thinking.\n It wasn't even out loud \nJason:\nMom: Hurry Up!!!\n\v\h01:Ok coming!
boxset 6
#raw 0x53 0x01 0x00
setflag 0x203
release
end


#org $end
release
end

ya forgot to add boxsets...

HackChu
April 9th, 2008, 05:35 AM
Hey this is a great tutorial but i was wandering.okay say that thier were 8 badges which thier is but i wanted 2 more what would i do because i want 4 extra badges for my hack

X-Buster
April 9th, 2008, 10:18 PM
I don't know if this goes here but can you explain this and give at least an example.. ^^,

http://img222.imageshack.us/img222/7079/mapscriptka1.png

/Circa
April 9th, 2008, 11:40 PM
I don't know if this goes here but can you explain this and give at least an example.. ^^,

http://img222.imageshack.us/img222/7079/mapscriptka1.png

Theres really no examples, it's a level script. Or in that case, a map script. Same thing ;).
What they are, are scripts that occur once you enter the map, so they can do various things.

Nomaiya
April 10th, 2008, 02:08 AM
I'm sorry to be a n00b, but would someone mind helping me with this?

I've installed/uninstalled Pokescript at least five times, and to begin with, everything goes well; I burn the script to my Fire Red rom, and it all seems fine and dandy. Then I copy the offset into AdvanceMap, and save that to my rom.

When I play the rom on no$gba to test it out, however, the script clearly doesn't work. Instead, I get a random box in the corner of the screen (here (http://img516.imageshack.us/img516/4193/boxxc5.png)), and when I click A, this (http://img515.imageshack.us/img515/3695/box2yb5.png) message comes up, and no$gba closes.

What the heck is making it do this!? I've followed every tutorial I can find, and I've even been using the scripts that are given as examples in these tutorials, but nothing works. So... Anyone kind enough to help a poor little n00blet?

I have tried using ScriptED, but the one linked to in the Tool Resources thread gave me a Trojan virus, so I had to delete it pretty quick >.> So, please help? :3

X-Buster
April 10th, 2008, 05:06 AM
Theres really no examples, it's a level script. Or in that case, a map script. Same thing ;).
What they are, are scripts that occur once you enter the map, so they can do various things.

Can you explain how to make one?

/Circa
April 10th, 2008, 10:32 PM
Can you explain how to make one?

A level script is just a normal script.

ZodiacDaGreat
April 10th, 2008, 11:40 PM
Can you explain how to make one?

Well, its pretty simple, one thing though, currently dont use advancemap 1.90's function of making Level scripts as its badly programmed.

What you do is open up a ROM with a hexeditor, and goto some free space, and depending on what sort of level script you want, you got different pointers. like:
1 = setmap tile
2 = msgboxes and applymovements
the rest I'm not sure.

For "01" Setmaptiles: goto some free space and enter 01XXXXXX0800, where XXXXXX is the pointer to the setmaptile script reversed, so 800000 = 000080 and 00 ends the main branch of level scripts

"02" msgboxes and applymovements, is tougher: goto some free space and enter 02XXXXXX0800, where XXXXXX,is the pointer to the conditionals script, and at pointer XXXXXX, put VVVV(Variable, reversed)CCCC(Conditionals)Pointer(005080)080000, so for example:

800000: 020001800800
800100: 50400100XXXXXX080000 , 5040 is variable 4050 reversed and 0100 is 0001 reversed meaning the level script will only activate when its set to 0x1

After that, open AMap, goto header view, and press "Ctrl-H" to activate professional view, and put the offset to the main branch of the level script at "Map Script Section" and then Save changes and reload map.

There, done, hope that helps, If you're not clear ask again

greenozano
April 11th, 2008, 05:16 AM
Originally Posted by greenozano
can someone tell me what I did wrong the boy in my map just moves and the just goes screen red. He doesn't even talk. I followed thethethethe's tutorial correctly and even used his program to script it and this one still didn't even work. Is it the flag?

#org $start
checkflag 0x203
if 0x1 goto $end
applymovement 0xFF $move1
$move1 1 ; #binary 0x62 0xFE
pause 0x20
applymovement 0x1 $move2
$move2 1 ; #binary 0x61 0x1D 0x1D 0x1D 0x1F 0x1F 0x20 0x20 0x02 0xFE
pause 0x40
message $MESSAGE1
$MESSAGE1 1 = OMG!\nI can't beleive that you are finally\l14.\nI feel angery and happy because\nI can now get your room, but\nstill you get a pokemon and I dont.\nanyway come on down\n the professor is here.
boxset 6
applymovement 0x1 $move3
$move3 1 ; #binary 0x1E 0x1E 0x1E 0xFE
pause 0x40
message $message 2
$message 2 1 =\v\h01:Man is my little brother always this\nenergetic.\nJason:Yeah, I am!\n\v\h01:??? He heared me? I was just thinking.\n It wasn't even out loud \nJasonnMom: Hurry Up!!!\n\v\h01:Ok coming!
boxset 6
#raw 0x53 0x01 0x00
setflag 0x203
release
end


#org $end
release
end
ya forgot to add boxsets...

Thanks for that I remember now man Im stupid how can I forget that.

X-Buster
April 11th, 2008, 02:57 PM
Well, its pretty simple, one thing though, currently dont use advancemap 1.90's function of making Level scripts as its badly programmed.

What you do is open up a ROM with a hexeditor, and goto some free space, and depending on what sort of level script you want, you got different pointers. like:
1 = setmap tile
2 = msgboxes and applymovements
the rest I'm not sure.

For "01" Setmaptiles: goto some free space and enter 01XXXXXX0800, where XXXXXX is the pointer to the setmaptile script reversed, so 800000 = 000080 and 00 ends the main branch of level scripts

"02" msgboxes and applymovements, is tougher: goto some free space and enter 02XXXXXX0800, where XXXXXX,is the pointer to the conditionals script, and at pointer XXXXXX, put VVVV(Variable, reversed)CCCC(Conditionals)Pointer(005080)080000, so for example:



After that, open AMap, goto header view, and press "Ctrl-H" to activate professional view, and put the offset to the main branch of the level script at "Map Script Section" and then Save changes and reload map.

There, done, hope that helps, If you're not clear ask again

I still can't, Maybe I'll Never Understand this..!

thethethethe
April 11th, 2008, 04:55 PM
@ZodiacDaGreat
Thanks for explaining that. I also don't really like the level script layout of A-Map 1.90. I'm still mainly using 1.82, instead of 1.90.

I still can't, Maybe I'll Never Understand this..!

It takes a while to understand and a little bit of trial and error before you understand them. There's a few tutorials on level scripts that might help you out. They aren't full tutorials on level scripts but you can get read into the certain things that seem to be what you need to look at.
There's a tutorial at WAH by Baro, just use a online to get a pretty bad translation, but it should be good enough to read.
And there's a tutorial here by me, that goes into de-activating level scripts. There's some info in that on the layout of level scripts and you'll hopefully be able to extract some information from it.

ZodiacDaGreat
April 11th, 2008, 05:10 PM
@ZodiacDaGreat
Thanks for explaining that. I also don't really like the level script layout of A-Map 1.90. I'm still mainly using 1.82, instead of 1.90.

Thanks alot Thethethethe, yeah, A-Map 1.90 is glitched up

Jamachi
April 12th, 2008, 04:15 AM
thanx for everything i now know how to script

Pheya
April 12th, 2008, 07:35 AM
Okay, I got a BIG problem, I copied a script from a friend of mine, but when I choose Compile Script he shows a lot of data, after that I get a empty LOG, he doesn't jump to bufrite. What to do?

thethethethe
April 12th, 2008, 03:27 PM
Okay, I got a BIG problem, I copied a script from a friend of mine, but when I choose Compile Script he shows a lot of data, after that I get a empty LOG, he doesn't jump to bufrite. What to do?

What's the name of the .rbc file? If you have certain characters within the name it does that. Try changing the name of the .rbc file to something simple like 123.rbc, and see if that works.

コリンク
April 12th, 2008, 10:42 PM
I'm not sure if this has been asked, but how and what would the offsets and cries be if you inserted Sinnoh Pokemon?

Pokepal2007
April 13th, 2008, 05:47 AM
ok guys i have a problem with this script i just don't know what it is can you help
?

#org $begin
checkflag 0x828
if b_true goto $done
message $1
boxset 5
compare LASTRESULT 0x1
if b_true goto $take
message $2
boxset 6
release
end

#org $take
message $3
boxset 6
givepokemon 280 10 0
fanfare 0x13E
message $4
boxset 4
waitfanfare
#raw 0x68
setflag 0x828
message $5
boxset 6
release
end

#org $done
message $6
boxset 6
release
end

#org $1
$1 1 =Hello there, i am kingdra leader of the\nPokémon Rescuers\pAre you wanting to join?

#org $2
$2 1 =Come back if you wish to join.

#org $3
$3 1 =Good, Your first mission is to goto\nthe center of Snake Forest and rescue\pa Pikachu.

#org $4
$4 1 =You got your first mission.

#org $5
$5 1 =Good luck on your mission.

#org $6
$6 1 =Good luck.

Khalil
April 13th, 2008, 08:35 AM
#org $begin
lock
faceplayer
message $whatup
boxset6
applymovement 0x10 $move
pausemove 0x0
applymovement 0xFF $move2
pause 0x30
applymovement 0x10 $move3
applymovement 0xFF $move3
pausemove 0x0
message $whatup2
boxset6
release
end

$org $whatup
$whatup 1 = Yo kid come with me.\n\v\h01!:....IM NOT A\pKID!

$org $move
#raw 0x10 0x10 0x10 0x10 0xFE

$org $move2
#raw 0x65 0XFE

$org $move3
#raw 0X11 0X11 0X11 0X11 0X12 0X12 0X12 0X12 0X12 0X11 0XFE

$org $whatup2
$whatup2 1 = \v\h01!:why did u take me here\n???:I don't know\p\v\h01!:**** YOU *****!

can u help me with this one? it wont compile the script

Pheya
April 14th, 2008, 05:41 AM
What's the name of the .rbc file? If you have certain characters within the name it does that. Try changing the name of the .rbc file to something simple like 123.rbc, and see if that works.

It was named givepkmn.rbc, I renamed it to 123.rbc and they both didn't work.

TSK
April 15th, 2008, 09:03 AM
This is a truly awesome guide, it has helped me a lot.

There is one thing I didn't find to be mentioned that is quite cool to use: #raw 0x2F
0x2F is used for sound effects like the exclamation mark sound, it's used like this:
#raw 0x2F 0xnn 0xnn

(Where the last two stand for the flipped sound effect number)

Pokepal2007
April 17th, 2008, 07:39 AM
can someone help me this script dosen't finish why?.

#org $begin
checkflag 0x201
if b_true goto $done
applymovement 0xFF $move1
pausemove 0
message $1
boxset 6
trainerbattle 0 0x001 $before $after $later
end

#org $done
release
end

#org $move1
#raw 0x10 0x10 0x10 0x10 0x12 0x12 0x10 0x10 0xFE

#org $1
$1 1 =Hey leave that pikachu alone!

#org $before
$before 1 = Battle me now and if you win i will\nGo away.

#org $after
$after 1 = Okay i will leave this pikachu alone.

#org $later
message $2
boxset 6
applymovement 0x01 $move1
pausemove 0
message $3
boxset 6
applymovement 0x00 $move2
pausemove 0
setflag 0x201
release
end

#org $2
$2 1 =I will return and you will lose.

#org $move1
#raw 0x13 0x60 0xFE

#org $3
$3 1 =Thank you for Saving me this staircase\nwill take us out.

#org $move2
#raw 0x13 0x60 0x13 0xFE

cooley
April 17th, 2008, 05:03 PM
can someone help me this script dosen't finish why?.

#org $begin
checkflag 0x201
if b_true goto $done
applymovement 0xFF $move1
pausemove 0
message $1
boxset 6
trainerbattle 0 0x001 $before $after $later
end

#org $done
release
end

#org $move1
#raw 0x10 0x10 0x10 0x10 0x12 0x12 0x10 0x10 0xFE

#org $1
$1 1 =Hey leave that pikachu alone!

#org $before
$before 1 = Battle me now and if you win i will\nGo away.

#org $after
$after 1 = Okay i will leave this pikachu alone.

#org $later
message $2
boxset 6
applymovement 0x01 $move1
pausemove 0
message $3
boxset 6
applymovement 0x00 $move2
pausemove 0
setflag 0x201
release
end

#org $2
$2 1 =I will return and you will lose.

#org $move1
#raw 0x13 0x60 0xFE

#org $3
$3 1 =Thank you for Saving me this staircase\nwill take us out.

#org $move2
#raw 0x13 0x60 0x13 0xFE
This is not a request thread, it's a Tutorial But I'll tell you what's wrong.

trainerbattle 0x0 is for battles that don't have $further or $later

trainerbattle 0x1 is for battles that have a script that continues after the battle eg. $later

himowa
April 20th, 2008, 09:42 AM
#org $start
checkflag 0x828
if b_true goto $done
message $1
boxset 5
compare LASTRESULT 0x1
if b_true goto $take
message $2
boxset 6
release
end

#org $take
givepokemon 133 5 0
fanfare 0x13E
message $3
boxset 4
waitfanfare
#raw 0x68
setflag 0x828
message $4
boxset 5
compare LASTRESULT 0x1
if b_true gosub $name
message $5
boxset 6
release
end

#org $name
call 0x1A74EB
return

#org $done
message $6
boxset 6
release
end

#org $1
$1 1 =AID: I'm sorry, PROF. PINE isn't\nhere right now.\p...Oh, so you need a POKeMON to travel with?\pHere, you can have\nthis POKeMON we study in the lab.\pTake the POKeMON?

#org $2
$2 1 =AID: Well if you change your mind let me know.

#org $3
$3 1 =\c\h01\h02You received an EEVEE!

#org $4
$4 1 =\c\h01\h02Would you like to rename EEVEE?

#org $5
$5 1 =We have been monitering\nEEVEE's evolution patterns.\lWe have plenty of them in the\nso this one is probably\lbetter off with you.

#org $6
$6 1 =How is EEVEE doing?

I'm having some problems with this script here. Everything seems to work, he says everything and you get the Eevee, but when you go to give it a nickname it has missingno's icon with ?'s for the name where is should have Eevee's icon and name.

But when you look through the start menu and everything you have a Eevee, only during renaming process.

Also after you rename you seem to have an identity crisis and switch places/sprites with the aid. (until you walk into a new map, then you go back to normal)

Tré
April 20th, 2008, 06:56 PM
hey how do you insert scripts using the tool....???

Hellsing
April 21st, 2008, 12:52 PM
hey how do you insert scripts using the tool....???

just right click your rbc. file and press compile.
and guys, this is a script tutorial, please just post in the script help thread for all these scripting screwups.

Dan13x
April 24th, 2008, 07:44 PM
#org $start
lock
faceplayer
checkflag 0x828
if b_true goto $done
message $1
boxset 5
compare LASTRESULT 0x1
if b_true goto $take
message $2
boxset 6
release
end

#org $take
givepokemon 133 5 0
fanfare 0x13E
message $3
boxset 4
waitfanfare
#raw 0x68
setflag 0x828
message $4
boxset 5
compare LASTRESULT 0x1
if b_true gosub $name
message $5
boxset 6
release
end

#org $name
call 0x1A74EB
return

#org $done
message $6
boxset 6
release
end

#org $1
$1 1 =AID: I'm sorry, PROF. PINE isn't\nhere right now.\p...Oh, so you need a POKeMON to travel with?\pHere, you can have\nthis POKeMON we study in the lab.\pTake the POKeMON?

#org $2
$2 1 =AID: Well if you change your mind let me know.

#org $3
$3 1 =\c\h01\h02You received an EEVEE!

#org $4
$4 1 =\c\h01\h02Would you like to rename EEVEE?

#org $5
$5 1 =We have been monitering\nEEVEE's evolution patterns.\lWe have plenty of them in the\nso this one is probably\lbetter off with you.

#org $6
$6 1 =How is EEVEE doing?

I'm having some problems with this script here. Everything seems to work, he says everything and you get the Eevee, but when you go to give it a nickname it has missingno's icon with ?'s for the name where is should have Eevee's icon and name.

But when you look through the start menu and everything you have a Eevee, only during renaming process.

Also after you rename you seem to have an identity crisis and switch places/sprites with the aid. (until you walk into a new map, then you go back to normal)

The letters in bold are the ones that are new. I don't know what happened, make sure you have lock and faceplayer when you're speaking with a person.

BBs0n
April 30th, 2008, 05:29 AM
I've a script, but it doesn't work. I've tried to change some flags, but I don't think that's the problem because the script is in the beginning of the game (when you down the stairs into your livingroom)

#org $start
checkflag 0x202
if b_true goto $done
setflag 0x202
applymovement 0x01 $popup
pausemove 0
message $verslapen
boxset 6
applymovement 0x01 $moves
pausemove 0
message $oak
boxset 6
applymovement 0x01 $movesback
pausemove 0
release
end

#org $done
release
end

#org $verslapen
$verslapen 1 =YOU OVERSLEPT!

#org $oak
$oak 1 =I don't think Professor Brown has \nany Pok\h1Bmon left for you. \lHe might have a pok\h1Bdex for you...


#org $popup
#raw 0x62
#raw 0xFE

#org $moves
#raw 0x11
#raw 0x11
#raw 0x13
#raw 0xFE

#org $movesback
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0x02
#raw 0xFE

Does anyone has an idea what's going wrong? If I walk onto it nothing happens. When I walk the second time over it the game freezes...

Piplup-Trainer
April 30th, 2008, 02:07 PM
Thanks to this tutorial I made a rocket script battle.

greenozano
April 30th, 2008, 02:31 PM
I made this script in which your mom is suppose to barge in your room and act excited it works all the way up to her disappearance then it frezzes try it out your self. What did I do wrong.

#org $start
checkflag 0x203
if 0x1 goto $end
applymovement 0xFF $move1
$move1 1 ; #binary 0x62 0xFE
pause 0x20
applymovement 0x1 $move2
$move2 1 ; #binary 0x61 0x1D 0x1D 0x1D 0x1F 0x1F 0x20 0x20 0x02 0xFE
pause 0x40
message $MESSAGE1
$MESSAGE1 1 = I can't beleive that you are finally\l14.\nI feel angery and happy at the same time\nanyway come on down\n the professor is here.
boxset 0x6
applymovement 0x1 $move3
$move3 1 ; #binary 0x1E 0x1E 0x1E 0xFE
pause 0x40
#raw 0x53 0x01 0x00
setflag 0x204
message $message 2
$message 2 1 =\v\h01:Man when did my mother get this\nenergetic.\nJason:Yeah, I am!\n\v\h01:??? did she heared me? I was just thinking.\n It wasn't even out loud\nMom: Hurry Up!!!\n\v\h01:Ok coming!
boxset 0x6
setflag 0x203
release
end


#org $end
release
end

Binary
May 1st, 2008, 08:17 AM
#org $start
checkflag 0x203
if B_true goto $end
applymovement 0xFF $move1
pause 0x10
applymovement 0x1 $move2
pausemove
message $MESSAGE1
boxset 6
applymovement 0x1 $move3
pause 0x30
#raw 0x53 0x01 0x00
message $message 2
boxset 6
setflag 0x203
release
end

#org $end
release
end

#org $move1
$move1 1 ; #binary 0x62 0xFE

#org $move2
$move2 1 ; #binary 0x61 0x1D 0x1D 0x1D 0x1F 0x1F 0x20 0x20 0x02 0xFE

#org $MESSAGE1
$MESSAGE1 1 = I can't beleive that you are finally\l14.\nI feel angery and happy at the sametime\nanyway come on down\n the professor is here.

#org $move3
$move3 1 ; #binary 0x1E 0x1E 0x1E 0xFE

#org $message 2
$message 2 1 =\v\h01:Man when did my mother get this\nenergetic.\nJason:Yeah, I am!\n\v\h01:??? did she heared me? I was just thinking.\n It wasn't even out loud\nMom: Hurry Up!!!\n\v\h01:Ok coming!

I suggest you to put the offsets in the end.

BBs0n
May 1st, 2008, 08:43 AM
I've got this script:

#org $start
checkflag 0x202
if b_true goto $done
applymovement 0x01 $popup
pausemove 0
message $verslapen
boxset 6
applymovement 0x01 $moves
pausemove 0
message $oak
boxset 6
applymovement 0x01 $movesback
pausemove 0
setflag 0x202
release
end

#org $done
release
end

#org $verslapen
$verslapen 1 = YOU OVERSLEPT!

#org $oak
$oak 1 = I don't think Professor Brown has \nany Pok\h1Bmon left for you. \lHe might have a pok\h1Bdex for you...


#org $popup
$popup 1 ; #binary 0x62 0xFE

#org $moves
$moves 1 ; #binary 0x11 0x11 0x13 0xFE

#org $movesback
$movesback 1 ; #binary 0x12 0x10 0x10 0x02 0xFE


When I walk onto the script, the game freezes. If I give the offset to people no.1 It will do the script perfectly when I talk to her. Why is that so? Why does it work on a People and not on a Script???

greenozano
May 1st, 2008, 02:13 PM
Quote:
#org $start
checkflag 0x203
if B_true goto $end
applymovement 0xFF $move1
pause 0x10
applymovement 0x1 $move2
pausemove
message $MESSAGE1
boxset 6
applymovement 0x1 $move3
pause 0x30
#raw 0x53 0x01 0x00
message $message 2
boxset 6
setflag 0x203
release
end

#org $end
release
end

#org $move1
$move1 1 ; #binary 0x62 0xFE

#org $move2
$move2 1 ; #binary 0x61 0x1D 0x1D 0x1D 0x1F 0x1F 0x20 0x20 0x02 0xFE

#org $MESSAGE1
$MESSAGE1 1 = I can't beleive that you are finally\l14.\nI feel angery and happy at the sametime\nanyway come on down\n the professor is here.

#org $move3
$move3 1 ; #binary 0x1E 0x1E 0x1E 0xFE

#org $message 2
$message 2 1 =\v\h01:Man when did my mother get this\nenergetic.\nJason:Yeah, I am!\n\v\h01:??? did she heared me? I was just thinking.\n It wasn't even out loud\nMom: Hurry Up!!!\n\v\h01:Ok coming!
I suggest you to put the offsets in the end.

Dude it still doesn't work right now it doesn't even start now.

Klex
May 1st, 2008, 02:20 PM
Man thethethethe i was just reading thru some of your tut and it is such nice work
man i didint think there was that much stuff for Scripting.

geno421
May 1st, 2008, 03:45 PM
That was alot to take in but now I have a clear understanding on how PokeScript works. Thanks. :)

Kye McPie
May 5th, 2008, 09:10 AM
I can tell this tutorial has a lot of information that's going to help me with hacking, even though I don't quite understand it all -_-;;. Good job, man.


Hey, could I get some help with my applymovement script? I want Mr. Oak here to say something, then take 2 fast steps to the right, then 1 fast steps up and 3 slides up and stop; then, the player will take 1 step down on the spot, Oak will again speak, and once he's done the player will follow Oak down 14 normal steps, then 5 steps to the right and finally 1 step up into a warp. When I try to compile the script I get this error;

"Run-time error '13'

Type mismatch"

Looking at the log behind the message the compiling seems to stop right after the first $move line.

Here's the script;

#org $start
checkflag 0x828
if b_true goto $done
message $1
boxset 6
applymovement 0x03 $move
pausemove 0x0
applymovement 0xFF $move2
pause 0x30
message $2
boxset 6
playsound 0x13E
nop
applymovement 0x03 $move3
applymovement 0xFF $move3
pausemove 0
fadesound 0x12C
nop
release
end

#org $done
release
end

#org $move
#raw 0x20 0x20 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x32 0x32 0x32 0xFE

#org $move2
#raw 0x00 0xFE

#org $move3
#raw 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x12 0x11 0xFE

#org $1
$1 1 = \c\h01\h04message!

#org $2
$2 1 =message!

And while I'm at it, I wanna ask; can you insert a unlimited amount of movements into a single line?

dragontamer
May 5th, 2008, 11:29 AM
okay im a noob and i want to start with hacking but,, how the f,*ck do you open this etc. i only get some log and something called *bugbite* explain me how im gonna use this?

cloudffvii2696
May 6th, 2008, 02:26 PM
okay im a noob and i want to start with hacking but,, how the f,*ck do you open this etc. i only get some log and something called *bugbite* explain me how im gonna use this?

I had the same problem too until I got used to it, but here's how to get it to work:
-open up Notepad and type up your code, then save it as a .rbc file.
-now, right click on XXXXXXX.rbc and choose "compile script"
-then it will compile and BufRite will open
-Hit the Assign icon and open up your rom
-hit the search button, click on a hex value, and now hit Reserve
-Now you should be set

Tré
May 8th, 2008, 07:08 PM
hey is there a problem with this script???
#org $34
lock
faceplayer
message $i'll give yah this
$i'll give yah this 1 =i'll give yah this
givepokemon 142 100 -1
special 0x9E
release
end
how do i insert it??

greenozano
May 9th, 2008, 04:18 AM
hey is there a problem with this script???
#org $34
lock
faceplayer
message $i'll give yah this
$i'll give yah this 1 =i'll give yah this
givepokemon 142 100 -1
special 0x9E
release
end
how do i insert it??

Even I know this

#org $34
lock
faceplayer
message $i'll give yah this
$i'll give yah this 1 =i'll give yah this
boxset 6
givepokemon 142 100 1
special 0x9E
release
end
how do i insert it??


You insert it by using pokescript so go to Irish witch's tutorial.

Perfect_Palkia_10
May 11th, 2008, 12:20 AM
Excellent tutorial. I've got a problem. When did my trainerbattle script for a gym leader all that happens in the game is that I get my badge and TM but its the wrong badge and I never battle. Can someone help.

Master_Track
May 11th, 2008, 04:39 AM
would help if you'd show us your script ^^

but it should be like this:

#org $begin
lock
faceplayer
message $raven
$raven 1 = Oh, a challenger? You\nare the first one after\lweeks.\pMy name is VINCENT RAVEN, but\ncall me VINCE. I am a trainer\lof BIRD POKEMON. They are\lfascinating, aren't they?\pWhen I was a small child I\nsaved a little MURKROW, we were\ltogether since this day. You can't\lbeat us!
boxset 6
trainerbattle 1 0x19E $before $after $later
end

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

#org $after
$after 1 = MURKROW, noooooo!

#org $later
message $beaten
$beaten 1 = You defeated even MURKROW.\nI can't believe it...\lYou are stronger than I thought.\lI'll give you the Badge of\lfreedom.
boxset 6
fanfare 0x13E
message $badge
$badge 1 = You received: \c\h01\h05Badge Of Freedom.
boxset 6
waitfanfare
message $tm
$tm 1 = I want to give you this\ntoo, it's my favourite\lattack.
boxset 6
fanfare 0x13E
message $tm1
$tm1 1 = You received: \c\h01\h04TM 40!
boxset 6
waitfanfare
message $ace
$ace 1 = This TM can teach one of your\npokemon the attack \c\h01\h04AERIAL\lACE\c\h01\h02. Think carefully before using it.
boxset 6
giveitem 0x148 1
setflag 0x820
release
end

you'll have to change the text and the number which i made bold.
it has to be the trainer id from PET.

PhaizeD
May 11th, 2008, 07:02 AM
I'm having a lot of problems. I've tried multiple tutorials and scripts from the tutorials always have issues with me. For instance the GivePokemon script in here, I even tried copying it and It NEVER gives the pokemon. It always sends me to $2 and ends it.

The lavacookie for ultra ball script in Irish Witch's tutorial also has a problem, it never recognizes that I have a cookie.

A lot of giveitem scripts either ALWAYS give the item or NEVER give the item.

I'm wondering if it has something to do with the version I'm using or something, I'm using pokescript v1.2. If I need an earlier or later version, could someone tell me and/or direct me somewhere that I can obtain it? As I can't find anything besides v1.2.

TheGoldenKing
May 12th, 2008, 03:44 PM
Can someone help me I want to make a trainer script like the rivals in fire red. I want to make the Pokemon you fight different depending on what Pokemon you pick as your stater, but I don't know how I would do it?

dragonarche
May 12th, 2008, 11:57 PM
click here

i got no reason to post

Master_Track
May 13th, 2008, 12:37 AM
Can someone help me I want to make a trainer script like the rivals in fire red. I want to make the Pokemon you fight different depending on what Pokemon you pick as your stater, but I don't know how I would do it?
you'll have to check for the pokemon in your party, and depending which you have you need to point do a different part of the script.
for example, you check for Larvitar. If the player has larvitar, the script goes normal on to..lets say trainerbattle 1 0x001.
but if not..goto $notvitar
and there u check for, lets say mew. If player has mew, the script goes on to trainerbattle 0x002.
if not, goto $last. And there u put another trainerbattle 0x003.
And each of this trainers are named like the rival, have the same picture but different pokemon ^^

TheGoldenKing
May 13th, 2008, 03:59 PM
I know that was what I was thinking but what if someone cheats and catches all starters or evolves their original one, what would I do then?

BBs0n
May 14th, 2008, 07:59 AM
Make a script where we're in the beginning of the game, like when we come out of Oak's lab. There you check the pokemon. I don't know what the script is but I know how it looks like

check a pokemon (let's say Charmander)
if 1 goto $charmander
check a pokemon (let's say Squirtle)
if 1 goto $squirtle
setflag 0x200
release
end

#org $charmander
setflag 0x201
release
end

#org $squirtle
set flag 0x202
release
end

(check a pokemon isn't the right command. It was just an example

Setflag 200 is for Bulbasaur
Setflag 201 is for Charmander
setflag 202 is for Squirtle

Now you can check which pokemon he had got first. I don't know if this is the easiest way, but I think it'll work...

MCRAIDER19
May 18th, 2008, 10:52 AM
I got a problem with the give pokemon script I got the pokemon but the flag didnt work and when it asked if the pokemon wants a nickname it just froze the game what is the problem?

X-Buster
May 18th, 2008, 07:45 PM
is their a script that will ask you your ID number in your Trainer Card?

and a script that only work in one gender?

1KewlDude
May 20th, 2008, 12:53 PM
Thank you very much thex4, this tutorial has helped me a lot :). I haven't read it all though.

I have a problem with the applymovements script. This is to stop the hero from continuing and making him/her move back. The script doesn't even start when I test it; here it is:


#org $start
applymovement 0x04 $stop
applymovement 0xFF $what
pausemove 0x0
message $1
boxset 6
applymovement 0xFF $move
pausemove 0x0
release
end

#org $stop
#raw 0x62 0xFE

#org $what
#raw 0x02 0x63 0xFE

#org $move
#raw 0x10 0xFE

#org $1
$1 1 =Stop! You can't pass.

Please help and thanks again thex4.

Jawash
May 20th, 2008, 04:25 PM
eck!
Ok, I tried making a script, it worked all fine and glitches the pokemon sprite a teency bit right before the screen does it's little animation
[Then you fight the pokemon]
and all but the pokemon does not disappear after the battle
And to think of it, nor do I hear the roar >,<'
I was wondering if you could help?

Here it be! :)

#org $start
Lock
Faceplayer
Message $roar
Boxset 6
Wildbattle 5 2 1
Setflag 0x200
Fadesreen 0
Release
End

#org $roar
$roar 3 = Charmeleon: Char... Charmeleon!

mitchel1
May 21st, 2008, 06:26 AM
Hello people who know the earthquake command for Fire-red? Because i don't know what that command code is i hope that someon can tell it me
Thanks in advance ^^
~Mitchel1

Master_Track
May 21st, 2008, 06:37 AM
special 0x136
#raw 0x2F 0x4B 0x01
setvar 0x8004 0x3
setvar 0x8005 0x3
setvar 0x8006 0x3A
setvar 0x8007 0x2
special 0x136
pause 0x3A

I'm not sure about what each var means, but I think the one with 0x3A sets the duration. the higher the number, the longer the quake.
the #raw activates the cave sound, if it should be outside u should delete this line ^^

Jawash
May 21st, 2008, 11:05 AM
eck!
Ok, I tried making a script, it worked all fine and glitches the pokemon sprite a teency bit right before the screen does it's little animation
[Then you fight the pokemon]
and all but the pokemon does not disappear after the battle
And to think of it, nor do I hear the roar >,<'
I was wondering if you could help?

Here it be! :)

#org $start
Lock
Faceplayer
Message $roar
Boxset 6
Wildbattle 5 2 1
Setflag 0x200
Fadesreen 0
Release
End

#org $roar
$roar 3 = Charmeleon: Char... Charmeleon!

Can someone please tell me how to make the pokemon disappear?
It has been bugging me for a long time.
Well... A good long while.
And is making the poke disappear in a legendary script any different from the norm?

Master_Track
May 21st, 2008, 11:44 AM
#org $start
Lock
Faceplayer
Message $roar
Boxset 6
Wildbattle 5 2 1
#raw 0x53 0x00 0x00 (<--reversed person number)
Setflag 0x200 (<---write the setflag number as ID for the sprite: 0200)
Fadesreen 0
Release
End

#org $roar
$roar 3 = Charmeleon: Char... Charmeleon!
it should work if u do what I wrote ;)

Jawash
May 21st, 2008, 12:01 PM
#org $start
Lock
Faceplayer
Message $roar
Boxset 6
Wildbattle 5 2 1
#raw 0x53 0x00 0x00 (<--reversed person number)
Setflag 0x200 (<---write the setflag number as ID for the sprite: 0200)
Fadesreen 0
Release
End

#org $roar
$roar 3 = Charmeleon: Char... Charmeleon!it should work if u do what I wrote ;)

The pokemon is still there.
there is no bye-bye pokemon.
eck.
7,7... i just need practice on this one script and i'll be just about finihed learnerating :D

Master_Track
May 21st, 2008, 12:31 PM
did u replace 0x00 0x00 with the person number? and was it reversed?
person number 6:
#raw 0x53 0x06 0x00
setflag 0x200

and u have to give the sprite the ID 0200.

number 6 was just an example, just replace it with another number ^^
if the number is higher than 9:
0x0A = 10
0x0B = 11
...
...
0x0F = 15
0x10 = 16
0x19 = 25
0x1A = 26

etc ^^

Jawash
May 21st, 2008, 12:45 PM
did u replace 0x00 0x00 with the person number? and was it reversed?
person number 6:
#raw 0x53 0x06 0x00
setflag 0x200

and u have to give the sprite the ID 0200.

number 6 was just an example, just replace it with another number ^^
if the number is higher than 9:
0x0A = 10
0x0B = 11
...
...
0x0F = 15
0x10 = 16
0x19 = 25
0x1A = 26

etc ^^

bleap bloop blop blape....
pineapple chicken fork...
i am sorry can you show me specifically what you mean?
i will use it as a base script and give you credit.
?

Master_Track
May 22nd, 2008, 12:35 AM
I'll try to explain it a bit:

#org $start
Lock
Faceplayer
Message $roar
Boxset 6
Wildbattle 5 2 1
#raw 0x53 0x00 0x00 (<--reversed person number)
Setflag 0x200 (<---write the setflag number as ID for the sprite: 0200)
Fadesreen 0
Release
End

#org $roar
$roar 3 = Charmeleon: Char... Charmeleon!

there is the #raw 0x53 command. the 2 bytes after it have to be the reversed
trainernummer. U have to reverse it like this:

person number 2:
0002
[00][02] --> [02][00] ---> 0x02 0x00

numbers higher than 10 have to be in hex. I showed above how to do that.
for example numer 10.
10 = 000A

[00][0A]---> [0A][00]---> 0x0A 0x00

if u do it right it should work.
Check if u use the person number, NOT the event number. (person number is the one above the picture number).
then u use a setflag here, 0200.
so the person which should vanish needs the ID 0200.

finished script for person number 5 :

#org $start
Lock
Faceplayer
Message $roar
Boxset 6
Wildbattle 5 2 1
#raw 0x53 0x05 0x00
Setflag 0x200
Fadesreen 0
Release
End

#org $roar
$roar 3 = Charmeleon: Char... Charmeleon!
u can just replace the number 5 with the right number if its lower than 10. if it's
10 or higher do what i showed above ;)

Jawash
May 22nd, 2008, 10:41 AM
I'll try to explain it a bit:

#org $start
Lock
Faceplayer
Message $roar
Boxset 6
Wildbattle 5 2 1
#raw 0x53 0x00 0x00 (<--reversed person number)
Setflag 0x200 (<---write the setflag number as ID for the sprite: 0200)
Fadesreen 0
Release
End

#org $roar
$roar 3 = Charmeleon: Char... Charmeleon!there is the #raw 0x53 command. the 2 bytes after it have to be the reversed
trainernummer. U have to reverse it like this:

person number 2:
0002
[00][02] --> [02][00] ---> 0x02 0x00

numbers higher than 10 have to be in hex. I showed above how to do that.
for example numer 10.
10 = 000A

[00][0A]---> [0A][00]---> 0x0A 0x00

if u do it right it should work.
Check if u use the person number, NOT the event number. (person number is the one above the picture number).
then u use a setflag here, 0200.
so the person which should vanish needs the ID 0200.

finished script for person number 5 :

#org $start
Lock
Faceplayer
Message $roar
Boxset 6
Wildbattle 5 2 1
#raw 0x53 0x05 0x00
Setflag 0x200
Fadesreen 0
Release
End

#org $roar
$roar 3 = Charmeleon: Char... Charmeleon!u can just replace the number 5 with the right number if its lower than 10. if it's
10 or higher do what i showed above ;)
now that's what i be screamin' thank you.
great!

Pokepal2007
May 25th, 2008, 01:40 PM
#org $begin
checkflag 0x807
if b_true goto $team
release
end

#org $team
checkflag 0x201
if b_true goto $done
applymovement 0x05 $move
pausemove 0
message $1
boxset 6
applymovement 0x05 $move1
pausemove 0
applymovement 0xFF $move2
pausemove 0
message $2
boxset 6
setflag 0x201
release
end

#org $done
release
end

#org $move
#raw 0x0B 0x0B 0x0B 0xFE

#org $1
$1 1 =Hey there kid could you help me?\nWell two bad guys walked into\pThe Sacred Field.\pCould you come with me?\p\v\h01:Yes ok.

#org $move1
#raw 0x0A 0x0A 0x09 0x09 0x09 0x09 0x09 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x08 0x08 0x0B 0x0B 0x0B 0x0B 0xFE

#org $move2
#raw 0x0A 0x0A 0x0A 0x09 0x09 0x09 0x09 0x09 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x08 0x08 0x0B 0x0B 0x0B 0xFE

#org $2
$2 1 =This is it just head through.

WHAT IS GOING WRONG?

Master_Track
May 26th, 2008, 05:38 AM
#org $begin
checkflag 0x807
if b_true goto $team
release
end

#org $team
checkflag 0x201
if b_true goto $done
applymovement 0x05 $move
pausemove 0
message $1
boxset 6
applymovement 0x05 $move1
pausemove 0
applymovement 0xFF $move2
pausemove 0
message $2
boxset 6
setflag 0x201
release
end

#org $done
release
end

#org $move
$move 1 ; #binary 0x0B 0x0B 0x0B 0xFE

#org $1
$1 1 = Hey there kid could you help me?\nWell two bad guys walked into\pThe Sacred Field.\pCould you come with me?\p\v\h01:Yes ok.

#org $move1
$move1 1 ; #binary 0x0A 0x0A 0x09 0x09 0x09 0x09 0x09 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x08 0x08 0x0B 0x0B 0x0B 0x0B 0xFE

#org $move2
$move2 1 ; #binary 0x0A 0x0A 0x0A 0x09 0x09 0x09 0x09 0x09 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x08 0x08 0x0B 0x0B 0x0B 0xFE

#org $2
$2 1 = This is it just head through.

WHAT IS GOING WRONG?


I replaced the #raws of the movement with #binary, because I think it works better ;)

And I also changed the setting of the messages.

message $1
$1 1 = Put a space after the equal sign,\nthen it should work.
boxset 6

xD

4tutoralcom
May 28th, 2008, 12:01 PM
Is there any way to create a script that allows you to trade pokemon in the game? If there is tell post the script.

maximum911
May 28th, 2008, 12:21 PM
when ever i have a script when you step on it something moves the games always hangs here is a simple example


#org $start
applymovement 0x4 $move
pausemove 0x0
message $2
boxset 6
release
end

#org $move
#raw 0x13 0x13 0x13 0x13 0xFE

#org $2
$2 1 =Hi big bro!

phmman
May 29th, 2008, 03:18 PM
Hello everyone! I'm new to this fourm! Anyway I don't understand the ApplyMovement script. Do I place the outset in a script or a Person? I'm new to script so please explain as simple as you can please. Thanks in advance!

Edit: Someone already answer this for me so thanks anyway if you were going to help.

Gundam-Fighter
May 30th, 2008, 01:29 PM
Hi, I'm new here and I'm setting up an unnamed hack of fire-red and I've got a script that won't get onto the rom and I'm not sure if it's the script or the length of the script that stops it working can someone help?

Here's the script:
#org $start
checkflag 0x829
if b_true goto $done
checkflag 0x828
if b_true goto $item
message $1
boxset 5
compare LASTRESULT 0x1
if b_true goto $take
message $2
boxset 6
release
end

#org $take
givepokemon 1x7E 0x5 0x0
fanfare 0x13E
message $3
boxset 4
waitfanfare
#raw 0x68
setflag 0x828
message $4
boxset 5
compare LASTRESULT 0x1
if b_true gosub $name
message $5
boxset 6
release
end

#org $name
call 0x1A74EB
return

#org $item
message $7
boxset 5
compare LASTRESULT 0x1
if b_true goto $getitem
message $9
boxset 3
compare LASTRESULT 0x1
if b_true goto $alt

#org $getitem
message $8
boxset 6
giveitem 0x5E 0x1
setflag 0x829
release
end

#org $done
message $6
boxset 6
release
end

#org $alt
message $10
boxset 5
giveitem 0x5D 0x1
setflag 0x829
release
end

#org $1
$1 1 =Would you like an ARON?

#org $2
$2 1 =Oh.\nOk bye.

#org $3
$3 1 =/c/h01/h02You received an ARON!

#org $4
$4 1 =/c/h01/h02Would you like to rename ARON?

#org $5
$5 1 =Please don't hurt it.

#org $6
$6 1 =I hope you like Aron.

#org $7
$7 1 =Would you like a MOON STONE?\nIt'll evolve ARON to a\nSTEELDROM!\pSo do you want one?

#org $8
$8 1 =Well here you go\p\c\h01\h02You recieved a MOON STONE!

#org $9
$9 1 =Oh.\pWell would you like to\nhave a SUN STONE instead?

#org $10
$10 1 =Here you go!\p\c\h01\h02You received a SUN STONE!

PS: Steeldrom is a different version of a Rhyhorn. I'm respriting alot of pokemon as the hack's based in a different time period to the other games so there are different pokemon.

Pokepal2007
May 31st, 2008, 07:57 AM
what would i do if i wanted to set the clock on ruby and sapphire?

maximum911
May 31st, 2008, 02:26 PM
help i set the vars on a script on the ground with the unknown 300 and var #5040
heres the script
#org $start
applymovement 0x1 $move
pausemove 0x0
message $2
boxset 6
release
end

#org $move
#raw 0x13 0x13 0x13 0x13 0xFE

#org $2
$2 1 =Hi big bro!
no movement occurs when i step on it any help?

peteb
June 1st, 2008, 03:22 AM
This is the tutorial that showed me how to edit scripts. This is fantastic. Thanks!

Gundam-Fighter
June 1st, 2008, 02:38 PM
None of my scripts work and neither do any of the examples. When pokescript encodes it it ends in
\- Processed 16 Buffers

|
\- Processed 0 Lines

|
\- Processed 0 Lines

What does this mean?

Megiddo-san
June 1st, 2008, 03:06 PM
Does it say file not found or user cancel?

Gundam-Fighter
June 1st, 2008, 03:15 PM
At every command it says invalid command e.g:#OFFSET: 0, 0
Invalid Command : lock
Invalid Command : faceplayer
Invalid Command : checkflag
Invalid Command : if
Invalid Command : checkflag
Invalid Command : if
Invalid Command : message
Invalid Command : boxset
Invalid Command : compare
Invalid Command : if
Invalid Command : message
Invalid Command : boxset
Invalid Command : release
Invalid Command : end

Can anyone help? Is it pokescript thats corrupt or something?

Megiddo-san
June 1st, 2008, 03:17 PM
Did you open it up in pokescript? You need to save it as a .rbc and right click on it and pick compile.

Gundam-Fighter
June 1st, 2008, 03:42 PM
I can't do the right click so I open poke script then click, file, encode and select the .rbc file but thats what happens. I don't know what's wrong because the script seems to be fine it's just it keeps saying invalid command for every line.

Megiddo-san
June 1st, 2008, 04:09 PM
Ah, somewhere in the docs and tuts section there's a tut on how to fix that.

Pokepal2007
June 2nd, 2008, 11:32 AM
what is wrong with dis script?

#org $begin
checkflag 0x220
if b_true goto $done
applymovement 0xFF $move
pausemove 0
message $1
boxset 6
warp 0x18 0x03 0x00
release
end

#org $done
message $2
boxset 6
applymovement 0xFF $move1
pausemove 0
release
end

#org $move
#raw 0x09 0x09 0x09 0x09 0x0B 0x0B 0x09 0xFE

#org $1
$1 1 =WHO DARE COME TO MY PLACE?\p\v\h01: my name is \v\h01,\nI came to ask you about the angels,\pYOU WANT TO KNOW ABOUT ANGELS\nTHEN TAKE THIS.

#org $2
$2 1 =Best i dont go here.

#org $move1
#raw 0x08 0xFE

Tré
June 3rd, 2008, 05:30 PM
uh..how can i make pikachu disappear after the wild battle... i mean if i walk away he'll appear again?? how can i do it???

#org $battlepika
lock
faceplayer
checkflag 0x200
if 0x1 goto $done
message $poke
$poke 1 =Hey!!! \pIt's A Pikachu!!! \pBattle it???
boxset 0x5
compare LASTRESULT 0x1
if 0x1 goto $battle
message $no
$no 1 =Maybe This Pikachu Has an \nOwner...
boxset 0x6
release
end
#org $done
#raw 0x53 0x04 0x00
release
end
#org $battle
lock
faceplayer
message $pikachuu
$pikachuu 1 =Pika....Pikachuuuu!!!!
boxset 0x6
wildbattle 25 7 0
setflag 0x200
fadescreen 0x0
release
end

Perfect_Palkia_10
June 4th, 2008, 09:27 PM
How do you use flags to activate HM's.

Judgment
June 5th, 2008, 08:51 AM
Help. How can I make the sprite dissappear after a battle? Here is script:
#org $battle
lock
faceplayer
message $roar
boxset 6
wildbattle 1 5 0
setflag 0x206
release
end

#org $roar
$roar 1 = Bulbasaur:Bul..Bulba!

Plz help.

Ninja Caterpie
June 7th, 2008, 11:32 PM
Uh...What's the flag for the National Dex?
And, if there is one, the Oak's Parcel one?

X-Buster
June 9th, 2008, 02:12 AM
Uh...What's the flag for the National Dex?
And, if there is one, the Oak's Parcel one?

try 16F if it will work but i think it will

Refresh
June 9th, 2008, 01:09 PM
Hi, I'm new here. I've been viewing this forum for quite a while though, without posting anything. I started making a hack for the RUBY US rom. Now I seem to have run into a scripting problem.

#org $start
checkflag 0x800
if b_true goto $done
message $noway
boxset 6
applymovement 0x01 $push
applymovement 0xFF $pushed
pausemove 0
applymovement 0x01 $stepback
pausemove 0
release
end

#org $done
trainerbattle 0 0x001 $before $after
message $beaten
boxset 6
applymovement 0x01 $disappear
release
end

#org $noway
$noway =Woah, you're not getting passed me\nunless you beat me in a POKéMON battle.\pOh wait!\nYou don't have any POKéMON!\pGuess you're not leaving anytime soon!

#org $push
#raw 0x07 0xFE

#org $pushed
#raw 0x0F 0xFE

#org $stepback
#raw 0x06 0x03 0xFE

#org $before
$before =Woah, you're not getting passed me\nunless...\pWhat?\nYou're here to challenge me?\pAlright then,\nbring it on!

#org $after
$after =No way!

#org $beaten
$beaten =I underestimated you.\nYou won't beat me a second time!

#org $dissapear
#raw 0x0A 0x0A 0x0A 0x0A 0x54 0xFEOk, this scipt is supposed to stop the player from leaving the first town without a pokemon (obvious). When you do have a pokemon, the guy blocking the entrance will battle you and afterwards leave. Anyway, this works fine if I use the script on the person (so if you talk to your rival this script will start). However I want the script to start when you walk into the tile in front of him. I thought I could just place the script on the tile, but when you walk over that tile the game freezes. How can I fix this? (and any other problem with this script for that matter?)

PS: I checked many tut's and tried the search button but they weren't very helpfull, so I'm sorry if this has been asked before.

thethethethe
June 9th, 2008, 01:24 PM
Hi, I'm new here. I've been viewing this forum for quite a while though, without posting anything. I started making a hack for the RUBY US rom. Now I seem to have run into a scripting problem.

Ok, this scipt is supposed to stop the player from leaving the first town without a pokemon (obvious). When you do have a pokemon, the guy blocking the entrance will battle you and afterwards leave. Anyway, this works fine if I use the script on the person (so if you talk to your rival this script will start). However I want the script to start when you walk into the tile in front of him. I thought I could just place the script on the tile, but when you walk over that tile the game freezes. How can I fix this? (and any other problem with this script for that matter?)

PS: I checked many tut's and tried the search button but they weren't very helpfull, so I'm sorry if this has been asked before.

To a lot of people's post my answer is read the tutorial.

Now Refresh within this tutorial, there was a little part on getting the scripts on tiles to work, I think.
In Advancemap 1.82 Change the first Unknown to 03 00 and the var number to 50 40.
In Advancemap 1.9 and higher, change the Unknown to 0003, and the var number to 4050.
It was in the tutorial, except it only covered Advancemap 1.82.

Refresh
June 9th, 2008, 01:28 PM
Ok, thanks alot. Your tut has been real helpfull so far.

twi1ight
June 11th, 2008, 05:47 PM
when I do a give pokemon script in the beginning the pokemon won't listen to me what am I doing wrong?

cooley
June 11th, 2008, 06:00 PM
Well maybe it's because you gave the Pokemon at a level that is too high. You need to get a couple of badges first.

How do you use flags to activate HM's.
Hmm...You don't. You can use giveitem scripts to do so. But you need the required badge for the HM to work.

twi1ight
June 11th, 2008, 07:04 PM
its at level 5 but it's a mew

thethethethe
June 11th, 2008, 07:15 PM
The level doesn't actually matter unless it's been traded to you. But if you knew anything about the layout of the Advance Games, is that Mew and I think Deoxys, will not listen to you unless you get them through the proper ways, or look for a way around it;).

Cy-Chan
June 18th, 2008, 07:48 AM
Is it possible to give a Pokémon with a specific move? So, giving the player a LV5 Charmander that knows Dragon Rage or something?

maoh4567
June 19th, 2008, 04:03 AM
hello the4x...

i've been resding your tutorial for a long time but...

the thing that i dont understand in scripting is setvars,addvar,copyvar,callasm

can u explain it to me...

thnx in advance...

thethethethe
June 19th, 2008, 03:33 PM
hello the4x...

i've been resding your tutorial for a long time but...

the thing that i dont understand in scripting is setvars,addvar,copyvar,callasm

can u explain it to me...

thnx in advance...

What don't you understand about them?
Setvar assigns a designated value to a variable.
Addvar increases the value that is stored within a variable.
Copyvar Copies the value in one variable to another variable.
Callasm Calls an ASM function.

maoh4567
June 20th, 2008, 04:26 AM
hmm...

is there a npc in firered that uses setvars/add/copy/callasm...
i really cant understand their uses

Perfect_Palkia_10
June 21st, 2008, 12:38 AM
Okay I'm editing Mr Briney but I can't recreate his script so I can change the directions we travel together and go to 1 or more towns
so can anyone help

thethethethe
June 21st, 2008, 01:27 AM
hmm...

is there a npc in firered that uses setvars/add/copy/callasm...
i really cant understand their uses

There would be some setvars and copyvars in most 'green' scripts.
You still haven't said what you don't understand about them.

maoh4567
June 21st, 2008, 03:22 AM
There would be some setvars and copyvars in most 'green' scripts.
You still haven't said what you don't understand about them.

let me say it this way...

what is the purpose of variables in a rom???
or can you give some examples of the different ways on how to use it...

adiktus
June 21st, 2008, 03:44 AM
let me say it this way...

what is the purpose of variables in a rom???
or can you give some examples of the different ways on how to use it...

In some cases, variables could be used to get your position. (st. anne, script tile for rival battle) If you stepped on the left, a variable is set to 0, and when its compared to 0, the rival moves to the left... If on the middle, the variable is 1, so the rival moves to the middle and so on...

In other cases, like the one when you choose your starting pokemon, a variable is set so that your rival will know what pokemon he will use..

There are a lot of other uses.. can't name them all XD

twi1ight
June 21st, 2008, 01:06 PM
for some reason I get a message that says

"run-time error '13'
type mismatch"
can anyone help?

Master_Track
June 21st, 2008, 01:23 PM
grammar mistake maybe?
it would be helpful if you could post your script, otherwise we can't tell you what's wrong ^^

twi1ight
June 21st, 2008, 01:40 PM
ok here it is. its really big so sorry

#org $getmew
countpokemon
compare LASTRESULT 0x1
if b_>= goto $done
#raw 0x55 0x03 0x00
clearflag 0x247
applymovement 0x03 $movealder
pausemove 0
applymovement 0x03 $jumpalder
applymovement 0xFF $jumpme
pausemove 0
applymovement 0x03 $givealder
pausemove 0
message $sorry
boxset 6
givepokemon 251 5 0
fanfare 0x13E
message $gotcelebi
boxset 4
waitfanfare
setflag 0x828
#raw 0x68
message $nickname
boxset 5
compare LASTRESULT 0x1
if b_true gosub $celebiname
message $got2go
boxset 6
applymovement 0xFF $outofway
pausemove 0
applymovement 0x03 $todoor
pausemove 0
#raw 0xAC 0x05 0x00 0x03 0x00
#raw 0xAE
applymovement 0x03 $goin
pausemove 0
#raw 0xAD 0x05 0x00 0x03 0x00
#raw 0xAE
#raw 0x53 0x03 0x00
setflag 0x247
#raw 0x55 0x05 0x00
clearflag 0x200
message $getprof
boxset 6
applymovement 0x05 $tome
pausemove 0
trainerbattle 1 0x146 $go $after $continue
end
#org $done
release
end
#org $movealder
#raw 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1F 0x1F 0xFE
#org $jumpalder
#raw 0x17 0xFE
#org $jumpme
#raw 0x16 0x03 0xFE
#org $givealder
#raw 0x1F 0x1F 0x1F 0x1F 0xFE
#org $sorry
$sorry 1 =Prof. Alder:Oh! \pI'm sorry for running into \nyou I'm just in a hurry \lhere just take this.
#org $gotcelebi
$gotmew 1 =You got a pokèmon!
#org $nickname
$nickname 1 =Would you like to nickname \nyour pokèmon?
#org $celebiname
call 0x1A74EB
return
#org $got2go
$got2go 1 =Now I need to go! \nsee me at my lab later.
#org $outofway
#raw 0x11 0x00 0xFE
#org $todoor
#raw 0x1F 0x1F 0x1F 0x1F 0x1F 0x1E 0xFE
#org $goin
#raw 0x11 0xFE
#org $getprof
$getprof 1 =(What is going on!?!) \p???:Come back here!
#org $tome
#raw 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1F 0x1F 0x1F 0x1F 0x1F 0x01 0xFE
#org $go
$go 1 =Oh no a witness, \nlooks like I'll have to \ltake care of you.
#org $after
$after 1 =The boss isn't going to \nlike this.
#org $continue
message $beatrival
boxset 6
applymovement 0x05 $rivalleave1
pausemove 0
#raw 0x53 0x05 0x00
setflag 0x200
#raw 0xAC 0x05 0x00 0x03 0x00
#raw 0xAE
#raw 0x55
clearflag 0x247
applymovement 0x03 $alderout
pausemove 0
#raw 0xAD 0x05 0x00 0x03 0x00
#raw 0xAE
applymovement 0x03 $alderwarp
pausemove 0
message $warp2lab
boxset 6
fadescreen 0x1
setflag 0x20A
warp 0x4 0x3 0x0
fadescreen 0x0
release
end
#org $beatrival
$beatrival 1 =I'll be back and beat you!
#org $rivalleave1
#raw 0x20 0x20 0x20 0x20 0x20 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0xFE
#org $alderout
#raw 0x10 0xFE
#org $alderwarp
#raw 0x13 0x13 0x13 0x13 0x13 0x01 0xFE
#org $warp2lab
$warp2lab 1 =Well it seems you beat \nhim. \pSorry I put you in that \nsituation ,but I knew \lyou could handle it. \lFor helping me I have \la present for you \lback at the lab \lcom'on.

in some of the lines although it looks like I used enter but I didn't

adiktus
June 21st, 2008, 05:13 PM
#org $tome
#raw 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1F 0x1F 0x1F 0x1F 0x1F 0x01 0xFE
#org $rivalleave1
#raw 0x20 0x20 0x20 0x20 0x20 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0xFE

Try writing each in two lines:


#org $tome
#raw 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D
#raw 0x1F 0x1F 0x1F 0x1F 0x1F 0x01 0xFE

#org $rivalleave1
#raw 0x20 0x20 0x20 0x20 0x20
#raw 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0x1E 0xFE

maoh4567
June 21st, 2008, 10:47 PM
In some cases, variables could be used to get your position. (st. anne, script tile for rival battle) If you stepped on the left, a variable is set to 0, and when its compared to 0, the rival moves to the left... If on the middle, the variable is 1, so the rival moves to the middle and so on...

In other cases, like the one when you choose your starting pokemon, a variable is set so that your rival will know what pokemon he will use..

There are a lot of other uses.. can't name them all XD

thnx alot...
now i understand what is their uses....

Master_Track
June 22nd, 2008, 12:03 AM
twi1ight:
your script seems okay, but listen to adiktus and write it in two lines ;)
Also, sometimes #binary works better, it's written like this:
#org $move
$move 1 ; #binary 0x13 0x13 0x13 0x13 0xFE

the movement codes are just the same ;)
( I said it SOMETIMES works better, normally it doesn't really matter if u use #raw or #binary).

Btw nice to see somebody using the doorcommands :D

And one suggestion: I'm not sure if #raw 0x55 will work allright if clearflag is written afterwards, write it before (then it will work for sure, I always do it like this).
clearflag 0x200
#raw 0x55 0x01 0x00

That's all, I think.
And to get a better structure in your script to overview everything:
Maka a free line after each script, like
#org $begin
lock
faceplayer
message $a
$a 1 = Yes or no?
boxset 5
compare 0x800D 0x1
if 1 goto $yes
message $no
$no 1 = You chose no.
release
end

#org $yes
..........................................don't want to write more, just wanted to show ^^

master morty
June 29th, 2008, 01:51 PM
I can't see anything wrong in this script.
Which Advance Map are you using?
I am using 1.90, and there the fields "unknown" and "variable number" looks like this:
Unknown: 0003
Var.Number:4051

And it works!
Hope that's the problem.


Is it,

unknown 0003
var number 4050
in all games or just fr/lg because my script (which convieniently had the unknown and var number problem) works fine in fr/lg
below is th script I used

'-----------------------
#org 0x800345
msgbox 0x8800362 '"Koo: hey he's over there\n[player]:..."
callstd 0x6
applymovement MOVE_PLAYER 0x880039B
pause 0x40
warp 0x0 0x2 0x1 0xE 0x11
releaseall
end

'-----------
' Movements
'-----------
#org 0x80039B
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw FE 'End of Movements

'---------
' Strings
'---------
#org 0x800362
= Koo: hey he's over there\n[player]: oh boy better bail.

コリンク
June 30th, 2008, 02:32 AM
Uhmm.. I hate to bother.. but how can I make the Pokemon speak with you before the cry and battle?

cooley
June 30th, 2008, 06:31 AM
Uhmm.. I hate to bother.. but how can I make the Pokemon speak with you before the cry and battle?
That has nothing to do with the topic. Stay on topic next time, as you can see, this is a scripting thread. Not a ask any Rom hacking questions thread. For that, you should click on ROM hacking, then scroll down to "Simple questions".

Anyways, in order to do that, you have to insert the music over the cry. And please, just because I answered you, that doesn't mean I know how to do it. So Don't PM ME.

Master_Track
June 30th, 2008, 06:37 AM
I'd say what he meant is just using a message before writing cry O.o
so
message $1
$1 1 = Pikachu: Pika-pika!
boxset 6
cry 0xA1 etc....

Though cooley is right, this is a tutorial, question into the simple question thread of if it's a more complicated script problem into the scrap box- script help thread.

コリンク
June 30th, 2008, 02:16 PM
That has nothing to do with the topic. Stay on topic next time, as you can see, this is a scripting thread. Not a ask any Rom hacking questions thread. For that, you should click on ROM hacking, then scroll down to "Simple questions".

I thought it did.. I was asking how to do in in the same script.

And please, just because I answered you, that doesn't mean I know how to do it. So Don't PM ME.

I wasn't going to.

I'd say what he meant is just using a message before writing cry O.o

Yes, that's what I meant, thank you.


Though cooley is right, this is a tutorial, question into the simple question thread of if it's a more complicated script problem into the scrap box- script help thread.

Okay, I will next time, like I said, "Sorry to bother."

twi1ight
July 8th, 2008, 03:48 PM
thnx guys srry im not thanking you earlier but ive been busy more trouble :(
but I have a question how do you use pokescript for a-map if its in the wrong place im srry but wat r the settings and do you use bufrite or pokescript? thanx.

12345
July 8th, 2008, 10:01 PM
Do you know abot "buffer" (bufferpokemon, bufferitem...)?
Can I explain me?

thethethethe
July 8th, 2008, 10:26 PM
thnx guys srry im not thanking you earlier but ive been busy more trouble :(
but I have a question how do you use pokescript for a-map if its in the wrong place im srry but wat r the settings and do you use bufrite or pokescript? thanx.
What? I don't understand what you're asking.

Do you know abot "buffer" (bufferpokemon, bufferitem...)?
Can I explain me?
I have those in the tutorial. Except those are XSE commands. I never game a command name to them in the tutorial. These commands begin at the top of the third post.
Like I explained it with "display Pokemon Name". In XSE terms this command is bufferpokemon.
Also "Display Item Name", in XSE terms is buffer item.

hi sir tomato my password is syvniti
July 8th, 2008, 10:30 PM
What? I don't understand what you're asking.




I think he mean the funcition with "See script" or something in a-map. and then a-map, tells the script editors decompiler to open the script.

twi1ight
July 9th, 2008, 05:47 AM
yes i mean the open script option

heatransoul
July 12th, 2008, 07:17 AM
I am trying to get a give Eevee script, but the options are $60 and $55. Here is the script:

#org $start
checkflag 0x828
if b_true goto $done
message $1
boxset 5
compare LASTRESULT 0x1
if b_true goto $take
message $2
boxset 6
release
end

#org $take
givepokemon 133 70 0
fanfare 0x13E
message $3
boxset 4
waitfanfare
#raw 0x68
setflag 0x828
message $4
boxset 5
compare LASTRESULT 0x1
if b_true gosub $name
message $5
boxset 6
release
end

#org $name
call 0x1A74EB
return

#org $done
message $6
boxset 6
release
end

#org $1
$1 1 =The Ranger Union has found\nThis Eevee.\pCan you take care of it for me?

#org $2
$2 1 =That's okay. I'm sure someone\nelse will take it.

#org $3
$3 1 =\c\h01\h02You received an Eevee!

#org $4
$4 1 =\c\h01\h02Would you like to rename Eevee?

#org $5
$5 1 =Take Care of Eevee.

#org $6
$6 1 =I hope you're taking good care of\nEevee.

What am I doing wrong??

hi sir tomato my password is syvniti
July 12th, 2008, 08:34 AM
Now I'm gonna answer before you Jason... How does that fell? HAHA!
yes i mean the open script option
Then use HM's XSE. It contain a Decompiller... Chose the file of it, and that's all...

I am trying to get a give Eevee script, but the options are $60 and $55. Here is the script:

#org $start
checkflag 0x828
if b_true goto $done
message $1
boxset 5
compare LASTRESULT 0x1
if b_true goto $take
message $2
boxset 6
release
end

#org $take
givepokemon 133 70 0
fanfare 0x13E
message $3
boxset 4
waitfanfare
#raw 0x68
setflag 0x828
message $4
boxset 5
compare LASTRESULT 0x1
if b_true gosub $name
message $5
boxset 6
release
end

#org $name
call 0x1A74EB
return

#org $done
message $6
boxset 6
release
end

#org $1
$1 1 =The Ranger Union has found\nThis Eevee.\pCan you take care of it for me?

#org $2
$2 1 =That's okay. I'm sure someone\nelse will take it.

#org $3
$3 1 =\c\h01\h02You received an Eevee!

#org $4
$4 1 =\c\h01\h02Would you like to rename Eevee?

#org $5
$5 1 =Take Care of Eevee.

#org $6
$6 1 =I hope you're taking good care of\nEevee.

What am I doing wrong??
You'll need to write the numbers in hex I would say... Try put 85
(If 133 is eevee) (70 to hex is about 45... But you'll better calcolate that to be sure...)

heatransoul
July 12th, 2008, 05:00 PM
Son Sebbe, I did what you told me to, but now he isn't talking at all. So did I do some hex'ing wrong?

markiss92
July 13th, 2008, 06:01 AM
THANK YOU SO MUCH! I cannot express how useful this is to people learning how to script. You're awesomesauce. :D

poddish
July 13th, 2008, 01:48 PM
How do you get it to work on advancemap?

cooley
July 13th, 2008, 02:00 PM
How do you get it to work on advancemap?
You can't. Which is one of the reasons why you shouldn't use pokescript. What's the point of associating it with Advance map anyways?

It's not like it can decompile the script anyways...use XSE. It has a movement planner coming!

hi sir tomato my password is syvniti
July 13th, 2008, 02:07 PM
You can't. Which is one of the reasons why you shouldn't use pokescript. What's the point of associating it with Advance map anyways?

It's not like it can decompile the script anyways...use XSE. It has a movement planner coming!


Dude, would you stop your advertising for XSE?
I seen you did it in you own tutorial, (of XSE) but now to start advertise in a pokescript guide is to far, I understand your point, but I think the thing you are doing is advertising...

In the end I can tell you that I use XSE, but really... You are way over the top in my eyes...

cooley
July 13th, 2008, 02:38 PM
Dude, would you stop your advertising for XSE?
I seen you did it in you own tutorial, (of XSE) but now to start advertise in a pokescript guide is to far, I understand your point, but I think the thing you are doing is advertising...

In the end I can tell you that I use XSE, but really... You are way over the top in my eyes...
Yeah, ok.
It's just that I haven't realized how I was speaking, until you told me.

Ryousha
July 13th, 2008, 02:40 PM
Cooley, XSE is pretty much similiar to Pokescript except they have everything you need and has a built in tutorial. xD.

XSE needs more tutorials, but I'm sticking with pokescript.

KhaosKnight
July 13th, 2008, 04:59 PM
Hey when using the Setmaptile command how do you get the map to reset, i used the special 0x8E, i think that is just for FR, i need this for a script in Emerald. Is the "special" value for reset different for emerald, and if so what is it?

heatransoul
July 13th, 2008, 05:09 PM
How do you get it to work on advancemap?
This is step by step. (May make me look stupid for underestimating the human mind)
1. Open AdvanceMap
2. Load your ROM (the one that has the script compiled)
3. Make a Person/Script Event
4. Get the script offset and place it where it says 'Offset'.

Don't know where to get the offset?
1. Write the Script in NOTEPAD!
2. Save the script as the All Files type, OR IT WILL BE CALLED example.rbc.txt instead of example.rbc .
3. Write Whatever you want as the save name and add .rbc next to it.
4. Open Pokescript.
5. Open this file with Pokescript.
6. It should open Buf Rite. Choose 'Destination' from the file menu. Then choose the rom you want to compile it to.
7. Go to the menu and press a button that, when you hover over it, it says, 'Assign'.
8. Choose FF if you want new space. Or OO if you want to delete existing space.
9. Choose the first number/letter code and select 'Assign'.
10. Then Copy down the FIRST Number/Letter Code that appears and put that as the script offset. If that doesn't work, please tell me.

Aspinth
July 14th, 2008, 07:16 AM
Cooley, XSE is pretty much similiar to Pokescript except they have everything you need and has a built in tutorial. xD.

XSE needs more tutorials, but I'm sticking with pokescript.
Hey, well it's your decision. When you wonder why your scripts aren't working, and you can't decompile it to find the problem. You'll know it's pokescript...

Look, not to be off-topic here, but Irish-Witch didn't fully understand scripting before she made the program. It's not my decision though, it's yours. So, I don't care what you use, as long as you have fun scripting and create a good hack! ;)

pokemonmaster21
July 14th, 2008, 08:48 AM
where do i get the script editor tool. i want to do a really good hack and of fire red and if anyone wants to join please tell me.i have started only a little.thxxx please tell me. also i cant make pokemart and a_text work. i have tried downloading the missing files and they still dont work.

please i need help. ^_^ really i need alot of help because i want to make a really good hack.

12345
July 14th, 2008, 10:54 PM
I can't hide sprites forever. After I leave there, it appears again.

thethethethe
July 15th, 2008, 04:14 AM
If I sound angry at anyone, I don't mean it, I'm just tired. So sorry if I happen to sound angry...
where do i get the script editor tool. i want to do a really good hack and of fire red and if anyone wants to join please tell me.i have started only a little.thxxx please tell me. also i cant make pokemart and a_text work. i have tried downloading the missing files and they still dont work.

please i need help. ^_^ really i need alot of help because i want to make a really good hack.
I'm getting so sick of saying this to new people who come to PC.
Google. Google. Google. Google.
Tools Sections at PC.
XSE
score_under's tool.
Don't just ask straight away, search first.
Also don't post things where they are irrelevant. This thread has nothing to do with Pokemart and A-text.

Hey when using the Setmaptile command how do you get the map to reset, i used the special 0x8E, i think that is just for FR, i need this for a script in Emerald. Is the "special" value for reset different for emerald, and if so what is it?
I usually just rely on hacking FR/LG, you could try and find it yourself through trial and error. That's about all the information I can give.
Hey, well it's your decision. When you wonder why your scripts aren't working, and you can't decompile it to find the problem. You'll know it's pokescript...

Look, not to be off-topic here, but Irish-Witch didn't fully understand scripting before she made the program. It's not my decision though, it's yours. So, I don't care what you use, as long as you have fun scripting and create a good hack! ;)
Considering you're new here and that was your first post, it seems like you're just jumping on the bandwagon of XSE. So it seems like you'd would never even have tried to use Pokescript, and are just repeating what other people have said. But then again, I could be wrong about that.
Honestly my opinion on this is that people can't just treat people's work like it's crap. Fair-enough, use XSE, but that doesn't give you reason to start talking about other people's programs as if they were the most useless thing on the planet, and, "how did we ever survive using this crappy tool?" I know no-one has said that exactly, but it seems like it's being implied every time someone talks about XSE and Pokescript in the same sentence.
So I don't care if you use XSE, but just stop all the talking about Pokescript as if it is 'crap'.
So at least from now on, keep XSE talk out of this pokescript tutorial. Okay?
This isn't totally directed at you, Aspinth, it's just what I've seen from this community as a whole, since the release of XSE, have just badmouthed pokescript to the point that all new hackers think it's a useless program that doesn't even work, and I'm just getting sick of it.

I can't hide sprites forever. After I leave there, it appears again.
Look back at the section on the Wildbattle. I think I covered keeping the sprite hidden.

12345
July 15th, 2008, 08:36 AM
Here is my script:

#dynamic 0x172632
#org @start
checkflag 0x100C
if 0x1 goto @dontshowsprite
applymovement 0xD @move
waitmovement 0x0
hidesprite 0xD
setflag 0x100C
release
end

#org @dontshowsprite
release
end

#org @move
#raw 0x04 0xFE
end


And sprite hidden. but when I return, it appears again. :(

hi sir tomato my password is syvniti
July 15th, 2008, 08:42 AM
Here is my script:

#dynamic 0x172632
#org @start
checkflag 0x100C
if 0x1 goto @dontshowsprite
applymovement 0xD @move
waitmovement 0x0
hidesprite 0xD
setflag 0x100C
release
end

#org @dontshowsprite
release
end

#org @move
#raw 0x04 0xFE
end


And sprite hidden. but when I return, it appears again. :(
That's because Jason is mad... He's never tired since he can sleep at much as he want, there he lives it's night at day... So...

But you can set a flag an then set the person or people (Don't remember what's it called) in advance map to the flag, when the flag then is setted the person is gone, and when not he's there...

Aspinth
July 15th, 2008, 09:04 AM
If I sound angry at anyone, I don't mean it, I'm just tired. So sorry if I happen to sound angry...

I'm getting so sick of saying this to new people who come to PC.
Google. Google. Google. Google.
Tools Sections at PC.
XSE
score_under's tool.
Don't just ask straight away, search first.
Also don't post things where they are irrelevant. This thread has nothing to do with Pokemart and A-text.


I usually just rely on hacking FR/LG, you could try and find it yourself through trial and error. That's about all the information I can give.

Considering you're new here and that was your first post, it seems like you're just jumping on the bandwagon of XSE. So it seems like you'd would never even have tried to use Pokescript, and are just repeating what other people have said. But then again, I could be wrong about that.
Honestly my opinion on this is that people can't just treat people's work like it's crap. Fair-enough, use XSE, but that doesn't give you reason to start talking about other people's programs as if they were the most useless thing on the planet, and, "how did we ever survive using this crappy tool?" I know no-one has said that exactly, but it seems like it's being implied every time someone talks about XSE and Pokescript in the same sentence.
So I don't care if you use XSE, but just stop all the talking about Pokescript as if it is 'crap'.
So at least from now on, keep XSE talk out of this pokescript tutorial. Okay?
This isn't totally directed at you, Aspinth, it's just what I've seen from this community as a whole, since the release of XSE, have just badmouthed pokescript to the point that all new hackers think it's a useless program that doesn't even work, and I'm just getting sick of it.


Look back at the section on the Wildbattle. I think I covered keeping the sprite hidden.
Sorry for all the trouble, but I've been using pokescript since it came out.
Well I did like pokescript, but I don't stick with one tool, when there is a better tool out there.

It's like using advance map 1.30 when there is 1.92. Anyways, you've made your point. Your Thread, your rules. Sorry to be a bother, nice tutorial by the way! You should update all the #raw commands with the new pokescript commands you've made!

jakerman999
July 15th, 2008, 10:07 AM
the images in the spoilers aren't working for me anymore. they were up yesterday, but now there is nothing to indicate they were there at all, except you referring to them.

I can't find them on google images either. help?

iammiho
July 15th, 2008, 08:09 PM
-sigh- too.. complicated.. can anyone tell me whats wrong with this one? o.O(i know i kinda took whole thing in the tutorial)

#org $lugia
lock
faceplayer
checkflag 0x200
message $1
boxset 6
cry 0xA1 249
nop
nop
wildpokemon 249 70 1
setflag 0x200
release
end

#org $1
$1 1 =GYAOOOO!!!!

destinedjagold
July 15th, 2008, 08:16 PM
-sigh- too.. complicated.. can anyone tell me whats wrong with this one? o.O(i know i kinda took whole thing in the tutorial)

#org $lugia
lock
faceplayer
checkflag 0x200
message $1
boxset 6
cry 0xA1 249
nop
nop
wildpokemon 249 70 1
setflag 0x200
release
end

#org $1
$1 1 =GYAOOOO!!!!

#org $lugia
lock
faceplayer
checkflag 0x200
if b_true goto $done
cry 0xA1 249
pause 0x38
message $1
boxset 6
wildpokemon 249 70 1
setflag 0x200
release
end

#org $1
$1 1 = GYAOOOO!!!!

#org $done
release
end

thethethethe
July 15th, 2008, 11:38 PM
Here is my script:

#dynamic 0x172632
#org @start
checkflag 0x100C
if 0x1 goto @dontshowsprite
applymovement 0xD @move
waitmovement 0x0
hidesprite 0xD
setflag 0x100C
release
end

#org @dontshowsprite
release
end

#org @move
#raw 0x04 0xFE

And sprite hidden. but when I return, it appears again. :(
First of all, why ask this here? Use the script help thread. I fixed one little problem, and doesn't people id sound familiar.

Sorry for all the trouble, but I've been using pokescript since it came out.
Well I did like pokescript, but I don't stick with one tool, when there is a better tool out there.

It's like using advance map 1.30 when there is 1.92. Anyways, you've made your point. Your Thread, your rules. Sorry to be a bother, nice tutorial by the way! You should update all the #raw commands with the new pokescript commands you've made!
Wow, I'd love to argue with you right now, about what you've just said there, but I'll just leave it. There's no point in arguing.
the images in the spoilers aren't working for me anymore. they were up yesterday, but now there is nothing to indicate they were there at all, except you referring to them.
I can't find them on google images either. help?
I just looked at them all and they were fine. Maybe it's your computer? That happens to me as well sometimes.

12345
July 15th, 2008, 11:42 PM
I want to a sprite move in another place forever after active a script
EX: My character is in A location and After I want this character is in B location forever.
Can you help me?
~~~~~~~
Sorry, if i have another question i will go to help thread

thethethethe
July 15th, 2008, 11:56 PM
I want to a sprite move in another place forever after active a script
EX: My character is in A location and After I want this character is in B location forever.
Can you help me?
~~~~~~~
Sorry, if i have another question i will go to help thread
Like the girl in pallet town that constantly moves at the beginning of the game.
Mixture of a movesprite and a level script.
Movesprite, layout is same between XSE and Pokescript, you can look here.
Level Script, Cooley's tutorial, Baro's Spanish Tutorial, wherever else there is one.

pokemon_hacking
July 18th, 2008, 01:08 AM
can somone help me i made this script but all it does it move to the side i want it to say the script then move to the side
#org $start
message $hru
applymovement 0x04 $move
pausemove 0x0
applymovement 0xFF $move2
pause 0x30
applymovement 0x04 $move3
applymovement 0xFF $move3
pausemove 0
release
end
#ORG $hru
$hru 1 = \c\h01\h06Hello, how are you \n\v\h01?
thanks in advanced

thethethethe
July 18th, 2008, 03:31 AM
can somone help me i made this script but all it does it move to the side i want it to say the script then move to the side
#org $start
message $hru
applymovement 0x04 $move
pausemove 0x0
applymovement 0xFF $move2
pause 0x30
applymovement 0x04 $move3
applymovement 0xFF $move3
pausemove 0
release
end
#ORG $hru
$hru 1 = \c\h01\h06Hello, how are you \n\v\h01?
thanks in advanced

The tutorial is there for a reason... You should try reading it.
Since you said it does move side to side, I'll just assume you left the movements out of this post.
The problem lies here.
#org $start
message $hru
applymovement 0x04 $move
What needs to follow a message command to appear?
Boxset
All 'message' does is copy the text from the rom to the ram.
The boxset allows it to appear.
So that little section should appear like this.
#org $start
message $hru
boxset 0x6
applymovement 0x04 $move

pokemon_hacking
July 18th, 2008, 04:33 AM
thank u so much
i am so happy now

wat am I doing wrong
#org $start
message $hi
boxset 0x6
applymovement 0xFF $move
pausemove 0x0
applymovement 0xFF $move2
pause 0x30
applymovement 0x04 $move3
applymovement 0xFF $move3
pausemove 0
goto 0x1 $battle
goto 0x2 $warp
release
end
#ORG $hi
$hi 1 = \c\h01\h06Hello, where am i \n\v\h01?
#org $move
#raw 0x06 0x06 0x06 0xFE
#org $move2
#raw 0x54 0xFE
#org $move3
#raw 0x55 0xFE

#org $battle
giveitem 13 1
release
end

#org $warp
message $****
boxset 6
warp 0x0 0x9 0x1
end
#org $****
$**** 1 =going to your house\ni see.

blackshadow
July 19th, 2008, 12:49 AM
hey im new to scripting and im trying to do a legendary battle with celebi and heres my script:
#org $start
lock
faceplayer
message $1
boxset 6
cry 0xA1 251
nop
nop
wildbattle 251 50 0x8B
fadescreen 0
#raw 0x53 0x0F 0x80
setflag 0x200
release
end
#org $1
$1 1 =Celebi:cele,cele,bi

and every time i try to compile it says run time error 9 subscript out of range
plz help!!!

pokemon_hacking
July 20th, 2008, 12:16 AM
how to make this start stop from restarting from the begging
#ORG $start
lock
faceplayer
message $talk
boxset 6
goto $movement1
release
end

#ORG $talk
$talk 1 = \c\h01\h04hey wats up

#ORG $movement1
applymovement 0xFF $walk
pausemove 0x0
pause 0x30
message $talk2
boxset 6
goto $aaa
release
end

#ORG $talk2
$talk2 1 = \c\h01\h04 kool

#org $walk
#raw 0x03 0x04 0x35 0x47 0xFE

#org $aaa
if B_true goto $finish
message $fed
boxset 6
warp 0x1 0x1 0x0
release
end

#ORG $fed
$fed 1 = \c\h01\h04nm g2g bye.

#ORG $finish
release
end

jamieboy30
July 20th, 2008, 02:42 AM
Hey, brilliant tutorial, learnt to script in one week! But i have a problem with one of my scripts (sorry if it's in the wrong place):


#org $hoohscript
checkflag 0x200
if b_true goto $done
applymovement 0xFF $move
message $7
boxset 6
cry 0xA1 250
nop
nop
applymovement 0x04 $move2
applymovement 0xFF $move3
applymovement 0x04 $move4
message $8
boxset 6
setflag 0x200
release
end

#org $7
$7 1 =\v\h01: ...Huh?\n................\p???:Screaaaaeaaaark!

#org $8
$8 1 =\v\h01: What on earth was that?!\nHmmmm, I guess I'll never know...

#org $move
#raw 0x01 0x65 0xFE

#org $move2
#raw 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0xFE

#org $move3
#raw 0x00 0xFE

#org $move4
#raw 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0xFE

#org $done
release
end


It all goes well, but Ho-oh is assigned to 04, so he should fly past /v/h01, but i think he gets stuck on the movement permissions, how can i make the person event of ho-oh ignore movement permissions? or is it impossible?

thethethethe
July 20th, 2008, 03:15 AM
thank u so much
i am so happy now

wat am I doing wrong
#org $start
message $hi
boxset 0x6
applymovement 0xFF $move
pausemove 0x0
applymovement 0xFF $move2
pause 0x30
applymovement 0x04 $move3
applymovement 0xFF $move3
pausemove 0
goto 0x1 $battle 'What on earth is this?
goto 0x2 $warp 'And this aswell?
release
end
#ORG $hi
$hi 1 = \c\h01\h06Hello, where am i \n\v\h01?
#org $move
#raw 0x06 0x06 0x06 0xFE
#org $move2
#raw 0x54 0xFE
#org $move3
#raw 0x55 0xFE

#org $battle
giveitem 13 1
release
end

#org $warp
message $**** 'And the title of the pointer?
boxset 6
warp 0x0 0x9 0x1
end
#org $****
$**** 1 =going to your house\ni see.
First of all it doesn't look like you understand the goto command. Once you goto a part of a script you can't return.
You may want to read over that section.

hey im new to scripting and im trying to do a legendary battle with celebi and heres my script:
#org $start
lock
faceplayer
message $1
boxset 6
cry 0xA1 251
nop
nop
wildbattle 251 50 0x8B
fadescreen 0
#raw 0x53 0x0F 0x80
setflag 0x200
release
end
#org $1
$1 1 =Celebi:cele,cele,bi

and every time i try to compile it says run time error 9 subscript out of range
plz help!!!
Try learning how to script. Don't just copy scripts straight out of the tutorial. That's a problem in Pokescript. It occurs in the 0x8B. Just change it to 0x0.

Hey, brilliant tutorial, learnt to script in one week! But i have a problem with one of my scripts (sorry if it's in the wrong place):


#org $hoohscript
checkflag 0x200
if b_true goto $done
applymovement 0xFF $move
message $7
boxset 6
cry 0xA1 250
nop
nop
applymovement 0x04 $move2
applymovement 0xFF $move3
pausemove 0x0
applymovement 0x04 $move4
pausemove 0x0
message $8
boxset 6
setflag 0x200
release
end

#org $7
$7 1 =\v\h01: ...Huh?\n................\p???:Screaaaaeaaaark!

#org $8
$8 1 =\v\h01: What on earth was that?!\nHmmmm, I guess I'll never know...

#org $move
#raw 0x01 0x65 0xFE

#org $move2
#raw 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0xFE

#org $move3
#raw 0x00 0xFE

#org $move4
#raw 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0x1D 0xFE

#org $done
release
end


It all goes well, but Ho-oh is assigned to 04, so he should fly past /v/h01, but i think he gets stuck on the movement permissions, how can i make the person event of ho-oh ignore movement permissions? or is it impossible?

Glad it helped.
Applymovements are immune to movement permissions. If don't have some form of pause, the movements will stop as there is not time for the moves to complete.

roywillow
July 20th, 2008, 05:41 AM
Well, I think I'd better ask here. Posting message isn't convenient.
The people ID, also a kind of flag. So how many of them have been used in the game? If I put some people on the map, what IDs can I give them?