PDA

View Full Version : [Tutorial] diegoisawesome's MEGA-HUGE XSE Scripting Tutorial


Pages : [1] 2 3 4 5

diegoisawesome
December 26th, 2008, 06:55 PM
For the Level Scripting Tutorial, click here (http://www.pokecommunity.com/showpost.php?p=4414826&postcount=86).


diegoisawesome's MEGA-HUGE XSE Scripting Tutorial


(PokeScript tutorial originally by thethethethe)


Don't Take Or Modify Without Permission

Update XSE To Latest Version And Extract All Files Or Else This Tutorial May Not Be Compatible


I want to say thanks to thethethethe for letting me take this tutorial and modify it for XSE compatibility. Also, I want to thank HackMew for making XSE in the first place, and for Irish Witch and PokeScript for getting me started on scripting. I also want to thank zel for making the hack (ShinyGold) that started me on the road to hacking. Since this is just a modification to thethethethe's original tutorial, you'll see very many similarities.

XSE is a program created by Hackmew, as I've already said. This program is, in my opinion, the best scripting program there is, having many advantages over ScriptED, PokeScript, Diamond Cutter, and the likes.
Some of the important features of XSE are:



Dynamic Offsets
All you need to find is the starting offset. XSE will find the rest.
Less Raws, More Commands
It's to make it easier. Instead of having to use #raw 0x53 0x07, you can just use hidesprite 0x07.

This tutorial is going to cover a lot.
I'll show a script at the beginning and then explain everything "new" after it.
Please note that because I hack Fire Red, most scripts are written to suit Fire Red/Leaf Green, and NOT Ruby/Sapphire/Emerald.

I think I'll start with pointers.
Pointers

XSE is great in the way that it uses dynamic offsets. You just put the starting offset (found in FSF {Free Space Finder}) and XSE will do the rest.
You can use any random name for the pointer. It could be, for example...
@blah ; @iliketoeatcheese ; @1234567890
As long as there are no spaces in it, and there aren't two exact same pointers, the pointer will work.
So, for example, these won't work
@mr potato head ; @i like mews ; @pikachu rocks.
Message Scripts

Now I can move onto a normal message script.
#dynamic 0x(FSF Offset)
#org @start
lock
faceplayer
msgbox @1 0x6
release
end

#org @1
= Hi.\nMy name is Diego.I'll begin at the top of the script and work my way down.
#dynamic 0x(FSF Offset) is the starting offset for your script. XSE will do the rest.
#org @start marks the start of the script, obviously. 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 talking with face you.
message is used when you want a message to display on the screen. It's followed by a pointer that will be placed at the bottom as shown.
The actual message will appear like this.
Hi.
My name is Diego. I'll explain the other types, like \p and \l and others, a little later.

Now the number after the pointer. That number MUST follow a msgbox pointer. Without this, the message box won't appear. In this case, I've used 0x6. I'll cover more numbers later.
Now we use release. This will release the locked player.
end will end the script, stopping it from reading any bytes past it that could crash your game when used.
Extra Message Info

There are lots of other little add-ons that can be used with the message. Here's a short list of them:
\c
\h
\n
\l
\p
\v I'll go in order of this list.
\c usually refers to a color.
This message:
\c\h01\h02You received a Pokémon!will appear in a black text. There's also a new way to write colors.
Here's a short list of the new ones:
Fire Red/Leaf Green
White - [white_fr]
Black -
Gray - [grey_fr]
Red - [red_fr]
Orange - [orange_fr]
Green - [green_fr]
Light Green - [lightgreen_fr]
Blue - [blue_fr]
Light Blue - [lightblue_fr]
Light Blue 2 - [lightblue2_fr]
Cyan - [cyan_fr]
Light Blue 3 - [lightblue3_fr]
Navy Blue - [navyblue_fr]
Dark Navy Blue - [darknavyblue_fr]

Ruby/Sapphire
Transparent - [transp_rs]
Dark Gray - [darkgrey_rs]
Red - [red_rs]
Light Green - [lightgreen_rs]
Blue - [blue_rs]
Yellow - [yellow_rs]
Cyan - [cyan_rs]
Magenta - [magenta_rs]
Gray - [grey_rs]
Black - [black_rs]
Light Gray - [lightgrey_rs]
White - [white_rs]
Sky Blue - [skyblue_rs]
Dark Sky Blue - [darkskyblue_rs]

Emerald
White - [white_em]
Dark Gray - [darkgrey_em]
Gray - [grey_em]
Red - [red_em]
Orange - [orange_em]
Green - [green_em]
Light Green - [lightgreen_em]
Blue - [blue_em]
Light Blue - [lightblue_em]
White 4 - [white4_em]
Lime Green- [limegreen_em]
Aqua - [aqua_em]
Navy - [navy_em]

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

Instead of using the codes below, I recommend using the Text Adjuster, found under Tools>Text Adjuster. Just type it in, press "Convert", and paste it in. It's that simple!

\n is used when we want to go to a new line. So this message:
Hi.\nWelcome. 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 this message:
Hi.\nI love my bed!\lDon't you dare sleep in\lit!will appear like this:
Hi.
I love my bed!
Don't you dare sleep in
it!
\p is used when we want the text to continue in a new box. This message:
...\p...\p...\pYup!will appear like this: ------------ means a new box.
...
------------------------------------------------
...
------------------------------------------------
...
------------------------------------------------
Yup!
\v is used when we want display stored text. Here's an example:
Hello, \v\h01!\n\v\h06 is looking for you.This would appear like this.
Hello, [PLAYER's name]!
[RIVAL's name] is looking for you.You could also do it like this:
Hello, [player]!\n[rival] is looking for you.

Msgbox Numbers

Here are the many different types, taken directly from The ROM Hacking Newsletter, also located in the ROM Hacking section.
This week's tip comes from HackMew. This time, it's all about msgboxes. Below is a description, script example and in-game shot of the different msgbox types.

[B]0x2Description:
This is the msgbox used for normal people. Using this type means that you don't need to use the lock, faceplayer or release commands.

Script:
#dynamic 0x800000

#org @start
msgbox @hello 0x2
end

#org @hello
= Hello, my name is dshayabusa.

In-Game:
http://i36.tinypic.com/2hi73nm.png[B]

0x3Description:
Used for signs etc. No lock or faceplayer effect. Only shows the sign textbox when used on an actual sign.

Script:
#dynamic 0x800000


#org @start
msgbox @sign 0x3
end

#org @sign
= You are here

In-Game:
http://i34.tinypic.com/2z9mb80.png
0x4Description:
A normal msgbox except for the fact that it does not close. Command closeonkeypress must be used to close it. No lock or faceplayer effect.

Script:
#org @start
msgbox @hello 0x4
end

#org @hello
= Hello, my name is dshayabusa.

In-Game:
http://i37.tinypic.com/erj2c5.png
0x5Description:
Used for Yes/No questions. No lock or faceplayer effect.

Script:
#dynamic 0x800000

#org @start
msgbox @question 0x5
end

#org @question
= Is this statement false?

In-game:
http://i36.tinypic.com/24yvihy.png
0x6Description:
Normal textbox. Has no lock or faceplayer effect.

Script:
#dynamic 0x800000

#org @start
msgbox @hello 0x6
end

#org @hello
= Hello, my name is dshayabusa.

In-game:
http://i37.tinypic.com/erj2c5.png

Flags


Flags are very useful when you need an event to only occur once or if you want a person to disappear.
Let's say you set flag 0x200. If you want an overworld to disappear, we have to assign the set flag (in this example, 0x200) to the overworld's people ID in Advance-Map. I'll go into more detail on that later.
Many flags are used within the game already. 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 used in the ROM already, here's a list: Taken directly from the XSE Comprehensive Scripting Guide, found here: Help>Guide

Ruby/Sapphire
0x1
0x2
0x3
0x4
0x5
0x6
0x11
0x12
0x13
0x14
0x15
0x16
0x17
0x18
0x19
0x1A
0x1B
0x1C
0x1D
0x1E
0x1F
0x20
0x2B
0x2C
0x2E
0x2F
0x30
0x31
0x32
0x33
0x34
0x35
0x36
0x37
0x38
0x39
0x3D
0x3E
0x3F
0x40
0x41
0x42
0x43
0x44
0x45
0x46
0x47
0x48
0x49
0x4A
0x4B
0x4C
0x4D
0x50
0x51
0x52
0x54
0x58
0x59
0x5A
0x5B
0x5C
0x5D
0x5E
0x5F
0x60
0x62
0x63
0x64
0x65
0x66
0x67
0x68
0x69
0x6A
0x6B
0x6D
0x6E
0x6F
0x70
0x71
0x72
0x73
0x74
0x75
0x76
0x77
0x79
0x7A
0x7B
0x7C
0x7D
0x7E
0x7F
0x80
0x81
0x82
0x83
0x84
0x85
0x86
0x87
0x88
0x89
0x8A
0x8B
0x8C
0x8D
0x8E
0x8F
0x90
0x91
0x92
0x93
0x94
0x95
0x96
0x97
0x98
0x99
0x9A
0x9B
0x9C
0x9E
0x9F
0xA0
0xA1
0xA2
0xA3
0xA4
0xA5
0xA6
0xA7
0xA8
0xA9
0xAA
0xAB
0xAC
0xAD
0xAE
0xAF
0xB0
0xB1
0xB2
0xB3
0xB4
0xB5
0xB6
0xB7
0xB8
0xB9
0xBA
0xBB
0xBC
0xBD
0xBE
0xBF
0xC0
0xC1
0xC2
0xC3
0xC4
0xC5
0xC6
0xC7
0xC8
0xC9
0xCA
0xCB
0xCC
0xCD
0xCE
0xD0
0xD1
0xD4
0xD5
0xD6
0xD7
0xD8
0xD9
0xDA
0xDB
0xDC
0xDD
0xDE
0xDF
0xE0
0xE1
0xE2
0xE3
0xE4
0xE5
0xE6
0xE7
0xE8
0xE9
0xEA
0xEB
0xEC
0xED
0xEE
0xEF
0xF0
0xF1
0xF2
0xF3
0xF4
0xF5
0xF6
0xF7
0xF8
0xF9
0xFA
0xFB
0xFC
0xFE
0xFF
0x100
0x101
0x102
0x103
0x104
0x105
0x106
0x107
0x108
0x109
0x10A
0x10B
0x10D
0x10E
0x10F
0x110
0x111
0x112
0x113
0x114
0x115
0x116
0x117
0x118
0x119
0x11A
0x11B
0x11C
0x11D
0x11E
0x11F
0x120
0x121
0x122
0x124
0x125
0x126
0x127
0x128
0x129
0x12A
0x12B
0x12C
0x12D
0x12E
0x138
0x140
0x141
0x142
0x143
0x144
0x163
0x16A
0x16E
0x16F
0x188
0x189
0x190
0x191
0x192
0x194
0x1A7
0x1A8
0x1A9
0x1AA
0x1B6
0x1B7
0x1B8
0x1CE
0x1CF
0x1D0
0x1E5
0x1E6
0x1ED
0x1EE
0x1EF
0x219
0x21A
0x21F
0x230
0x231
0x232
0x233
0x234
0x235
0x236
0x237
0x238
0x239
0x23A
0x23B
0x23C
0x23D
0x23F
0x240
0x241
0x243
0x244
0x245
0x246
0x247
0x248
0x249
0x24A
0x24B
0x24D
0x24E
0x24F
0x250
0x251
0x252
0x253
0x254
0x255
0x256
0x257
0x258
0x259
0x25B
0x25E
0x263
0x264
0x265
0x266
0x267
0x268
0x269
0x26A
0x26B
0x26C
0x26D
0x26E
0x26F
0x270
0x271
0x272
0x273
0x274
0x275
0x276
0x278
0x279
0x27A
0x27B
0x27C
0x27D
0x27E
0x27F
0x280
0x281
0x282
0x283
0x284
0x285
0x286
0x287
0x288
0x289
0x28A
0x28B
0x28C
0x28D
0x28E
0x28F
0x290
0x291
0x292
0x293
0x294
0x295
0x296
0x297
0x298
0x29A
0x29B
0x29C
0x29D
0x29E
0x29F
0x2A0
0x2A1
0x2A2
0x2A3
0x2A5
0x2A6
0x2BB
0x2BC
0x2BD
0x2BE
0x2BF
0x2C0
0x2C1
0x2C2
0x2C3
0x2C4
0x2C5
0x2C6
0x2C7
0x2C8
0x2C9
0x2CA
0x2CB
0x2CC
0x2CD
0x2CE
0x2CF
0x2D0
0x2D1
0x2D2
0x2D3
0x2D4
0x2D5
0x2D6
0x2D7
0x2D8
0x2D9
0x2DA
0x2DB
0x2DC
0x2DD
0x2E1
0x2E2
0x2E3
0x2E4
0x2E5
0x2E6
0x2E7
0x2E8
0x2EC
0x2ED
0x2EE
0x2EF
0x2F0
0x2F1
0x2F2
0x2F3
0x2F4
0x2F5
0x2F6
0x2F7
0x2F8
0x2F9
0x2FA
0x2FB
0x2FC
0x2FD
0x2FE
0x2FF
0x300
0x301
0x302
0x303
0x305
0x307
0x308
0x309
0x30A
0x30B
0x30C
0x30D
0x310
0x311
0x31C
0x31D
0x31E
0x31F
0x320
0x321
0x322
0x323
0x326
0x327
0x328
0x329
0x32E
0x32F
0x330
0x333
0x335
0x336
0x33C
0x33D
0x33F
0x343
0x348
0x349
0x34D
0x34E
0x350
0x351
0x354
0x356
0x357
0x358
0x35A
0x35B
0x35C
0x362
0x364
0x365
0x366
0x36D
0x36E
0x370
0x371
0x372
0x373
0x379
0x37A
0x37B
0x37C
0x37D
0x37E
0x380
0x381
0x382
0x384
0x385
0x386
0x387
0x388
0x389
0x38A
0x38F
0x390
0x391
0x393
0x394
0x395
0x396
0x39E
0x39F
0x3A0
0x3A5
0x3A6
0x3A7
0x3A8
0x3A9
0x3AC
0x3AD
0x3AE
0x3B0
0x3B1
0x3B2
0x3B3
0x3B4
0x3B5
0x3B7
0x3B8
0x3B9
0x3BA
0x3BB
0x3BC
0x3BD
0x3BE
0x3BF
0x3C1
0x3C2
0x3C3
0x3C4
0x3C5
0x3C7
0x3C8
0x3CD
0x3CE
0x3CF
0x3D0
0x3D1
0x3D2
0x3D3
0x3D4
0x3D6
0x3D7
0x3D8
0x3D9
0x3DA
0x3DB
0x3DC
0x3DD
0x3DE
0x3DF
0x436
0x4B0
0x4B1
0x4B2
0x4B3
0x4B4
0x4B5
0x4B6
0x4B7
0x4B8
0x4B9
0x4BA
0x4BB
0x4BC
0x4BD
0x4C1
0x4C9
0x4CD
0x4D4
0x4DD
0x4DE
0x4DF
0x4E0
0x800
0x801
0x802
0x804
0x805
0x806
0x807
0x808
0x809
0x80A
0x80B
0x80C
0x80D
0x80E
0x80F
0x810
0x811
0x812
0x813
0x814
0x815
0x816
0x817
0x818
0x819
0x81A
0x81B
0x81C
0x81D
0x81E
0x820
0x821
0x822
0x823
0x824
0x825
0x826
0x827
0x828
0x829
0x82A
0x82B
0x82C
0x82D
0x82F
0x830
0x832
0x834
0x83A
0x83B
0x83C
0x83D
0x83E
0x83F
0x840
0x841
0x842
0x843
0x844
0x845
0x846
0x847
0x848
0x849
0x84A
0x84B
0x84C
0x84F
0x850
0x851
0x852
0x853
0x854
0x855
0x856
0x857
0x858
0x859
0x85A
0x85B
0x85C
0x85E
0x85F
0x860
0x861
0x863
0x890
0x891
0x892
0x893
0x894
0x895
0x896
0x897
0x898
0x899
0x89A
0x89B
0x89C
0x89D
0x89E
0x89F
0x8A0
0x8A1
0x8A2
0x8A3
0x8A4
0x8A5
0x8A6
0x8A7
0x8A8
0x8A9
0x8AA
0x8AB
0x8AC
0x8AD
0x8AE
0x8AF
0x8B0
0x8B1
0x8B2
0x8B3
0x8B4
0x8B5
0x8B6
0x8B7
0x8B8
0x8B9
0x8BA
0x8BB
0x8BC
0x8BD
0x8BE
0x8BF
0x8C0
0x8C1
0x8C2
0x8CA
0x8CB
0x8CC
0x8CD
0x8CE
0x8CF
0x8D0
0x8D1
0x8D2

Fire Red/Leaf Green:
0x1
0x2
0x3
0x4
0x5
0x6
0x2B
0x2C
0x2E
0x2F
0x30
0x31
0x32
0x33
0x34
0x35
0x36
0x37
0x39
0x3D
0x3E
0x3F
0x40
0x41
0x42
0x43
0x44
0x45
0x46
0x47
0x48
0x49
0x4A
0x4B
0x4C
0x4D
0x50
0x52
0x54
0x58
0x59
0x5C
0x5D
0x5F
0x62
0x63
0x64
0x65
0x66
0x67
0x68
0x69
0x6A
0x6B
0x72
0x75
0x7A
0x7B
0x7C
0x7D
0x7E
0x80
0x81
0x82
0x84
0x85
0x86
0x88
0x8B
0x8C
0x8D
0x8E
0x91
0x92
0x93
0x94
0x95
0x96
0x97
0x98
0x99
0x9A
0x9B
0x9C
0x9E
0x9F
0xA0
0xA1
0xA2
0xAA
0xAD
0xAE
0xB1
0xB2
0xB3
0xB4
0xD5
0xD6
0xD7
0xDC
0xEA
0x109
0x10A
0x10B
0x118
0x119
0x11A
0x11B
0x120
0x121
0x124
0x125
0x126
0x127
0x128
0x129
0x142
0x143
0x144
0x163
0x16A
0x16E
0x16F
0x188
0x189
0x190
0x191
0x192
0x1A7
0x1A8
0x1B6
0x1B7
0x1B8
0x1CE
0x1CF
0x1D0
0x219
0x21A
0x21F
0x230
0x231
0x232
0x233
0x234
0x235
0x236
0x237
0x238
0x239
0x23A
0x23B
0x23C
0x23D
0x23F
0x240
0x241
0x243
0x244
0x245
0x246
0x247
0x248
0x249
0x24A
0x24B
0x24D
0x24E
0x24F
0x250
0x251
0x252
0x253
0x254
0x255
0x256
0x257
0x258
0x259
0x25B
0x25E
0x263
0x264
0x265
0x266
0x267
0x268
0x269
0x26A
0x26B
0x26C
0x26D
0x26E
0x26F
0x270
0x271
0x272
0x273
0x274
0x275
0x276
0x278
0x27A
0x27B
0x27C
0x27D
0x27E
0x27F
0x280
0x281
0x282
0x283
0x284
0x285
0x286
0x287
0x288
0x289
0x28A
0x28B
0x28C
0x28D
0x290
0x291
0x292
0x293
0x294
0x295
0x296
0x297
0x298
0x29A
0x29B
0x29C
0x29D
0x29E
0x29F
0x2A0
0x2A1
0x2A2
0x2A3
0x2A5
0x2A6
0x2BB
0x2BC
0x2BD
0x2BE
0x2BF
0x2C0
0x2C1
0x2C2
0x2C3
0x2C4
0x2C5
0x2C6
0x2C7
0x2C8
0x2C9
0x2CA
0x2CB
0x2CC
0x2CD
0x2CE
0x2CF
0x2D0
0x2D1
0x2D2
0x2D3
0x2D4
0x2D5
0x2D6
0x2D7
0x2D8
0x2D9
0x2DA
0x2DB
0x2DC
0x2DD
0x2E1
0x2E2
0x2E3
0x2E4
0x2E5
0x2EC
0x2ED
0x2EE
0x2EF
0x2F0
0x2F1
0x2F2
0x2F3
0x2F4
0x2F5
0x2F6
0x2F7
0x2F8
0x2F9
0x2FA
0x2FB
0x2FC
0x2FD
0x2FE
0x2FF
0x4B0
0x4B1
0x4B2
0x4B3
0x4B4
0x4B5
0x4B6
0x4B7
0x4B8
0x4B9
0x4BA
0x4BB
0x4BC
0x805
0x807
0x820
0x821
0x822
0x823
0x824
0x825
0x826
0x827
0x828
0x829
0x82C
0x82D
0x82F
0x830
0x834
0x83E
0x841
0x842
0x844
0x845
0x846
0x847
0x848
0x849
0x84A
0x84B
0x890
0x891
0x892
0x893
0x894
0x895
0x896
0x897
0x898
0x899
0x89A
0x89B
0x89C
0x89D
0x89E
0x89F
0x8A0
0x8A1
0x8A2
0x8A3
0x8A4
0x8A5
0x8A6
0x8A7
0x8A8
0x8A9
0x8AA
0x8AB
0x8AC
0x8AD
0x8AE
0x8AF
0x8B0
0x8B1
0x8B2
0x8B3
0x8B4
0x8B5
0x8B6
0x8B7
0x8B8
0x8B9
0x8BA
0x8BB
0x8BC
0x8BD
0x8BE
0x8BF
0x8C0
0x8C1
0x8C2

Emerald:
0x1
0x2
0x3
0x4
0x11
0x12
0x13
0x14
0x15
0x16
0x17
0x18
0x19
0x1A
0x1B
0x1C
0x1D
0x1E
0x1F
0x38
0x41
0x47
0x48
0x49
0x4A
0x50
0x51
0x52
0x53
0x58
0x59
0x5A
0x5B
0x5C
0x5D
0x5E
0x5F
0x60
0x61
0x62
0x63
0x64
0x65
0x66
0x67
0x69
0x6A
0x6B
0x6C
0x6D
0x6E
0x6F
0x70
0x71
0x73
0x74
0x75
0x76
0x77
0x78
0x79
0x7A
0x7B
0x7C
0x7D
0x7E
0x7F
0x80
0x81
0x82
0x83
0x84
0x85
0x86
0x87
0x88
0x89
0x8A
0x8B
0x8C
0x8D
0x8E
0x8F
0x90
0x91
0x92
0x93
0x94
0x95
0x97
0x98
0x99
0x9A
0x9B
0x9C
0x9D
0x9E
0x9F
0xA0
0xA1
0xA2
0xA3
0xA4
0xA5
0xA6
0xA7
0xA8
0xA9
0xAA
0xAB
0xAC
0xAE
0xAF
0xB0
0xB1
0xB2
0xB3
0xB4
0xB5
0xB6
0xB7
0xB8
0xB9
0xBA
0xBB
0xBC
0xBD
0xBE
0xBF
0xC0
0xC1
0xC2
0xC3
0xC4
0xC5
0xC6
0xC7
0xC8
0xC9
0xCA
0xCB
0xCC
0xCD
0xCE
0xCF
0xD0
0xD1
0xD2
0xD3
0xD4
0xD5
0xD7
0xD8
0xD9
0xDA
0xDB
0xDD
0xDE
0xDF
0xE0
0xE1
0xE2
0xE3
0xE4
0xE5
0xE6
0xE7
0xE8
0xE9
0xEA
0xEB
0xEC
0xED
0xEE
0xEF
0xF0
0xF1
0xF2
0xF3
0xF4
0xF5
0xF6
0xF7
0xF8
0xF9
0xFA
0xFB
0xFC
0xFD
0xFE
0xFF
0x100
0x101
0x102
0x103
0x104
0x105
0x106
0x107
0x108
0x109
0x10A
0x10B
0x10D
0x10E
0x10F
0x110
0x111
0x112
0x113
0x114
0x115
0x116
0x117
0x118
0x119
0x11A
0x11B
0x11C
0x11D
0x11E
0x11F
0x120
0x121
0x122
0x124
0x125
0x126
0x127
0x128
0x129
0x12A
0x12B
0x12C
0x12D
0x12E
0x12F
0x130
0x131
0x132
0x133
0x134
0x135
0x136
0x137
0x138
0x139
0x140
0x141
0x143
0x14E
0x14F
0x150
0x151
0x152
0x153
0x154
0x155
0x156
0x157
0x159
0x15A
0x15B
0x191
0x192
0x194
0x1A9
0x1AA
0x1AC
0x1AD
0x1AE
0x1AF
0x1B0
0x1B1
0x1B2
0x1B3
0x1B4
0x1B5
0x1B6
0x1B7
0x1B8
0x1B9
0x1BA
0x1BB
0x1BC
0x1BD
0x1BE
0x1BF
0x1C0
0x1C1
0x1C2
0x1C3
0x1C4
0x1C5
0x1C6
0x1C7
0x1C8
0x1C9
0x1CA
0x1CB
0x1CC
0x1CD
0x1CE
0x1CF
0x1D0
0x1D1
0x1D2
0x1D4
0x1D5
0x1D6
0x1D7
0x1D8
0x1D9
0x1DB
0x1DC
0x1DD
0x1ED
0x1EE
0x1EF
0x1F5
0x1F6
0x23B
0x23C
0x23D
0x23E
0x23F
0x246
0x247
0x248
0x249
0x24F
0x25E
0x265
0x266
0x281
0x287
0x288
0x289
0x28A
0x28E
0x28F
0x2BC
0x2BD
0x2BF
0x2C0
0x2C1
0x2C2
0x2C3
0x2C4
0x2C5
0x2C6
0x2C7
0x2C8
0x2C9
0x2CA
0x2CB
0x2CC
0x2CE
0x2CF
0x2D0
0x2D1
0x2D2
0x2D6
0x2D8
0x2DA
0x2DC
0x2DF
0x2E0
0x2E1
0x2E2
0x2E3
0x2E4
0x2E5
0x2E6
0x2E7
0x2E8
0x2E9
0x2EA
0x2F1
0x2F2
0x2F3
0x2F4
0x2F6
0x2F7
0x2F8
0x2F9
0x2FA
0x2FB
0x2FC
0x2FE
0x2FF
0x300
0x301
0x302
0x303
0x307
0x308
0x309
0x30A
0x30B
0x30C
0x30D
0x30E
0x30F
0x310
0x311
0x313
0x314
0x319
0x31C
0x31D
0x31E
0x31F
0x320
0x321
0x322
0x323
0x326
0x327
0x328
0x329
0x32E
0x32F
0x330
0x331
0x332
0x333
0x335
0x336
0x337
0x33A
0x33B
0x33C
0x33D
0x33E
0x33F
0x340
0x343
0x347
0x348
0x349
0x34A
0x34B
0x34C
0x34D
0x34E
0x34F
0x350
0x351
0x354
0x356
0x357
0x358
0x359
0x35A
0x35B
0x35C
0x35E
0x35F
0x360
0x361
0x362
0x365
0x366
0x369
0x36A
0x36D
0x36E
0x370
0x371
0x372
0x373
0x379
0x37A
0x37B
0x37C
0x37D
0x37E
0x380
0x381
0x382
0x384
0x385
0x386
0x387
0x388
0x389
0x38A
0x390
0x391
0x393
0x394
0x395
0x396
0x39C
0x39E
0x39F
0x3A0
0x3A1
0x3A5
0x3A6
0x3A7
0x3A8
0x3A9
0x3AC
0x3AD
0x3AE
0x3B0
0x3B1
0x3B2
0x3B3
0x3B4
0x3B5
0x3B7
0x3B8
0x3B9
0x3BA
0x3BB
0x3BC
0x3BD
0x3BE
0x3BF
0x3C1
0x3C2
0x3C3
0x3C4
0x3C5
0x3C7
0x3C8
0x3CD
0x3CE
0x3CF
0x3D0
0x3D1
0x3D2
0x3D3
0x3D4
0x3D7
0x3D8
0x3DF
0x3E0
0x3E1
0x3E2
0x3E5
0x3E6
0x3E7
0x436
0x4F0
0x4F1
0x4F2
0x4F3
0x4F4
0x4F5
0x4F6
0x4F7
0x4F8
0x4FB
0x4FC
0x4FD
0x4FE
0x860
0x861
0x862
0x864
0x865
0x866
0x867
0x868
0x869
0x86A
0x86B
0x86C
0x86D
0x86E
0x870
0x871
0x872
0x873
0x874
0x875
0x876
0x877
0x878
0x879
0x87A
0x87B
0x87C
0x87E
0x880
0x889
0x88A
0x88B
0x892
0x89A
0x89B
0x89C
0x89D
0x89E
0x89F
0x8A0
0x8A1
0x8A3
0x8A4
0x8A5
0x8A6
0x8A7
0x8A8
0x8A9
0x8AA
0x8AB
0x8AF
0x8B0
0x8B1
0x8B2
0x8B3
0x8B4
0x8B5
0x8B6
0x8B7
0x8B8
0x8B9
0x8BA
0x8BB
0x8BC
0x8BE
0x8BF
0x8C0
0x8C1
0x8C3
0x8C4
0x8C5
0x8C6
0x8C7
0x8C8
0x8C9
0x8CA
0x8CB
0x8CC
0x8CD
0x8CE
0x8CF
0x8D0
0x8D1
0x8D2
0x8D3
0x8D4
0x8D5
0x8D6
0x8D8
0x8D9
0x8DA
0x8DC
0x8DD
0x8DE
0x8DF
0x8E0
0x8E1
0x8E2
0x921
0x92A
0x92B
0x92C
0x92D
0x92E
0x92F
0x930
0x931
0x932
0x934

I'll have to do a bit of explaining here, so I'll start with preventing events to happen. I'll use #dynamic 0x800000 for the rest of my examples.
#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x200
if 0x1 goto @done
msgbox @1 0x6
setflag 0x200
release
end

#org @done
msgbox @2 0x6
clearflag 0x200
release
endWe've already covered lock and faceplayer, so we'll go to checkflag.
checkflag checks if a flag has been set. Checkflag is always followed by an if line.
When using the if line after checkflag, it contains either a 0x1 or 0x0. 0x1, means that if the flag is set goto @(pointer), and if it's not set, it will continue with the script. Similarly, 0x0 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 normally.

As you can see, the if 0x1 goto @done points to a different part of a script, as shown with the #org @done .
At #org @done, we have both a message and a new command, clearflag.
Once flags are set they can be "cleared" with the command clearflag.
Clearflag has to be followed by the flag number, which in this case is 0x200.

There is more than one way to use a flag. Some flags have some sort of game function, like these:
Flags

Fire Red:
0x820 – Activates First Badge
0x821 - Activates Second Badge
0x822 - Activates Third Badge
0x823 - Activates Fourth Badge
0x824 - Activates Fifth Badge
0x825 - Activates Sixth Badge
0x826 - Activates Seventh Badge
0x827 - Activates Eighth Badge
0x828 - Activates Pokemon Menu
0x829 - Activates Pokedex Menu
0x82F - Activates Running Shoes

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

Emerald:
0x860 - Activates Pokemon Menu
0x861 - Activates Pokedex Menu
0x862 - Activates Pokenav Menu
0x867 - Activates First Badge
0x868 - Activates Second Badge
0x869 - Activates Third Badge
0x86A - Activates Fourth Badge
0x86B - Activates Fifth Badge
0x86C - Activates Sixth Badge
0x86D - Activates Seventh Badge
0x86E - Activates Eighth Badge
0x8C0 - Activates Running Shoes
Badge flags and the running shoes flag found by Crocky.
I'll explain these in the next part.


Givepokemon

Givepokemon does exactly what it says. It gives the player a Pokemon. Here's my example script. There are lots of new commands to look at here.
#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 goto @done
msgbox @1 0x5
compare LASTRESULT 0x1
if 0x1 goto @take
msgbox @2 0x6
release
end

#org @take
givepokemon 0x4 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @3 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @4 0x5
compare LASTRESULT 0x1
if 0x1 call @name
msgbox @5 0x6
release
end

#org @name
call 0x1A74EB
return

#org @done
msgbox @6 0x6
release
end

#org @1
= Hello.\nSorry to trouble you.\nI can't take care\nof my Charmander.\pCan you take care of\nit for me?

#org @2
= That's okay.\pI'm sure someone else will\ntake it.

#org @3
= You received a Charmander!

#org @4
= [black_fr]Would you like to give a\nnickname to Charmander?

#org @5
= Please take care of\nCharmander.

#org @6
= Are you taking good care\nof Charmander?Okay. There's a lot here I need to explain.
I'll start from the top.

We've already covered checkflag and the if line, as well as msgbox.
For info on 0x5, read the section labeled Msgbox Numbers.
0x5 is always followed by a compare line.
compare needs a variable, which in this case is 0x800D, and a value, which in this case is 0x1.
0x800D is a useful variable that most commands store values in.
When using compare after a msgbox @(text) 0x5 line, you only have two options for the value. They're 0x0, which is the value set to 0x800D when you choose NO, and 0x1, which is the value set to 0x800D when you choose YES.
A compare 0x800D 0x1 line will check if you pressed YES and, of course, compare 0x800D 0x0 will check if you pressed NO.
The if line that follows the compare line does the same thing as what it does for checkflag. if 0x1 will check if the button pressed matches the compared value. If it matches, it will goto @(pointer). If not, it will continue the script.
Then we have a normal msgbox.

The first new command here is givepokemon.
givepokemon uses six values. The first is the Pokemon, the second being the level, the third being the Item Held, and the last three being buffers.
So in the script above, mine shows....
givepokemon 0x4 (Charmander) 0x5 (Level 5) 0x0 (no item) 0x0 0x0 0x0 (buffers)Here's two lists of Pokemon and Items.

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

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

Now, we have fanfare 0x13E. This is a jingle. It's a short bit of music that's played when you receive something, like a Pokemon or an item.
Then we have a msgbox. The only difference here is that we have used 0x4. But if it doesn't close, why would I use it? You'll just have to keep reading to find out.
waitfanfare will do what it's name displays. It will wait for the fanfare to finish before it allows the script to continue. 0x4 left the box open while the fanfare plays.
closeonkeypress is a very useful command. This is extremely useful when bundled with 0x4. It will basically make the 0x4 act as an 0x6, which allows for it to be closed with the press of a button.
setflag 0x828... Do you remember what it's for? In Fire Red and Leaf Green, it activates the Pokemon Menu.

Now, here's this part:
msgbox @4 0x5
compare LASTRESULT 0x1
if 0x1 call @nameWe have something slightly different there. Instead of, if 0x1 [B]goto @name, we have if 0x1 call @name.
If you use ScriptED, this would just be if2 to you. call is something used in other programming languages (sometimes named 'gosub') and is just used to say, "go to @offset, but you have to return."
Let's look at what we have there. call @name. That means that we're going to go look at @name.

Here, we have call 0x1A74EB. call by itself can be used in the same way: to call some other script within a ROM. It can also call another part of your script. In that case, it would appear like this:
call @(pointer)I know what you're asking. What's at 0x1A74EB? The offset 0x1A74EB contains a script which is used to name a Pokemon.
Now we have return. It makes the script return to wherever it was called from or called from. I didn't mention it earlier, but call should have a return to wherever it is called from.
That return has brought us back to msgbox @5 0x6. The rest is already explained, so now we can move onto the next part.

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


#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @1 0x6
cry 0x6 0x0
wildbattle 0x6 0x1E 0x8B
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @1
= CHARIZARD: Raaarrgghh!I'll just start straight with cry, since you already know about everything before it.
I have to get a little "advanced" here. Hopefully, I'll explain it well enough so that it sounds simple. When we script cry, it takes 6 bytes:
cry [pkmn #] 0x0
First we have the command. That's followed by the Pokemon number, which in this case is a Charizard. The last 0x0 is supposed to determine the "effect number", but play it safe and stick with 0x0.
Now, we have the command wildbattle. In my script, we have:
wildbattle 0x06 (Charizard) 0x1E (Level 30) 0x8B (Oran Berry)From there, I can explain. The first two bytes are the Pokemon's numbers, 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 or white and back. fadescreen 0x1 will fade the screen out to black. There are some more fadescreens, listed here:

0x0 - fade from black to normal
0x1 – fade from normal to black
0x2 – fade from white to normal
0x3 – fade from normal to white

Now we can move onto hidesprite 0x800F. This is very useful, as it makes the overworld you're interacting with disappear. Here's some in-depth info on hidesprite 0x800F:
When we interact/talk with an OW, the people number is assigned to the variable 0x800F. In the case of hidesprite 0x800F, it's saying, "hide sprite, (variable) 0x800F" It isn't actually a people no. 0x800F is just the variable that's assigned to the sprite currently being interacted with.
hidesprite can also be used a little differently. I'll explain that a little later in the tutorial.

Remember how I mentioned something about the People ID in Advance-Map? This is where I'll be explaining that. Let's say you set flag number 0x200. We are going to change the script's overworld's People ID to 0200. The People ID is used to make sure that the overworld doesn't continue to re-appear.
That's it! I guess we can move onto something else now.
Checkgender


#dynamic 0x800000

#org @start
lock
faceplayer
checkgender
compare 0x800D 0x0
if 0x1 goto @boy
compare 0x800D 0x1
if 0x1 goto @girl
end

#org @boy
msgbox @1 0x6
release
end

#org @girl
msgbox @2 0x6
release
end

#org @1
= Hello, Mr. \v\h01!

#org @2
= Hello, Ms. \v\h01!
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 0x800D. We check what this value is with compare 0x800D 0x*. The asterisk just stands for what we are checking for. checkgender assigns 0x0 to 0x800D for a male, and assigns 0x1 to 0x800D for a female.
I've used two compares but it could have alternatively been written like this:
#dynamic 0x800000

#org @start
lock
faceplayer
checkgender
compare 0x800D 0x0
if 0x1 goto @boy
msgbox @2 0x6
release
end

#org @boy
msgbox @1 0x6
release
end

#org @1
= Hello, Mr. \v\h01!

#org @2
= Hello, Ms. \v\h01!Or like this...
#dynamic 0x800000

#org @start
lock
faceplayer
checkgender
compare 0x800D 0x1
if 0x1 goto @girl
msgbox @1 0x6
release
end

#org @girl
msgbox @2 0x6
release
end

#org @1
= Hello, Mr. \v\h01!

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


#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x200
if 0x1 goto @done
msgbox @1 0x5
compare 0x800D 0x1
if 0x1 goto @take
msgbox @2 0x6
release
end

#org @done
msgbox @3 0x6
release
end

#org @take
giveitem 0xD 0x1 MSG_OBTAIN
msgbox @3 0x6
setflag 0x200
release
end

#org @1
= Hi!\pI'm from the Cherrygrove\nPokeMart.\pWhy don't you take this\nfree sample?

#org @2
= That's okay. I'm sure someone\nelse will enjoy it.
#org @3
= If you want more, you'll\nhave to go to the PokeMart\nto buy them.One thing you may notice about this script is that I've pointed 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 uses three values, the item no., the amount, and the message type. The message type can be either MSG_FIND or MSG_OBTAIN.
In my script, I used these:
giveitem 0xD (Potion) 0x1 (One of them) MSG_OBTAIN (Obtaining from a person message)That's actually all you need to do for this command. It will automatically play a jingle and display a message saying "[PLAYER] received ............". That's actually all I need to explain.
Let's move onto some simple specials now.

Special

#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @10 0x4
closeonkeypress
fadescreen 0x1
fanfare 0x100
special 0x0
waitfanfare
fadescreen 0x0
msgbox @11 0x6
release
end

#org @10
= What wonderful Pokèmon you\nhave there!\pThey look like\nthey could use a long rest.

#org @11
= Now they look better!\nDon't forget to visit!Looks like I've used 0x4 and closeonkeypress again. I've also used fadescreen 0x1 as well 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?
It fades from black to normal.
Now, we can move backwards and look at, “Why I used 0x4 instead of 0x6.”
For some reason that I can't explain, if we use 0x6 before we use fadescreen 0x1, the box will remain open until we return to our normal screen with fadescreen 0x0. Once we are there, we will see it close, but we don't want that, do we? It doesn't look very good. We want it to close before we come back from our black screen. I also can't explain this, but for some reason, when we use 0x4 and closeonkeypress, it does just that. So whenever you have a script like this, use 0x4 and closeonkeypress before a fadescreen.
The fanfare is very useful in this script. In theory, I could have used pause (which is a command I haven't covered yet), but I wanted to use the combination of fanfare 0x100 and waitfanfare.
For those of you who don't know, fanfare 0x100 is the healing jingle that is played when someone heals your Pokemon. So 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 a spoiler right here, for whoever may want it.
Specials
special 0x0 - Heal Pokemon
special 0x3C - Access Bill's PC (FR/LG)
special 0x98 - Going up to Mountain (R/S)
special 0x9C - Wally Catch (R/S)
special 0x9F - choose A Pokemon (R/S)
special 0xE0 - PokeBlock Case (R/S)
special 0x10F - Restart Game
special 0x110 - Hall of Fame and Credits
special 0x111 - Elevator Animation
special 0x119 - Groudon's Orb effect (R/S)
special 0x131 - Earthquake (R/S)
special 0x132 - Show Floors
special 0x133 - Long Earthquake (Emerald)
special 0x136 - Earthquake (FR/LG)
special 0x137 - Lava Battle
special 0x13D - Short Earthquake (Emerald)
special 0x156 - Battle with Ghost (FR/LG)
special 0x157 - Get on Bike (FR/LG)
special 0x161 - Start Surfing (FR/LG)
special 0x166 - Nickname
special 0x16F - Activate National Dex (FR/LG)
special 0x17B - Seagallop Animation
special 0x191 - SS. Anne Leaving
special 0x1F3 - Activate National Dex (Emerald)

For the earthquake animation, here's a few variables you should set before using the special:
setvar 0x8004 0xF //This controls how far the screen shakes vertically
setvar 0x8005 0xF //This controls how far the screen shakes horizontally
setvar 0x8006 0xF //This controls how long the overall animation lasts
setvar 0x8007 0xF //This controls how long one screen shake lasts

Applymovement


#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 goto @done
msgbox @1 0x6
applymovement 0x04 @move
waitmovement 0x0
applymovement 0xFF @move2
pause 0x30
msgbox @2 0x6
playsong 0x13E 0x0
applymovement 0x04 @move3
applymovement 0xFF @move3
waitmovement 0x0
fadesong 0x12C
release
end

#org @done
release
end

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

#org @move2
#raw 0x03
#raw 0xFE

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

http://files.domoreaweso.me/people%20event%20num.jpg

It also needs 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 (255). There's almost never 255 overworlds on one map. 0xFF is the “hero's” people number.
Now, let's look at this movements list: (credit to HackMew for finding them and including them in XSE)
Ruby/Sapphire/Emerald
#raw 0x00 = Face Down
#raw 0x01 = Face Up
#raw 0x02 = Face Left
#raw 0x03 = Face Right
#raw 0x04 = Step Down (Slow)
#raw 0x05 = Step Up (Slow)
#raw 0x06 = Step Left (Slow)
#raw 0x07 = Step Right (Slow)
#raw 0x08 = Step Down (Normal)
#raw 0x09 = Step Up (Normal)
#raw 0x0A = Step Left (Normal)
#raw 0x0B = Step Right (Normal)
#raw 0x0C = Jump2 Down
#raw 0x0D = Jump2 Up
#raw 0x0E = Jump2 Left
#raw 0x0F = Jump2 Right
#raw 0x10 = Delay1
#raw 0x11 = Delay2
#raw 0x12 = Delay3
#raw 0x13 = Delay4
#raw 0x14 = Delay5
#raw 0x15 = Step Down (Fast)
#raw 0x16 = Step Up (Fast)
#raw 0x17 = Step Left (Fast)
#raw 0x18 = Step Right (Fast)
#raw 0x19 = Step on the Spot Down (Slow)
#raw 0x1A = Step on the Spot Up (Slow)
#raw 0x1B = Step on the Spot Left (Slow)
#raw 0x1C = Step on the Spot Right (Slow)
#raw 0x1D = Step on the Spot Down (Normal)
#raw 0x1E = Step on the Spot Up (Normal)
#raw 0x1F = Step on the Spot Left (Normal)
#raw 0x20 = Step on the Spot Right (Normal)
#raw 0x21 = Step on the Spot Down (Faster)
#raw 0x22 = Step on the Spot Up (Faster)
#raw 0x23 = Step on the Spot Left (Faster)
#raw 0x24 = Step on the Spot Right (Faster)
#raw 0x25 = Step on the Spot Down (Fastest)
#raw 0x26 = Step on the Spot Up (Fastest)
#raw 0x27 = Step on the Spot Left (Fastest)
#raw 0x28 = Step on the Spot Right (Fastest)
#raw 0x29 = Slide Down
#raw 0x2A = Slide Up
#raw 0x2B = Slide Left
#raw 0x2C = Slide Right
#raw 0x2D = Slide Down
#raw 0x2E = Slide Up
#raw 0x2F = Slide Left
#raw 0x30 = Slide Right
#raw 0x31 = Slide Down
#raw 0x32 = Slide Up
#raw 0x33 = Slide Left
#raw 0x34 = Slide Right
#raw 0x35 = Slide Running Down
#raw 0x36 = Slide Running Up
#raw 0x37 = Slide Running Left
#raw 0x38 = Slide Running Right
#raw 0x3A = Jump Facing Left (Down)
#raw 0x3B = Jump Facing Down (Up)
#raw 0x3C = Jump Facing Up (Left)
#raw 0x3D = Jump Facing Left (Right)
#raw 0x3E = Face Player
#raw 0x3F = Face Against Player
#raw 0x40 = Lock Sprite Facing
#raw 0x41 = Release Sprite Facing
#raw 0x42 = Jump Down
#raw 0x43 = Jump Up
#raw 0x44 = Jump Left
#raw 0x45 = Jump Right
#raw 0x46 = Jump in Place (Facing Down)
#raw 0x47 = Jump in Place (Facing Up)
#raw 0x48 = Jump in Place (Facing Left)
#raw 0x49 = Jump in Place (Facing Right)
#raw 0x4A = Jump in Place (Facing Down/Up)
#raw 0x4B = Jump in Place (Facing Up/Down)
#raw 0x4C = Jump in Place (Facing Left/Right)
#raw 0x4D = Jump in Place (Facing Right/Left)
#raw 0x4E = Face Left
#raw 0x54 = Hide Sprite
#raw 0x55 = Show Sprite
#raw 0x56 = Exclamation Mark (!)
#raw 0x57 = Question Mark (?)
#raw 0x58 = Love (<3)
#raw 0x62 = Walk Down
#raw 0x63 = Walk Down
#raw 0x64 = Face Down (Delayed)
#raw 0x65 = Face Up (Delayed)
#raw 0x66 = Face Left (Delayed)
#raw 0x67 = Face Right (Delayed)
#raw 0x70 = Jump in Place (Facing Down)
#raw 0x71 = Jump in Place (Facing Up)
#raw 0x72 = Jump in Place (Facing Left)
#raw 0x73 = Jump in Place (Facing Right)
#raw 0x74 = Jump Down Running
#raw 0x75 = Jump Up Running
#raw 0x76 = Jump Left Running
#raw 0x77 = Jump Right Running
#raw 0x78 = Jump2 Down Running
#raw 0x79 = Jump2 Up Running
#raw 0x7A = Jump2 Left Running
#raw 0x7B = Jump2 Right Running
#raw 0x7C = Walk on the Spot (Down)
#raw 0x7D = Walk on the Spot (Up)
#raw 0x7E = Walk on the Spot (Left)
#raw 0x7F = Walk on the Spot (Right)
#raw 0x80 = Slide Down Running
#raw 0x81 = Slide Up Running
#raw 0x82 = Slide Left Running
#raw 0x83 = Slide Right Running
#raw 0x84 = Slide Down
#raw 0x85 = Slide Up
#raw 0x86 = Slide Left
#raw 0x87 = Slide Right
#raw 0x88 = Slide Down on Left Foot
#raw 0x89 = Slide Up on Left Foot
#raw 0x8A = Slide Left on Left Foot
#raw 0x8B = Slide Right on Left Foot
#raw 0x8C = Slide Left diagonally (Facing Up)
#raw 0x8D = Slide Right diagonally (Facing Up)
#raw 0x8E = Slide Left diagonally (Facing Down)
#raw 0x8F = Slide Right diagonally (Facing Down)
#raw 0x90 = Slide2 Left diagonally (Facing Up)
#raw 0x91 = Slide2 Right diagonally (Facing Up)
#raw 0x92 = Slide2 Left diagonally (Facing Down)
#raw 0x93 = Slide2 Right diagonally (Facing Down)
#raw 0x96 = Walk Left
#raw 0x97 = Walk Right
#raw 0x98 = Levitate
#raw 0x99 = Stop Levitating
#raw 0x9C = Fly Up Vertically
#raw 0x9D = Land
#raw 0xFE = End of Movements


Fire Red/Leaf Green
#raw 0x0 = Face Down
#raw 0x1 = Face Up
#raw 0x2 = Face Left
#raw 0x3 = Face Right
#raw 0x4 = Face Down (Faster)
#raw 0x5 = Face Up (Faster)
#raw 0x6 = Face Left (Faster)
#raw 0x7 = Face Right (Faster)
#raw 0x8 = Step Down (Very Slow)
#raw 0x9 = Step Up (Very Slow)
#raw 0xA = Step Left (Very Slow)
#raw 0xB = Step Right (Very Slow)
#raw 0xC = Step Down (Slow)
#raw 0xD = Step Up (Slow)
#raw 0xE = Step Left (Slow)
#raw 0xF = Step Right (Slow)
#raw 0x10 = Step Down (Normal)
#raw 0x11 = Step Up (Normal)
#raw 0x12 = Step Left (Normal)
#raw 0x13 = Step Right (Normal)
#raw 0x14 = Jump2 Down
#raw 0x15 = Jump2 Up
#raw 0x16 = Jump2 Left
#raw 0x17 = Jump2 Right
#raw 0x18 = Delay1
#raw 0x19 = Delay2
#raw 0x1A = Delay3
#raw 0x1B = Delay4
#raw 0x1C = Delay5
#raw 0x1D = Step Down (Fast)
#raw 0x1E = Step Up (Fast)
#raw 0x1F = Step Left (Fast)
#raw 0x20 = Step Right (Fast)
#raw 0x21 = Step on the Spot Down (Normal)
#raw 0x22 = Step on the Spot Up (Normal)
#raw 0x23 = Step on the Spot Left (Normal)
#raw 0x24 = Step on the Spot Right (Normal)
#raw 0x25 = Step on the Spot Down (Faster)
#raw 0x26 = Step on the Spot Up (Faster)
#raw 0x27 = Step on the Spot Left (Faster)
#raw 0x28 = Step on the Spot Right (Faster)
#raw 0x29 = Step on the Spot Down (Fastest)
#raw 0x2A = Step on the Spot Up (Fastest)
#raw 0x2B = Step on the Spot Left (Fastest)
#raw 0x2C = Step on the Spot Right (Fastest)
#raw 0x2D = Face Down (Delayed)
#raw 0x2E = Face Up (Delayed)
#raw 0x2F = Face Left (Delayed)
#raw 0x30 = Face Right (Delayed)
#raw 0x31 = Slide Down (Slow)
#raw 0x32 = Slide Up (Slow)
#raw 0x33 = Slide Left (Slow)
#raw 0x34 = Slide Right (Slow)
#raw 0x35 = Slide Down (Normal)
#raw 0x36 = Slide Up (Normal)
#raw 0x37 = Slide Left (Normal)
#raw 0x38 = Slide Right (Normal)
#raw 0x39 = Slide Down (Fast)
#raw 0x3A = Slide Up (Fast)
#raw 0x3B = Slide Left (Fast)
#raw 0x3C = Slide Right (Fast)
#raw 0x3D = Slide Running on Right Foot (Down)
#raw 0x3E = Slide Running on Right Foot (Up)
#raw 0x3F = Slide Running on Right Foot (Left)
#raw 0x40 = Slide Running on Right Foot (Right)
#raw 0x41 = Slide Running on Left Foot (Down)
#raw 0x42 = Slide Running on Left Foot (Up)
#raw 0x43 = Slide Running on Left Foot (Left)
#raw 0x44 = Slide Running on Left Foot (Right)
#raw 0x46 = Jump Facing Left (Down)
#raw 0x47 = Jump Facing Down (Up)
#raw 0x48 = Jump Facing Up (Left)
#raw 0x49 = Jump Facing Left (Right)
#raw 0x4A = Face Player
#raw 0x4B = Face Against Player
#raw 0x4C = Lock Sprite Facing
#raw 0x4D = Release Sprite Facing
#raw 0x4E = Jump Down
#raw 0x4F = Jump Up
#raw 0x50 = Jump Left
#raw 0x51 = Jump Right
#raw 0x52 = Jump in Place (Facing Down)
#raw 0x53 = Jump in Place (Facing Up)
#raw 0x54 = Jump in Place (Facing Left)
#raw 0x55 = Jump in Place (Facing Right)
#raw 0x56 = Jump in Place (Facing Down/Up)
#raw 0x57 = Jump in Place (Facing Up/Down)
#raw 0x58 = Jump in Place (Facing Left/Right)
#raw 0x59 = Jump in Place (Facing Right/Left)
#raw 0x60 = Hide Sprite
#raw 0x61 = Show Sprite
#raw 0x62 = Exclamation Mark (!)
#raw 0x63 = Question Mark (?)
#raw 0x64 = Cross (X)
#raw 0x65 = Double Exclamation Mark (!!)
#raw 0x66 = Happy (^_^)
#raw 0xFE = End of Movements


Before we look at the movements in a different view, I should explain the layout of the movements at the pointer. It's set out in a similar way to a message. We have #org @pointer first and what's being written to the ROM below that. You put #raw, then the movement that you want. You have to put #raw 0xFE at the end of the movements, or else the movements won't work.
Now, we're going to look at waitmovement and pause.
waitmovement is one of the best commands that you will ever find. It's the "perfect pause"! When used as waitmovement 0x0, it will wait for the exact amount of time that it takes for the movements to move the sprite. Really helpful, isn't it?
Now, we have pause. pause will wait for a set amount of time. You have to add the amount that it will wait for. If you want to calculate pause time vs. seconds, here's a (not very good) conversion thingy:
0x20 Pause time = approx. 1 sec. real time
I don't use this very often. I prefer to use waitmovement almost all of the time.

Okay now, no more sidetracking. Let's look at the movements. Let's look at the script without anything but the applymovements, pause and waitmovements. This leaves us with this:
#dynamic 0x800000

#org @start
applymovement 0x04 @move
waitmovement 0x0
applymovement 0xFF @move2
pause 0x30
applymovement 0x04 @move3
applymovement 0xFF @move3
waitmovement 0x0
release
end

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

#org @move2
#raw 0x03
#raw 0xFE

#org @move3
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFEThe first two applymovements are in a completely normal setup.
ie. applymovement 0xXX @YYYYYY
waitmovement/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, or however many you want in a "group". I think that's all there is to the applymovement command.

Now we can move onto that playsong.
When we script playsong, we need a few bytes to get it to work. Here's a short summary of what we need:
playsong [song #] 0x0
That 0x0 is a buffer. We need it in order for the command to work.
Whatever game you're hacking, you can find the song numbers in A-Map.

Now we have fadesong. What's that do? It's set up similar to playsong and will fade into the sound displayed. If you want more detail on how it works, just refer back to playsong. The only thing different is that it does not need that extra buffer.

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? In one script, we can check if a flag was set in a different script. In this section, we check if the Pokemon menu has been activated before the script will end (@done).

Okay. Compile the script, assign it to a script tile (green with an S) and not a person.
Now test it in the ROM. Then look at this spoiler.
Didn't work, did it? Froze on the spot. You're going to need to change this...

http://files.domoreaweso.me/before%20change.jpg

to this....

http://files.domoreaweso.me/after%20change.jpg

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

So, what's next?
Countpokemon

I'm not going to show just one script. There's too much to explain in just one script.
Here's the most basic example.
countpokemon
compare 0x800D 0x6
if 0x1 goto @continueThis is the most basic form.
Before I explain this fragment of a script, I should go into a little more detail on the command countpokemon itself.
countpokemon checks how many Pokemon are in your party and assigns the value to 0x800D. If we have six Pokemon in our party, it would assign 0x06 to 0x800D, and if we had 3 Pokemon in our party, it would assign 0x03 to 0x800D.
Now back to that part of a script.
compare 0x800D 0x6 checks to see if there are six Pokemon in the player's party. Then, with if 0x1 goto @continue, it says, "if there are six Pokemon in your party, go to @continue".
That's the simplest and easiest form of countpokemon.

I'll add one more example just to help the information sink in.
countpokemon
compare 0x800D 0x2
if 0x1 goto @continueIn this example, it checks if you have two Pokemon. If you have a number of Pokemon other than two, the script won't continue to @continue.
Trainerbattle 0x0

Just a simple trainerbattle script:
#dynamic 0x800000

#org @start
trainerbattle 0x0 0x001 0x0 @before @after
msgbox @beaten 0x6
release
end

#org @before
= Go, all my PIKACHUs!

#org @after
= Nooo! My PIKACHUs!!!!!

#org @beaten
= My PIKACHUs can be used to\ncharge my Nintendo DS Lite.t
rainerbattle is a battle with a trainer. trainerbattle is great because the game keeps track of whether you have beaten a trainer or not. In this script, we have no need for a checkflag/setflag situation.
Now to explaining these values after the trainerbattle. These are:
trainerbattle 0x0 [Type of battle] 0x001 [Trainer ID] 0x0 [Reserved Byte (normally 0x0)] @before [Pointer to Message When Seen] @after [Pointer to Winning Message]
I guess I'll explain the type of battle. This byte determines whether it's a double battle, Gym Leader Battle, or another type. A normal trainerbattle is 0x0. The trainer will "see you", then go to the beginning message, then the battle, and then goes to the message when you win.
Now we'll move onto the Trainer ID. This is the ID of a trainer that's found in PET. For example, Brock can be found with with a Trainer ID of 0x19E, and Blaine can be found with 0x1A3.
Now, there are two pointers, @before & @after. I've labeled these to help display what they are used for. The first pointer, @before, shows the pointer to the message displayed before the battle.
Now onto @after. It's the pointer to the message after the battle, obviously! This message appears while we are still in the battle itself. Remember the colors that were mentioned towards the beginning of this tutorial? Well, we can use colors with this too! They're different, though. Sadly, I don't have a list for those values.

Now, if I were to test it in a ROM, what would happen after the trainerbattle? Nothing. The script ends. So why do I have a msgbox after it?
Remember how I talked about trainerbattle keeping track of whether you have beaten them or not? Well, once you beat the trainer, the trainerbattle will be skipped, so when you speak to them after beating them in a battle, it'll be treated like a normal message script.
Wait! Why don't I have a lock and faceplayer after the trainerbattle? The reason is that once you have beaten that trainer, trainerbattle will also 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 in-game trainer battle? I bet your answer is no.
You'll need to fill in these boxes:

http://files.domoreaweso.me/trainerbattle.jpg
Trainerbattle 0x1

#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x820
if 0x1 goto @done
msgbox @2 0x6
trainerbattle 0x1 0x001 0x0 @before @after @later
end

#org @before
= Show me what ya got!

#org @after
= What the-?

#org @later
msgbox @3 0x6
fanfare 0x13E
msgbox @4 0x4
waitfanfare
closeonkeypress
msgbox @5 0x6
giveitem 0x147 0x1
setflag 0x820
release
end

#org @done
msgbox @1 0x6
release
end

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

#org @2
= Welcome to Pewter City Gym.\nYou want to challenge me?

#org @3
= Congratulations!\pFor beating me, you get\nthis badge!

#org @4
= \v\h01 recieved a badge!

#org @5
= 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 and the “View radius” box doesn't need to have a value in it.
This script is a little longer than the previous trainerbattle script.
You'll see that the "0x0" from the previous script has become a "0x1." There's also a third pointer.
If the “Battle type” box says "0x1", 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 the third pointer doesn't go to a message! It points to @later. It's a separate part of the script. This is where the script continues after you've won the battle.
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 trainer card.
I think that's about all I need to add on trainerbattles.
Warp

I think I'm at the stage in this tutorial where I don't need to show an example script for 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 or location. warp is used like this:
warp [map bank] [map number] [warp number] [extra, for now] [extra, for now]
Let's say we wanted to warp to the door of Oak's Lab in Pallet Town.
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 should 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 say "Event Number: 2" on an unmodified Pallet Town. Now, we have our three values.
Now, we write our warp command.
warp 0x3 0x0 0x2 0x0 0x0There's our warp! The only thing is, there's a problem with warping. Once you use warp, the script ends. You're probably saying, "How come when Prof. Oak takes you to his 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


#dynamic 0x800000

#org @start
msgbox @1 0x6
warp 0x4 0x1 0xFF 0x02 0x06
end

#org @1
= I'm going to teleport you\nto your 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.
Well, this should warp you straight to your bed in your room. This is in map PALLET TOWN (4.1). So, what's the 0xFF for? The 0xFF is what tells the command that it's going to warp to a certain position. What are the last values for?

Let's look at the locations of the bed in your room. The values are: (X=2) (Y=6). They are actually 02 & 06. Now, just plug the numbers into the script.
It's that simple! We can now warp to a certain position.
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.
This is how we set up our setweather command:
setweather [weather type, 2 bytes]
A list of the different weather types is in A-Map.
If we wanted to have rainy weather, we would have:
setweather 0x3
doweather is used to activate the weather. So let's show a script to display these in use:
#dynamic 0x800000

#org @start
checkflag 0x200
if 0x1 goto @next
setweather 0x3
doweather
setflag 0x200
release
end

#org @next
setweather 0x2
doweather
clearflag 0x200
release
endThere is also one more somewhat useful command: resetweather.
This command will prepare the game to return back to its default map weather. Since this only prepares the ROM for it, it still must be followed by doweather.
Pokemart

Here's a basic script showing the pokemart command. By now, you should be able to add to it pretty easily:
#dynamic 0x800000

#org @start
lock
faceplayer
pokemart @values
release
end

#org @values
#raw word 0x1
#raw word 0x2
#raw word 0x3
#raw word 0x4
#raw word 0x5
#raw word 0x6
#raw word 0x7
#raw word 0x8
#raw word 0x9
#raw word 0xA
#raw word 0xB
#raw word 0xC
#raw word 0x13
#raw word 0x14
#raw word 0x0Well, here we have the pokemart command. It's simply followed by a pointer. This will point to the values of the items that will appear in the PokeMart screen. The #raw words are set up differently. They're set up like this:
#raw word 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 did I put #raw word 0x0 at the end if there isn't an 0x0 item? 0x0 marks the end of the item line. Without this, the command will NOT work.
#raw's

I think I should go into a little detail on these. When we script in #raw, we're just scripting in hex. Here's an example script:
#dynamic 0x800000

#org @start
#raw 0x6A
#raw 0x5A
#raw 0xA4 0x01 0x00
#raw 0xA5
#raw 0x6C
#raw 0x02This script in XSE language would appear like this:
#dynamic 0x800000

#org @start
lock
faceplayer
setweather 0x1
doweather
release
end
Hidesprite and Showsprite

hidesprite is the command that we covered a little in detail earlier. We used it like this: hidesprite 0x800F . It makes the last person we talked to disappear. But what if we wanted a certain person to disappear?
A common mistake is confusing the People ID with the Event ID. Make sure you get the People ID. This is how you set out the command:
hidesprite 0x(people no.)
So let's use an example: People ID. = 4. Here's how it will appear:
hidesprite 0x04
One more: People ID = 12.
hidesprite 0x0C
By now, you should have a pretty good understanding of the hidesprite command, so let's move onto showsprite.

showsprite can make an OW re-appear once it has been hidden with hidesprite.
showsprite is set out in the exact same way as hidesprite.
Here's some complimentary examples from when I explained hidesprite:
Example 1. People No. = 4.
showsprite 0x04
Example 2. People No = 12.
showsprite 0x0C
If you remember back to wildbattle, you'll see that you need to use setflag to keep the person hidden. If we wanted to keep them viewable after using showsprite, we would need to use clearflag.



Giveegg

giveegg is a relatively simple command to use. All we need is to add the Pokemon species number after it.
As an example, let's give a Pikachu Egg. Pikachu's Pokemon number is 25. Converting that to hex gives us 0x19.
Our giveegg command would appear like this:
giveegg 0x19Just in case you need some more explanation, let's use Treecko as an extra example. Treecko is number 277. Converting it to hex gives us 0x115. Our line appears like this:
giveegg 0x115Pretty easy, huh?
Textcolor
We have three useful colors here:


Blue = 0x00
Red = 0x01
Black = 0x02

Since they're short, I'll show examples of all three of them:
Black Text
#dynamic 0x800000

#org @start
lock
faceplayer
textcolor 0x02
msgbox @1 0x6
release
end

#org @1
= This is black text.

Blue Text
#dynamic 0x800000

#org @start
lock
faceplayer
textcolor 0x00
msgbox @1 0x6
release
end
#org @1
= This is blue text.Red Text
#dynamic 0x800000

#org @start
lock
faceplayer
textcolor 0x01
msgbox @1 0x6
release
end

#org @1
= This is red text. Setmaptile

I'll show a script and explain it for this one:
#dynamic 0x800000

#org @start
setmaptile 0xA 0xD 0x1 0x0
special 0x8E
release
endNice and short. setmaptile is set out like this:
setmaptile [X Coordinate] [Y Coordinate] [Tile Number] [Movement allowed?]
So in my short script, we have:
X Co-ordinate = 10 or 0xA
Y-Co-ordinate = 13 or 0xD
Tile = Normal Grass (in tileset 0 [Fire Red]) or 0x1
Movement Allowed = Yes or 0x0

We can find our X and Y coordinates in Advance-Map, which has been shown earlier. We can also find our tile number in Advance-Map. The number also depends on what tileset we are using. 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 checktrainerflag.
Second is cleartrainerflag.
Last is is settrainerflag.
All three commands are set out in the same way:
[command] [PET ID]
For all three examples, I'm going to use the trainer "Leader Brock", with a PET ID of 0x19E.
Now let's work with checktrainerflag. 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 0x800D. Here's an example:
checktrainerflag 0x19E
compare 0x800D 0x1
if 0x1 goto @alreadybattledPretty 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 cleartrainerflag. Again, we'll be using Brock for the example:
cleartrainerflag 0x19EThat's it. If were supposed to battle Brock, we couldn't battle him anymore. The trainerbattle is disabled.
But if we want to re-enable the trainerbattle what command do we use? settrainerflag! I'm still using Brock.
settrainerflag 0x19EThe trainerbattle 0x19E has now been re-enabled.
Checkitem/removeitem

These are probably easier to view through an example:
#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @1
boxset 0x5
compare 0x800D 0x1
if 0x1 goto @check
msgbox @2 0x6
release
end

#org @check
checkitem 0xD 0x1
compare 0x800D 0x1
if 0x4 goto @got
msgbox @2 0x6
release
end

#org @got
removeitem 0xD 0x1
giveitem 0x4 0x1
msgbox @3 0x6
release
end

#org @1
= Would you like to trade this\nPOKE BALL for your POTION?

#org @2
= Oh. That's too bad.
#org @3
= Yay! Thanks a lot!We've got a few new things here. We've got:


checkitem 0xD 0x1
if 0x4 goto @pointer
removeitem 0x4 0x1

I'll start at the top of my list.

if 0x4 goto @pointer is different. Why have I used 0x4 instead of 0x1?
Other than what we have here, we can also use values, like 0x1, 0x2, 0x3 etc. I'll propose a "table".
Lower Than (0x0)
Equals (0x1)
Greater Than (0x2)
Lower than or Equal to (0x3)
Greater than or Equal to (0x4)
Not exactly equal to (0x5)Now we can see what each value represents.

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. checkitem is scripted like this:
checkitem [amount of item]As an example, let's say we want to check for 10 MASTERBALLs. It would appear like this:
checkitem 0x1 0xA
compare 0x800D 0x1
if 0x4 goto @gotI haven't explained the compare yet, have I? This compare checks for "Yes, you've got the item (0x1)" or "No, you don't have the item (0x0)"
By now, you should be able to tell what the if should do.

Now, we go into removeitem. Obviously, it removes an item from your bag. It's set out in the same way as giveitem and checkitem.
removeitem [item number] [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. We will use this more and more often as we progress through the tutorial.
Here's the explanation:
Let 0x8008 be "A" and 0x800D be "B"
copyvar 0x8008 0x800DVariable "B" copies onto variable "A".
I know that it's backwards, but that's just the way that copyvar is.
Pretty easy, don't you think?
Copyvarifnotzero

This is what some might call a little "add-on" to the copyvar command. The name says it all, doesn't it? It says, “copy variables, if not equal to zero”.
copyvarifnotzero 0x800D 0x8004That's about it. Pretty basic, don't you think?
Setvar

Setvar is a pretty simple command with a wide range of uses. It sets a certain value, ranging from 0x0 to 0xFFFF, to a certain variable, which is basically a number which is kept in memory and persists through saves. Think of them like flags that can be set to whatever number you want instead of just on and off.
The command is written like this:
setvar 0x[variable] 0x[value]Here's just a sample view of how the command appears:
setvar 0x8008 0x1If it's still hard to think about, try thinking of it as a msgbox @(text) 0x5. 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.

IMPORTANT: Make sure to always use variables between 0x4011 and 0x40FF. If you don't, then anything could happen to your game, ranging from Bad EGGs in your players' PC boxes to a deleted save file.
Random

With this command, the ROM will choose a random number within the range of 0x0 to the value you set with the argument, and then assign it to 0x800D. Here's a little example:
random 0x03
compare 0x800D 0x0
if 0x1 goto @option1
compare 0x800D 0x1
if 0x1 goto @option2
compare 0x800D 0x2
if 0x1 goto @option3That should be about it. I'll show an extra example if you need it, but I shouldn't need to explain any more:
random 0x0A
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 @10That should be about it.
Special2

I'll show an example script fragment. This is a "checkpokemon" only usable for Fire Red.
setvar 0x8004 0x19
special2 0x800D 0x17C
compare 0x800D 0x1
if 0x1 goto @haveFirst, we assign the value to the variable 0x8004. Using this command, the 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, 0x1 is assigned to the variable, which in this case is 0x800D. If it's not in our party, 0x0 is assigned to the variable.
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 to help you:
This compare checks for "Yes, you've got the item (0x1)" or "No, you don't have the item (0x0)"
By now, you should be able to tell what the if should do.
There you go. Lesson 1 on setvar and special2 under your belt.
Special, Part 2

We're adding to the special command. Well, not really. I'm just going to tell you about the waitstate command.
Let's just use special 0x9D, which in Fire Red, shows the "Old Man Catches Weedle" scene. Look at how we're going to use it:
special 0x9D
waitstateSimple as that. No arguments, just waitstate.
Movesprite

This will obviously move a sprite from one place to another instantaneously.
It's set out like this:
movesprite [People Number] [X coordinate to move sprite to] [Y coordinate to move sprite to]The people number is the same as it has been since the beginning of this tutorial.
The X coordinate is the X coordinate of the tile that we want to move the overworld sprite to.
Obviously, the Y coordinate is the Y coordinate of the tile that we want to move the overworld sprite to.
Here's just a simple example of the command. We'll use People number = 4; X co-ordinate = 12; Y co-ordinate = 5.
movesprite 0x4 0xC 0x5If you want another example, here's one with People Number = 9; X coordinate = 3; Y coordinate = 10.
movesprite 0x9 0x3 0xAThat's all there is to it!
Setvar Lesson 2

I'll show an example of this command that thethethethe used in his hack, Legend of Dragons. It's actually three scripts.
Script 1, right tile
#dynamic 0x800000

#org @start
setvar 0x4003 0x2
goto 0x8017CC
end

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

#org @left
applymovement 0xFF @move
applymovement 0x08 @move4
waitmovement 0x0
applymovement 0xFF @move3
goto @cont
end

#org @middle
applymovement 0xFF @move
applymovement 0x08 @move5
waitmovement 0x0
applymovement 0xFF @move3
goto @cont
end

#org @right
applymovement 0xFF @move
applymovement 0x08 @move2
waitmovement 0x0
applymovement 0xFF @move3
goto @cont
end

#org @cont
msgbox @1 0x5
compare 0x800D 0x1
if 0x1 goto @100
msgbox @2 0x6
goto @100
end

#org @100
msgbox @3 0x5
compare 0x800D 0x1
if 0x1 goto @101
msgbox @4 0x6
goto @102
end

#org @101
msgbox @5 0x6
goto @102
end

#org @102
setflag 0x20A
setflag 0x20B
applymovement 0x08 @move6
waitmovement 0x0
hidesprite 0x08
release
end

#org @done
release
end

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

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

#org @move3
#raw 0x04
#raw 0xFE

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

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

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

#org @1
= [blue_fr]I 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
= [blue_fr]Too bad. I'm going to tell\nyou anyway.

#org @3
= [blue_fr]Unfortunately, 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
= [blue_fr]Well, you have no choice\nin this.

#org @5
= [blue_fr]I'll meet you at the front\nof the room.

Script 2, middle tile
#dynamic 0x800000

#org @start
setvar 0x4003 0x1
goto 8017CC
end

Script 3, left tile
#dynamic 0x800000

#org @start
setvar 0x4003 0x0
goto 0x8017CC
endYou'll see that at the beginning of every script is this:
#dynamic 0x800000

#org @start
setvar 0x4003 0x[value]
goto @pointer
endWhat we're doing here is we are assigning a certain value depending on which tile we stand on that we will be able to call upon later.
I'll explain the goto a little later. But for now, let's look at what's in Script 1 under @script. We've got the usual checkflag 0x[flag] to prevent the event from repeating itself.
Now, we've got some compare lines:
compare 0x4003 0x0
if 0x1 goto @left
compare 0x4003 0x1
if 0x1 goto @middle
compare 0x4003 0x2
if 0x1 goto @rightThe pointers give away what they're there for, don't they? They're saying, “depending on which value was set, go to a different set of movements”. This is a great way to save space, and instead of compiling that big ugly script 3 times, with slightly altered movements, we can compile that jumbo script once, and then we have two clean scripts. Also, a variable's 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, which were the beginnings of scripts 1, 2 and 3.
Look at the similarities between each one:
#dynamic 0x800000

#org @start
setvar 0x4003 0x0
goto 0x8017CC
end#dynamic 0x800000

#org @start
setvar 0x4003 0x1
goto 0x8017CC
end#dynamic 0x800000

#org @start
setvar 0x4003 0x2
goto 0x8017CC
endObviously, 0x8017CC is @script. How did I get that pointer?
Let's compile Script 1 into the ROM. After it's been burnt to the ROM, we should see a list of the different names of the pointers.
We should have something like this:
[I]@start 8007E6
@script 80083C
@done 80086D
@left 80089E
@middle 8008CF
...etc....
We need to take that pointer that is after @script. That is our pointer that we will use with Scripts 2 and 3.
If I were to use these pointers as an example, my Script 2 would be something like this:
#dynamic 0x800000

#org @start
setvar 0x4003 0x2
goto 0x80083C
endI'd say that's all on setvar.... for now.
Resetvars

This command doesn't reset every variable, just 0x8000, 0x8001 and 0x8002.
It's just command resetvars. It doesn't need any extra arguments. All it needs it this:
resetvars
Money Commands

This is a pretty big section, so I'll split it up into 6 sections for each of the money related commands.


givemoney
paymoney
checkmoney
showmoney
hidemoney
updatemoney

I'll explain them in the order they were listed.
Givemoney

The name gives it away. This command will give the player a designated amount of money. The command is set out like this.
Let XX be the money value:
givemoney [XX] 0x00
The final 0x00 actually determines whether it updates your money account. If it were changed to 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.
Here's our line of code:
givemoney 0x2710 0x00You should be able to understand what's happening. I'll give another example, just in case you need it:
Money amount = 500 [hex = 0x1F4]
givemoney 0x1F4 0x00]I'd say that's enough information on givemoney.
Paymoney

Like givemoney, the name gives the function away. This command takes money from the player.
The command is set up in an almost identical manner to givemoney. I'll show the setup again, just in case you forgot already:
Let XX, be the money value:
paymoney [XX] 0x00
The final 0x00 has the same function as what it does with givemoney.
Just in case you wanted it, here's an example:
Money amount = 600 [Hex = 258]
paymoney 0x258 0x00Ta-dah! You've now learned the givemoney and paymoney commands.
Checkmoney

This command, obviously, checks if your account for a designated amount of money. It's set up in the same way as the previous two commands, but there is a difference. I'll show you how it's set up.
checkmoney [XX] 0x00
Looks the same, doesn't it? That's because it is exactly the same. The difference is that the reason for the 0x00 at the end is for something different than the other two.
0x00 means "Check Money account", and 0x01 would mean "Don't check Money account", so if you were to use 0x01, it would defeat the purpose of the command.
Now, how do we check 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
checkmoney 0x3E8 0x00
compare 0x800D 0x1
if 0x4 goto @continue
msgbox @notenough 0x6Just in case you feel that you need another example, here's one more:
Conditions:
Money amount = 20,000 [Hex = 4E20] ;
Need less than 20,000 to continue in script
checkmoney 0x4E20 0x00
compare 0x800D 0x1
if 0x0 goto @continue
msgbox @toomuch 0x6 Showmoney

This breaks away from the style that the other money commands are written in. It's set out like this:
showmoney [X coordinate] [Y coordinate] 0x00 Okay. The first byte is showmoney, obviously, followed by the X coordinate and the Y coordinate on the screen. Personally, I just the co-ordinates (0,0). I think that by now you can just trust me and just use 0x00 for that last byte. There's a reason, but if you remember the reasons for the previous commands, just use the 0x00.
Here's a little example of what how it is set out:
X and Y co-ordinates - (0,0)
showmoney 0x00 0x00 0x00This box will appear in the top left hand corner of the screen.
Hidemoney

This one is also different from the rest of them. This command is set out like this:
hidemoney [X coordinate] [Y coordinate]The second and third arguments 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 hidemoney line would appear like this:
hidemoney 0x00 0x00Nice and simple.
Updatemoney

This is the last money command. It's simply set out like this:
updatemoney [X-Co-ordinate] [Y-co-ordinate] 0x00 Like the hidemoney command, the X & Y co-ordinates need to compliment the co-ordinates of the showmoney. Well, I'll just show an example, I guess.
updatemoney 0x00 0x00 0x00I guess now I can move onto some different commands now.
Addvar

The name says it all. It says "Add to Variable". Before I explain what it does, I'll show you how it's set out.
addvar [Variable] [Value]
addvar 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 variable 0x4036 already has the value 0x1 stored into it, and we want to add 0x3 to it to make it 0x4.
I'll put it into an example:
setvar 0x4036 0x1
addvar 0x4036 0x3That'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 addvar:
subvar [Variable] [Value]Since it's just the opposing function to addvar, I think I can just go straight through to the example:
setvar 0x4004 0x6
subvar 0x4004 0x03In the example, it takes 0x3 from what is stored in the variable 0x4004.
Lockall

It's just lockall. There's no other arguments. It's used when you want to lock all the people in the map, instead of locking just the person you're talking to. It's pretty useful.
Showpokepic

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:
showpokepic [Pokemon No.] [X coordinate] [Y coordinate]We obviously need to begin with the command. Then, it's followed by the Pokemon number, which needs to be in hex. This is then followed by the X and Y coordinates of where you want the image of the Pokemon to appear. Here's a little example to help clarify things:
Conditions:
Pokemon = Dratini
Coordinates = (10,3) Center of Screen.
showpokepic 0x93 0x0A 0x03I'd say that's about it for now, but I'll show a bigger example in the next section.
Hidepokepic

Without using this, your showpokepic box will remain open until you leave the map.
The command is just hidepokepic. There's no need for any arguments.
Well, here's an example of the two commands combined in a fragment of a script.
showpokepic 0x01 0x0A 0x03
msgbox @1 0x5
compare 0x800D 0x1
if 0x1 goto @seen
hidepokepic
msgbox @2 0x6
..... .....etc.

#org @seen
hidepokepic
msgbox @3 0x6
......... .........etc.

#org @1
= Have you seen this Pokemon?

#org @2
= That's too bad.

#org @3
= That's cool. I wish I could\nsee it.The hidepokepic just closes the pokepic box.
Door Commands
There are three door related commands.


setdooropened [prepare to open door]
setdoorclosed [prepare to close door]
doorchange [activate door animation]


I guess we'll start with setdooropened.
Setdooropened
Obviously, this opens doors on a map. It's set out like this:
setdooropened [X coordinate] [Y coordinate]Here's an example. Oak's Lab's Door in Pallet Town's coordinates are (10,0D).
setdooropened 0x10 0x0DSo 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.
Doorchange
This command needs to follow both setdooropened and setdoorclosed. Without this command following, they don't work. This command doesn't need any arguments. Here's an example, with the setdooropened command:
setdooropened 0x10 0x0D
doorchange Setdoorclosed
It's set out in the same way as the setdooropened command. I'll show you the set-up again, just in case you've already forgotten. setdoorclosed [X coordinate] [Y coordinate]I'm going to show an example using all three commands:
setdooropened 0x10 0x0D
doorchange
applymovement 0xFF @move
waitmovement 0x0
setdoorclosed 0x10 0x0D
doorchange
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. Here's a list of the different commands:


checkcoins
givecoins
removecoins
showcoins
hidecoins
updatecoins

I'll work my way from the top down, I guess.
Checkcoins
This is a pretty simple command, and isn't as difficult or as long as checkmoney. It checks to see if you have a certain amount of coins. It's set out like this:
checkcoins [Amount] Here's a short little example:
Check for 3000 coins; if higher than, continue
checkcoins 0xBB8
compare 0x800D 0x1
if 0x4 goto @continue Givecoins/removecoins

Since they have similiar aguments, I thought I'd put these two together.
This is how they are set out:
[command] [Amount]
I guess I'll give an example of both so we can move onto the other three commands:
givecoins
Give 1000 coins
givecoins 0x3E8
removecoins
Take 1000 coins
removecoins 0x3E8 Showcoins

This command will display a little box with your coin count. It's set out in a similiar way to showmoney, except you drop off the last argument. This is how the command is set out:
showcoins [X Coordinate] [Y Coordinate]As an example, the co-ordinates (0,0) will appear like this:
showcoins 0x00 0x00Not hard, is it?
Hidecoins

Obviously, this command hides the coin counter that was brought up with the showcoins command. It's set out in the same way as showcoins, but if you want to see it again, here it is:
hidecoins [X Coordinate] [Y Coordinate]Just remember that without this command, the counter will remain until the map is reset.
Updatecoins

Of course, this will update the coin counter and show any changes within your "coin balance". How's this set out? I bet you would be able to guess correctly. It's set up the same way as the showcoins and hidecoins, and just for the heck of it, I'll show the example again.
updatecoins [X Coordinate] [Y Coordinate]Here's what I promised. I'll make it a little bigger than what I normally do. I shouldn't have to explain this script because you should be able to understand it:
showcoins 0x00 0x00
givecoins 0x3E8
updatecoins 0x00 0x00
msgbox @1 0x5
compare 0x800D 0x1
if 0x1 goto @begin
hidecoins 0x00 0x00
msgbox @2 0x6
release
end

#org @1
= Is there anything else?

#org @2
= Thank you! Please come\nagain!There! I've used four of the six commands in a few lines of one script.
Displaying Names/Values

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.
Here's a list of the commands that we will go over.


bufferpokemon
bufferfirstpokemon
bufferitem
bufferattack
buffernumber

Like always, I'll start at the top and work my way down.
Bufferpokemon

With this, we will assign a certain Pokemon's name to a \v\hXX variable.
It's set out like this.
bufferpokemon [buffer#] [PKMN Number]We have to subtract two from the end of the and use that number.
Here's an example. We're going to assign Charizard's name to [buffer1].
bufferpokemon 0x00 0x06
msgbox @1 0x6
release
end

#org @1
= How is [buffer1]?[/code]Nice and basic. Just in case you want a second example, I'll 'chuck' one more below.
Pokemon = Chikorita; Storing to? = \v\h03
bufferpokemon 0x01 0x98
msgbox @1 0x6
release
end

#org @1
= How's \v\h03 going? Bufferfirstpokemon

This command is set out a little differently to the one above. We just set it out like this:
bufferfirstpokemon [buffer#]There's just two bytes needed for it to work.
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 the party's name to [buffer1].
bufferfirstpokemon 0x00
msgbox @1 0x6
.... ....

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

It's set out in the exact same way that bufferpokemon is, but it's still worth showing. In case you've forgotten how bufferpokemon was set out, here's how bufferitem is set out.
bufferitem [buffer#]
Since there really isn't too much need for a second explanation, I'll move straight into the example:
bufferitem 0x00 0x04
msgbox @doyou 0x5
.... .... ....

#org @doyou
= Do you have any [buffer1]s?Notice how I've added "s" straight after [I][buffer1]. If you don't know why, it's so that the message will appear like this:
Do you have any POKe BALLs?
Bufferattack

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

Now I guess I could jump into an example now, couldn't I?
bufferattack 0x00 0x13B
bufferpokemon 0x01 0x06
msgbox @1 0x5
... ...

#org @1
= Can [buffer2] use [buffer1]?I just thought I'd make it a little more confusing.
The message actually says:
Can Charizard use Overheat? Buffernumber

This is just used to display a number stored in a variable. It's set up like this:
buffernumber [buffer#] [Variable]
The downside of this command is that it can only display numbers from 0-65535 [Hex = 0x0 - I'll show an example. We're going to put the number 50000 in [buffer1].
setvar 0x800D 0xC350
buffernumber 0x00 0x800D
msgbox @1 0x6
.... .... ....

#org @1
= Account Balance: \hB7: [buffer1]That's all there is to it.
Msgboxsign

This is a fun little command. This will turn your normal msgbox into a Signpost Box. Here's an example:
#dynamic 0x800000

#org @start
msgbox @1 0x6
msgboxsign
msgbox @1 0x6
msgboxnormal
msgbox @1 0x6
release
end

#org @1
= Test.Try this in a ROM.
The first message should appear as a normal boxset 0x6. But when we used msgboxsign, our second boxset 0x6 became a signpost box. But what's this msgboxnormal doing here? msgboxnormal converts the box back into a normal boxset 0x6. 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 explanation
[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 XSE language:
#dynamic 0x800000

#org @start
callasm 0x71B771
wildbattle 0x82 0x1E 0x0
special 0x138
pause 0x101
callasm 0x71B771
endwith a bit more of an explanation.
He's called the ASM function twice: once to turn it on, and once to turn it off.
I think he's explained everything else.
Getplayerpos

getplayerpos can be used to store the player's X and Y positions on the map into designated variables.
The command is set out like this:
getplayerpos [xxxx] [yyyy]
xxxx: Variable for x position
yyyy: Variable for y positionHere's an example. With this, we'll store the Player's X Position to 0x4000, and the Player's Y position into 0x4001.
....
getplayerpos 0x4000 0x4001
.... Repeattrainerbattle

This is a simple command that will begin the Last Trainer battle commenced. It's done simply with command repeattrainerbattle.
We can easily use this in a script by simply doing:
repeattrainerbattle Releaseall

This command is used as the opposite to 'lockall''. This command will release all sprites on the current map.
Here's how it can be used:
releaseall Waitkeypress

This command can be used as a pause. The command waitkeypress is used to wait until a key is pressed before it continues.
It's used like this:
waitkeypress It doesn't need any arguments.


Yesnobox

This command is somewhat pointless when there is msgbox @text 0x5. It acts in the same way as 0x5 where when you use compare, yes = 1 and no = 0. Its 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:
yesnobox [xx] [yy]xx: X co-ordinate
yy: Y co-ordinate
In a script, we can use it like this:
msgbox @1 0x4
yesnobox 0x0 0x0
closeonkeypress
compare 0x800D 0x1
if 0x1 goto @yes Multichoice, preparemsg, waitmsg

Yes, it's something people want to use, so here's a brief guide on multichoice 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:
preparemsg 0x161232
waitmsg
multichoice 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 0x1 goto @canceled
endFirst, I'll explain preparemsg. The following four bytes refer to the pointer to text.
waitmsg is similar to closeonkeypress. This command is special and is used with preparemsg to close it.
Now onto the multichoice command. YAY! Well, it's set out like this:
multichoice [xx] [yy] [zz] [aa]xx: X co-ordinate
yy: Y co-ordinate
zz: Multi ID. Refer to Multi List
aa: Determines if B can cancel. 0x0 means B can cancel.
The first two parameters are easy to use. 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. It's for Fire Red, so sorry to Ruby hackers.
[00] - Yes
No
[01] - Eevee
Flareon
Jolteon
Vaporeon
Quit looking.
[02] - Normal
Black
Pink
Sepia
[03] - Hall of Fame
Quit
[04] - Eggs
Quit
[05] - Victories
Quit
[06] - Hall of Fame
Eggs
Quit
[07] - Hall of Fame
Victories
Quit
[08] - Eggs
Victories
Quit
[09] - Hall of Fame
Eggs
Victories
Quit
[0A] - Exit
[0B] - Exit
[0C] - Exit
[0D] - Bicycle $1,000,000
No Thanks
[0E] - Abra 180 coins
Clefairy 500 coins
Dratini 2,800 coins
Scyther 5,500 coins
Porygon 9,999 coins
No Thanks
[0F] - SLP
PSN
PAR
BRN
FRZ
EXIT
[10] - Yes
No
Info
[11] - Single battle
Double battle
Multi battle
Info
Exit
[12] - Yes
No
Info
[13] - Make a Challenge
Info
Exit
[14] - Rooftop
B1F
Exit
[15] - Helix Fossil
Exit
[16] - Dome Fossil
Exit
[17] - Old Amber
Exit
[18] - Helix Fossil
Old Amber
Exit
[19] - Dome Fossil
Old Amber
Exit
[1A] - Fresh Water $200
Soda Pop $300
Lemonade $350
Exit
[1B] - 50 coins $1,000
500 coins $10,000
Exit
[1C] - Excellent
Not So Bad
[1D] - Right
Left
[1E] - TM13 4,000 coins
TM23 3,500 coins
TM24 4,000 coins
TM30 4,500 coins
TM35 4,000 coins
No Thanks
[1F] - 5F
4F
3F
2F
1F
Exit
[20] - Fresh Water
Exit
[21] - Soda Pop
Exit
[22] - Fresh Water
Soda Pop
Exit
[23] - Lemonade
Exit
[24] - Fresh Water
Lemonade
Exit
[25] - Soda Pop
Lemonade
Exit
[26] - Fresh Water
Soda Pop
Lemonade
Exit
[27] - Trade Center
Colosseum
Exit
[28] - Game Link Cable
Wireless
Exit
[29] - Smoke Ball 800 coins
Miracle Seed 1,000 coins
Charcoal 1,000 coins
Mystic water 1,000 coins
Yellow flute 1,600 coins
No Thanks
[2A] - B1F
B2F
B4F
Exit
[2B] - Linked game play
Direct Corner
Union Room
Quit
[2C] - Two Island
Three Island
Exit
[2D] - One Island
Three Island
Exit
[2E] - One Island
Two Island
Exit
[2F] - Trade Center
Colosseum
Berry Crush
Exit
[30] - Nada
Nada
Exit
[31] - Pokemon Jump
Dodrio Berry-Picking
Exit
[32] - Trade Center
Colosseum
Exit
[33] - 2 Tinymushrooms
1 Big Mushroom
[34] - Trade Center
Colosseum
Berry Crush
Exit
[35] - Trade Center
Colosseum
Exit
[36] - Sevii Islands
Navel Rock
Exit
[37] - Sevii Islands
Birth Island
Exit
[38] - Sevii Islands
Navel Rock
Birth Island
Exit
[39] - One Island
Two Island
Three Island
Exit
[3A] - Vermilion
Two Island
Three Island
Exit
[3B] - Vermilion
One Island
Three Island
Exit
[3C] - Vermilion
One Island
Two Island
Exit
[3D] - Vermilion
Exit
[3E] - Blank
Blank
Exit
[3F] - Join Group
Become Leader
Exit
[40] - Single
Double
Knockout
Mixed
Exit
From the example script, you should be able to tell that the selected result from multichoice is stored into the variable 0x800D.
You should be able to see I copied it to variable 0x8000 to see if it would confuse anyone. I hope it didn't. The copyvar was not needed. You can just compare with 0x800D, but by now, 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 top option, 0x1 is the second to the top, and so on until the final option.
Name Pokemon

Here's another working Name Pokemon sequence, although this one will only work if the Pokemon is given into the party and not a PC box. 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. First in line is 0x0. And sixth would be 0x5. Now the script...
countpokemon
compare 0x800D 0x6 'If you have 6 Pokemon, don't continue.
if 0x1 goto @toomany
givepokemon 0x1 0x5 0x0 'Gives a Pokemon
msgbox @2 0x5 'the obligatory, "Would you like to rename....
compare 0x800D 0x1
if 0x1 call @name 'If yes call .... ....'
Who cares about this part?

#org @name
countpokemon 'Counts Pokemon
subvar 0x800D 0x1 'Takes one away from 0x800D. Reason Above.
copyvar 0x8004 0x800D 'copies over to 0x8004 which is used by special 0x166
fadescreen 0x1 'Fades screen to black
special 0x166 'Name Pokemon, Party number at 0x8004
waitstate 'Wait for Special
return 'Returns

#org @toomany
msgbox @1 0x6
release
end

#org @1
= Your party is full.\nPlease deposit one to\nmake room.

#org @2
= Would you like to give a\nnickname to this Pokemon?Hope that helped.
Store Pokemon to Pokedex

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


That was a very extensive and in-detail scripting tutorial. Hope you enjoyed it!
If you see any bugs, feel free to tell me about them.

Tyrantrum
December 26th, 2008, 07:21 PM
This is great! :D

I hope to see more soon.
Thanks Diego~

Vrai
December 26th, 2008, 08:41 PM
It'll definitely help all of the noobies who don't want to convert thethethethe's tutorial into XSE in their head. x3

That aside, it's good work, Diego. Thanks a lot ;)

destinedjagold
December 26th, 2008, 11:14 PM
finally! an XSE tutorial based on thethethethe's pokescript tutorial. I have been waiting for ages for a tutorial. thanks for making this with thethethethe's approval. ;)

also, I disagree with the warp part...
your example there is warp 0x3 0x0 0x2...
why, every time I open a script with a warp command, it has a fifth value, for instance, warp 0xA 0x10 0x2 0xFA9C...?

I wish to know that, even if it has already been answered in the old Script Help Thread...

Also, can you include the usages of nop and nop1, for those commands mess my scripts if I play with No$GBA... :\

anyways, thanks again for this tutorial.

пзо
December 26th, 2008, 11:21 PM
Well for instance, the fith variable would be the X/Y Co-ordinates.
As seen in Thethethethe's Tutorial. Let me add more:

If the Co-ordinates are 03 00.
You Reverse them to 00 30 then, its compatible with the script.
but in XSE i'd think it was 0x0030.

Hope I helped!

iTeruri
December 27th, 2008, 01:25 AM
WOW thanks! Really helpfull. I just needed the heal and trainerbattle explenation that wasn't in the other tutorials. Thanks alot!

Hiche..
December 27th, 2008, 01:31 AM
finally! an XSE tutorial based on thethethethe's pokescript tutorial. I have been waiting for ages for a tutorial. thanks for making this with thethethethe's approval. ;)

also, I disagree with the warp part...
your example there is warp 0x3 0x0 0x2...
why, every time I open a script with a warp command, it has a fifth value, for instance, warp 0xA 0x10 0x2 0xFA9C...?

I wish to know that, even if it has already been answered in the old Script Help Thread...

Also, can you include the usages of nop and nop1, for those commands mess my scripts if I play with No$GBA... :\

anyways, thanks again for this tutorial.

When 0xA 0x10 0x2 0xFA9C, appears when you decompile the script, it's most likely that the command mixed up with the flag you set after it (or even with the release command).
I am not sure, but the warp command posted is wrong. When you try to compile warp 0x3 0x0 0x2, XSE says, "Too less parameter". It needs X/Y co-ordinates.

Example:

#dynamic 0x80000

#org @1
warp 0x3 0x0 0x2 0x1 0x3
setflag 0x1000
end
0x1 is X coordinate.
0x3 is Y coordinate.

Also, this XSE tutorial is very useful, but is explained for the old version of XSE. Like, it should not be:

message @1
boxset 0x2

It should be:

message @1 MSG_FACE or 0x2

The color commands can be set out differently, Like this for example:

White - [white_fr]
Black - [black_fr]
Gray - [gray_fr]
Red - [red_fr]
etc..

Just thought to clarify some things. For XSE now, is updated a lot. :]

liuyanghejerry
December 27th, 2008, 02:18 AM
Year after year,I finally see a full tutroial about XSE!
I can make XSE scripts ,but It's better to have a dictionary like this.It makes me relieved.

HackMew
December 27th, 2008, 02:59 AM
No offense but the updated guide explains basically anything you need to start scripting. Besides some info here is kinda wrong...

Ninja Caterpie
December 27th, 2008, 03:03 AM
:\

Boxsets are no longer boxsets. They're just numbers after a message pointer now.

HackMew
December 27th, 2008, 03:08 AM
:\

Boxsets are no longer boxsets. They're just numbers after a message pointer now.

Yeah, that's just one example. But also flags from 0x200 to 0x2FF aren't that good anyway... If you check the Used Flags section on the guide you'll understand why.
I suggest the author downloading latest XSE and adjusting the whole post to adjust or remove anything that's outdated, wrong or misleading. Thanks in advance.

machomuu
December 27th, 2008, 06:58 PM
Bravo Diego, A very useful tutorial.

iTeruri
December 28th, 2008, 02:30 PM
So how can you keep the sprite hidden with hidesprite? Setting the flag doens't work, if I walk away the sprite pop ups again, even if I set a flag right after the hidesprite command.
What I do is: a person blocks the entrence to a cave, but if you have the first badge he will walk away and and the sprite has to be hidden after that (so the player can enter the cave).

What should I do to make it work?

Edot: Never mind, didn't saw the sentence where you explain it a bit more. It works now.

~Teh Panda~
December 28th, 2008, 11:21 PM
Me very very sorry..
I sent you a visitor message diego

thethethethe
December 28th, 2008, 11:44 PM
Umm thread infringement!

I am sorry but this is a blatant copy of THeTheTheThe's tutorial put in to XSE. WIthout even doing it correcty shame on you, your name should be DiegoIsAThief

Even with credits did you ask him, he said not to take without perm.'s if you did show us a chat log

Just relax a bit. He asked if he could.

cooley
December 29th, 2008, 08:30 AM
Do you even know how to script? I'm just asking...
Anyways, I found a mistake in your "script" the one about giving Pokemon..And that's only because I scrolled upward from the last post

countpokemon
compare 0x800D 0x6
if 0x1 goto @toomany 'If you do have 6 Pokémon then don't give any
givepokemon 0x1 0x5 0x0 0x0 0x0 0x0 'Gives a Pokemon
msgbox @2 0x5 'the obligatory, "Would you like to rename....
compare 0x800D 0x1
if 0x1 gosub @name 'If yes call .... ....'
release 'If it's a person you're talking to, it should return to a release/end
end
Who cares about this part?

#org @name
countpokemon 'Counts Pokemon
subvar 0x800D 0x1 'Takes one away from 0x800D. Reason Above.
copyvar 0x8004 0x800D 'copies over to 0x8004 which is used by special 0x166
fadescreen 0x1 'Fades screen to black
special 0x166 'Name Pokemon, Party number at 0x8004
waitstate 'Wait for Special
return 'Returns

#org @toomany
msgbox @1 0x6
release
end

#org @1
= Your party is full.\nPlease deposit one to\nmake room.

#org @2
= Would you like to give a\nnickname to this Pokemon?
Oh and By the way, XSE uses "msgbox @1 0x6" Not boxset or callstd any more

diegoisawesome
December 29th, 2008, 08:54 AM
Do you even know how to script? I'm just asking...
Anyways, I found a mistake in your "script" the one about giving Pokemon..And that's only because I scrolled upward from the last post

countpokemon
compare 0x800D 0x6
if 0x1 goto @toomany 'If you do have 6 Pokémon then don't give any
givepokemon 0x1 0x5 0x0 0x0 0x0 0x0 'Gives a Pokemon
msgbox @2 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
subvar 0x800D 0x1 'Takes one away from 0x800D. Reason Above.
copyvar 0x8004 0x800D 'copies over to 0x8004 which is used by special 0x166
fadescreen 0x1 'Fades screen to black
special 0x166 'Name Pokemon, Party number at 0x8004
waitstate 'Wait for Special
return 'Returns

#org @toomany
msgbox @1 0x6
release
end

#org @1
= Your party is full.\nPlease deposit one to\nmake room.

#org @2
= Would you like to give a\nnickname to this Pokemon?
Oh and By the way, XSE uses "msgbox @1 0x6" Not boxset or callstd any more
The words, "Who cares about this part?" means that that's the rest of the script.
Thanks for the heads-up, though.

~Teh Panda~
December 30th, 2008, 03:08 PM
Eeeek, sorry man, ok, well just fix up some mistakes to make it 100% XSE sorry lol :)

blkmagic445
January 3rd, 2009, 04:17 PM
wow this tutorial is incredible! i now understand how to script thank you! now if only i knew how to use connection points in advance map lol

cyberzero
January 13th, 2009, 02:45 PM
This was a very helpful tutorial! Good job, thanks for putting in the effort to remake thethethethe's tutorial XSE style!

You mentioned that you'd do level scripts later on, and those are something that I've been having problems with. I haven't been able to find any info on those, I was wondering if you were planning on adding that?

night_demon
January 16th, 2009, 06:13 PM
hey thanks bra, every one says use boxset but u had that other thing i dont wann look right now and now it works thanks man also the whole 0x0 at the end of the msgbox also helped so thanks alot good tutorial im book markign this **** cause no way ima remeber it all

diegoisawesome
January 17th, 2009, 06:56 PM
Here's a link to the Level Script section:
http://www.pokecommunity.com/showthread.php?t=141650

THE TUTORIAL HAS BEEN MEGA-UPDATED! :D :D :D

Surf
January 18th, 2009, 05:07 PM
Also when using the callasm after inserting the shiny data you need to have the offset as the same on that you used.

sab
January 20th, 2009, 03:08 PM
this is the biggst tut I've seen for xse!! It covers tons of stuff!!

Surf
January 20th, 2009, 06:09 PM
Diago you should've explained this more
do you even know half the scripts that your writing?

diegoisawesome
January 20th, 2009, 06:32 PM
Diago you should've explained this more
do you even know half the scripts that your writing?
What do you mean by that?

GFS
January 20th, 2009, 07:17 PM
What do you mean by that?
I think that he means that you don't know what some of the scripts that you have on your tutorial you don't even understand
It certainly looks that way

madarawolf
January 24th, 2009, 08:59 AM
I am having problems scripting with xse. I made the script using this tutorial for a sign and when I go to compile it, it says that there is a missing parameter on line 5 msgbox@sign. So I wondered what that was about.

Full Metal
January 26th, 2009, 12:30 PM
how might one check the pokedex progress?

Mourgrim
January 26th, 2009, 02:24 PM
I must thank you for compiling this guide. I have just started my 'pursuit' in learning how to hack a pokemon game (A friend and I are starting with FireRed) and this tutorial will be a great help.

Thanks to thethethethe, you, and of course HackMew. :)

diegoisawesome
January 28th, 2009, 03:00 PM
how might one check the pokedex progress?
Just inspect the Oak script in FR/LG or the Birch script in R/S/E.

I must thank you for compiling this guide. I have just started my 'pursuit' in learning how to hack a pokemon game (A friend and I are starting with FireRed) and this tutorial will be a great help.

Thanks to thethethethe, you, and of course HackMew. :)

wow this tutorial is incredible! i now understand how to script thank you! now if only i knew how to use connection points in advance map lol

hey thanks bra, every one says use boxset but u had that other thing i dont wann look right now and now it works thanks man also the whole 0x0 at the end of the msgbox also helped so thanks alot good tutorial im book markign this **** cause no way ima remeber it all

this is the biggst tut I've seen for xse!! It covers tons of stuff!!
You're all welcome! :)

I am having problems scripting with xse. I made the script using this tutorial for a sign and when I go to compile it, it says that there is a missing parameter on line 5 msgbox@sign. So I wondered what that was about.
Replace that line with:
msgbox @sign 0x3
And if you have a boxset under that, delete it.

Lyzo
January 28th, 2009, 10:43 PM
First of all: Great that you compiled this :D

But I have a question.... I set a flag in my script, 0x01. It's for a script that i'm testing. When you talk to someone you get something and if you talk to them again you won't get it. That's what the Flag is for. Now when I leave the room where the event happens and come back in, I get the item again... So that must mean that the flag is unchecked again. Why does this happen?

Using FireRed.

EDIT: Nvm... seems that using flag 0x01 doesn't work but other flags like 0x200 do work...

Mourgrim
January 29th, 2009, 02:19 PM
Hello, I've been having some troubles with a script I wanted to start out with. What I want the script to do is:

Yes or no ask if I would like a pokemon
give the pokemon
set flags so it doesn't repeat.

I've tried various different circumstances for this, but everytime something goes wrong. One time, it was in a whole bunch of symbols. Another, it was all placed wrong (even though I used XSE's Text Adjuster) and wouldn't even give the pokemon.

If anyone could offer some help or advice, it'd be greatly appreciated for my first script. :) Thank you.

This is the one that seemed to come closest to working, but still failed.

#dynamic 0x80000

#org @start
checkflag 0x1000
if 0x1 call @given
msgbox @yesno 0x5
compare LASTRESULT 0x1
if 0x1 goto @yes
msgbox @no 0x2
setflag 0x1000
end

#org @given
msgbox @given2
end

#org @yes
countpokemon
compare LASTRESULT 0x6
if 0x1 call @full
givepokemon 0x4 0x4 0x0 0x0 0x0 0x0
msgbox @thanks 0x2
end

#org @full
msgbox @full2 0x2
end

#org @yesno
= Yes or no?

#org @given2
= I gave you it already.

#org @full2
= Your party's full.

#org @no
= Okay.

#org @thanks
= Thanks.

diegoisawesome
January 29th, 2009, 02:32 PM
Hello, I've been having some troubles with a script I wanted to start out with. What I want the script to do is:

Yes or no ask if I would like a pokemon
give the pokemon
set flags so it doesn't repeat.

I've tried various different circumstances for this, but everytime something goes wrong. One time, it was in a whole bunch of symbols. Another, it was all placed wrong (even though I used XSE's Text Adjuster) and wouldn't even give the pokemon.

If anyone could offer some help or advice, it'd be greatly appreciated for my first script. :) Thank you.

This is the one that seemed to come closest to working, but still failed.

#dynamic 0x80000

#org @start
checkflag 0x1000
if 0x1 goto @given
msgbox @yesno 0x5
compare LASTRESULT 0x1
if 0x1 goto @yes
msgbox @no 0x2
setflag 0x1000
end

#org @given
msgbox @given2
end

#org @yes
countpokemon
compare LASTRESULT 0x6
if 0x1 goto @full
givepokemon 0x4 0x4 0x0 0x0 0x0 0x0
msgbox @thanks 0x2
end

#org @full
msgbox @full2 0x2
end

#org @yesno
= Yes or no?

#org @given2
= I gave you it already.

#org @full2
= Your party's full.

#org @no
= Okay.

#org @thanks
= Thanks.
Changes in bold.
filleritup!

Lyzo
January 29th, 2009, 02:35 PM
Hello, I've been having some troubles with a script I wanted to start out with. What I want the script to do is:

Yes or no ask if I would like a pokemon
give the pokemon
set flags so it doesn't repeat.

I've tried various different circumstances for this, but everytime something goes wrong. One time, it was in a whole bunch of symbols. Another, it was all placed wrong (even though I used XSE's Text Adjuster) and wouldn't even give the pokemon.

If anyone could offer some help or advice, it'd be greatly appreciated for my first script. :) Thank you.

This is the one that seemed to come closest to working, but still failed.

#dynamic 0x80000

#org @start
checkflag 0x1000
if 0x1 call @given
msgbox @yesno 0x5
compare LASTRESULT 0x1
if 0x1 goto @yes
msgbox @no 0x2
setflag 0x1000
end

#org @given
msgbox @given2
end

#org @yes
countpokemon
compare LASTRESULT 0x6
if 0x1 call @full
givepokemon 0x4 0x4 0x0 0x0 0x0 0x0
msgbox @thanks 0x2
end

#org @full
msgbox @full2 0x2
end

#org @yesno
= Yes or no?

#org @given2
= I gave you it already.

#org @full2
= Your party's full.

#org @no
= Okay.

#org @thanks
= Thanks.

Okay, nothing much wrong with this script.
You missed a msgbox sort once:
#org @given
msgbox @given2
end

But that's about all the mistakes I could find. I personally don't use call, but I only use goto.

This is how I'd script it:

#dynamic 0x80000

#org @start
lock
faceplayer
checkflag 0x200
if 0x1 goto @given
msgbox @yesno 0x5
compare LASTRESULT 0x1
if 0x1 goto @yes
msgbox @no 0x6
release
end

#org @given
msgbox @given2 0x6
release
end

#org @given2
= I gave you it already.

#org @yesno
= Yes or no?

#org @yes
countpokemon
compare LASTRESULT 0x6
if 0x1 goto @full
givepokemon 0x4 0x4 0x0 0x0 0x0 0x0
setflag 0x200
msgbox @thanks 0x6
release
end

#org @full
msgbox @full2 0x6
release
end

#org @full2
= Your party's full.

#org @thanks
= Thanks.

#org @no
= Okay.


Anyway hope this helped ;)

Mourgrim
January 29th, 2009, 05:05 PM
Thank you both kindly. :) And yeah, I'm not completely surprised I missed the msgbox pointer. I typed it up fairly quickly. I'm glad to see everyone here is so helpful, though.

So, is it better to use the 0x2 for messages or the 0x6?

Lyzo
January 30th, 2009, 01:48 AM
Thank you both kindly. :) And yeah, I'm not completely surprised I missed the msgbox pointer. I typed it up fairly quickly. I'm glad to see everyone here is so helpful, though.

So, is it better to use the 0x2 for messages or the 0x6?Nothing is better or worse. It's just what you like. I use 0x6 because I'm used to using it and I like seeing the lock and release command xD.
Also while using pokescript It didn't have the 0x2 so I was used to using the 0x6. But 0x2 is fine as well.

GuyNamedSean
January 30th, 2009, 08:33 PM
I am having trouble making a trainerbattle.
Every time I click "Open Script" on A-Map, the srcipt that I made is gone.
This is the script, but I didn't see anything wrong with it.
#dynamic 0x800000
#org @start
trainerbattle 0x0 0x2E7 0x0 @before @after
msgbox @beaten 0x6
release
end
#org @before
= Hey! \nYour not aloud here!
#org @after
= What! \I've been beat by \ia BLUE PHEONIX brat?!
#org @beaten
= Great... \nThanks to you, \ithe boss took away my \iHOUNDOUR...
PLEASE HELP!!!
And isn't the dynamic value the same as the script offset?

Lyzo
February 1st, 2009, 02:54 AM
I was wondering... You know how in Ruby/Saphire when you beat the elite 4, latios and latias are released into the game. I was wondering if someone could explain how to do that. I was looking at the script at the end of the elite 4 and there were lots of flags that have been set and there was also a special that I didn't see in this guide. special 0xA9. If someone could help me with this that would be great!

diegoisawesome
February 1st, 2009, 07:12 AM
I was wondering... You know how in Ruby/Saphire when you beat the elite 4, latios and latias are released into the game. I was wondering if someone could explain how to do that. I was looking at the script at the end of the elite 4 and there were lots of flags that have been set and there was also a special that I didn't see in this guide. special 0xA9. If someone could help me with this that would be great!
I'm sorry, but I can't help you. Maybe you should go to the Simple Questions thread.

I am having trouble making a trainerbattle.
Every time I click "Open Script" on A-Map, the srcipt that I made is gone.
This is the script, but I didn't see anything wrong with it.
#dynamic 0x800000

#org @start
trainerbattle 0x0 0x2E7 0x0 @before @after
msgbox @beaten 0x6
release
end

#org @before
= Hey!\nYou're not allowed here!

#org @after
= What!\nI've been beat by\la BLUE PHEONIX brat?!

#org @beaten
= Great...\nThanks to you,\lthe boss took away my \lHOUNDOUR...
PLEASE HELP!!!
And isn't the dynamic value the same as the script offset?
Sometimes, it's not. You know the box that pops up saying that the script got compiled? Well, use the offset next to @start for the script offset.

darkmewham2
February 1st, 2009, 12:29 PM
You might want to add how to trade onto this guide. I've looked everywhere and found it on the XSE tutorial on the program, lol... x3

Sonikku17
February 1st, 2009, 06:06 PM
Hey, thanks for the guide! I'm pretty much a rookie hacker, and this has been a huge help!

Here's a quick question:
I'm trying to make a givepokemon script. When I run it in-game, everything works perfectly...except for the nicknaming part. For some reason, when it gets to the part where I should be nicknaming the pokemon that was given, it makes me nickname the first pokemon in my party. Any ideas about why this may be happening?

Mourgrim
February 2nd, 2009, 02:40 PM
Hello. I've been having troubles with yet another script that's confusing me quite a bit.

The script I'm trying to make has a man step forward twice, inform the player that they can't leave without a pokemon, have the player step to the right twice to where the pokeball is, have them take it, and leave without the man stopping them. Of course, there's a 'bit' more to it when you read the actual scripts, but that's the gist of it all. If anyone can help, again, I'd greatly appriecate it.

The Movement Script:

#dynamic 0x800000

#org @start
checkflag 0x1000
if 0x1 goto @done
if 0x0 goto @movement
release
end

#org @movement
msgbox @hey 0x2
applymovement 0x00 @move
waitmovement 0x0
applymovement 0xFF @move2
waitmovement 0x0
msgbox @take 0x2
applymovement 0x00 @move3
waitmovement 0x0
setflag 0x1001
release
end

#org @done
release
end

#org @move
#raw 0x1E
#raw 0x1E

#org @move2
#raw 0x13
#raw 0x13

#org @move3
#raw 0x13

#org @hey
= Hey, you can't leave\nwithout having something\lto protect you!

#org @take
= Take my EEVEE. Raise it\nwell, and let it evolve\linto whatever you wish it\lto become!

The Man's Script:

#dynamic 0x800010

#org @start
checkflag 0x1002
if 0x1 goto @good
if 0x0 goto @omg
release
end

#org @good
msgbox @leave 0x2
applymovement 0x00 @move
waitmovement 0x0
msgbox @goodluck 0x2
release
end

#org @omg
msgbox @takeit 0x2
release
end

#org @move
#raw 0x14
#raw 0x0C

#org @leave
= Okay, you may leave.

#org @goodluck
= Goodluck out there!

#org @takeit
= Would you just take it?

The Pokeball's Script:

#dynamic 0x800020

#org @start
checkflag 0x1001
if 0x1 goto @take
if 0x0 goto @done
release
end

#org @take
givepokemon 0x133 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @received 0x4
waitfanfare
closeonkeypress
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x1000
setflag 0x1002
release
end

#org @done
release
end

#org @received
= You received EEVEE!

If you see any problems with other parts of what's going on, I'd appreciate it if that was mentioned as well. :)

¦Next Pro
February 3rd, 2009, 06:36 AM
I think you should make your own level scripting sutorial and add it here. Because
Cooleys was hard to understand for me. (Still learned it :P)

nemesish
February 5th, 2009, 02:28 PM
Kinda curious.
When i did a give pokemon script. it just takes me to the last line "so, how´s my old TORCHIC?"

In first place the NPC NEVER gave a pokemon?
No talking or nothing, it just takes me to the last line

Even i tried copying the one in the tut, but the same results.

btw, in-game i´m oing to getm Oaks parcel, so I don´t have a Pokedex. In case you´re wondering if i used that flag

diegoisawesome
February 5th, 2009, 04:54 PM
Hey, thanks for the guide! I'm pretty much a rookie hacker, and this has been a huge help!

Here's a quick question:
I'm trying to make a givepokemon script. When I run it in-game, everything works perfectly...except for the nicknaming part. For some reason, when it gets to the part where I should be nicknaming the pokemon that was given, it makes me nickname the first pokemon in my party. Any ideas about why this may be happening?

Hello. I've been having troubles with yet another script that's confusing me quite a bit.

The script I'm trying to make has a man step forward twice, inform the player that they can't leave without a pokemon, have the player step to the right twice to where the pokeball is, have them take it, and leave without the man stopping them. Of course, there's a 'bit' more to it when you read the actual scripts, but that's the gist of it all. If anyone can help, again, I'd greatly appriecate it.

The Movement Script:

#dynamic 0x800000

#org @start
checkflag 0x1000
if 0x1 goto @done
checkflag 0x1000
if 0x0 goto @movement
release
end

#org @movement
msgbox @hey 0x2
applymovement 0xThis should be the People Number of the man. @move
waitmovement 0x0
applymovement 0xFF @move2
waitmovement 0x0
msgbox @take 0x2
applymovement 0xAgain, this should be the People Number of the man. @move3
waitmovement 0x0
setflag 0x1001
release
end

#org @done
release
end

#org @move
#raw 0x1E
#raw 0x1E

#org @move2
#raw 0x13
#raw 0x13

#org @move3
#raw 0x13

#org @hey
= Hey, you can't leave\nwithout having something\lto protect you!

#org @take
= Take my EEVEE. Raise it\nwell, and let it evolve\linto whatever you wish it\lto become!

The Man's Script:

#dynamic 0x800010

#org @start
checkflag 0x1002
if 0x1 goto @good
checkflag 0x1002
if 0x0 goto @omg
release
end

#org @good
msgbox @leave 0x2
applymovement 0xAnd again, this should be the People Number of the man. @move
waitmovement 0x0
msgbox @goodluck 0x2
release
end

#org @omg
msgbox @takeit 0x2
release
end

#org @move
#raw 0x14
#raw 0x0C

#org @leave
= Okay, you may leave.

#org @goodluck
= Good luck out there!

#org @takeit
= Would you just take it?

The Pokeball's Script:

#dynamic 0x800020

#org @start
checkflag 0x1001
if 0x1 goto @take
checkflag 0x1001
if 0x0 goto @done
release
end

#org @take
givepokemon 0x133 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @received 0x4
waitfanfare
closeonkeypress
fadescreen 0x1
hidesprite 0x800F
setflag 0x1000
setflag 0x1002
fadescreen 0x0
release
end

#org @done
release
end

#org @received
= You received EEVEE!

If you see any problems with other parts of what's going on, I'd appreciate it if that was mentioned as well. :)
Done. :)

I think you should make your own level scripting sutorial and add it here. Because
Cooleys was hard to understand for me. (Still learned it :P)
I will, just haven't got around to it.

Kinda curious.
When i did a give pokemon script. it just takes me to the last line "so, how´s my old TORCHIC?"

In first place the NPC NEVER gave a pokemon?
No talking or nothing, it just takes me to the last line

Even i tried copying the one in the tut, but the same results.

btw, in-game i´m oing to getm Oaks parcel, so I don´t have a Pokedex. In case you´re wondering if i used that flag
Can you post the script here? And have you already set the Pokemon menu flag? If so, use another flag besides 0x828.

Mourgrim
February 5th, 2009, 05:34 PM
I think I see...and that's what I thought was probably going to be the problem. But, with that, I'm slightly confused. The man's number is 00, because he's the only person on the map. Does that mean I should put 01 not 00?

diegoisawesome
February 5th, 2009, 05:36 PM
I think I see...and that's what I thought was probably going to be the problem. But, with that, I'm slightly confused. The man's number is 00, because he's the only person on the map. Does that mean I should put 01 not 00?
Exactly. You have to use the people number, not the event number.

Mourgrim
February 5th, 2009, 05:45 PM
(EDIT)
The problem persists, but I think it may have something to do with the release/end commands. You see, the game freezes, but not the music. (I didn't notice this before because I usually have it muted)

So, are any problems apparent with the way I used release/end etc.?

nemesish
February 6th, 2009, 01:34 PM
Can you post the script here? And have you already set the Pokemon menu flag? If so, use another flag besides 0x828.

#dynamic 0x71A290

#org @start
checkflag 0x828
if 0x1 goto @nope
msgbox @2 0x5
compare LASTRESULT 0X1
if 0x1 goto @take
msgbox @2 0x6
release
end

#org @take
givepokemon 0x255 0x5 0x1 0x0 0x0 0x0
fanfare 0x13e
msgbox @3 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @4 0x5
compare LASTRESULT 0x1
if 0x1 gosub @name
msgbox @5 0x6
release
end

#org @name
call 0x1A74EB
return

#org @nope
msgbox @6 0x6
release
end

#org @1
= Hala!\nOye, no quieres este TORCHIC?\nEs la cria de mi BLAZIKEN.

#org @2
= No puedes?\nOh, bueno. Supongo que encontrare a alguien mas que pueda.

#org @3
= [red_fr]Recibiste un TORCHIC

#org @4
= Quieres darle un nombre?

#org @5
= Cuidalo bien por favor.

#org @6
= Como te está yendo con el TORCHIC?

This is the script that´s giving me problem.
I also tried with the one in your tutorial but the result is the same

diegoisawesome
February 6th, 2009, 02:58 PM
(EDIT)
The problem persists, but I think it may have something to do with the release/end commands. You see, the game freezes, but not the music. (I didn't notice this before because I usually have it muted)

So, are any problems apparent with the way I used release/end etc.?
The Movement Script:

#dynamic 0x800000

#org @start
checkflag 0x1000
if 0x1 goto @done
checkflag 0x1000
if 0x0 goto @movement
end

#org @movement
msgbox @hey 0x2
applymovement 0xThis should be the People Number of the man. @move
waitmovement 0x0
applymovement 0xFF @move2
waitmovement 0x0
msgbox @take 0x2
applymovement 0xAgain, this should be the People Number of the man. @move3
waitmovement 0x0
setflag 0x1001
end

#org @done
end

#org @move
#raw 0x1E
#raw 0x1E

#org @move2
#raw 0x13
#raw 0x13

#org @move3
#raw 0x13

#org @hey
= Hey, you can't leave\nwithout having something\lto protect you!

#org @take
= Take my EEVEE. Raise it\nwell, and let it evolve\linto whatever you wish it\lto become!

The Man's Script:

#dynamic 0x800010

#org @start
checkflag 0x1002
if 0x1 goto @good
checkflag 0x1002
if 0x0 goto @omg
end

#org @good
msgbox @leave 0x2
applymovement 0xAnd again, this should be the People Number of the man. @move
waitmovement 0x0
msgbox @goodluck 0x2
end

#org @omg
msgbox @takeit 0x2
end

#org @move
#raw 0x14
#raw 0x0C

#org @leave
= Okay, you may leave.

#org @goodluck
= Good luck out there!

#org @takeit
= Would you just take it?

The Pokeball's Script:

#dynamic 0x800020

#org @start
checkflag 0x1001
if 0x1 goto @take
checkflag 0x1001
if 0x0 goto @done
end

#org @take
givepokemon 0x133 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @received 0x4
waitfanfare
closeonkeypress
fadescreen 0x1
hidesprite 0x800F
setflag 0x1000
setflag 0x1002
fadescreen 0x0
end

#org @done
end

#org @received
= You received EEVEE!
Lol. You were using release when you weren't using lock.

Mourgrim
February 6th, 2009, 03:59 PM
...
Okay, I think I figured it out. Thanks for all your help. lol

1KewlDude
February 7th, 2009, 08:38 AM
I have an annoying problem... I made this very long script but it just doesn't work. You just walk right over it, it doesn't freeze or anything. Help!#dynamic 0x727078

#org @1
setvar 0x4000 0x0
goto @start
end

#org @2
setvar 0x4000 0x1
goto @start
end

#org @3
setvar 0x4000 0x2
goto @start
end

#org @4
setvar 0x4000 0x3
goto @start
end

#org @5
setvar 0x4000 0x4
goto @start
end

#org @start
compare 0x4000 0x0
if 0x1 goto @leftdude
compare 0x4000 0x1
if 0x1 goto @leftdude
compare 0x4000 0x2
if 0x1 goto @leftdude
compare 0x4000 0x3
if 0x1 goto @rightdude
compare 0x4000 0x4
if 0x1 goto @rightdude
end

#org @leftdude
applymovement 0x08 @left!
waitmovement 0x0
applymovement 0xFF @lookleft
waitmovement 0x0
compare 0x4000 0x0
if 0x1 goto @cant
compare 0x4000 0x1
if 0x1 goto @moveleft1
compare 0x4000 0x2
if 0x1 goto @moveleft2
end

#org @rightdude
applymovement 0x09 @right!
waitmovement 0x0
applymovement 0xFF @lookright
waitmovement 0x0
compare 0x4000 0x3
if 0x1 goto @moveright1
compare 0x4000 0x4
if 0x1 goto @moveright2
end

#org @left!
#raw 0x62
#raw 0xFE

#org @lookleft
#raw 0x02
#raw 0xFE

#org @cant
msgbox @sorry 0x2
applymovement 0xFF @back
compare 0x4000 0x1
if 0x1 gosub @backleft
compare 0x4000 0x2
if 0x1 gosub @backleft2
compare 0x4000 0x3
if 0x1 gosub @backright
compare 0x4000 0x4
if 0x1 gosub @backright2
waitmovement 0x0
release
end

#org @moveleft1
applymovement 0x08 @right1
waitmovement 0x0
goto @cant
end

#org @moveleft2
applymovement 0x08 @right2
waitmovement 0x0
goto @cant
end

#org @right!
#raw 0x62
#raw 0xFE

#org @lookright
#raw 0x03
#raw 0xFE

#org @moveright1
applymovement 0x09 @left1
waitmovement 0x0
goto @cant
end

#org @moveright2
applymovement 0x09 @left2
waitmovement 0x0
goto @cant
end

#org @sorry
= Sorry. This passage is blocked due\nto construction.\lFor safety reasons you can't pass.\pHave a nice day!

#org @back
#raw 0x10
#raw 0xFE

#org @backleft
applymovement 0x08 @left1
return

#org @backleft2
applymovement 0x08 @left2
return

#org @backright
applymovement 0x09 @right1
return

#org @backright2
applymovement 0x09 @right2
return

#org @right1
#raw 0x13
#raw 0x02
#raw 0xFE

#org @right2
#raw 0x13
#raw 0x13
#raw 0x02
#raw 0xFE

#org @left1
#raw 0x12
#raw 0x03
#raw 0xFE

#org @left2
#raw 0x12
#raw 0x12
#raw 0x03
#raw 0xFE

Mourgrim
February 7th, 2009, 11:33 AM
And here's yet another issue...xD My give pokemon code isn't working correctly. First, the nicknaming: it just keeps asking "Would you like to nickname EEVEE?" over and over until I say no. Also, it's not an eevee. I entered the number for eevee, and yet, it's giving me a Breloom. Also, I put in "hidesprite" so that it'd disappear, but that's not working either. When I step away, it reappears.

Anyway, here's the code:
#dynamic 0x800020

#org @start
checkflag 0x1000
if 0x1 goto @give
msgbox @notyours 0x2
end

#org @give
givepokemon 0x133 0x5 0x0 0x0 0x0 0x0
msgbox @received 0x2
setflag 0x828
msgbox @nickname 0x5
compare LASTRESULT 0x1
if 0x1 gosub @name
hidesprite 0x02
end

#org @name
call 0x1A7FEB
end

#org @notyours
= This isn't your POK\h06MON,\nyou shouldn't even be\llooking at it!

#org @received
= You received EEVEE!

#org @nickname
= Would you like to nickname\nEEVEE?

Surf
February 7th, 2009, 01:26 PM
Of first of all your hidesprite command isn't working because you need to put 828 in the persons flag no.
Secondly the number for Eevee isn't wht you think it is.
Youu have to confert it into hex

Mourgrim
February 7th, 2009, 01:38 PM
I see... I was trying to make it a pokeball that'd disappear, as noticed. lol Thanks for the help.
However, now it's an eevee and not a Breloom and it disappears. But, I still don't have the option to give it a nickname and I can continue to say "yes" over and over. In fact, I don't even have the popup asking for "Yes" or "No" come up. It's either I press "A" or "B". It continues to give me eevees so long as I continue to press "A" and won't stop until I press "B". How would I go about stopping this so it works correctly?

~*Mew*~
February 7th, 2009, 01:43 PM
This is a awesome tut, well done !

bian
February 7th, 2009, 04:29 PM
can someone please tell me the script in fire red in xse where when the prof. gives
you the pokedex,it is in the national pokedex mode already.

pls.answer,tnx..

Mourgrim
February 7th, 2009, 04:33 PM
can someone please tell me the script in fire red in xse where when the prof. gives
you the pokedex,it is in the national pokedex mode already.

pls.answer,tnx..

Activating the pokedex requires a flag. For the national, it's a special. The flag for Pokedex, I think, is 0x829 and the special for national would be 0x1F3. I'm just about positive that all of this is in this tutorial, though.

1KewlDude
February 7th, 2009, 04:52 PM
Activating the pokedex requires a flag. For the national, it's a special. The flag for Pokedex, I think, is 0x829 and the special for national would be 0x1F3. I'm just about positive that all of this is in this tutorial, though.You're right... only problem is... I think he wants someone to right the script for him... X|

bian
February 7th, 2009, 05:03 PM
Thanks for the answer.Sorry because i just can't find that script in XSE even when i'm searching in google, and i don't even know that it is included in the tutorial already XD. I'm just lazy to read it all.

and no, i don't need someone to correct my script since i'm just starting,i only want to know what script it is.

Anyway,thanks for the answers,i really appreciate it!

madarawolf
February 8th, 2009, 12:07 PM
here is my script. It wont let me add it to my hack. so just tell me what I need to change o.k. thanks.

#dynamic 0x800010

#org @start
msgbox @sign 0x3
textcolor 0x02
end
#org @hello
= Welcome To Mt. Butt Rape. \lDon't lean against the walls.

1KewlDude
February 8th, 2009, 12:38 PM
here is my script. It wont let me add it to my hack. so just tell me what I need to change o.k. thanks.

#dynamic 0x800010

#org @start
msgbox @sign 0x3
textcolor 0x02
end
#org @sign
= Welcome To Mt. Butt Rape. \lDon't lean against the walls.Your first pointer didn't actually point to anywhere. Also, I don't know if you can do text colour that way, but you should press the debug button at the top and you should get a message if it's wrong.

Your hack sounds good by the way... LOL!

madarawolf
February 8th, 2009, 02:14 PM
Thanks for the help and the compliment. now I just need to make one more script and Mt. Butt Rape will be finished. I need a little help on that one too.
alright so the script I want is going to pop up when you step on it then you can still move. how would I do that? and if it helps the message will be, You just got anally raped!!!

Full Metal
February 8th, 2009, 03:02 PM
...*offtopic* and why would you incorporate this into a pokemon hack?...wow the world is really getting less and less sensible of their actions...

Mourgrim
February 8th, 2009, 08:10 PM
....Yeeah...

Anyway, I was wondering. I didn't see this in the tutorial, but maybe I just read over it on accident. However, how would one go about allowing the player to use an HM? Like, after a battle. Or just in general, really.

Sonikku17
February 14th, 2009, 08:30 AM
Hey, is there any chance you could make a tutorial for move tutor scripts? That would be wonderful!

Knomez
February 16th, 2009, 09:18 AM
Very nice tutorial, now i actually understand scripting, before it was just a bunch of jumbled words o-o...

Zaptinex
February 16th, 2009, 11:13 PM
Love the tutorial! Its like most of the scripting commands and more in one tutorial! Nice work.

Kryszajtys
February 22nd, 2009, 10:23 PM
i cant hide the sprite i talk to Please help this is the Script i was using

Note: its a spoiler for my New Pokemon game
another Note: Not like any1 cares :P


#dynamic 0x800000
#org @start
lock
faceplayer
msgbox @text 0x6
release
end
#org @text
=Hey im Lance , I no you don't know me \pBut i have been watching\n you \pand your pokemon grow \pThere are some crazy people\nout there \pIn fact there are 10 people \pwho are trying to create a\nnew pokemon\pThere going to call it Suicune\pI need you to help me stop this\pThere Planing to use\nthis Pokemon\pfor evil , to take over\nthe world \pwith this pokemons power it wont be hard\pWe will meet again , when it is time
hidesprite 0x05







Edit:Some one Please help with the Hidesprite ^ cause its not working :(


and also can some one give me a Better example for Giving an Egg cause he just put giveegg 0x115
i dont get that can some one give me an Example with every command

like

#dynamic 0x80000
#org @start
giveegg 0x155



is that all i put or something

or are these commands spousto be in the SCript

checkflag
msgbox
setflag
etc.


please give me an example Script for giving an egg :)

bardock10
February 23rd, 2009, 02:58 PM
OK on the wild battle script (lets use yours)
#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @1 0x6
cry 0x6 0x0
wildbattle 0x6 0x0 0x1E 0x8B 0x0
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @1
= CHARIZARD: Raaarrgghh!





So I change the stuff I need to change But when I save and go to compile it says
too many permiters on line 8wildbattle 0x6 0x0 0x1E 0x8B 0x0 the correct number is 3.What does this mean?

PokemonBroski
February 23rd, 2009, 07:32 PM
theres a problem with your give pokemon script
whenever I put it in the game and I try to talk to the person they just sit there and nothing pops up

jcys810
February 24th, 2009, 05:29 AM
This is a great tutorial, it ought to help me should I ever decide to make a hack of my own!

Thanks alot, bookmarked!

Blackpanfa
March 1st, 2009, 12:44 PM
thanks to you the applymovement works!!! One problem though, I only want it to happen ONCE: here is my script for it.
#Dynamic 0x80005D

#org @start
checkflag 0x900
if 0x1 goto @end
checkflag 0x828
if 0x0 goto @move
if 0x1 goto @end
setflag 0x900
end

#org @move
applymovement 0xFF @back
waitmovement 0x0
release
end

#org @back
#raw 0x62 0x00 0x0C 0x0C 0x0C 0xFE

#org @end
clearflag 0x900
release
end

Thanks.

diegoisawesome
March 1st, 2009, 12:51 PM
thanks to you the applymovement works!!! One problem though, I only want it to happen ONCE: here is my script for it.
#Dynamic 0x80005D

#org @start
checkflag 0x828
if 0x0 goto @move
checkflag 0x828
if 0x1 goto @end
end

#org @move
applymovement 0xFF @back
waitmovement 0x0
release
end

#org @back
#raw 0x62 0x00 0x0C 0x0C 0x0C 0xFE

#org @end
clearflag 0x900
release
end
Thanks.
Try that and see if that's what you want.

OK on the wild battle script (lets use yours)
#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @1 0x6
cry 0x6 0x0
wildbattle 0x6 0x1E 0x8B
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @1
= CHARIZARD: Raaarrgghh!




So I change the stuff I need to change But when I save and go to compile it says
too many permiters on line 8wildbattle 0x6 0x0 0x1E 0x8B 0x0 the correct number is 3.What does this mean?
Thanks for catching that. It's been fixed.

dogz
March 1st, 2009, 03:12 PM
can anyone tell me whats wrong with this script

#dynamic 0x80005b

#org @start
lock
faceplayer
checkflag 0x829
if 0x0 goto @pokedex
if 0x1 goto @tobad
release

#org @pokedex
setflag 0x829
msgbox @here
boxset 0x6
release
end

#org @tobad
msgbox @noway
boxset 0x6
end

#org @here
= heres a pokedex for you

#org @noway
= now leave me alone!

diegoisawesome
March 1st, 2009, 03:22 PM
can anyone tell me whats wrong with this script

#dynamic 0x80005b

#org @start
lock
faceplayer
checkflag 0x829
if 0x0 goto @pokedex
checkflag 0x829
if 0x1 goto @tobad
release

#org @pokedex
setflag 0x829
msgbox @here
boxset 0x6
release
end

#org @tobad
msgbox @noway
boxset 0x6
end

#org @here
= heres a pokedex for you

#org @noway
= now leave me alone!
I've fixed it for you. now leave me alone! :P lol

Curt_09
March 1st, 2009, 08:02 PM
Okay, I've compiled the script, but every time I go to try it out on the ROM, it only makes it to the first movement and then freezes...

#dynamic 0x800000

#org @start
checkflag 0x999
if 0x1 goto @end
applymovement 0x1 @mom
waitmovement 0x1
msgbox @1 0x2
applymovement 0x1 @mum
waitmovement 0x1
setflag 0x999
end

#org @end
end

#org @mom
#raw 0x62
#raw 0x01

#org @1
= [red_fr]Good morning [player]! \nAre you ready to beat [rival]?

#org @mum
#raw 0x02

machomuu
March 2nd, 2009, 06:18 AM
Okay, I've compiled the script, but every time I go to try it out on the ROM, it only makes it to the first movement and then freezes...

#dynamic 0x800000

#org @start
checkflag 0x999
if 0x1 goto @end
applymovement 0x1 @mom
waitmovement 0x1
msgbox @1 0x2
applymovement 0x1 @mum
waitmovement 0x1
setflag 0x999
end

#org @end
end

#org @mom
#raw 0x62
#raw 0x01

#org @1
= [red_fr]Good morning [player]! \nAre you ready to beat [rival]?

#org @mum
#raw 0x02

#dynamic 0x800000

#org @start
checkflag 0x999
if 0x1 goto @end
applymovement 0x1 @mom
waitmovement 0x1
msgbox @1 0x2
applymovement 0x1 @mum
waitmovement 0x1
setflag 0x999
end

#org @end
end

#org @mom
#raw 0x62
#raw 0x01
#raw 0xFE

#org @1
= [red_fr]Good morning [player]! \nAre you ready to beat [rival]?

#org @mum
#raw 0x02
#raw 0xFE

The changes are in bold.

Curt_09
March 2nd, 2009, 08:38 PM
Thanks, that did the trick!
Umm... I'm having a prob with that flag not setting, or something... After the event happens and I walk onto that tile again, the game freezes. If I leave the room and come back and step on the tile, the event happens again...

eraserhead
March 7th, 2009, 09:12 AM
In the GIVEPOKEMON script.
After i compile i can only choose one value to copy to the perosn in advance map!
Causing the person to either just talk.
Or just give me a pokmeon?
Any help?

diegoisawesome
March 7th, 2009, 10:00 AM
In the GIVEPOKEMON script.
After i compile i can only choose one value to copy to the perosn in advance map!
Causing the person to either just talk.
Or just give me a pokmeon?
Any help?
Well, copy the @start offset if you're using my script.

Pokepal17
March 7th, 2009, 11:08 AM
This is an excellent translation of thethethethe's Pokescript tutorial. When will you be adding the level script part? Also, do you think you could do a bit on the command sethealingplace?

diegoisawesome
March 7th, 2009, 11:35 AM
diegoisawesome's XSE Level Scripting Tutorial

Do Not Take or Modify Without Permission

A lot of people have been asking me for this, so here it is!

Step 1:
Make the script you want.

Step 2:
Add a setvar 0x(variable number) 0x1 into your script. Make sure that the player is FORCED to do the part that you add it into. Note: You do NOT need a setflag/checkflag situation unless you have a script that sets a flag for another script.


IMPORTANT: Make sure to always use variables between 0x4011 and 0x40FF. If you don't, then anything could happen to your game, ranging from Bad EGGs in your players' PC boxes to a deleted save file.
Step 3:
Compile the script.

Step 4:
In A-Map, go to the map you want to put your level script onto.

Step 5:
Go to the Header view.

Step 6:
Under Map Script, remove all other old level scripts and press Add.

Step 7:
Under Script Type, select 02 Validates values, loads handler to...

Step 8:
Paste the script offset into the Script offset 2 box.

Step 9:
Put the number of the variable that will be set to 0x1 in your script under Flag. Leave the Value box alone.

Step 10:
Press Save map scripts.

Step 11:
Press Ctrl+H on your keyboard. The view should change to Pro-Header view.

Step 12:
In the Map options>Map script offset box, copy the offset past the dollar sign and paste it into the Offset box in XSE.

Step 13:
Decompile the script and...Blank! Not to worry! Press the button right next to the Decompile button, press the Decompile button itself and...voila! There's a script now!

Step 14:
There should be a minimum of three parts to the script: two things with pointers and your script that you made. In the second part, there should be a pointer to your script. Under it, there should be a #raw word 0x(random number). Replace the random number with 0. Compile it and test it out in the game.

Step 15:
Enjoy your level script!

Pokepal17
March 7th, 2009, 02:15 PM
diegoisawesome's XSE Level Scripting Tutorial



Do Not Take or Modify Without Permission


A lot of people have been asking me for this, so here it is!



Step 1:


Make the script you want.



Step 2:


Add a setvar 0x(variable number) 0x1 into your script. Make sure that the player is FORCED to do the part that you add it into. I recommend using variables 0x7000 up.


Note: You do NOT need a setflag/checkflag situation unless you have a script that sets a flag for another script.



Step 3:


Compile the script.



Step 4:


In A-Map, go to the map you want to put your level script onto.



Step 5:


Go to the Header view.



Step 6:


Under Map Script, remove all other old level scripts and press Add.



Step 7:


Under Script Type, select 02 Validates values, loads handler to...



Step 8:


Paste the script offset into the Script offset 2 box.



Step 9:


Put the number of the variable that will be set to 0x1 in your script under Flag. Leave the Value box alone.



Step 10:


Press Save map scripts.



Step 11:


Press Ctrl+H on your keyboard. The view should change to Pro-Header view.



Step 12:


In the Map options>Map script offset box, copy the offset past the dollar sign and paste it into the Offset box in XSE.



Step 13:


Decompile the script and...Blank! Not to worry! Press the button right next to the Decompile button, press the Decompile button itself and...voila! There's a script now!



Step 14:


There should be a minimum of three parts to the script: two things with pointers and your script that you made. In the second part, there should be a pointer to your script. Under it, there should be a #raw word 0x(random number). Replace the random number with 0. Compile it and test it out in the game.



Step 15:


Enjoy your level script!




I think what most of us were expecting was one on all types level scripts not just the most commonly used one.

Alice
March 9th, 2009, 10:48 PM
Well that was probably the best tutorial I've seen so far. It has sooo much content, while most of the others don't even have trainerbattle scripts.

It was pretty big, so I might have missed it, but I can't get figure out the trainer thing. I want to make completely new trainers for my hack, and there are no tutorials specifically for this so I'll start by asking here. How do you create new trainer IDs?

diegoisawesome
March 10th, 2009, 05:28 AM
Well that was probably the best tutorial I've seen so far. It has sooo much content, while most of the others don't even have trainerbattle scripts.

It was pretty big, so I might have missed it, but I can't get figure out the trainer thing. I want to make completely new trainers for my hack, and there are no tutorials specifically for this so I'll start by asking here. How do you create new trainer IDs?
Go into PET and select one of the trainers at the beginning that has no name.

Alice
March 10th, 2009, 01:47 PM
Go into PET and select one of the trainers at the beginning that has no name.
That's the problem, there are none with no name.

Dragonmaster91
March 13th, 2009, 05:44 PM
How could you hide a sprite before even using it, then have it appear for one thing, then disappear? I looked at professor Oak's in the beginning, but that did not help...


Edit: Just use Professor Oak's person ID.

Edit 2: Or you could use the hide sprite thingy in the options in events......

dogz
March 21st, 2009, 11:18 AM
#dynamic 0x100008C

#org @start
lock
faceplayer
checkflag 0x829
if 0x0 goto @pokedex
checkflag 0x829
if 0x1 goto @tobad
release

#org @pokedex
setflag 0x829
msgbox @here 0x6
release
end

#org @tobad
msgbox @noway 0x6
end

#org @here
= heres a pokedex for you

#org @noway
= now leave me alone!



The script still makes the game freeze it is in Fire Red and is not working

Xatoku
March 21st, 2009, 11:48 AM
Well why do you have 2 checkflags? And post this in the script help thread.

Matteron (96)
March 29th, 2009, 05:08 AM
Hi I'm new to scripting and I wrote this script but when i press debug mode it shows this message.
Error 13 "type mismatch" on line 8.
Missing Dynamic label.
can you tell me what i'm doing wrong heres the script
#dynamic 0x71A23C
#org @start
lock
faceplayer
applymovement 0x1 @walk1
waitmovement 0x0
#org @Mom1
msgbox @ha 0x6
givepokemon 0x85 0x5 0x0 0x0 0x0 0x0
#org @Mom3
msgbox @he 0x6
giveitem 0xD 0x1 MSG_OBTAIN
#org @mom4
msgbox @ho 0x6
applymovement 0x1 @walk2
waitmovement 0x0
#org @walk1

#RAW 0x13
#RAW 0x13
#RAW 0x11
#RAW 0xFE
#org @Mom
= Oh [player] don't forget your eevee\n. We would not want anything \phappening to you on your first day.\nHere you go.\p
#org @Mom2
= Also you should take this potion.\n
#org @mom5
= Good-luck [player].\n
#org @walk2

#RAW 0x10
#RAW 0x12
#RAW 0x12
#RAW 0xFE

Liquid Shadow
March 29th, 2009, 07:00 AM
Hi I'm new to scripting and I wrote this script but when i press debug mode it shows this message.
Error 13 "type mismatch" on line 8.
Missing Dynamic label.
can you tell me what i'm doing wrong heres the script
#dynamic 0x71A23C
#org @start
lock
faceplayer
applymovement 0x1 @walk1
waitmovement 0x0
#org @Mom1
msgbox @ha 0x6
givepokemon 0x85 0x5 0x0 0x0 0x0 0x0
#org @Mom3
msgbox @he 0x6
giveitem 0xD 0x1 MSG_OBTAIN
#org @mom4
msgbox @ho 0x6
applymovement 0x1 @walk2
waitmovement 0x0
#org @walk1

#RAW 0x13
#RAW 0x13
#RAW 0x11
#RAW 0xFE
#org @Mom
= Oh [player] don't forget your eevee\n. We would not want anything \phappening to you on your first day.\nHere you go.\p
#org @Mom2
= Also you should take this potion.\n
#org @mom5
= Good-luck [player].\n
#org @walk2

#RAW 0x10
#RAW 0x12
#RAW 0x12
#RAW 0xFE

Well on line 8 you have "msgbox @ha 0x6". Well, if you look at your script you don't have a "@ha message". That's your problem. There's no message even though in your script theres a msgbox.

Matteron (96)
March 29th, 2009, 07:44 AM
thanks
wow i really need to get better at this.
um i no i already asked for help but when i inserted the script it just froze up on me heres the image of what i typed into amap
http://img14.imageshack.us/img14/2638/picture1nbk.png
also here the new script.
#dynamic 0x71A23C
#org @start
lock
faceplayer
applymovement 0x1 @walk1
waitmovement 0x0
#org @Mom1
msgbox @mom2 0x6
givepokemon 0x85 0x5 0x0 0x0 0x0 0x0
#org @Mom3
msgbox @mom2 0x6
giveitem 0xD 0x1 MSG_OBTAIN
#org @mom4
msgbox @mom5 0x6
applymovement 0x1 @walk2
waitmovement 0x0
#org @walk1

#RAW 0x13
#RAW 0x13
#RAW 0x11
#RAW 0xFE
#org @Mom
= Oh [player] don't forget your eevee\n. We would not want anything \phappening to you on your first day.\nHere you go.\p
#org @Mom2
= Also you should take this potion.\n
#org @mom5
= Good-luck [player].\n
#org @walk2

#RAW 0x10
#RAW 0x12
#RAW 0x12
#RAW 0xFE

X_CiEnCe
March 31st, 2009, 05:18 AM
Oh diego
your tuto
are the best
:)

I use this every time
when i build a script

LunaticHigh
April 2nd, 2009, 08:16 PM
In the Apply Movement section, the last spoiler the images aren't working so what exactly am I supposed to change so it doesnt freeze when I step on the tile?

diegoisawesome
April 3rd, 2009, 07:28 PM
In the Apply Movement section, the last spoiler the images aren't working so what exactly am I supposed to change so it doesnt freeze when I step on the tile?
It works for me. Try refreshing the page.

GoldxLight
April 3rd, 2009, 07:35 PM
Hey, I seem to be having a problem with XSE...

Whenever I try to script something, whether a talking or givepokemon script, it changes into a roll of garbage that makes no sense when I go back to it.


EDIT: Fixed the problem...

Dragonmaster91
April 5th, 2009, 01:37 PM
thanks
wow i really need to get better at this.
um i no i already asked for help but when i inserted the script it just froze up on me heres the image of what i typed into amap
http://img14.imageshack.us/img14/2638/picture1nbk.png
also here the new script.
#dynamic 0x71A23C
#org @start
lock
faceplayer
applymovement 0x1 @walk1
waitmovement 0x0
#org @Mom1
msgbox @mom2 0x6
givepokemon 0x85 0x5 0x0 0x0 0x0 0x0
#org @Mom3
msgbox @mom2 0x6
giveitem 0xD 0x1 MSG_OBTAIN
#org @mom4
msgbox @mom5 0x6
applymovement 0x1 @walk2
waitmovement 0x0
#org @walk1

#RAW 0x13
#RAW 0x13
#RAW 0x11
#RAW 0xFE
#org @Mom
= Oh [player] don't forget your eevee\n. We would not want anything \phappening to you on your first day.\nHere you go.\p
#org @Mom2
= Also you should take this potion.\n
#org @mom5
= Good-luck [player].\n
#org @walk2

#RAW 0x10
#RAW 0x12
#RAW 0x12
#RAW 0xFE
http://i298.photobucket.com/albums/mm255/dragoncharger/Help.png

Hope this helps.

Sophidius
April 8th, 2009, 06:42 AM
Uhh, is there no way to get an earthquake in FR/LG?

Giratina the master
April 8th, 2009, 07:24 AM
Why does when i make a trade i says unknown word givepokemon

diegoisawesome
April 8th, 2009, 02:10 PM
Uhh, is there no way to get an earthquake in FR/LG?
There is. Check under the Specials section.

s270171
April 8th, 2009, 06:59 PM
okay, regarding level scripts.
i got confused when you said it needs three parts...example maybe? I don't know... maybe its just cuz i dont really understand the point of variables...
could someone explain that too?

by the way love the tutorial. It got me soooooooooo far

oh and a regular scripting problem.
when I give the item TEACHY TV it will go into my bag but when I try and use it the screen goes black and it freezes. Is there something im missing?

NTA
April 10th, 2009, 01:58 PM
is tere a list of fanfares i can use?

rednano12
April 12th, 2009, 12:07 PM
Thanks for the great guide! With this and Hackmew's included guide, I think I am starting to get the hang of scripting. I was wondering if it was possible to get a list of fanfares?

diegoisawesome
April 12th, 2009, 12:37 PM
Sorry, but I don't have a list of fanfares.

LunaticHigh
April 12th, 2009, 02:38 PM
For hidesprite, can you use it to hide the player's sprite?
If you can, what do you put for the person id?

triplexh18
April 13th, 2009, 01:19 AM
Can someone help me with this script i'm really new to scripting but i still have read almost every tutorial but no matter what this scipt doesn't work the way i want it to

im trying to make a scipt so that once i enter a new area outside
Prof Oak runs up to me shouting my name with a "!" above his head then walking 2 steps down in front of me and his Prof Oak theme comes on and then he says about 2 paragraphs of text(i know how the \p \n \l works so i got that right) than before we battle the track goes to the ENCOUNTER 4 theme and than we fight(i gave him pokemon in A-trainer)with Gary's Elite Four theme.

the problem is whenever i step on the script either nothing happens or the game freezes and i already changed Var number and Unknown to what the tut said.

and when i talk to him myself the game freezes

but when i make another person with the same script as the Prof Oak i made
and talked to him then it works but then the 1st Oak does the script i wanted him to do but no battle occurs, the music doesn't change and then

i deleted and added some stuff to the script but can someone please tell me what script do i give to Oak and what script i put on that green S mark

this is what it says on the Green S
I opened the script and copied and pasted it here.

please correct any mistakes

//---------------
#org 0x8036F7
checkflag 0x8C0
if 0x1 goto 0x8803731
msgbox 0x880373A MSG_NORMAL //"OSCIZOR!"
playsong 0x156
applymovement 0x14 0x8803734
waitmovement 0x0
applymovement 0x14 0x8803736
pause 0x30
trainerbattle 0x0 0x1FF 0x0 @2 @ 3
msgbox 0x8803746 MSG_NORMAL //"Hold on OSCIZOR!\pI know you are\n..."
playsong 0x155 0x0
waitmovement 0x0
fadesong 0x12C
release
end
//---------------
#org 0x803731
release
end

//---------
// Strings
//---------
#org 0x80373A
= OSCIZOR!
#org 0x803746
= Hold on OSCIZOR!\pI know you are\ntrying to go onto battle this\lman but you see..I can't let you.\pThe reason being is\nthat you were not supposed to\l get this far and fight him...\pMy grandson was supposed to.\pAnd if you beat him...\lyou...\nyou will just ruin everything!\pWHY ARE YOU TRYING\nTO RUIN EVERYTHING!

//-----------
// Movements
//-----------
#org 0x803734
#raw 0x62 //Exclamation Mark (!)
#org 0x803736
#raw 0x52 //Jump in Place (Facing Down)
#raw 0x1D //Step Down (Fast)
#raw 0x1D //Step Down (Fast)

I also made a youtube video if it helps

i explain a little more there but i can't post a link so just combine all this with no spaces

ww w.
youtube.
com
/watch?v
=9PybIbNXY-8

my username there is Xboxproscar
along with the video
Fire Red Script 001 Footage

LunaticHigh
April 13th, 2009, 05:24 PM
//---------------
#org 0x8036F7
checkflag 0x8C0
if 0x1 goto 0x8803731
msgbox 0x880373A MSG_NORMAL //"OSCIZOR!"
playsong 0x156
applymovement 0x14 0x8803734 <---- Is the event id from A.map turned into hex? This is probably why Oak isnt moving.
waitmovement 0x0
applymovement 0x14 0x8803736 <---- same here
pause 0x30
trainerbattle 0x0 0x1FF 0x0 @2 @ 3
msgbox 0x8803746 MSG_NORMAL //"Hold on OSCIZOR!\pI know you are\n..."
playsong 0x155 0x0
waitmovement 0x0
fadesong 0x12C
release
end
//---------------
#org 0x803731
release
end

//---------
// Strings
//---------
#org 0x80373A
= OSCIZOR!
#org 0x803746
= Hold on OSCIZOR!\pI know you are\ntrying to go onto battle this\lman but you see..I can't let you.\pThe reason being is\nthat you were not supposed to\l get this far and fight him...\pMy grandson was supposed to.\pAnd if you beat him...\lyou...\nyou will just ruin everything!\pWHY ARE YOU TRYING\nTO RUIN EVERYTHING!

//-----------
// Movements
//-----------
#org 0x803734
#raw 0x62 //Exclamation Mark (!)
#raw 0xFE <-- This is end of movements
#org 0x803736
#raw 0x52 //Jump in Place (Facing Down)
#raw 0x1D //Step Down (Fast)
#raw 0x1D //Step Down (Fast)
#raw 0xFE


I didn't look into your script too much but I can point out a few errors that might be messing up your script.
Changes and stuff are in bold.

You should also put this in the script help thread :X

triplexh18
April 15th, 2009, 01:45 PM
thanks

I got it to work

NatureKeeper
April 17th, 2009, 10:57 AM
Thanks to this tutorial, I won't be needing scripters. I can script now, thanks for your efforts.

ElusionM
April 17th, 2009, 07:58 PM
Ok, guys. I've got a problem.
I've made a script so that if I don't have a certain pokemon(for this example, Pikachu), the guy will not move aside for me. I've used a checkpokemon script. However, if I don't have a Pikachu, the "Not allowed" message comes fine. However, when I DO have the Pikachu, he doesn't follow the applymovement, and top of that, the GAME FREEZES!

Here is the Code, please proof-read it for me; the last time I did anything related to hacking was 2007 and only for like a month; I've forgotten everything I knew and now have to relearn everything to also match with the new tools and the updates everyone is releasing:


'---------------
#org 0x71AC40
lock
faceplayer
setvar 0x8004 0x19
special2 LASTRESULT 0x17C
compare LASTRESULT 0x1
if 0x1 goto 0x871AD70
msgbox 0x871AD90 MSG_NORMAL '"Sorry, you're not allowed."
release
end

'---------------
#org 0x71AD70
applymovement 0x5 0x871ADA0

'---------
' Strings
'---------
#org 0x71AD90
= Sorry, you're not allowed.


'-----------
' Movements
'-----------
#org 0x71ADA0
#raw 0xE8 'movE8
#raw 0x0 'Face Down
#raw 0xD5 'movD5
#raw 0xE0 'movE0
#raw 0xE0 'movE0
#raw 0xE3 'movE3
#raw 0xEB 'movEB
#raw 0xD9 'movD9
#raw 0xD8 'movD8
#raw 0xAD 'movAD

machomuu
April 17th, 2009, 09:02 PM
Ok, guys. I've got a problem.
I've made a script so that if I don't have a certain pokemon(for this example, Pikachu), the guy will not move aside for me. I've used a checkpokemon script. However, if I don't have a Pikachu, the "Not allowed" message comes fine. However, when I DO have the Pikachu, he doesn't follow the applymovement, and top of that, the GAME FREEZES!

Here is the Code, please proof-read it for me; the last time I did anything related to hacking was 2007 and only for like a month; I've forgotten everything I knew and now have to relearn everything to also match with the new tools and the updates everyone is releasing:


'---------------
#org 0x71AC40
lock
faceplayer
setvar 0x8004 0x19
special2 LASTRESULT 0x17C
compare LASTRESULT 0x1
if 0x1 goto 0x871AD70
msgbox 0x871AD90 MSG_NORMAL '"Sorry, you're not allowed."
release
end

'---------------
#org 0x71AD70
applymovement 0x5 0x871ADA0

'---------
' Strings
'---------
#org 0x71AD90
= Sorry, you're not allowed.


'-----------
' Movements
'-----------
#org 0x71ADA0
#raw 0xE8 'movE8
#raw 0x0 'Face Down
#raw 0xD5 'movD5
#raw 0xE0 'movE0
#raw 0xE0 'movE0
#raw 0xE3 'movE3
#raw 0xEB 'movEB
#raw 0xD9 'movD9
#raw 0xD8 'movD8
#raw 0xAD 'movAD

http://i298.photobucket.com/albums/mm255/dragoncharger/Help.png
Credits to Dragonmaster91 for the picture.

diegoisawesome
April 18th, 2009, 05:11 AM
Ok, guys. I've got a problem.
I've made a script so that if I don't have a certain pokemon(for this example, Pikachu), the guy will not move aside for me. I've used a checkpokemon script. However, if I don't have a Pikachu, the "Not allowed" message comes fine. However, when I DO have the Pikachu, he doesn't follow the applymovement, and top of that, the GAME FREEZES!

Here is the Code, please proof-read it for me; the last time I did anything related to hacking was 2007 and only for like a month; I've forgotten everything I knew and now have to relearn everything to also match with the new tools and the updates everyone is releasing:


'---------------
#org 0x71AC40
lock
faceplayer
setvar 0x8004 0x19
special2 LASTRESULT 0x17C
compare LASTRESULT 0x1
if 0x1 goto 0x871AD70
msgbox 0x871AD90 MSG_NORMAL '"Sorry, you're not allowed."
release
end

'---------------
#org 0x71AD70
applymovement 0x5 0x871ADA0
waitmovement 0x5
end

'---------
' Strings
'---------
#org 0x71AD90
= Sorry, you're not allowed.


'-----------
' Movements
'-----------
#org 0x71ADA0
#raw 0xE8 'movE8
#raw 0x0 'Face Down
#raw 0xD5 'movD5
#raw 0xE0 'movE0
#raw 0xE0 'movE0
#raw 0xE3 'movE3
#raw 0xEB 'movEB
#raw 0xD9 'movD9
#raw 0xD8 'movD8
#raw 0xAD 'movAD
#raw 0xFE
Try it now. Changes are in bold.

machomuu
April 18th, 2009, 05:24 AM
Oh, I misread the script, sorry :P.

ElusionM
April 18th, 2009, 09:50 AM
Thanks guys/Diego! However, one more problem:

Now the script works, but I can click on the guy again, and AGAIN he moves back. I tried doing it so the script is IN FRONT of the tile he is on, rather than on himself, but now everytime I step on the tile, the script executes, and he moves even yet again!! To the point he's standing in other mountain tiles; which is fake looking.

I realize I need to use the 'setflag', but can you add it to the script to show me how's it's effectively done?

And what's wrong with this script(I know I'm missing good chunks of commands). When I step on it, it's supposed to be EARTHQUAKE, but instead the game freezes:

'---------------
#org 0x1F0FE0
special 0x136
msgbox 0x81F0FF0 MSG_NORMAL '"What!? What was that?"
release
end


'---------
' Strings
'---------
#org 0x1F0FF0
= What!? What was that?

s270171
April 19th, 2009, 03:37 PM
level scripts.
how do u make it so that you can do more than one in the entire game. when i follwed your instructions it worked, but i could only do the one script. how do you change the script offset of the level script so i can make two of them?

HackinJohn
April 20th, 2009, 12:36 PM
Seeing as this script has been giving me a nightmare for the last two days, would someone like to offer any assistance? ;D

Before I go and show it off, here's what I'm *trying* to make happen:

Player comes through warp, and as soon as they step out of the cave, he is noticed by the leader of an evil organization. The leader walks over to him, talks to him, and then scares the player out of the way, and he disappears through the warp the player just came through.

Here's the script: (I'm sure there's plenty wrong with it.)

#dynamic 0x2FB2F7

#org @start
lock
faceplayer
checkflag 0x200
if 0x1 goto @done
setflag 0x200
applymovement 0x01 @move
waitmovement 0x0
msgbox @monologue 0x6
applymovement 0xFF @move2
waitmovement 0x0
applymovement 0x01 @move3
waitmovement 0x00
hidesprite 0x01
release
end

#org @done
release
end

#org @move
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x00
#raw 0x11
#raw 0x03
#raw 0x13
#raw 0x01
#raw 0xFE

#org @monologue
= I heard from one of my minors that\nsomeone had been interfering, and\lI guess, no doubt, that he or she\lwas heading up the mountain,\ltrying to get into the next city.\pI figured I would try to head them\noff by running to the peak.\pBut I never imagined that he or\nshe would be so young.\pAnd seeing as this would not be a\nfair fight, I will let you go this\ltime.\pBut we shall meet again.

#org @move2
#raw 0x62
#raw 0x50
#raw 0xFE

#org @move3
#raw 0x1E
#raw 0x1E
#raw 0x60
#raw 0xFE

Any kind of help would be more than magnificent. :D

diegoisawesome
April 20th, 2009, 01:53 PM
Seeing as this script has been giving me a nightmare for the last two days, would someone like to offer any assistance? ;D

Before I go and show it off, here's what I'm *trying* to make happen:

Player comes through warp, and as soon as they step out of the cave, he is noticed by the leader of an evil organization. The leader walks over to him, talks to him, and then scares the player out of the way, and he disappears through the warp the player just came through.

Here's the script: (I'm sure there's plenty wrong with it.)

#dynamic 0x2FB2F7

#org @start
lock
faceplayer
checkflag 0x200
if 0x1 goto @done
setflag 0x200
applymovement 0x01 @move
waitmovement 0x0
msgbox @monologue 0x6
applymovement 0xFF @move2
waitmovement 0x0
applymovement 0x01 @move3
waitmovement 0x00
hidesprite 0x01
release
end

#org @done
release
end

#org @move
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x00
#raw 0x11
#raw 0x03
#raw 0x13
#raw 0x01
#raw 0xFE

#org @monologue
= I heard from one of my minors that\nsomeone had been interfering, and\lI guess, no doubt, that he or she\lwas heading up the mountain,\ltrying to get into the next city.\pI figured I would try to head them\noff by running to the peak.\pBut I never imagined that he or\nshe would be so young.\pAnd seeing as this would not be a\nfair fight, I will let you go this\ltime.\pBut we shall meet again.

#org @move2
#raw 0x62
#raw 0x50
#raw 0xFE

#org @move3
#raw 0x1E
#raw 0x1E
#raw 0x60
#raw 0xFEAny kind of help would be more than magnificent. :D
This is meant to be a level script based on what you said, right? If it is, try this:
#dynamic 0x2FB2F7

#org @start
lock
faceplayer
setvar 0x(Variable) 0x1
setflag 0x200
applymovement 0x01 @move
waitmovement 0x0
msgbox @monologue 0x6
applymovement 0xFF @move2
waitmovement 0x0
applymovement 0x01 @move3
waitmovement 0x00
hidesprite 0x01
release
end

#org @move
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x00
#raw 0x11
#raw 0x03
#raw 0x13
#raw 0x01
#raw 0xFE

#org @monologue
= I heard from one of my minors that\nsomeone had been interfering, and\lI guess, no doubt, that he or she\lwas heading up the mountain,\ltrying to get into the next city.\pI figured I would try to head them\noff by running to the peak.\pBut I never imagined that he or\nshe would be so young.\pAnd seeing as this would not be a\nfair fight, I will let you go this\ltime.\pBut we shall meet again.

#org @move2
#raw 0x62
#raw 0x50
#raw 0xFE

#org @move3
#raw 0x1E
#raw 0x1E
#raw 0x60
#raw 0xFE
Now follow my tut and it should be running in no time! :)

HackinJohn
April 20th, 2009, 02:54 PM
Thank you so much, diego!!
Your tutorial has been so much help thus far!!

powerbomb
April 21st, 2009, 06:29 PM
Hello there, newbie at scripting (this tut helps a LOT).
I was looking around, and forgive my stupidity, but I have utterly no idea how to set up a Vs. Seeker script for a trainer. I used the regular trainer script, such as:

#dynamic 0x34ED04

#org @start
trainerbattle 0x0 0x004 0x0 @before @after
msgbox @beaten 0x6
release
end

#org @before
= INTRUDER ALERT!

#org @after
= So you are worthy!

#org @beaten
= I'll let you pass this once.

That's my script. But how do I make it so that the trainer responds to the Vs. Seeker?

s270171
April 22nd, 2009, 12:12 PM
level scripts.
how do u make it so that you can do more than one in the entire game. when i follwed your instructions it worked, but i could only do the one script. how do you change the script offset of the level script so i can make two of them?

COULD SOMEONE PLEASE ANSWER THIS! it is kinda putting me at a stand-still in my game. plz!

CollinP
April 25th, 2009, 12:20 PM
umm... i have a question- is there a tutorial for newbies? cuz i can't understand any of this, and when i tried to do it, it didn't work...........

3 days later- nvm, i found out how to do it, ty

AmusedRaccoon
April 27th, 2009, 11:55 PM
The nickname pokemon script offset in LeafGreen is 0x1A74C7. (Whereas the one for FireRed, as Diego used in his tutorial, is 0x1A74EB.)

Just thought I'd point this out, since it felt good to bend Translhextion to my will for once. Maybe it'll help somebody! ;D

Satoshi Ookami
April 30th, 2009, 07:35 AM
I have a problem with pokemon giving script... I copied what you have here just to be sure that it's working but it isn't... person who I gave offset of script don't do a thing... Can anyone help me?

ctave6
April 30th, 2009, 11:50 PM
WHY!! everytime i try scripting and i leave my house it resets heres my script i deleted oak lol =P
#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @1 0x6
applymovement 0x06 @move
msgbox @2 0x6
givepokemon 0x85 0x5 0x0 0x0 0x0 0x0
Hidesprite 6
release
end

#org @1
= WAIIIT!!!

#org @2
= Take this Eevee for protection./n/nCya around kk?

#org @move
#raw 0x1E
#raw 0x1E
#raw 0x1E
#raw 0x1E
#raw 0x1E

Speedy179
May 1st, 2009, 07:32 AM
thanky you man this tut will help me a lot

vdstruijk
May 2nd, 2009, 06:04 AM
#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @1 0x6
applymovement 0x06 @move
msgbox @2 0x6
givepokemon 0x85 0x5 0x0 0x0 0x0 0x0
Hidesprite 6
release
end

#org @1
= WAIIIT!!!

#org @2
= Take this Eevee for protection./n/nCya around kk?

#org @move
#raw 0x1E
#raw 0x1E
#raw 0x1E
#raw 0x1E
#raw 0x1E

You must use flags in it. For example

#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x1111
if 0x1 goto @(var) <--- Choose an variable
msgbox @1 0x6
applymovement 0x06 @move
msgbox @2 0x6
givepokemon 0x85 0x5 0x0 0x0 0x0 0x0
Hidesprite 6
setflag 0x1111
release
end

#org @1
= WAIIIT!!!

#org @2
= Take this Eevee for protection./n/nCya around kk?

#org @move
#raw 0x1E
#raw 0x1E
#raw 0x1E
#raw 0x1E
#raw 0x1E

#org @(var)
release
end

Matteron (96)
May 2nd, 2009, 08:03 AM
Hey guys remember me. Well thanks to this tut I learned how to script extremly well, but after making plent of scripts there is one script that im stuck on

#dynamic 0x743CF8

#org @start
applymovement 0xFF @?
applymovement 0x03 @!
waitmovement 0x0
msgbox @1 0x6
fanfare 0x13E
msgbox @givedex 0x6
msgbox @cya 0x6
applymovement 0x03 @bye
waitmovement 0x0
setflag 0x829
hidesprite 0x800F
setflag 0x200
release
end

#org @?
#raw 0x63
#raw 0xFE

#org @!
#raw 0x00
#raw 0x62
#raw 0xFE

#org @1
= Bryan: Hey! \v\h01! How is it\ngoing?\l\v\h01: Good, you?\lBryan: Good.\l\v\h01: Anyhow, aren't you\lsupposed to be at Nartu Island?\lBryan: Ya, I am supposed to leave\ltoday, but I was waiting for you\lso I could give this to you.

#org @givedex
= [green_fr]\v\h01 recieved a POKEDEX

#org @cya
= Oh! Look at the time, gotta run.

#org @bye
#raw 0x11
#raw 0x11
#raw 0x12
#raw 0x12
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE

what happens is that "bryan" (the guy who you are talking) reapears and blocks your way again. Also you have to keep talking to him and recieve the pokedex to pass.

can anyone find a way to hide him for good.

HackChu
May 2nd, 2009, 09:05 AM
Take a look at this:

#dynamic 0x71A32C

#org @start
checkflag 0x820
if 0x1 goto @done
msgbox @1 0x6
applymovement 0x04 @move
pause 0x20
release
end

#org @done
release
end

#org @move
#raw 0x12
#org @1
= Here you go!

The guy says what I told him to,and than he takes a step at me than the game crashes.What did I do wrong?

Matteron (96)
May 2nd, 2009, 10:35 AM
Take a look at this:

#dynamic 0x71A32C

#org @start
checkflag 0x820
if 0x1 goto @done
msgbox @1 0x6
applymovement 0x04 @move
pause 0x20
release
end

#org @done
release
end

#org @move
#raw 0x12
#org @1
= Here you go!

The guy says what I told him to,and than he takes a step at me than the game crashes.What did I do wrong?

Try this: (changes are bold)

#dynamic 0x71A32C

#org @start
checkflag 0x820
if 0x1 goto @done
msgbox @1 0x6
applymovement 0x04 @move
pause 0x20
release
end

#org @done
release
end

#org @move
#raw 0x12
#raw 0xFE
#org @1
= Here you go!

I used to have the same problem see you were missing #raw 0xFE after your movements. Without #raw 0xFE (which ends the movements) the game thinks that somebody still has to move so it waits until somebody does...which will never happen...moral of the story is that no #raw 0xFE=no continue...understand

HackChu
May 2nd, 2009, 11:03 AM
Um,I used this and when my character got to a door they didn't do in,they stood on it,and the character didn't show,which was Oak in the beginning.

#dynamic 0x71A26C

#org @start
checkflag 0x828
if 0x1 goto @done
msgbox @1 0x6
applymovement 0x03 @move
waitmovement 0x0
msgbox @2 0x6
applymovement 0x03 @move2
pause 0x20
playsong 0x13E 0x0
applymovement 0x03 @move3
applymovement 0x03 @move4
applymovement 0xFF @move5
waitmovement 0x0
fadesong 0x12C
release
end

#org @done
release
end

#org @move
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE

#org @move2
#raw 0x13
#raw 0x13
#raw 0xFE

#org @move3
#raw 0x11
#raw 0xFE

#org @move4
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x11
#raw 0xFE

#org @move5
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x11
#raw 0xFE
#org @1
= Hey, wait up!
#org @2
= Come follow me.

Try this: (changes are bold)

#dynamic 0x71A32C

#org @start
checkflag 0x820
if 0x1 goto @done
msgbox @1 0x6
applymovement 0x04 @move
pause 0x20
release
end

#org @done
release
end

#org @move
#raw 0x12
#raw 0xFE
#org @1
= Here you go!

I used to have the same problem see you were missing #raw 0xFE after your movements. Without #raw 0xFE (which ends the movements) the game thinks that somebody still has to move so it waits until somebody does...which will never happen...moral of the story is that no #raw 0xFE=no continue...understand
Thanks,but I found that out after I posted lol.

Powerflare
May 2nd, 2009, 03:29 PM
How do you combine (in Ruby) a trainerbattle script with an applymovement script. Also, I wanna learn it so I can make in notepad. If not, that's fine.

Matteron (96)
May 3rd, 2009, 03:59 AM
How do you combine (in Ruby) a trainerbattle script with an applymovement script. Also, I wanna learn it so I can make in notepad. If not, that's fine.

um lets see here I don't think you can make in notepad(fix m if i'm wrong) and about the movement do you want it after or before the trainer battle

ps can anyone fix my script plz

I have a problem with pokemon giving script... I copied what you have here just to be sure that it's working but it isn't... person who I gave offset of script don't do a thing... Can anyone help me?

Now on to the script...lets see what could be the matter...hmm... well you could have got a offset with not enough bytes, or you could have just not compiled it...

Rathelong
May 3rd, 2009, 05:20 AM
Hello there! Maybe someone can help me.

I just wanted to try out the "Giveitem" script, but everytime I try to compile it says:

Missing #define or Parameter on the Line 21 (marked)

------------------

#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x200
if 0x1 goto @done
msgbox @1 0x5
compare 0x800D 0x1
if 0x1 goto @take
msgbox @2 0x6
release
end

#org @done
msgbox @3 0x6
release
end

#org @take
giveitem 0xD 0x1 MSG_OBTAIN
msgbox @3 0x6
setflag 0x200
release
end

#org @1
= Hi!\pI'm from the Cherrygrove\nPokeMart.\pWhy don't you take this\nfree sample?

#org @2
= That's okay. I'm sure someone\nelse will enjoy it.
#org @3
= If you want more, you'll\nhave to go to the PokeMart\nto buy them.

------------------------


I hope you can help me T_T

Matteron (96)
May 3rd, 2009, 02:41 PM
Hello there! Maybe someone can help me.

I just wanted to try out the "Giveitem" script, but everytime I try to compile it says:

Missing #define or Parameter on the Line 21 (marked)

------------------

#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x200
if 0x1 goto @done
msgbox @1 0x5
compare 0x800D 0x1
if 0x1 goto @take
msgbox @2 0x6
release
end

#org @done
msgbox @3 0x6
release
end

#org @take
giveitem 0xD 0x1 MSG_OBTAIN
msgbox @3 0x6
setflag 0x200
release
end

#org @1
= Hi!\pI'm from the Cherrygrove\nPokeMart.\pWhy don't you take this\nfree sample?

#org @2
= That's okay. I'm sure someone\nelse will enjoy it.
#org @3
= If you want more, you'll\nhave to go to the PokeMart\nto buy them.

------------------------


I hope you can help me T_T

I don't see anything wrong with it its perfectly fine...does anyone no what's wrong with it?

Curt_09
May 3rd, 2009, 04:55 PM
Hello there! Maybe someone can help me.

I just wanted to try out the "Giveitem" script, but everytime I try to compile it says:

Missing #define or Parameter on the Line 21 (marked)

------------------

#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x200
if 0x1 goto @done
msgbox @1 0x5
compare 0x800D 0x1
if 0x1 goto @take
msgbox @2 0x6
release
end

#org @done
msgbox @3 0x6
release
end

#org @take
giveitem 0xD 0x1 MSG_OBTAIN
msgbox @3 0x6
setflag 0x200
release
end

#org @1
= Hi!\pI'm from the Cherrygrove\nPokeMart.\pWhy don't you take this\nfree sample?

#org @2
= That's okay. I'm sure someone\nelse will enjoy it.
#org @3
= If you want more, you'll\nhave to go to the PokeMart\nto buy them.

------------------------


I hope you can help me T_T

I can't find anything wrong with this, except you may want to space between org2 and org3 down there at the bottom. Try changing the MSG_OBTAIN to 0x1.

colcolstyles
May 3rd, 2009, 06:31 PM
I just wanted to try out the "Giveitem" script, but everytime I try to compile it says:

Missing #define or Parameter on the Line 21 (marked)

...

giveitem 0xD 0x1 MSG_OBTAIN

Well if the error code says that you're "Missing #define or Parameter on the Line 21" then that's probably the problem. From what I understand, 'MSG_OBTAIN' is read by XSE and replaced with a byte when the script is compiled. However, you have to define what exactly 'MSG_OBTAIN' should be replaced by. The XSE built-in guide should be able to help you with using the '#define' preprocessing directive.

Satoshi Ookami
May 4th, 2009, 07:17 AM
Now on to the script...lets see what could be the matter...hmm... well you could have got a offset with not enough bytes, or you could have just not compiled it...
I compiled it of course... do ya think that problem could be with flags? because without flags scripts workin'...

ctave6
May 5th, 2009, 02:57 AM
:D IT WORKS!! I CHANGED ROMS!! IT WORKS NO RESET!!

PoliBattler
May 8th, 2009, 05:05 PM
I need help, Whenever I try to Compile, I get various errors, examples; There are duplicate scripts; Unknown Value on Line 6; And like Error, too many parameters on line 1, What does this mean? Can someone help me fix it?

powerbomb
May 9th, 2009, 09:55 PM
#dynamic 0x2DD0F8

#org @start
checkflag 0x828
if 0x1 goto @done
msgbox @1 0x6
applymovement 0x01 @move
waitmovement 0x0
applymovement 0xFF @move2
pause 0x30
msgbox @2 0x6
applymovement 0x01 @move3
applymovement 0xFF @move3
waitmovement 0x0
release
end

#org @done
release
end

#org @move
#raw 0x62
#raw 0x01
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0xFE

#org @move2
#raw 0x03
#raw 0xFE

#org @move3
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE

#org @1
= Hey! [player]!

#org @2
= Here! Try this out!

What are the Unknown and Var numbers for this script? How do I find them?

BlizzardMamoswine
May 11th, 2009, 03:33 PM
there are alrdy spaces in between those

The Original Darkwiz787
May 19th, 2009, 04:05 PM
Ehe, NVM. forgort that thread's a tutorial, not a script help thread...

Anyways, I used to think scripting was hard to the level of "Insanium in the Cranium" But its not!

Ty for the tut, see you and good night!

Sweet Jasmine
May 20th, 2009, 12:43 AM
Gee This Tutorial is Great
Helps me alot with my Hack
Because im using XSE >3
My Hack is Pokemon Pink Destiny
Thanks for Posting this Thread
This help me alot ^_^ *giggles*

-Yasumin >3

notbob
May 20th, 2009, 03:58 AM
You are wrong, your pointers are not offsets. #org 0x720AFE ----> This should be a pointer example: @give, @1.
No, this is the compiled version. And there's nothing wrong with the pointers.

TheDarkAngel
May 20th, 2009, 04:58 AM
I have a problem, I use Advance Map, overwrite a script, and then what do I do? Because it always goes back to the old script. (I have debug, compiled, saved it and yet nothing works. Yes I am new at using XSE, but can someone help?)

I was using the give pokemon charmander code.

HackChu
May 20th, 2009, 05:10 AM
you should post in the script help thread,you will get answers there sooner.

Sweet Jasmine
May 20th, 2009, 05:45 AM
Tyson is right.. or you could Private Message HackMew to answer your question >3
Hope that helped ^_^ *giggles*

-Yasumin >3 Your Sweet Friend ^_^

Pheya
May 20th, 2009, 06:35 AM
I have a problem, I use Advance Map, overwrite a script, and then what do I do? Because it always goes back to the old script. (I have debug, compiled, saved it and yet nothing works. Yes I am new at using XSE, but can someone help?)

I was using the give pokemon charmander code.

Try remaking the script. ;)

Vince_27
May 24th, 2009, 01:41 AM
Make sure you have XSE 1.0.1.
If it's the case I can't help you.

onyx79
May 24th, 2009, 10:16 AM
nice tut! what is a level script?

notbob
May 24th, 2009, 06:29 PM
I have an error on making a signpost.



The error is : type mismatch on line 4. Missing dynamic label.

I've been trying everything, I even used your scripts almost word for word. How do I fix this?
Change @chicken to @1, it should work.

Pokepal17
May 25th, 2009, 02:26 AM
nice tut! what is a level script?

A script which activates as soon as you enter a map.

Pokemon12345678901
May 25th, 2009, 10:12 AM
I made a script for a battle, but it appears as Gary on the S.S. Anne. How do I make it have certain Pokemon, levels, battle sprites, and etc... Thank you in advance.

DarkPrince304
May 28th, 2009, 04:40 AM
Hello Guys
This is my 1st post and I am a Beginner to scripting...
I just made this script to battle Ho-Oh


#dynamic 0x800000
#org @start
lock
faceplayer
message @yesno
boxset 5
compare LASTRESULT 1
if b_true goto @yes
wildbattle 250 50 0 0 0 0
compare LASTRESULT 0
if b_true goto @no
release
end

#org @tutorial
= Are you sure you want to battle HO-OH?

#org @yes
message @pressyes
boxset 6
release
end

#org @no
message @pressno
boxset 6
release
end

#org @pressyes
= HO-OH Woke Up!\p HO-OH:Geeyaauugh!!

#org @pressno
= You left HO-OH...

Now
I have put Ho-oh in a room along with Lugia,Raikou,Entei,and Suicune
I want someone to make and explain me an event in which if I battle Any of the 5 pokemon the other 4 dissapear after the battle leaving a message..
I need a code for it

1 more thing
in the statement wildbattle 250 50 0 0 0 0
What do the other 4 zero's mean...I just typed that by seeing what other people did but I don't know what the other 4 zero's mean
Thank You :D

TomByrne
May 29th, 2009, 03:53 AM
Once you've got the script you want wha do you do with it? How do you import it into ADV map? or get it working in the rom?

NTA
May 29th, 2009, 04:26 AM
i made some changes to the wildbattle script
the cry came right after the message giving alot lesss time to play the cry
and the fadescreen was right but the player dissapeared right after the fadescreen not during it so i fixed that too :D

#dynamic 0x800000

#org @start
lock
faceplayer
cry 0x6 0x0
msgbox @1 0x6
wildbattle 0x6 0x1E 0x8B
fadescreen 0x1
hidesprite 0x800F
fadescreen 0x0
setflag 0x200
release
end

#org @1
= CHARIZARD: Raaarrgghh!

Kolossus
May 29th, 2009, 06:12 AM
Try remaking the script. ;)

could someone explain what he means by that? I am having the exact same problem. I change some of the existing script, then I try to save, but it just makes a new file for that script! Then when I close the script and open it again, it opens the old script. I can open mine, but it opens in a new tab. Even when I go 'compile' it still saves as a new file. Any help would be much appreciated

DarkPrince304
May 29th, 2009, 11:11 AM
Umm Hi Guys I want to make a script with following information

I begin my adventure and as soon as I try to go down the stairs,mom comes up and says to go back to sleep as we have to choose our 1st pokemon tomorrow and then we go to sleep...

So I want it like when i go to stairs the mom blocks and when i have gone to sleep and wake up the mom is not blocking me anymore...Please help me
I pray for help please!!... :(
and please explain me the script too
Thank you very much :)

Hunter9098
June 1st, 2009, 07:06 AM
I don't understand the flags at all :(
I just want my trainer to dissappear after battle
actually, i want it so he gives you an item after the battle, then dissappears. Everything works except i cant get him to dissappear :(:(:(
this sucks :(

DarkPrince304
June 1st, 2009, 07:29 AM
Hey Hunter I have the same problem
Just see the Script Help Thread
Can anyone help us

PI Hudson
June 1st, 2009, 06:53 PM
I PM'ed Diego about a week ago to ask him if I should make this into a downloadable item, but Diego has't replied. This was to help combine the mess that the multiple posts in different areas had into one document. I took the liberty to make it anyway because Diego hasn't replied.

It was copied and pasted WORD FOR WORD, so there is no comments from me or anyone else in there

diegoisawesome
June 2nd, 2009, 02:45 PM
I PM'ed Diego about a week ago to ask him if I should make this into a downloadable item, but Diego has't replied. This was to help combine the mess that the multiple posts in different areas had into one document. I took the liberty to make it anyway because Diego hasn't replied.

It was copied and pasted WORD FOR WORD, so there is no comments from me or anyone else in there
Thanks for making it, anyways. Sorry I didn't respond. I had stuff to do, like working on my hack and modding my Wii.

heatransoul
June 6th, 2009, 10:48 AM
When I do any wildbattle script, it freezes at the cry part.
I got the cry to work later, but then it freezes at the wildbattle.
Can you help me?
Here is the script:

#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @1 0x6
cry 0x194 0x2
wildbattle 0x194 0x32 0x8B
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @1
= The wild Sudrak attacked!

Satoshi Ookami
June 6th, 2009, 10:52 AM
Ya didn't use checkflag... but it's just guess I don't know if it'll solve your problem

diegoisawesome
June 6th, 2009, 11:04 AM
When I do any wildbattle script, it freezes at the cry part.
I got the cry to work later, but then it freezes at the wildbattle.
Can you help me?
Here is the script:

#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @1 0x6
cry 0xC0 0x0
wildbattle 0xC0 0x32 0x8B
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @1
= The wild Sudrak attacked!

There is no Pokémon, fake or otherwise, numbered 404 that is programmed or can be programmed into the game. I think you mean 0xC0.
And don't use effect number 0x2. Just to be safe, use 0x0.

heatransoul
June 6th, 2009, 11:48 AM
There is no Pokémon, fake or otherwise, numbered 404 that is programmed or can be programmed into the game. I think you mean 0xC0.
And don't use effect number 0x2. Just to be safe, use 0x0.
Well, I tried what you said, but it still froze on the Wildbattle.
Also, C0 is the number for Sunflora...
I believe that 383 in Hex is 17E...

diegoisawesome
June 6th, 2009, 11:56 AM
Well, I tried what you said, but it still froze on the Wildbattle.
Also, C0 is the number for Sunflora...
I believe that 383 in Hex is 17E...
What number Pokémon do you need?
EDIT: It may be a messed-up sprite.
That's what happened to me. Just re-insert the sprite at an offset that ends in 0.

heatransoul
June 6th, 2009, 12:00 PM
What number Pokémon do you need?
EDIT: It may be a messed-up sprite.
That's what happened to me. Just re-insert the sprite at an offset that ends in 0.
It's for Kyogre.
And how do you do the offset thing?

diegoisawesome
June 6th, 2009, 12:07 PM
Look somewhere else for that answer.
Sorry, but I have no time left.

Mr
June 10th, 2009, 02:32 AM
Nice Tutorial! This has a lot of information.

Tacoman4rmsj94
June 21st, 2009, 12:11 AM
#Dynamic 0x000001

#org @start
lock
faceplayer
msgbox @blah 0x6
cry 0xF5 0x0
wildbattle 0xF5 0x32 0x0
hidesprite 0x1
release
end

#org @blah
= GYAOO!


everytime i stop fighting the pokemon the sprite dissapears but then immediately reappears after I move. Help Please.

Excalibur
June 21st, 2009, 12:41 AM
Tacoman4rmsj94, you have to set a flag on sprite and then use command setflag after hidesprite.

Chimchar 9
June 21st, 2009, 08:38 AM
How do i stop a script from repeating??
I forgot cause i haven't scripted for a while.

hashtag
June 21st, 2009, 08:41 AM
I believe it is

releaseall
end

Chimchar 9
June 21st, 2009, 08:47 AM
No it wasn't that.
I forgot to put setflag 0x1000.
xD

Tacoman4rmsj94
June 21st, 2009, 07:39 PM
i keep encountering the same problem
i battle then he keeps re appearing
can you give me an example please?

Excalibur
June 21st, 2009, 09:16 PM
#Dynamic 0x000001

#org @start
lock
faceplayer
msgbox @blah 0x6
cry 0xF5 0x0
wildbattle 0xF5 0x32 0x0
hidesprite 0x1
setflag 0x<your flag>
release
end

#org @blah
= GYAOO!

And then in A-Map choose your sprite and where is Person ID, write the same flag.

There is an image
img520.imageshack.us/img520/2349/examplef.png

Tacoman4rmsj94
June 21st, 2009, 10:01 PM
OMG IT WORKED!!!
i owe you big time
thank you

ShinyBlaziken
June 22nd, 2009, 04:24 AM
Okay, I fixed my problem on my own xD

But now I've got another Problem
I tried the "givepokemon" Script but it didn't work.
XSE said that there is missing something at the "compare LASTRESULT 0x1" part.
But what's missing there???

diegoisawesome
June 22nd, 2009, 08:34 AM
Don't know why but it doesn't work for me...
I wanted to make a sign so I made this:
'---------------
#dynamic 0x800159


#org @start
msgbox @sign 0x3
end

#org @sign
= Hi!When I clicked the Sign there didn't appear any text...

Okay, I fixed my problem on my own xD

But now I've got another Problem
I tried the "givepokemon" Script but it didn't work.
XSE said that there is missing something at the "compare LASTRESULT 0x1" part.
But what's missing there???
Replace LASTRESULT with 0x800D.

Pokepal17
June 22nd, 2009, 08:37 AM
Replace LASTRESULT with 0x800D.

To avoid stuff like that, will you please write at the very beginning of the tutorial, to make sure the reader is using the latest XSE and that they have extracted all the files or else this tutorial may not be compatible.

ShinyBlaziken
June 22nd, 2009, 08:45 AM
Okay, thank you!!! ! :D

Hmmm...
Well the Script was okay but i don't get any Pokemon :D
I talk to a guy but he always says "Are you taking good care of Charmander".
Is it because I already have a Charmander?
What do i have to change??

diegoisawesome
June 22nd, 2009, 09:15 AM
Okay, thank you!!! ! :D

Hmmm...
Well the Script was okay but i don't get any Pokemon :D
I talk to a guy but he always says "Are you taking good care of Charmander".
Is it because I already have a Charmander?
What do i have to change??
Change the flag numbers. That was just an example flag #.

TheDon
June 22nd, 2009, 11:44 AM
Question, does #dynamic 0x<offset> overwrite the designated offset? Or does it look for free space starting from the offset?

Pokepal17
June 22nd, 2009, 12:46 PM
Question, does #dynamic 0x<offset> overwrite the designated offset? Or does it look for free space starting from the offset?
It looks for free space starting from the offset.

TheDon
June 22nd, 2009, 12:51 PM
Is there a command that I can use in XSE or wherever to erase a certain script from an offset, then replace it with the new one that at the time, I just made? I tried the #remove before and after the #dynamic at the beginning of the script, but it didn't work.

Pokepal17
June 22nd, 2009, 12:54 PM
Is there a command that I can use in XSE or wherever to erase a certain script from an offset, then replace it with the new one that at the time, I just made? I tried the #remove before and after the #dynamic at the beginning of the script, but it didn't work.

All the script should be is:

#remove 0xoffset


nothing else.

TheDon
June 22nd, 2009, 01:03 PM
Meh. I go to compile it to the ROM, and it gives me "No dynamic start offset specified" after I take out the #dynamic command.

ShinyBlaziken
June 23rd, 2009, 05:21 AM
I made this Script


#dynamic 0x803E28

#org @start
checkflag 0x209
if 0x1 goto @done
msgbox @1 0x5
compare 0x800D 0x1
if 0x1 goto @take
msgbox @2 0x2
release
end

#org @take
givepokemon 0x382 0x5 0x199 0x0 0x0 0x0
fanfare 0x13E
msgbox @3 0x4
waitfanfare
closeonkeypress
setflag 0x209
msgbox @4 0x5
compare 0x800D 0x1
if 0x1 gosub @name
msgbox @5 0x6
release
end

#org @name
call 0x1A74EB
return

#org @done
clearflag 0x209
release
end

#org @1
= [black_fr]There's a Pokeball on the table\nDo you want to take it?

#org @2
= [black_fr]You left the Pokeball on the table

#org @3
= [black_fr]You received Aron

#org @4
= [black_fr]Would you like to give a\nnickname to Aron?

#org @5
= DREW: Please take care of\nAron!


At first there's the Question if I take the Pokeball or not. if I click "no" then "You left the Pokeball on the table" appears and nothing else happens.
But if I click at "Yes" my game just freezes -.-
I don't know why.

Excalibur
June 23rd, 2009, 07:46 AM
ShinyBlaziken, there is an error in your givepokemon command. The values must be in hex.

ShinyBlaziken
June 23rd, 2009, 09:14 AM
And how should i change it?

Excalibur
June 23rd, 2009, 09:57 AM
You can use Windows Calculator Advance Mode or XSE Calc.
382 in hex = 17E and 199 in hex = C7.

ShinyBlaziken
June 24th, 2009, 06:28 AM
Okay thanks, it works now!


And how can I make a script for a hidden item on the ground??

Excalibur
June 24th, 2009, 08:42 AM
Its not a script. Its a type of signpost. (06 Hidden Item)

ShinyBlaziken
June 29th, 2009, 11:14 AM
Hi,
I've got another Problem now xDDD

I made a Script but there appears the message "This tree looks like it can be CUT down" when I'm talking to the Person.

Here's my script


#dynamic 0x8001F6

#org @start
lock
faceplayer
msgbox @speak 0x2
applymovement 0x4 @move
waitmovement 0x0
release
end

#org @speak
= [blue_fr]LINDSAY: Hi, this is my farm.\nI've got a lot of Pokemon here\pMy favorite is...\n[black_fr]JOHN: Lindsay!\pDon't say any other word!/n[blue_fr]LINDSAY: Oh..., Gotta go!

#org @move
#raw 0x20
#raw 0x20
#raw 0x20
#raw 0x20
#raw 0x0
#raw 0xFE

Wuggles
June 29th, 2009, 02:01 PM
Heya. first of all: nice tut! ;D

I need a flexible kind of warp.
A warp with vars in it like this:
warp 0x7005 0x7006 0x7007 0x0 0x0
Is it possible? because this gives me errors :/

is there a way to use vars in warps?
Thanks in Advance

TheDon
June 29th, 2009, 04:51 PM
Is there a command that I can use in XSE or wherever to erase a certain script from an offset, then replace it with the new one that at the time, I just made? I tried the #remove before and after the #dynamic at the beginning of the script, but it didn't work.

Still looking for help with this. Thanks in advance.

.Seth
June 29th, 2009, 05:50 PM
I'm not saying anyone's breaking rules here, but there is a script help thread, you know.

I've never really taken the time to comment on this tutorial (or did I? I dunno. :P), so I think I will.

Overall, it's just a big translation of thethethethe's PokeScript tutorial, so really, it's not completely yours, but you gave credit, so I've no problem with that.

All in all, there are a few errors here and there, but it's very useful, and even I, the author of a different XSE tutorial, find myself looking at this.

Doctortux
July 1st, 2009, 08:50 AM
Wow, I cannot understand any of that. This isn't a tutorial for begginers is it? Anyways, it seems like you put a lot of effort into this so great job!

bna_li
July 1st, 2009, 10:03 PM
Hi, I'm trying to get into this hacking thing. Great guide, but I'm an idiot. -______-

I don't really get how flags work, I'm at the beginning of Ruby and I want to make those mover guys disappear. But I don't really get the flags thingies. How would I not make them disappear until I finish setting my clock? Right now they disappear if I accidentally go down.

Edit: Eh. Where is the script help thread by the way?

Malkner
July 4th, 2009, 02:19 PM
diegoisawesome, I checked my Ruby game, and I'm pretty sure you mixed up some of those specials. You listed special 0x9C as Wally's catch, but according to the "H-help me!" script, that's actually the special for choosing your first Pokemon.

There's a good chance I'm wrong, but somebody should look into that.

bna_li
July 5th, 2009, 01:38 AM
Can someone help me? I'm stuck and I'm only at the beginning..

Proclifo
July 6th, 2009, 11:38 AM
I have a prob too. I made Celebi wild Pokemon script in Viridian Forest, and thanks for the flag numbers, by the way. It dissapears normally when you kill it or run away from it. But when I catch it, it won't dissapear! Can someone help me and tell what to do? :/

Haz
July 12th, 2009, 03:46 AM
Thanks for the tutorial, this really helped me on my hack!

Rocka210
July 15th, 2009, 02:03 PM
I need help!


#dynamic 0x8003D5
#org @start
checkflag 0x828
if 0x0 goto @1
if 0x1 goto @end
end
#org @1
lock
applymovement 0x01 @move
waitmovement 0x0
msgbox @Pine
boxset 0x6
applymovement 0x01 @move2
waitmovement 0x0
setflag 0x828
release
end
#org @move
#raw 0x03
#raw 0x62
#raw 0x13
#raw 0x13
#raw 0x11
#raw 0xFE
#org @move2
#raw 0x10
#raw 0x12
#raw 0x12
#org @end
release
end
#org @Pine
= Hey \v\h01!\nProf. Pine wanted to see you\nIt was something about getting your\nfirst pokemon.

This script is supposed to make the person walk 2 steps right and 2 steps up then say the script
and walk back to the beggining area

What did I do wrong

PS Please tell me the best XSE tutorial you've seen I'm not a great scripter

Excalibur
July 15th, 2009, 10:33 PM
Rocka210,
1. replace ??? with person event number (in A-map)
2. Yes, it possible. In your script after setflag 0x828 write "setvar 0x???? 0x1" (replace ???? with your variable, like 0x5001 or other), and then go to script events in A-map and choose your script event. Then write your variable in the "Var. number" and save your map and compile your script.

Larvitar170
July 21st, 2009, 10:30 AM
Okay. I am editing the post, since I change the idea I had. Is there anyway to mix apply movement and trainer battle? I tried, but it won't work at all. Here is the script I tried. I would appreciate any help if someone can spare the time.

'---------------
#dynamic 0x000064
#org 0x000064
applymovement 0x1 0x2D51C3
waitmovement 0x0
return

'---------------
#dynamic 0x000005
trainerbattle 0x0 0x001 0x0 $before $after
msgbox @lost 0x6
release
end

'---------------
#dynamic 0x00007F
applymovement 0x1 0x2D51C3
waitmovement 0x0
return

#org $before
= [Brandon] Hey, have you seen my partner?\nHe has brown hair and a Totodile.\pNevermind, let's just battle!

#org $after
= No...I never lose...\nMy Herecross was just worn out.

#org @lost
= Well...I'll win next time!\nNow where could Miles have gone...

'-----------
' Movements
'-----------
#org 0x720CB4
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org 0x720CB4
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE

Gold Man
July 23rd, 2009, 01:05 PM
Can you cerrent my script:
'-----------------------
#org 0x800A3D
lock
checkflag 0x828
if 0x1 goto 0x8800A96
checkgender
compare LASTRESULT 0x0
if 0x1 goto 0x8800A60
compare LASTRESULT 0x1
if 0x1 goto 0x8800A7B
end
'-----------------------
#org 0x800A96
hidesprite 0x1
end
'-----------------------
#org 0x800A60
givepokemon 0x88 0x5 0x0 0x0 0x0 0x0
msgbox 0x8800A9B '"[player]: This must be oak's\n poke..."
setflag 0x828
release
end
'-----------------------
#org 0x800A7B
givepokemon 0x87 0x5 0x0 0x0 0x0 0x0
msgbox 0x8800A9B '"[player]: This must be oak's\n poke..."
setflag 0x828
release
end

'---------
' Strings
'---------
#org 0x800A9B
= [player]: This must be oak's\n pokemon I better take it to him.

What's I want to happen is you find a pokeball and get pokemon deppening on your gender and then it says:[player]: This must be oak's pokemon I better take it to him. after that the pokeball disappears and you keep going but the pokeball disappears untill you walk 1 step then it reappears can you help me?

diegoisawesome
July 23rd, 2009, 01:39 PM
Can you cerrent my script:
'-----------------------
#org 0x800A3D
lock
checkflag 0x828
if 0x1 goto 0x8800A96
checkgender
compare LASTRESULT 0x0
if 0x1 goto 0x8800A60
compare LASTRESULT 0x1
if 0x1 goto 0x8800A7B
end
'-----------------------
#org 0x800A96
hidesprite 0x1
end
'-----------------------
#org 0x800A60
givepokemon 0x88 0x5 0x0 0x0 0x0 0x0
msgbox 0x8800A9B '"[player]: This must be oak's\n poke..."
setflag 0x828
release
end
'-----------------------
#org 0x800A7B
givepokemon 0x87 0x5 0x0 0x0 0x0 0x0
msgbox 0x8800A9B '"[player]: This must be oak's\n poke..."
setflag 0x828
release
end

'---------
' Strings
'---------
#org 0x800A9B
= [player]: This must be oak's\n pokemon I better take it to him.

What's I want to happen is you find a pokeball and get pokemon deppening on your gender and then it says:[player]: This must be oak's pokemon I better take it to him. after that the pokeball disappears and you keep going but the pokeball disappears untill you walk 1 step then it reappears can you help me?
Give the Poké Ball a People ID of 0828. That should fix your problem.

Gold Man
July 23rd, 2009, 02:20 PM
Ya but I forgot to say that the talking part dosen't come up what do I do about that?

diegoisawesome
July 23rd, 2009, 03:05 PM
Ya but I forgot to say that the talking part dosen't come up what do I do about that?
Since, apparently, you're using the old version of XSE, either update to the new one and put 0x2 after your msgbox command or put boxset 0x2 under the msgbox command if you don't want to update it for whatever reason.

Gold Man
July 23rd, 2009, 03:43 PM
Well when I put boxset 6 when I closed it and open it, it change my script into the one that dosn't work and it did that all by it self. And what do you mean by put 0x2 after your msgbox command?

Sorry about that my scripts never work :(

diegoisawesome
July 23rd, 2009, 04:17 PM
Well when I put boxset 6 when I closed it and open it, it change my script into the one that dosn't work and it did that all by it self. And what do you mean by put 0x2 after your msgbox command?

Sorry about that my scripts never work :(
Did you recompile with dynamic offsets or static? If static, then you overwrote some stuff from one part of your script with another. Try repointing the first part to a different offset.

lugia386
July 23rd, 2009, 07:27 PM
very usefull... how ever, how come no one ever ****ing tells you how to add new events, i cant for the LIFE of me, figure out how, apparantly it must be "easy" if no one will say how, but why? I dont know how, it is vital information for absolute beginners like my self.

.Seth
July 23rd, 2009, 08:17 PM
very usefull... how ever, how come no one ever ****ing tells you how to add new events, i cant for the LIFE of me, figure out how, apparantly it must be "easy" if no one will say how, but why? I dont know how, it is vital information for absolute beginners like my self.
Watch that language. :o

In A-Map, you go to a map, click the "Events" tab, then at the bottom of the right sidebar, you change the number of the events and hit Apply, or OK, whatever it may be.

Then you click the event tile after position it, and add it's offset etc.

Dragonmaster91
July 23rd, 2009, 09:41 PM
Watch that language. :o

In A-Map, you go to a map, click the "Events" tab, then at the bottom of the right sidebar, you change the number of the events and hit Apply, or OK, whatever it may be.

Then you click the event tile after position it, and add it's offset etc.
Is there an easier to understand explanation?\Sarcasm
Anyway, here's a tip to some people. Whenever you create a script and test it in-game, and it is destroyed, it means it either hit other parts of the game's data, or overwrote a previous script. Solution: Simple, save the script before compiling, and if it is bad in-game, use a different offset.

Of course, that is for the newbs\noobs.

Technically, I am a noob. But lately, I have really gotten a grasp on MANY things. Pretty much\Almost everything but creating sprites.

flamezy boi
July 24th, 2009, 02:31 AM
Is there an easier to understand explanation?\Sarcasm
Anyway, here's a tip to some people. Whenever you create a script and test it in-game, and it is destroyed, it means it either hit other parts of the game's data, or overwrote a previous script. Solution: Simple, save the script before compiling, and if it is bad in-game, use a different offset.

Of course, that is for the newbs\noobs.

Technically, I am a noob. But lately, I have really gotten a grasp on MANY things. Pretty much\Almost everything but creating sprites.
SOME 1 ANY 1 PLEASE!!!!! HELP i have been trying all day...

#dynamic 0x800018

#org @start
lock
faceplayer
msgbox @1 0x6
release
end

#org @1
= Hi.
^i wuld try that and many other ways but when i go on the emulator the sprite
doesnt respond at all....

Cynder The Bloody Angel
July 24th, 2009, 02:46 AM
... WOOOOOOOW THAT is a tutorial ! man thanks a lot !

lugia386
July 24th, 2009, 10:10 AM
i thought this tutorial could help but i guess its just me who fails...
i tried to do what it said, and the stuff doesnt work...
i try looking for what i needed to change, and it wasn't here....
i'm about ready to give up on hacking, becuase i can't get the help i need...
if some one can help me out live, over msn, or something, because i need some actual personal training on this stuff, cause i am ALWAYS running into problems that arent explained here, or as far as i know, anywhere...
my email is [email protected]
if and one wants to help me, please, please email me! I would be eternaly greatful!

.Seth
July 24th, 2009, 10:53 AM
Is there an easier to understand explanation?\Sarcasm
Anyway, here's a tip to some people. Whenever you create a script and test it in-game, and it is destroyed, it means it either hit other parts of the game's data, or overwrote a previous script. Solution: Simple, save the script before compiling, and if it is bad in-game, use a different offset.

Of course, that is for the newbs\noobs.

Technically, I am a noob. But lately, I have really gotten a grasp on MANY things. Pretty much\Almost everything but creating sprites.
It really can't get any simpler than that.
I mean, seriously.

SOME 1 ANY 1 PLEASE!!!!! HELP i have been trying all day...

#dynamic 0x800018

#org @start
lock
faceplayer
msgbox @1 0x6
release
end

#org @1
= Hi.
^i wuld try that and many other ways but when i go on the emulator the sprite
doesnt respond at all....
You have to put in the offset in A-map, if you didn't. Also, here is the corrected script:


#dynamic 0x 800000

#org @start
msgbox @1 0x2
end

#org @1
= Hi.

Simple, eh?
0x2 has lock and faceplayer built-in, so it's more stable.

i thought this tutorial could help but i guess its just me who fails...
i tried to do what it said, and the stuff doesnt work...
i try looking for what i needed to change, and it wasn't here....
i'm about ready to give up on hacking, becuase i can't get the help i need...
if some one can help me out live, over msn, or something, because i need some actual personal training on this stuff, cause i am ALWAYS running into problems that arent explained here, or as far as i know, anywhere...
my email is [email protected]
if and one wants to help me, please, please email me! I would be eternaly greatful!
Well, there's a tutoring section over in the main ROM Hacking section. Try signing up for Simple Scripting there.

I'm sure you can find a tutor.
Though, if you can't, just try editing a script. Like making it say something else.
Then move on to actually creating a script, if that way works for you.

Gold Man
July 25th, 2009, 11:56 AM
Umm I found an update of xse but it toke away the
'---------------
#org 0x800A9B
= [player]: This must be oak's\n pokemon I better take it to him.

Part can you help me?

Never mind I figriad it out.
Ps: the talking sill dosn't come up and the update of xse change my script to this:
'---------------
#org 0x800A3D
lock
checkflag 0x828
if 0x1 goto 0x8800A96
checkgender
compare LASTRESULT 0x0
if 0x1 goto 0x8800A60
compare LASTRESULT 0x1
if 0x1 goto 0x8800A7B
end
'---------------
#org 0x800A96
hidesprite 0x1
end
'---------------
#org 0x800A60
givepokemon 0x88 0x5 0x0 0x0 0x0 0x0
loadpointer 0x0 0x8800A9B '"[player]: This must be oak's\n pok..."
setflag 0x828
release
end
'---------------
#org 0x800A7B
givepokemon 0x87 0x5 0x0 0x0 0x0 0x0
loadpointer 0x0 0x8800A9B '"[player]: This must be oak's\n pok..."
setflag 0x828
release
end

'---------
' Strings
'---------
#org 0x800A9B
= [player]: This must be oak's\n pokemon I better take it to him.

quickfire
July 26th, 2009, 06:33 AM
How does XSE work? Everytime I try to type in a script and try to compile, it always tells me unknown word at such-and-such line. Thats with EVERY thing I try.

Dragonmaster91
July 26th, 2009, 07:28 AM
It really can't get any simpler than that.
I mean, seriously. Hence the /sarcasm line there.

How does XSE work? Everytime I try to type in a script and try to compile, it always tells me unknown word at such-and-such line. Thats with EVERY thing I try.Maybe you should fix the thing on that line.

Here is a script, a level script:

#org 0x3CA314
showsprite 0x3
showsprite 0x6
setvar 0x7000 0x1
msgbox 0x83CA37D MSG_YESNO
compare LASTRESULT 0x1
if 0x1 goto 0x83CA33B
setflag 0x207
loadpointer 0x0 0x83CA3A3
applymovement MOVE_PLAYER 0x83CA496
waitmovement 0xFF
trainerbattle 0x0 0x2 0x0 0x83CA3D5 0x83CA3F9
setflag 0x208
msgbox 0x83CA421 MSG_NORMAL
applymovement 0x3 0x83CA499
hidesprite 0x3
msgbox 0x83CA45C MSG_NORMAL
applymovement 0x6 0x83CA4A1
hidesprite 0x6
release
end

#org 0x3CA33B
applymovement MOVE_PLAYER 0x83CA496
waitmovement 0xFF
trainerbattle 0x0 0x2 0x0 0x83CA3D5 0x83CA3F9
setflag 0x208
msgbox 0x83CA421 MSG_NORMAL
applymovement 0x3 0x83CA499
hidesprite 0x3
msgbox 0x83CA45C MSG_NORMAL
applymovement 0x6 0x83CA4A1
hidesprite 0x6
release
end

#org 0x3CA37D
= Prof. Oak: Are you ready to battle?

#org 0x3CA3A3
= Prof. Oak: Ok, well step up when\nyou are ready.

#org 0x3CA3D5
= [rival]: So you think you can\nbeat me?

#org 0x3CA3F9
= [rival]: How can a loser like you\nbeat me?

#org 0x3CA421
= Professor Oak: I will be in the\ncave if anyone needs me.

#org 0x3CA45C
= [rival]: Gramps, wait!\pI want to give you back this\npokemon!

#org 0x3CA496
#raw 0x11
#raw 0xFE

#org 0x3CA499
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0xFE

#org 0x3CA4A1
#raw 0x11
#raw 0x11
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0xFEWhen I beat him, I just get asked the question again. If I say yes that time, it will continue, then ask me the question AGAIN. If I say no, it does the step up thing, and then repeats. I actually need help again. Can anyone figure it out?

Edit: Figured it out. Set a variable at the end of the script to 0x2. Say you use setvar 0x7000 0x1 in the previous script. In order for it to work only AFTER you set the var, go to the part where you enter the variable normally, and in value, put in 0001. In order for the script to only happen once, and not repeat forever and ever, you have to use setvar 0x7000 0x2. That's right, 0x2. Giving it a different value, makes the script not happen because the script only works if the value is set to...


0x1!

Guess that's kind of an important part of the tut. Diego, you should add this to the level script tutorial.

indohekrz
July 26th, 2009, 11:54 PM
Wow! This tutorial is answer my problem on scripting. Thank you.

boytjuh
July 27th, 2009, 03:52 PM
I saw someone asking a question so:
I started working on my own hack today. I never made any scripts for anything before but managed to make a give pokémon script, and made the character dissapear, but the only thing is that i needed a pokédex. Now i did a setflag 829 to obtain the pokédex but the pokémon giving character also tells my nationaldex data in a bugged way. Is there anyway to solve that?
Well here's the script, maybe some corrections possible? (should be :3) OR maybe another way to add pokédex?
#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x828
checkflag 0x829
msgbox @1 0x4
goto @take
release
end

#org @take
givepokemon 0x83 0x5 0x0 0x0 0x0 0x0
msgbox @2 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @3 0x6
compare LASTRESULT 0x1
setflag 0x829
call 0x1A743B
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @done
msgbox @4 0x6

#org @1
= Hi!\pYou should take this\nLAPRAS.\p It's dangerous out there\pwithout a Pokémon!

#org @2
= You obtained an LAPRAS!

#org @3
= You also need a Pokédex!\pYou received Pokédex!

#org @4
= I have to go now,\p See you around?

Dragonmaster91
July 27th, 2009, 07:43 PM
I saw someone asking a question so:
I started working on my own hack today. I never made any scripts for anything before but managed to make a give pokémon script, and made the character dissapear, but the only thing is that i needed a pokédex. Now i did a setflag 829 to obtain the pokédex but the pokémon giving character also tells my nationaldex data in a bugged way. Is there anyway to solve that?
Well here's the script, maybe some corrections possible? (should be :3) OR maybe another way to add pokédex?
#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x828
checkflag 0x829
msgbox @1 0x4
goto @take
release
end

#org @take
givepokemon 0x83 0x5 0x0 0x0 0x0 0x0
msgbox @2 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @3 0x6
compare LASTRESULT 0x1
setflag 0x829
call 0x1A743B
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @done
msgbox @4 0x6

#org @1
= Hi!\pYou should take this\nLAPRAS.\p It's dangerous out there\pwithout a Pokémon!

#org @2
= You obtained an LAPRAS!

#org @3
= You also need a Pokédex!\pYou received Pokédex!

#org @4
= I have to go now,\p See you around?You screwed it up bad... Let me fix it, hang on.

Edit: I'm not even going to boldificate the changes, thats how much I changed.

#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x828
if 0x0 goto @take
release
end

#org @take
msgbox @1 0x6
givepokemon 0x83 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @2 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @3 0x6
setflag 0x829
msgbox @4 0x6
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @1
= Hi!\pYou should take this\nLAPRAS.\p It's dangerous out there\pwithout a Pokémon!

#org @2
= You obtained an LAPRAS!

#org @3
= You also need a Pokédex!\pYou received Pokédex!

#org @4
= I have to go now,\p See you around? #org @done
msgbox @4 0x6 You did not even have anything pointing at that. So, that became "loose" data.


#org @start
lock
faceplayer
checkflag 0x828
checkflag 0x829
msgbox @1 0x4
goto @take
release
endHere is all you needed:

#org @start
lock
faceplayer
checkflag 0x828
if 0x1 goto @end
______________
and then put @take here without the #org @take.

I put the script in the simplest way I could, 'cause I felt lazy.

Or, simply:


#org @start
lock
faceplayer
checkflag 0x828
if 0x1 goto @end
msgbox @1 0x6
givepokemon 0x83 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @2 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @3 0x6
setflag 0x829
msgbox @4 0x6
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F (This should actually be the sprite you are talking to, I recommend against 0x800F)
setflag 0x200
release
endAnd #org @end would be like this:

#org @end
release
end

And your whole script:

#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x828
if 0x1 goto @end
msgbox @1 0x6
givepokemon 0x83 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @2 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @3 0x6
setflag 0x829
msgbox @4 0x6
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @end
release
end


#org @1
= Hi!\pYou should take this\nLAPRAS.\p It's dangerous out there\pwithout a Pokémon!

#org @2
= You obtained an LAPRAS!

#org @3
= You also need a Pokédex!\pYou received Pokédex!

#org @4
= I have to go now,\p See you around?That is how I am used to doing it.

Does this help?

It should, because now, even I know what I am doing.

boytjuh
July 28th, 2009, 01:54 AM
Thanks ALOT! I've been looking what i had to do for a while lol, since I'm new at scripting. ;) EDIT: It works :D

Dragonmaster91
July 28th, 2009, 05:53 AM
Thanks ALOT! I've been looking what i had to do for a while lol, since I'm new at scripting. ;) EDIT: It works :D
Told you, I know what I'm doing... Funny, a month ago, I would have had no clue...

justdieplz
July 28th, 2009, 10:07 AM
This thread is not for fixing scripts, please move to the script help thread by HackMew to continue

Dragonmaster91
July 28th, 2009, 12:00 PM
This thread is not for fixing scripts, please move to the script help thread by HackMew to continue
Wow, that's nice of you. You won't help someone on a script that was obviously one of their first, instead you refer them over there. Next time, make sure at the very least, that no one has already helped them, AT THE VERY LEAST.

Gold Man
July 28th, 2009, 01:46 PM
Umm angian why dose the talking part dosn't come up?

Dragonmaster91
July 28th, 2009, 02:32 PM
Umm angian why dose the talking part dosn't come up?
That's because it has loadpointer. Replace that with msgbox. Is it a question, or statement? If it is a statement, try msgbox @(pointer) 0x6. If it is a question, try msgbox @(pointer) 0x5.

All loadpointer does is.. load... Not necessarily load a text box, especially if it does not know which kind.

Pokepal17
July 29th, 2009, 06:41 AM
That's because it has loadpointer. Replace that with msgbox. Is it a question, or statement? If it is a statement, try msgbox @(pointer) 0x6. If it is a question, try msgbox @(pointer) 0x5.

All loadpointer does is.. load... Not necessarily load a text box, especially if it does not know which kind.

Msgbox will work.
Loadpointer is a command used in the msgbox construct (loadpointer & callstd) and it works differently on it's own, if not used in that construct.

icyace
July 29th, 2009, 06:47 AM
This tutorial helped me a lot, tnx.

Dragonmaster91
July 29th, 2009, 07:11 AM
Msgbox will work.
Loadpointer is a command used in the msgbox construct (loadpointer & callstd) and it works differently on it's own, if not used in that construct.
Thank you, I did not know that.

joshay
July 29th, 2009, 10:48 AM
Cheers for the tutorial, I've bookmarked it and use it for reference loads.
cheers :)

Josephine
July 31st, 2009, 04:33 AM
Say I have the offset for some text, is there any way for me to find out the offset of the script which calls that text?

A search function would be handy, of course I haven't a clue whether that's possible though.

indohekrz
July 31st, 2009, 10:27 PM
How do I can activate national dex on Ruby/Sapphire???

Using flag or special?
What's the hex?

0m3GA ARS3NAL
July 31st, 2009, 10:36 PM
Say I have the offset for some text, is there any way for me to find out the offset of the script which calls that text?

A search function would be handy, of course I haven't a clue whether that's possible though.

Yeah, lets sat the offset of the text is 0x823131, you would do a search (In a hex editor) for 31318208 (Because we use Hex reversal)

AaBbCcDd
would become
DdCcBbAa

Pokepal17
August 1st, 2009, 05:00 AM
How do I can activate national dex on Ruby/Sapphire???

Using flag or special?
What's the hex?

No flag or special, I think it's ASM or editing something in the RAM.

0m3GA ARS3NAL
August 1st, 2009, 07:01 AM
To activate the Nat. Dex? No, that is a special, just which one. Here's a tip, look at the script that gives you the Nat. Dex, and use that.

Very Wrong.
There is no script in R/S that gives you the National Pokedex.
There is an ASM code / Action Replay code that does that.

HackinJohn
August 1st, 2009, 12:49 PM
I've tried everything, so I need help.
I'm trying to make my Oak overworld (Person Event No.: 3) to disappear completely once I talk to him, and he does, but as soon as I come back to the map, he's back. o.O;

#dynamic 0x71A36B

#org @start
lock
faceplayer
msgbox @1 0x4
closeonkeypress
fanfare 0x100
special 0x16F
waitfanfare
fadescreen 0x0
msgbox @2 0x6
applymovement 0x3 @oak
waitmovement 0x0
setflag 0x2000
release
end

#org @1
= Oh, [PLAYER], I'm glad I caught you!\pI forgot to give you your upgrade!

#org @2
= With that upgrade, you will be\nable to keep account of more than\ljust the Kanto Pokemon!\pIsn't it fantastic!?\pWell, I must be going. Don't let\nme down!

#org @oak
#raw 0x01
#raw 0x11
#raw 0x60
#raw 0x11
#raw 0xFE

Thanks ahead of time [:

hygz1223
August 3rd, 2009, 09:00 AM
i need help in the giveitem script. i type it in and it says #define on line 21 with hs the msg_obtain

indohekrz
August 4th, 2009, 11:50 PM
I've tried everything, so I need help.
I'm trying to make my Oak overworld (Person Event No.: 3) to disappear completely once I talk to him, and he does, but as soon as I come back to the map, he's back. o.O;

#dynamic 0x71A36B

#org @start
lock
faceplayer
msgbox @1 0x4
closeonkeypress
fanfare 0x100
special 0x16F
waitfanfare
fadescreen 0x0
msgbox @2 0x6
applymovement 0x3 @oak
waitmovement 0x0
hidesprite 0x3
setflag 0x2000
release
end

#org @1
= Oh, [PLAYER], I'm glad I caught you!\pI forgot to give you your upgrade!

#org @2
= With that upgrade, you will be\nable to keep account of more than\ljust the Kanto Pokemon!\pIsn't it fantastic!?\pWell, I must be going. Don't let\nme down!

#org @oak
#raw 0x01
#raw 0x11
#raw 0x60
#raw 0x11
#raw 0xFE

Thanks ahead of time [:

Do you put the flag on Oak's overworld???

You must put:
People ID: 2000

Or maybe, you must use hidesprite (the red text).

NintendoWalkthrudude
August 5th, 2009, 11:53 PM
I find this tutorial very useful diego, but I have a question.

I want it so when you talk to Professor Oak he says, "Want a pokemon?" and if you say yes he gives you a totodile, but if you say no he gives you a cyndaquil anyways. How can I get this to happen? I tried combining both the YES/NO script with the give pokemon script and it didn't work..

indohekrz
August 6th, 2009, 12:36 AM
I find this tutorial very useful diego, but I have a question.

I want it so when you talk to Professor Oak he says, "Want a pokemon?" and if you say yes he gives you a totodile, but if you say no he gives you a cyndaquil anyways. How can I get this to happen? I tried combining both the YES/NO script with the give pokemon script and it didn't work..

Try this script:
#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 goto @done
checkflag 0x828
if 0x0 goto @willgive
end

#org @done
lock
faceplayer
msgbox @already 0x6
release
end

#org @willgive
lock
faceplayer
msgbox @ask 0x5
compare LASTRESULT 0x0
if 0x1 goto @cyndaquil
compare LASTRESULT 0x1
if 0x1 goto @totodile
end

#org @cyndaquil
msgbox @givecynda 0x4
givepokemon 0x9B 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @get 0x4
waitfanfare
msgbox @takecare 0x6
setflag 0x828
release
end

#org @totodile
msgbox @givetoto 0x4
givepokemon 0x9E 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @get2 0x4
waitfanfare
msgbox @takecare 0x6
setflag 0x828
release
end

#org @already
= That is Johto pokemon.

#org @ask
= Want a pokemon?

#org @get
= [player] received Cyndaquil from Oak.

#org @get2
= [player] received Totodile from Oak.

#org @givecynda
= But, you need a pokemon.\pThis pokemon for you.

#org @givetoto
= Okay, this is for you.

#org @takecare
= Please take care of your\npokemon.


Attention: This only work if you don't have a pokemon.

If you have a pokemon, change the flag to other flag.
Example: ... 0x828 change to ... 0x900 (... = setflag or checkflag.)

NintendoWalkthrudude
August 6th, 2009, 10:07 AM
Try this script:
#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 goto @done
checkflag 0x828
if 0x0 goto @willgive
end

#org @done
lock
faceplayer
msgbox @already 0x6
release
end

#org @willgive
lock
faceplayer
msgbox @ask 0x5
compare LASTRESULT 0x0
if 0x0 goto @cyndaquil
compare LASTRESULT 0x1
if 0x1 goto @totodile
end

#org @cyndaquil
msgbox @givecynda 0x4
givepokemon 0x9B 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @get 0x4
waitfanfare
msgbox @takecare 0x6
setflag 0x828
release
end

#org @totodile
msgbox @givetoto 0x4
givepokemon 0x9E 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @get2 0x4
waitfanfare
msgbox @takecare 0x6
setflag 0x828
release
end

#org @already
= That is Johto pokemon.

#org @ask
= Want a pokemon?

#org @get
= [player] received Cyndaquil from Oak.

#org @get2
= [player] received Totodile from Oak.

#org @givecynda
= But, you need a pokemon.\pThis pokemon for you.

#org @givetoto
= Okay, this is for you.

#org @takecare
= Please take care of your\npokemon.


Attention: This only work if you don't have a pokemon.

If you have a pokemon, change the flag to other flag.
Example: ... 0x828 change to ... 0x900 (... = setflag or checkflag.)

Thank you, but when I click NO, it just he just repeats the question!

diegoisawesome
August 6th, 2009, 10:25 AM
Thank you, but when I click NO, it just he just repeats the question!
#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 goto @done
checkflag 0x828
if 0x0 goto @willgive
end

#org @done
lock
faceplayer
msgbox @already 0x6
release
end

#org @willgive
lock
faceplayer
msgbox @ask 0x5
compare LASTRESULT 0x0
if 0x1 goto @cyndaquil
compare LASTRESULT 0x1
if 0x1 goto @totodile
end

#org @cyndaquil
msgbox @givecynda 0x4
givepokemon 0x9B 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @get 0x4
waitfanfare
msgbox @takecare 0x6
setflag 0x828
release
end

#org @totodile
msgbox @givetoto 0x4
givepokemon 0x9E 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @get2 0x4
waitfanfare
msgbox @takecare 0x6
setflag 0x828
release
end

#org @already
= That is Johto pokemon.

#org @ask
= Want a pokemon?

#org @get
= [player] received Cyndaquil from Oak.

#org @get2
= [player] received Totodile from Oak.

#org @givecynda
= But, you need a pokemon.\pThis pokemon for you.

#org @givetoto
= Okay, this is for you.

#org @takecare
= Please take care of your\npokemon.
Before, the script was checking for "if not no, goto @cyndaquil" and "if yes, it's yes, then go to @totodile", but I fixed it.