• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

thethethethe's Scripting Tutorial

1,104
Posts
16
Years
  • thethethethe's Pokescript Tutorial

    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.
    Code:
    #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
    \v
    I'll go in order of this list.
    \c usually refers to a colour.
    So in this type of message
    \c\h01\h02You recieved a Pokemon
    Will appear in a black text. But there are some more colours.
    Here's a short list.
    Fire Red/Leaf Green
    Spoiler:
    Ruby/Sapphire I'd assume that they work for Emerald too, but I haven't actually tested it yet.
    Spoiler:

    \h is used with hex values. Here's an example.
    Here's \hB7100
    That \hB7 is the currency sign of the Pokemon world.
    So in this example, I'm goint to use "$", here's an example.
    Here's $100
    Here's a Table for all the hex codes of each symbol.
    Spoiler:


    \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.
    Code:
    #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
    end
    We'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.
    Code:
    #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....
    Code:
    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[/B]
    [spoiler]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
    [/spoiler]
    
    [B]Items[/B]
    [spoiler]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[/spoiler]
    
    Now we have [I]fanfare 0x13E[/I]. 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 [I]message[/I]. The only difference here is that we have used [I]boxset 4[/I]. Boxset 4 is different to [I]boxset 6[/I], 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.
    [I]waitfanfare[/I] will do what it's name displays. It will wait for the fanfare to finish, before it allows the script to continue. This [I]boxset 4[/I] has left the box open while we wait for the [I]fanfare[/I] to end.
    [I]#raw 0x68[/I], a very useful command in my script. This is a very useful command with [I]boxset 4[/I]. It will basically, make the [I]boxset 4[/I] act as a [I]boxset 6[/I], so that it can now close when you press a button.
    [I]setflag 0x828[/I]... I wonder what this is for. In Fire Red and Leaf Green, this is very useful, as it activates the [I]Pokemon[/I] 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?
    [B]Flags[/B]
    [spoiler]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[/spoiler]
    Now we have the [code]boxset 5
    compare LASTRESULT 0x1
    if b_true gosub $name
    But 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,
    Code:
    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​

    Code:
    #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] [bank] [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.
    Spoiler:

    #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​

    Code:
    #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.
    Code:
    #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...
    Code:
    #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​

    Code:
    #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​

    Code:
    #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?
    Spoiler:

    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(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.
    Specials
    Spoiler:


    Applymovement​

    Code:
    #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...

    tutorial.PNG


    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
    Spoiler:

    Fire Red/Leaf Green
    Spoiler:


    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.
    Code:
    #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 0xFE
    The 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] [buffer]
    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.
    Fire Red Songs
    Spoiler:

    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.
    Spoiler:


    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.
    Code:
    countpokemon
    compare LASTRESULT 0x6
    if b_true goto $continue
    This 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.
    Code:
    countpokemon 
    compare LASTRESULT 0x1
    if b_>> goto $continue
    compare 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_??.
    Spoiler:


    So I'll add one more example, just to help the information sink in.
    Code:
    countpokemon 
    compare LASTRESULT 0x2
    if b_!= goto $continue
    In 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.
     
    Last edited by a moderator:
    1,104
    Posts
    16
    Years
  • Trainerbattle 0​
    Just a simple trainerbattle script...
    Code:
    #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
    Spoiler:

    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.

    tutorial4.PNG


    Trainerbattle 1​
    Code:
    #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.
    Code:
    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​
    Code:
    #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.
    Spoiler:

    So if we wanted to have rainy weather, we would have.
    Code:
    setweather 0x3
    Doweather is used to activate the weather. So let's show a script to display these in use.
    Code:
    #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.
    Code:
    #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.
    Code:
    #binary int 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x0
    or even like this.
    Code:
    #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.
    Code:
    #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.
    Code:
    #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.
    thethethethe said:
    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 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
    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.
    Code:
    #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;
    Code:
    #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
    Code:
    #org $start
    lock
    faceplayer
    #raw 0xC7 0x02
    message $1
    boxset 6
    release
    end
    
    #org $1
    $1 1 =This is black Text.
    Blue Text
    Code:
    #org $start
    lock
    faceplayer
    #raw 0xC7 0x00
    message $1
    boxset 6
    release
    end
    
    #org $1
    $1 1 =This is blue Text.
    Red Text
    Code:
    #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.
    Code:
    #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.
    Code:
    #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.
    Code:
    #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.
    Code:
    #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.
    Code:
    #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.
    Code:
    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] [item no.] [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.
    
    [SIZE="4"][center]Copyvarifnotzero[/center][/size]
    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[/i].
    [b]Example 1(Variable Copy)[/b]
    [code]copyvarifnotzero 0x800D 0x8004
    Example 2(Value Copy)
    This example I use is actually, what's behind the give item command.
    Code:
    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.
    Code:
    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.
    Code:
    #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.
    Code:
    #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.
    Code:
    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.
    thethethethe said:
    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.
    #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.
    Code:
    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
    Code:
    movesprite 0x4 0x0C 0x5
    And if you want another example. People Number = 9; X co-ordinate = 3; Y co-ordinate = 10
    Code:
    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
    Code:
    #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
    Code:
    #org $start
    setvar 0x4003 0x1
    goto 0x8017CC
    end
    Script 1 (Left) tile
    Code:
    #org $start
    setvar 0x4003 0x0
    goto 0x8017CC
    end

    You'll see the beginning of every script is this.
    Code:
    #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.
    Code:
    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.
    Code:
    #org $start
    setvar 0x4003 0x0
    goto 0x8017CC
    end
    Code:
    #org $start
    setvar 0x4003 0x1
    goto 0x8017CC
    end
    Code:
    #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.
    bufrite said:
    - 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.
    Code:
    #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:
    Code:
    #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.
    Code:
    #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]
    Code:
    #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]
    Code:
    #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
    Code:
    #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
    Code:
    #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)
    Code:
    #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.
    Code:
    #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.
    Code:
    #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.
    Code:
    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.
    Code:
    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.
    Code:
    #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.
    Code:
    #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.
    Code:
    #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.
    Code:
    #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.
    Code:
    #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
    Code:
    #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
    Code:
    #raw 0xB4 0xE8 0x03
    and
    Take Coins
    Take 1000 coins
    Code:
    #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.
    Code:
    #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.
    Code:
    #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.
     
    Last edited:
    1,104
    Posts
    16
    Years
  • 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?
    Spoiler:

    So here's the example. We are going to assign Charizard's name to \v\h02.
    Code:
    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
    Code:
    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.
    Code:
    #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.
    Code:
    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
    Spoiler:

    Now I guess I could jump into an example now, coudn't I?
    Code:
    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.
    Code:
    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.
    Code:
    #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.
    Code:
    #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.
    Code:
    ....
    #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:
    Code:
    #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:
    Code:
    #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:
    Code:
    #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:
    Code:
    #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.
    Code:
    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.
    Code:
    #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...
    Spoiler:

    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...
    Code:
    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.
    Code:
    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.
    Code:
    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.
    Code:
    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.
    Code:
    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
    Mirror
    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.
     
    Last edited:

    destinedjagold

    You can contact me in PC's discord server...
    8,593
    Posts
    16
    Years
    • Seen Dec 23, 2023
    a VERY useful tutorial.
    A helpful thread for hackers, indeed.

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

    derv1205

    Trade/Battle/Breed/Clone (X,B2,D)
    267
    Posts
    16
    Years
  • 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

    Working on a Mobile System
    429
    Posts
    17
    Years
  • 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

    a face in the clouds.
    881
    Posts
    16
    Years
  • 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

    Mr.Gaburiasu
    77
    Posts
    16
    Years
  • 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... >_>
     
    581
    Posts
    17
    Years
  • 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!
     
    1,104
    Posts
    16
    Years
  • 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

    Jolly Good
    385
    Posts
    17
    Years
  • 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.
     
    Last edited:

    derv1205

    Trade/Battle/Breed/Clone (X,B2,D)
    267
    Posts
    16
    Years
  • 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
     
    1,104
    Posts
    16
    Years
  • 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...
     
    Last edited:
    3
    Posts
    16
    Years
    • Seen Mar 4, 2008
    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

    Trade/Battle/Breed/Clone (X,B2,D)
    267
    Posts
    16
    Years
  • 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
    Code:
    #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 ?
     

    WindBlows

    It's been a long time!
    749
    Posts
    17
    Years
    • Seen Aug 5, 2023
    thethethethe said:
    Here's a Table for all the hex codes of each symbol.
    Spoiler:
    Spoiler:


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

    Thanks ^^
     

    derv1205

    Trade/Battle/Breed/Clone (X,B2,D)
    267
    Posts
    16
    Years
  • Hi dude, i made this for the ASM Script:
    First, script:
    Code:
    #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)
    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...
     
    1,104
    Posts
    16
    Years
  • 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=
    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:
    Code:
    #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)
    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.
     
    Back
    Top