PHO - Pokémon Hackers Online
Go Back   PHO - Pokémon Hackers Online > Discussion Board > Archive

Notices

Archive Old threads that serve no purpose are here.

 
 
Thread Tools Display Modes
Old 9th January 2013, 04:43 AM   #1
Shiny Quagsire
Super Awesome Ninja ASM Guy
PHO VIP
 
Shiny Quagsire's Avatar
 
Join Date: Apr 2010
Age: 20
Posts: 62
Shiny Quagsire
Default Shiny Quagsire's XSE Tutorial of Epic Proportions!

NOTE: This is just a direct Copy+Paste job from the old forums.

Hey guys! I've been getting a lot of PM's on scripting help, so I decided to make a tutorial of general scripts. It is written with XSE. I prefer XSE ofer pokescript, simply since it's more up to date and less buggy.

Simple Scripting


Scripting Basics
Spoiler:

Before you script, you have to know a lot of thigs first.

#dynamic - Where to look for free space from.
#org - This is a section in a script. Think of is as a grocery conveyor belt. It has a lot of groceries all in a line.
end - this ends the part of the script

Example layout:
Code:
#dynamic 0x800000

#org @start
end
arguments - Things a command needs before it does it. Kinda like a vending machine. It needs money and the number of the candy.
Example:
Code:
msgbox @msg 0x2
@msg and 0x2 are arguments.

string - Basically a string of letters to make a sentence.

Example:
Code:
#org @msg
= Hello! Nice to meet you.


Simple Messages
Spoiler:

One of the most basic scripts out there is the simple message script.
In this part, we'll use these new commands:
Code:
lock -Disables movement
faceplayer -Makes the person face you
msgbox -Makes a message
release -Let's us move again
First, let's look at an example:
Code:
#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @hello 0x2
release
end

#org @hello
= Hello World!
Let's break it up:
lock -locks us
faceplayer -he looks at us
msgbox @hello 0x2 [email protected] is where to get the message. 0x2 tells it we want a basic message.
release -Let's us move
end -ends the script

Let's look at the string:
Code:
#org @hello
= Hello World
Notice the '=' after @hello. This tells it that it is a string, and not the main part of the script.

Congratulations! You made your first script!


Escape Sequences
Spoiler:

Yes, the title is pretty scary isn't it? Well, it's actually the best thing in the world.

Let's say we want to say more than a line of text, like:
Code:
Hello World!
I like pie!
Banana cream pie!
If you tried this, it would overlap the other text. We need escape sequences!

Here s a list of escape sequences:
Code:
\n - Goes from the top line, to the next line. You'll only need this about once.
\p - Goes to a new box. I don't use this very much
\l - Scrolls to a new line. You'll use this a lot.
But how do we use these thingys? It's simple. Add them to your string like this:
Code:
#org @msg
= Hello World!\nI like pie!\lBanana cream pie!
Wasn't that easy? [i]But,[i] a common mistake is people use frontslash (/) instead of backslash (\). That is a very bad thing.
If you use frontslash, it won't work.


Yes and No Scripts
Spoiler:

Messages are nice, but what is we want a yes/no situation? In this part, I'll show you how!

New Commands in this section are:
Code:
compare - Used to compare variables
if - What if the variable is equal or not?
goto - Goes to another part of the script
Yes and No scripts are very useful, like when giving an item or pokemon. Believe it or not, it is very simple.
To make a yes/no, use this command:
Code:
msgbox @yesno 0x5
The 0x5 signifies that is is a yes/no message. But how do we find out what they said? It is delivered to the LASTRESULT variable.
Let's look at an example:
Code:
#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @yesno 0x5
compare lastresult 0x1 'Check is lastresult is 0x1, or "yes"
if 0x1 goto @yespart 'If it's true, goto @yespart
msgbox @no 0x2 'It continues on with the script is no.
release
end

'Another section
#org @yespart
msgbox @yes 0x2 'Say our yes message
release
end

#org @yesno
= Do you like pie?

#org @yes
= Me too!

#org @no
= Oh well, I'll ask someone else.
As you can see, it's a little more advanced, but it also uses prior knowledge.

Congratulations! You've made a yes/no script!


Wild Battles and Cries
Spoiler:

Every game usually has a legendary battle or special event. In this part, We are going to to make a battle!

New commands used:
Code:
cry - Plays a pokemon's cry
wildbattle - Makes a wild battle!
setflag - This sets a flag. More details later.
Making a battle is relatively easy. All you need is a messagebox, a cry, and a battle.
First, before starting, find an overworld you want to battle. If you want it to disappear, set it's ID to a number at about 1000 or more.

Now, let's examine how our new commands work:
Code:
wildbattle 0x197 0x32 0x0
0x197 - The pokemon's ID. Use the list below.
0x32 - The pokemon's level in hex. It has to be hex, or it won't work.
0x0 - The pokemon's item ID. Most battles won't have anything held.

cry 0x197 0x0
0x197 - Again, out pokemon's ID.
0x0 - Effect #. No clue about that yet.
Pokemon's ID (Taken From XSE)
Spoiler:

MISSINGNO 0x0
BULBASAUR 0x1
IVYSAUR 0x2
VENUSAUR 0x3
CHARMANDER 0x4
CHARMELEON 0x5
CHARIZARD 0x6
SQUIRTLE 0x7
WARTORTLE 0x8
BLASTOISE 0x9
CATERPIE 0xA
METAPOD 0xB
BUTTERFREE 0xC
WEEDLE 0xD
KAKUNA 0xE
BEEDRILL 0xF
PIDGEY 0x10
PIDGEOTTO 0x11
PIDGEOT 0x12
RATTATA 0x13
RATICATE 0x14
SPEAROW 0x15
FEAROW 0x16
EKANS 0x17
ARBOK 0x18
PIKACHU 0x19
RAICHU 0x1A
SANDSHREW 0x1B
SANDSLASH 0x1C
NIDORANF 0x1D
NIDORINA 0x1E
NIDOQUEEN 0x1F
NIDORANM 0x20
NIDORINO 0x21
NIDOKING 0x22
CLEFAIRY 0x23
CLEFABLE 0x24
VULPIX 0x25
NINETALES 0x26
JIGGLYPUFF 0x27
WIGGLYTUFF 0x28
ZUBAT 0x29
GOLBAT 0x2A
ODDISH 0x2B
GLOOM 0x2C
VILEPLUME 0x2D
PARAS 0x2E
PARASECT 0x2F
VENONAT 0x30
VENOMOTH 0x31
DIGLETT 0x32
DUGTRIO 0x33
MEOWTH 0x34
PERSIAN 0x35
PSYDUCK 0x36
GOLDUCK 0x37
MANKEY 0x38
PRIMEAPE 0x39
GROWLITHE 0x3A
ARCANINE 0x3B
POLIWAG 0x3C
POLIWHIRL 0x3D
POLIWRATH 0x3E
ABRA 0x3F
KADABRA 0x40
ALAKAZAM 0x41
MACHOP 0x42
MACHOKE 0x43
MACHAMP 0x44
BELLSPROUT 0x45
WEEPINBELL 0x46
VICTREEBEL 0x47
TENTACOOL 0x48
TENTACRUEL 0x49
GEODUDE 0x4A
GRAVELER 0x4B
GOLEM 0x4C
PONYTA 0x4D
RAPIDASH 0x4E
SLOWPOKE 0x4F
SLOWBRO 0x50
MAGNEMITE 0x51
MAGNETON 0x52
FARFETCHED 0x53
DODUO 0x54
DODRIO 0x55
SEEL 0x56
DEWGONG 0x57
GRIMER 0x58
MUK 0x59
SHELLDER 0x5A
CLOYSTER 0x5B
GASTLY 0x5C
HAUNTER 0x5D
GENGAR 0x5E
ONIX 0x5F
DROWZEE 0x60
HYPNO 0x61
KRABBY 0x62
KINGLER 0x63
VOLTORB 0x64
ELECTRODE 0x65
EXEGGCUTE 0x66
EXEGGUTOR 0x67
CUBONE 0x68
MAROWAK 0x69
HITMONLEE 0x6A
HITMONCHAN 0x6B
LICKITUNG 0x6C
KOFFING 0x6D
WEEZING 0x6E
RHYHORN 0x6F
RHYDON 0x70
CHANSEY 0x71
TANGELA 0x72
KANGASKHAN 0x73
HORSEA 0x74
SEADRA 0x75
GOLDEEN 0x76
SEAKING 0x77
STARYU 0x78
STARMIE 0x79
MRMIME 0x7A
SCYTHER 0x7B
JYNX 0x7C
ELECTABUZZ 0x7D
MAGMAR 0x7E
PINSIR 0x7F
TAUROS 0x80
MAGIKARP 0x81
GYARADOS 0x82
LAPRAS 0x83
DITTO 0x84
EEVEE 0x85
VAPOREON 0x86
JOLTEON 0x87
FLAREON 0x88
PORYGON 0x89
OMANYTE 0x8A
OMASTAR 0x8B
KABUTO 0x8C
KABUTOPS 0x8D
AERODACTYL 0x8E
SNORLAX 0x8F
ARTICUNO 0x90
ZAPDOS 0x91
MOLTRES 0x92
DRATINI 0x93
DRAGONAIR 0x94
DRAGONITE 0x95
MEWTWO 0x96
MEW 0x97
CHIKORITA 0x98
BAYLEEF 0x99
MEGANIUM 0x9A
CYNDAQUIL 0x9B
QUILAVA 0x9C
TYPHLOSION 0x9D
TOTODILE 0x9E
CROCONAW 0x9F
FERALIGATR 0xA0
SENTRET 0xA1
FURRET 0xA2
HOOTHOOT 0xA3
NOCTOWL 0xA4
LEDYBA 0xA5
LEDIAN 0xA6
SPINARAK 0xA7
ARIADOS 0xA8
CROBAT 0xA9
CHINCHOU 0xAA
LANTURN 0xAB
PICHU 0xAC
CLEFFA 0xAD
IGGLYBUFF 0xAE
TOGEPI 0xAF
TOGETIC 0xB0
NATU 0xB1
XATU 0xB2
MAREEP 0xB3
FLAAFFY 0xB4
AMPHAROS 0xB5
BELLOSSOM 0xB6
MARILL 0xB7
AZUMARILL 0xB8
SUDOWOODO 0xB9
POLITOED 0xBA
HOPPIP 0xBB
SKIPLOOM 0xBC
JUMPLUFF 0xBD
AIPOM 0xBE
SUNKERN 0xBF
SUNFLORA 0xC0
YANMA 0xC1
WOOPER 0xC2
QUAGSIRE 0xC3
ESPEON 0xC4
UMBREON 0xC5
MURKROW 0xC6
SLOWKING 0xC7
MISDREAVUS 0xC8
UNOWN 0xC9
WOBBUFFET 0xCA
GIRAFARIG 0xCB
PINECO 0xCC
FORRETRESS 0xCD
DUNSPARCE 0xCE
GLIGAR 0xCF
STEELIX 0xD0
SNUBBULL 0xD1
GRANBULL 0xD2
QWILFISH 0xD3
SCIZOR 0xD4
SHUCKLE 0xD5
HERACROSS 0xD6
SNEASEL 0xD7
TEDDIURSA 0xD8
URSARING 0xD9
SLUGMA 0xDA
MAGCARGO 0xDB
SWINUB 0xDC
PILOSWINE 0xDD
CORSOLA 0xDE
REMORAID 0xDF
OCTILLERY 0xE0
DELIBIRD 0xE1
MANTINE 0xE2
SKARMORY 0xE3
HOUNDOUR 0xE4
HOUNDOOM 0xE5
KINGDRA 0xE6
PHANPY 0xE7
DONPHAN 0xE8
PORYGON2 0xE9
STANTLER 0xEA
SMEARGLE 0xEB
TYROGUE 0xEC
HITMONTOP 0xED
SMOOCHUM 0xEE
ELEKID 0xEF
MAGBY 0xF0
MILTANK 0xF1
BLISSEY 0xF2
RAIKOU 0xF3
ENTEI 0xF4
SUICUNE 0xF5
LARVITAR 0xF6
PUPITAR 0xF7
TYRANITAR 0xF8
LUGIA 0xF9
HOOH 0xFA
CELEBI 0xFB
TREECKO 0x115
GROVYLE 0x116
SCEPTILE 0x117
TORCHIC 0x118
COMBUSKEN 0x119
BLAZIKEN 0x11A
MUDKIP 0x11B
MARSHTOMP 0x11C
SWAMPERT 0x11D
POOCHYENA 0x11E
MIGHTYENA 0x11F
ZIGZAGOON 0x120
LINOONE 0x121
WURMPLE 0x122
SILCOON 0x123
BEAUTIFLY 0x124
CASCOON 0x125
DUSTOX 0x126
LOTAD 0x127
LOMBRE 0x128
LUDICOLO 0x129
SEEDOT 0x12A
NUZLEAF 0x12B
SHIFTRY 0x12C
NINCADA 0x12D
NINJASK 0x12E
SHEDINJA 0x12F
TAILLOW 0x130
SWELLOW 0x131
SHROOMISH 0x132
BRELOOM 0x133
SPINDA 0x134
WINGULL 0x135
PELIPPER 0x136
SURSKIT 0x137
MASQUERAIN 0x138
WAILMER 0x139
WAILORD 0x13A
SKITTY 0x13B
DELCATTY 0x13C
KECLEON 0x13D
BALTOY 0x13E
CLAYDOL 0x13F
NOSEPASS 0x140
TORKOAL 0x141
SABLEYE 0x142
BARBOACH 0x143
WHISCASH 0x144
LUVDISC 0x145
CORPHISH 0x146
CRAWDAUNT 0x147
FEEBAS 0x148
MILOTIC 0x149
CARVANHA 0x14A
SHARPEDO 0x14B
TRAPINCH 0x14C
VIBRAVA 0x14D
FLYGON 0x14E
MAKUHITA 0x14F
HARIYAMA 0x150
ELECTRIKE 0x151
MANECTRIC 0x152
NUMEL 0x153
CAMERUPT 0x154
SPHEAL 0x155
SEALEO 0x156
WALREIN 0x157
CACNEA 0x158
CACTURNE 0x159
SNORUNT 0x15A
GLALIE 0x15B
LUNATONE 0x15C
SOLROCK 0x15D
AZURILL 0x15E
SPOINK 0x15F
GRUMPIG 0x160
PLUSLE 0x161
MINUN 0x162
MAWILE 0x163
MEDITITE 0x164
MEDICHAM 0x165
SWABLU 0x166
ALTARIA 0x167
WYNAUT 0x168
DUSKULL 0x169
DUSCLOPS 0x16A
ROSELIA 0x16B
SLAKOTH 0x16C
VIGOROTH 0x16D
SLAKING 0x16E
GULPIN 0x16F
SWALOT 0x170
TROPIUS 0x171
WHISMUR 0x172
LOUDRED 0x173
EXPLOUD 0x174
CLAMPERL 0x175
HUNTAIL 0x176
GOREBYSS 0x177
ABSOL 0x178
SHUPPET 0x179
BANETTE 0x17A
SEVIPER 0x17B
ZANGOOSE 0x17C
RELICANTH 0x17D
ARON 0x17E
LAIRON 0x17F
AGGRON 0x180
CASTFORM 0x181
VOLBEAT 0x182
ILLUMISE 0x183
LILEEP 0x184
CRADILY 0x185
ANORITH 0x186
ARMALDO 0x187
RALTS 0x188
KIRLIA 0x189
GARDEVOIR 0x18A
BAGON 0x18B
SHELGON 0x18C
SALAMENCE 0x18D
BELDUM 0x18E
METANG 0x18F
METAGROSS 0x190
REGIROCK 0x191
REGICE 0x192
REGISTEEL 0x193
KYOGRE 0x194
GROUDON 0x195
RAYQUAZA 0x196
LATIAS 0x197
LATIOS 0x198
JIRACHI 0x199
DEOXYS 0x19A
CHIMECHO 0x19B


Now, let's make a script!
Code:
#dynamic 0x800000

#org @start
lock
faceplayer
cry 0x197 0x0
msgbox @cry 0x2
wildbattle 0x197 0x32 0x0
setflag 0x1000 'Remember the person ID you used? Use it here instead of 0x1000. This makes the overworld will disappear.
release
end

#org @cry
= Rawr!
There you have it! You've just made a wild battle!


Flags
Spoiler:

Flags are probably the most common used things in special events.
But what is a flag? A flag is basically a true or false situation. If a flag is set, it's already happened. If not, it has yet to happen. Another common use it to permanently vanish a sprite, or make it re-appear.

Flags take up the same space as variables, and generally range from 0x0 to 0x9FF (that's 2559 flags). So no worries about running out of flags.

New Commands used in this section:
Code:
setflag - Sets a flag
clearflag - Clears the flag's value
checkflag - Checks a flag. Returns 0x1 if it's set.
So, now we got a jist of what flags are, but how do we use them? It's very simple. Here's how each commands works:
Code:
setflag 0x1000 - Sets flag 1000
clearflag 0x1000 - Clears the flag 1000
checkflag 0x1000 - Checks the flag
Let's see an example:
Code:
#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x1000
if 0x1 goto @talked
setflag 0x1000
msgbox @msg 0x2
release
end

#org @talked
msgbox @talkd 0x2
release
end

#org @msg
= This is your first time talking\nto me.

#org @talkd
= You already talked to me.
That code will allow the player to only talk to him once. This is very usefull for giving pokemon or items.
What if we want to let him talk again? That is easily done with clearflag. Here is a sort example of how to use clearflag.

Code:
clearflag 0x1000
Just add that to your script.

Now, earlier, I said you can permanently vanish a person. It is very easy. Simply set the person ID to the flag you will set. Then when you st the flag, he/she vanishes!

Hooray! Now we know how to use flags!


Giving Pokemon and Eggs in a Script
Spoiler:

Almost every game has someone who gives you a pokemon or an egg. In this section, we will easily do this.

New commands used in this section:
Code:
givepokemon - Pretty self explanatory
giveegg - ^Ditto Above^
countpokemon - counts your pokemon. Returns to lastresult.
fanfare - Plays a little jingle
Giving pokemon is pretty easy. Here is how each command works:
Code:
givepokemon 0x19 0x5 0x0 0x0 0x0 0x0
0x19 - The pokemon's ID
0x5 - The pokemon's level
1st 0x0 - The pokemon's item
the rest - Fillers

giveegg 0x1
0x1 - The pokemon's ID

countpokemon:
Code:
countpokemon
compare LASTRESULT 0x6
if 0x1 goto @toomany
That peice checks if there is too many pokemon. fanfare:
Code:
fanfare 0x101
msgbox @rec 0x2
That plays the little "Player recieved a banana" ditty.
Now, let's use it in a script:
Code:
#dynamic 0x800000

#org @start
lock
faceplayer
countpokemon
compare LASTRESULT 0x6
if 0x1 goto @toomany
givepokemon 0x19 0x5 0x0 0x0 0x0 0x0 'Replace with giveegg for an egg
fanfare 0x101
msgbox @player 0x2
setflag 0x1000 'Make the pokeball disappear
release
end

#org @player
= [PLAYER] recieved a PIKACHU!

#org @toomany
= [player] has too many pokemon!\n[player] leaves the POKEBALL alone.
Congrats! You can now give pokemon!


Intermediate Scripting


Welcome to the intermediate level! In this section, we'll deal with the meat of the scripting process.
I am assuming you have read the previous part of the tutorial. If you haven't, just simply go back and read it. In the code here, the #dynamic
is not included, since we already went over the basics.

Calling and Returning
Spoiler:

Calling is a method used to go to a section, and then come back. A good use of this would be to check something, set something, and come back.

New commands used:
Code:
call - calls another part of the script
gosub - Does the same thing as call
return - Returns from a called part of the script
Let's take a look at a good example:
Code:
#org @start
lock
faceplayer
msgbox @doyou 0x5
compare lastresult 0x1
if 0x1 call @give 'Call @give
msgbox @have 0x2
release
end

#org @give
givepokemon 0x1 0x5 0x0 0x0 0x0 0x0
fanfare 0x101
msgbox @player 0x2
return 'return from the call

#org @doyou
= Do you want a BULBASAUR?

#org @have
= Have a great day!

#org @player
= [player] recieved a BULBASAUR!
AS you can see, it calls @give, then it returns.

Congratulations! You just did your first intermediate tutorial!


Shiny Pokemon Battles (ASM Calling)
Spoiler:

Meh, this is pretty basic and easy, but it also isn't directly related to scripting either.

First off, get your hands on a program like Shinyzer (Made by HackMew), and open it, and find 144 bytes of free space. Then hit shinyze,(Is that a word?) and remember that offset you put in.

New Commands Introduced:
Code:
callasm - Calls ASM function. Shinyzer inserted a shiny ASM routine.
Using ASM is pretty easy to do. All you do is type
Code:
callasm 0xOFFSET
And it does whatever it does.

Here is an example:
Code:
#org @start
lock
faceplayer
cry 0x197 0x0
msgbox @cry 0x2
callasm 0xOFFSET 'Make pokemon shiny
wildbattle 0x6 0x32 0x0
callasm 0xOFFSET 'Make them normal
release
end

#org @cry
= Rawr!
I pretty much just copied my wild battle script from earlier, but this could also apply to givepokemon:
Code:
#org @start
lock
faceplayer
countpokemon
compare LASTRESULT 0x6
if 0x1 goto @toomany
callasm 0xoffset 'Make shiny
givepokemon 0x19 0x5 0x0 0x0 0x0 0x0
callasm 0xoffset 'Make it normal
fanfare 0x101
msgbox @player 0x2
release
end

#org @player
= [PLAYER] recieved a PIKACHU!

#org @toomany
= [player] has too many pokemon!\n[player] leaves the POKEBALL alone.
Yeah, I copied that too. But it's to show how easy it is to do!

Congrats! You can now have shiny pokemon! But please, don't overuse it!


Warps
Spoiler:

Every hack has a map with warps. You can also do it in a script! In this part, we will deal with warps and teleporting and holes!

New commands used in this part:
Code:
warp - Warps
warpmuted - Warps without noise
warpwalk - Warps with walking effect (Beats me :\)
warphole - Warps with the "Aaaaah! I'm falling" effect. :)
warpteleport - The kinda warp in Sabrina's GYM.
All of the warps have the same arguments, except warphole. Here are the arguments
Code:
warp 0xBANK 0xMAP 0xEXIT 0xX 0xY
warphole's arguments are different:
Code:
warphole 0xBANK 0xMAP
Personally, I've never used this command, but I know how it works. It takes your X position, and your Y position, and you fall on that spot in the warped map.

The script I'll use will be short and sweet:
Code:
#org @start
lock
faceplayer
msgbox @begone 0x2
warp 0x0 0x1 0x2 0x0 0x0
end

#org @begone
= Be gone!
Another interesting command in warp is this:
Code:
warp 0x0 0x1 0xFF 0x5 0x5
Now, you may be wondering "But there is no exit FF"
Well, FF makes it warp to the coordinates 5,5. Pretty cool!

Well, that's it about warps!


Giving Items
Spoiler:

I thought this didn't belong in the basics, because it can be pretty complicated.
Not much to say, so let's look at some commands:
Code:
giveitem - Gives an item
additem - Adds an item
checkitem - Checks an item
removeitem - Removes an item
addpcitem - Add item to PC
checkpcitem - Checks a pc item
Wow, a lot of commands!

Since we pretty much know a good understanding about scripts, I'll just explain how it's used.
Code:
giveitem 0x1 0x1 0x0
0x1 - Item ID
0x1 - Quantity
0x0 - Message type. 0x0 is obtained, 0x1 is found.

additem 0x1 0x1
0x1 - Item ID
0x1 - Quantity
The only difference is it has no message.

Code:
checkitem 0x1 0x1
compare lastresult 0x1
if 0x1 goto @otherpart
0x1 - Item ID 0x1 - Quantity removeitem 0x1 0x1 0x1 - Item ID 0x1 - Quantity addpcitem 0x1 0x1 0x1 - Item ID 0x1 - Quantity
Code:
checkpcitem 0x1 0x1
if 0x1 goto @yes
0x1 - Item ID 0x1 - Quantity
And that's it! Everything dealing with items!


Trainer Battles
Spoiler:

Ah, what is a game without a battle? In this section, we'll be making a battle!

New Commands:
Code:
trainerbattle - Makes a trainer battle
Usage:
Code:
trainerbattle 0x0 0x1 0x0 @intro @defeat
0x0 - The type of battle. 0x0 if regular, 0x1 is official, and 0x4 is double.
0x1 - The trainer ID. You can get this in A-Trainer.
0x0 - Filler
@intro - Intro message
@defeat - Defeated message (I just pwned you! XD)

Example in a script:
Code:
#org @start
lock
faceplayer
trainerbattle 0x0 0x59 0x0 @intro @defeat
msgbox @msg 0x2
release
end

#org @intro
= Yo, you must be a new trainer.\nLet's battle

#org @defeat
= You're not new?

#org @msg
= I'll just train harder!
Official Battles use an extra parameter at the end, usually to give a badge or something:
Code:
#org @start
trainerbattle 0x1 0x14E 0x0 @intro @defeat @after
msgbox @msg 0x2
end

#org @after
msgbox @msg2 0x2
end

#org @intro
= I'm GARY!\nLet's battle!

#org @defeat
= ...

#org @msg
= Haaaay!\nI'm GARY.

#org @msg2
= You beat me...\n...So?
That si a snippet taken from XSE. Here is another snippet taken from XSE for double battles.

Code:
#dynamic 0x800000

#org @start
trainerbattle 0x4 0x1EB 0x0 @intro @defeat @extra
msgbox @msg 0x2
end

#org @intro
= Hi!\nYou have to battle me\lHahaha

#org @defeat
= Meh, you beat me

#org @extra
= Uhm, you need 2 pokémon to double\nbattle

#org @msg
= I have learnt not to rush into\nthings.
Double battles also have another argument, for when you only have 1 pokemon. Pretty nive eh?

And that's it! How to make a trainer battle!


Advanced tutorials

These tutorials are for you extreme scripters that want to take it far!
Fading the Screen
Spoiler:

Forgot to put this in there, so I thought I minus well include this.

New commands:
Code:
fadescreen - fades the screen in a certain fasion
This command is pretty simple to use, so let's look at an example:
Code:
fadescreen 0x1
fadescreen 0x0
Notice the arguments. Here is a list of what to put in there:
Spoiler:

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

There you have it! Pretty simple!


Applymovement Scripts
Spoiler:

Ah, yes, the applymovement. The prime of the scripting age, and also the hardest thing to master. In this part, we'll be movin' and groovin'!

New Commands Used:
Code:
applymovement - Applys a list of movements to an overworld.
Here is a list of applymovements for fire red:
Spoiler:

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


Ruby/Sapphire
Spoiler:

#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 = Slide Down
#raw 0x16 = Slide Up
#raw 0x17 = Slide Left
#raw 0x18 = Slide Right
#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 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 (Lef)
#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

Now, when using applymovement, you follow it with waitmovement 0x0. waitmovement 0x0 pauses the script for exactly how long the movements take. Pretty neat eh?
applymovement workd like this:
Code:
applymovement [person #] [movement list]
or
applymovement 0xFF @move
When using applymovement, 0xFF would move the player, and a movement list would look like this:
Code:
#org @move
#raw 0x10 0x11 0x66 0xFE
That would make him step up, step down, have the ^_^ thing, and 0xFE ends it.
Let's look at a script as an example:
Code:
#org @start
lock
faceplayer
applymovement 0xFF @move
waitmovement 0x0
msgbox @youmove 0x2
release
end

#org @move
#raw 0x10 0x11 0x12 0x13 0xFE

#org @youmove
= You moved!
I guess there isn't much to say about it. Just make sure you use the right list, and have fun moving!


Weather Commands
Spoiler:

We live on a beautiful Earth with lots of weather don't we? Well, now let's make some weather in a script!

New Commands:
Code:
setweather [weather type] - Set's the weather
doweather - Does the set weather
resetweather - Resets to the default weather
Weather is quite easy. I'm not going to give you a list of weather, but you can find it in advanced map.
Here's how to use it:
Code:
#org @start
lock
setweather 0x3
doweather
msgbox @it 0x2
release
end

#org @it
= It's raining!
As you can see, that makes it rain! To set it back, simply use resetweather.
And that's it! Whether rain or snow, you can always change the weather!


Pokemarts
Spoiler:

Yes, no game is complete without some stuff to buy is it?

New Commands:
Code:
pokemart [values] - Makes a pokemart
Pokemarts are like applymovements. Simply make a list of the item's ID like in the applymovements.
Example:
Code:
#org @start
lock
faceplayer
pokemart @stuff
release
end

#org @stuff
#raw 0x1 0xD 0xE 0x22 0x3F 0x0
As you can see, the raw are a masterball, a potion, an antidote, an ether, and an HP UP.

Here is a list of the items taken from XSE:
Spoiler:

#define ITEM_NONE 0x0
#define ITEM_MASTERBALL 0x1
#define ITEM_ULTRABALL 0x2
#define ITEM_GREATBALL 0x3
#define ITEM_POKEBALL 0x4
#define ITEM_SAFARIBALL 0x5
#define ITEM_NETBALL 0x6
#define ITEM_DIVEBALL 0x7
#define ITEM_NESTBALL 0x8
#define ITEM_REPEATBALL 0x9
#define ITEM_TIMERBALL 0xA
#define ITEM_LUXURYBALL 0xB
#define ITEM_PREMIERBALL 0xC
#define ITEM_POTION 0xD
#define ITEM_ANTIDOTE 0xE
#define ITEM_BURNHEAL 0xF
#define ITEM_ICEHEAL 0x10
#define ITEM_AWAKENING 0x11
#define ITEM_PARLYZHEAL 0x12
#define ITEM_FULLRESTORE 0x13
#define ITEM_MAXPOTION 0x14
#define ITEM_HYPERPOTION 0x15
#define ITEM_SUPERPOTION 0x16
#define ITEM_FULLHEAL 0x17
#define ITEM_REVIVE 0x18
#define ITEM_MAXREVIVE 0x19
#define ITEM_FRESHWATER 0x1A
#define ITEM_SODAPOP 0x1B
#define ITEM_LEMONADE 0x1C
#define ITEM_MOOMOOMILK 0x1D
#define ITEM_ENERGYPOWDER 0x1E
#define ITEM_ENERGYROOT 0x1F
#define ITEM_HEALPOWDER 0x20
#define ITEM_REVIVALHERB 0x21
#define ITEM_ETHER 0x22
#define ITEM_MAXETHER 0x23
#define ITEM_ELIXIR 0x24
#define ITEM_MAXELIXIR 0x25
#define ITEM_LAVACOOKIE 0x26
#define ITEM_BLUEFLUTE 0x27
#define ITEM_YELLOWFLUTE 0x28
#define ITEM_REDFLUTE 0x29
#define ITEM_BLACKFLUTE 0x2A
#define ITEM_WHITEFLUTE 0x2B
#define ITEM_BERRYJUICE 0x2C
#define ITEM_SACREDASH 0x2D
#define ITEM_SHOALSALT 0x2E
#define ITEM_SHOALSHELL 0x2F
#define ITEM_REDSHARD 0x30
#define ITEM_BLUESHARD 0x31
#define ITEM_YELLOWSHARD 0x32
#define ITEM_GREENSHARD 0x33











#define ITEM_HPUP 0x3F
#define ITEM_PROTEIN 0x40
#define ITEM_IRON 0x41
#define ITEM_CARBOS 0x42
#define ITEM_CALCIUM 0x43
#define ITEM_RARECANDY 0x44
#define ITEM_PPUP 0x45
#define ITEM_ZINC 0x46
#define ITEM_PPMAX 0x47

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

#define ITEM_SUPERREPEL 0x53
#define ITEM_MAXREPEL 0x54
#define ITEM_ESCAPEROPE 0x55
#define ITEM_REPEL 0x56






#define ITEM_SUNSTONE 0x5D
#define ITEM_MOONSTONE 0x5E
#define ITEM_FIRESTONE 0x5F
#define ITEM_THUNDERSTONE 0x60
#define ITEM_WATERSTONE 0x61
#define ITEM_LEAFSTONE 0x62




#define ITEM_TINYMUSHROOM 0x67
#define ITEM_BIGMUSHROOM 0x68

#define ITEM_PEARL 0x6A
#define ITEM_BIGPEARL 0x6B
#define ITEM_STARDUST 0x6C
#define ITEM_STARPIECE 0x6D
#define ITEM_NUGGET 0x6E
#define ITEM_HEARTSCALE 0x6F









#define ITEM_ORANGEMAIL 0x79
#define ITEM_HARBORMAIL 0x7A
#define ITEM_GLITTERMAIL 0x7B
#define ITEM_MECHMAIL 0x7C
#define ITEM_WOODMAIL 0x7D
#define ITEM_WAVEMAIL 0x7E
#define ITEM_BEADMAIL 0x7F
#define ITEM_SHADOWMAIL 0x80
#define ITEM_TROPICMAIL 0x81
#define ITEM_DREAMMAIL 0x82
#define ITEM_FABMAIL 0x83
#define ITEM_RETROMAIL 0x84
#define ITEM_CHERIBERRY 0x85
#define ITEM_CHESTOBERRY 0x86
#define ITEM_PECHABERRY 0x87
#define ITEM_RAWSTBERRY 0x88
#define ITEM_ASPEARBERRY 0x89
#define ITEM_LEPPABERRY 0x8A
#define ITEM_ORANBERRY 0x8B
#define ITEM_PERSIMBERRY 0x8C
#define ITEM_LUMBERRY 0x8D
#define ITEM_SITRUSBERRY 0x8E
#define ITEM_FIGYBERRY 0x8F
#define ITEM_WIKIBERRY 0x90
#define ITEM_MAGOBERRY 0x91
#define ITEM_AGUAVBERRY 0x92
#define ITEM_IAPAPABERRY 0x93
#define ITEM_RAZZBERRY 0x94
#define ITEM_BLUKBERRY 0x95
#define ITEM_NANABBERRY 0x96
#define ITEM_WEPEARBERRY 0x97
#define ITEM_PINAPBERRY 0x98
#define ITEM_POMEGBERRY 0x99
#define ITEM_KELPSYBERRY 0x9A
#define ITEM_QUALOTBERRY 0x9B
#define ITEM_HONDEWBERRY 0x9C
#define ITEM_GREPABERRY 0x9D
#define ITEM_TAMATOBERRY 0x9E
#define ITEM_CORNNBERRY 0x9F
#define ITEM_MAGOSTBERRY 0xA0
#define ITEM_RABUTABERRY 0xA1
#define ITEM_NOMELBERRY 0xA2
#define ITEM_SPELONBERRY 0xA3
#define ITEM_PAMTREBERRY 0xA4
#define ITEM_WATMELBERRY 0xA5
#define ITEM_DURINBERRY 0xA6
#define ITEM_BELUEBERRY 0xA7
#define ITEM_LIECHIBERRY 0xA8
#define ITEM_GANLONBERRY 0xA9
#define ITEM_SALACBERRY 0xAA
#define ITEM_PETAYABERRY 0xAB
#define ITEM_APICOTBERRY 0xAC
#define ITEM_LANSATBERRY 0xAD
#define ITEM_STARFBERRY 0xAE
#define ITEM_ENIGMABERRY 0xAF



#define ITEM_BRIGHTPOWDER 0xB3
#define ITEM_WHITEHERB 0xB4
#define ITEM_MACHOBRACE 0xB5
#define ITEM_EXPSHARE 0xB6
#define ITEM_QUICKCLAW 0xB7
#define ITEM_SOOTHEBELL 0xB8
#define ITEM_MENTALHERB 0xB9
#define ITEM_CHOICEBAND 0xBA
#define ITEM_KINGSROCK 0xBB
#define ITEM_SILVERPOWDER 0xBC
#define ITEM_AMULETCOIN 0xBD
#define ITEM_CLEANSETAG 0xBE
#define ITEM_SOULDEW 0xBF
#define ITEM_DEEPSEATOOTH 0xC0
#define ITEM_DEEPSEASCALE 0xC1
#define ITEM_SMOKEBALL 0xC2
#define ITEM_EVERSTONE 0xC3
#define ITEM_FOCUSBAND 0xC4
#define ITEM_LUCKYEGG 0xC5
#define ITEM_SCOPELENS 0xC6
#define ITEM_METALCOAT 0xC7
#define ITEM_LEFTOVERS 0xC8
#define ITEM_DRAGONSCALE 0xC9
#define ITEM_LIGHTBALL 0xCA
#define ITEM_SOFTSAND 0xCB
#define ITEM_HARDSTONE 0xCC
#define ITEM_MIRACLESEED 0xCD
#define ITEM_BLACKGLASSES 0xCE
#define ITEM_BLACKBELT 0xCF
#define ITEM_MAGNET 0xD0
#define ITEM_MYSTICWATER 0xD1
#define ITEM_SHARPBEAK 0xD2
#define ITEM_POISONBARB 0xD3
#define ITEM_NEVERMELTICE 0xD4
#define ITEM_SPELLTAG 0xD5
#define ITEM_TWISTEDSPOON 0xD6
#define ITEM_CHARCOAL 0xD7
#define ITEM_DRAGONFANG 0xD8
#define ITEM_SILKSCARF 0xD9
#define ITEM_UPGRADE 0xDA
#define ITEM_SHELLBELL 0xDB
#define ITEM_SEAINCENSE 0xDC
#define ITEM_LAXINCENSE 0xDD
#define ITEM_LUCKYPUNCH 0xDE
#define ITEM_METALPOWDER 0xDF
#define ITEM_THICKCLUB 0xE0
#define ITEM_STICK 0xE1




























#define ITEM_REDSCARF 0xFE
#define ITEM_BLUESCARF 0xFF
#define ITEM_PINKSCARF 0x100
#define ITEM_GREENSCARF 0x101
#define ITEM_YELLOWSCARF 0x102
#define ITEM_MACHBIKE 0x103
#define ITEM_COINCASE 0x104
#define ITEM_ITEMFINDER 0x105
#define ITEM_OLDROD 0x106
#define ITEM_GOODROD 0x107
#define ITEM_SUPERROD 0x108
#define ITEM_SSTICKET 0x109
#define ITEM_CONTESTPASS 0x10A

#define ITEM_WAILMERPAIL 0x10C
#define ITEM_DEVONGOODS 0x10D
#define ITEM_SOOTSACK 0x10E
#define ITEM_BASEMENTKEY 0x10F
#define ITEM_ACROBIKE 0x110
#define ITEM_POKEBLOCKCASE 0x111
#define ITEM_LETTER 0x112
#define ITEM_EONTICKET 0x113
#define ITEM_REDORB 0x114
#define ITEM_BLUEORB 0x115
#define ITEM_SCANNER 0x116
#define ITEM_GOGOGGLES 0x117
#define ITEM_METEORITE 0x118
#define ITEM_RM1KEY 0x119
#define ITEM_RM2KEY 0x11A
#define ITEM_RM4KEY 0x11B
#define ITEM_RM6KEY 0x11C
#define ITEM_STORAGEKEY 0x11D
#define ITEM_ROOTFOSSIL 0x11E
#define ITEM_CLAWFOSSIL 0x11F
#define ITEM_DEVONSCOPE 0x120
#define ITEM_TM01 0x121
#define ITEM_TM02 0x122
#define ITEM_TM03 0x123
#define ITEM_TM04 0x124
#define ITEM_TM05 0x125
#define ITEM_TM06 0x126
#define ITEM_TM07 0x127
#define ITEM_TM08 0x128
#define ITEM_TM09 0x129
#define ITEM_TM10 0x12A
#define ITEM_TM11 0x12B
#define ITEM_TM12 0x12C
#define ITEM_TM13 0x12D
#define ITEM_TM14 0x12E
#define ITEM_TM15 0x12F
#define ITEM_TM16 0x130
#define ITEM_TM17 0x131
#define ITEM_TM18 0x132
#define ITEM_TM19 0x133
#define ITEM_TM20 0x134
#define ITEM_TM21 0x135
#define ITEM_TM22 0x136
#define ITEM_TM23 0x137
#define ITEM_TM24 0x138
#define ITEM_TM25 0x139
#define ITEM_TM26 0x13A
#define ITEM_TM27 0x13B
#define ITEM_TM28 0x13C
#define ITEM_TM29 0x13D
#define ITEM_TM30 0x13E
#define ITEM_TM31 0x13F
#define ITEM_TM32 0x140
#define ITEM_TM33 0x141
#define ITEM_TM34 0x142
#define ITEM_TM35 0x143
#define ITEM_TM36 0x144
#define ITEM_TM37 0x145
#define ITEM_TM38 0x146
#define ITEM_TM39 0x147
#define ITEM_TM40 0x148
#define ITEM_TM41 0x149
#define ITEM_TM42 0x14A
#define ITEM_TM43 0x14B
#define ITEM_TM44 0x14C
#define ITEM_TM45 0x14D
#define ITEM_TM46 0x14E
#define ITEM_TM47 0x14F
#define ITEM_TM48 0x150
#define ITEM_TM49 0x151
#define ITEM_TM50 0x152
#define ITEM_HM01 0x153
#define ITEM_HM02 0x154
#define ITEM_HM03 0x155
#define ITEM_HM04 0x156
#define ITEM_HM05 0x157
#define ITEM_HM06 0x158
#define ITEM_HM07 0x159
#define ITEM_HM08 0x15A


#define ITEM_OAKSPARCEL 0x15D
#define ITEM_POKEFLUTE 0x15E
#define ITEM_SECRETKEY 0x15F
#define ITEM_BIKEVOUCHER 0x160
#define ITEM_GOLDTEETH 0x161
#define ITEM_OLDAMBER 0x162
#define ITEM_CARDKEY 0x163
#define ITEM_LIFTKEY 0x164
#define ITEM_HELIXFOSSIL 0x165
#define ITEM_DOMEFOSSIL 0x166
#define ITEM_SILPHSCOPE 0x167
#define ITEM_BICYCLE 0x168
#define ITEM_TOWNMAP 0x169
#define ITEM_VSSEEKER 0x16A
#define ITEM_FAMECHECKER 0x16B
#define ITEM_TMCASE 0x16C
#define ITEM_BERRYPOUCH 0x16D
#define ITEM_TEACHYTV 0x16E
#define ITEM_TRIPASS 0x16F
#define ITEM_RAINBOWPASS 0x170
#define ITEM_TEA 0x171
#define ITEM_MYSTICTICKET 0x172
#define ITEM_AURORATICKET 0x173
#define ITEM_POWDERJAR 0x174
#define ITEM_RUBY 0x175
#define ITEM_SAPPHIRE 0x176
#define ITEM_MAGMAEMBLEM 0x177
#define ITEM_OLDSEAMAP 0x178

#define DEC_SMALLDESK 0x1
#define DEC_POKEMONDESK 0x2
#define DEC_HEAVYDESK 0x3
#define DEC_RAGGEDDESK 0x4
#define DEC_COMFORTDESK 0x5
#define DEC_PRETTYDESK 0x6
#define DEC_BRICKDESK 0x7
#define DEC_CAMPDESK 0x8
#define DEC_HARDDESK 0x9
#define DEC_SMALLCHAIR 0xA
#define DEC_POKEMONCHAIR 0xB
#define DEC_HEAVYCHAIR 0xC
#define DEC_PRETTYCHAIR 0xD
#define DEC_COMFORTCHAIR 0xE
#define DEC_RAGGEDCHAIR 0xF
#define DEC_BRICKCHAIR 0x10
#define DEC_CAMPCHAIR 0x11
#define DEC_HARDCHAIR 0x12
#define DEC_REDPLANT 0x13
#define DEC_TROPICALPLANT 0x14
#define DEC_PRETTYFLOWERS 0x15
#define DEC_COLORFULPLANT 0x16
#define DEC_BIGPLANT 0x17
#define DEC_GORGEOUSPLANT 0x18
#define DEC_REDBRICK 0x19
#define DEC_YELLOWBRICK 0x1A
#define DEC_REDBALLOON 0x1B
#define DEC_BLUEBALLOON 0x1C
#define DEC_YELLOWBALLOON 0x1D
#define DEC_REDTENT 0x1F
#define DEC_BLUETENT 0x20
#define DEC_SOLIDBOARD 0x21
#define DEC_SLIDE 0x22
#define DEC_FENCELENGTH 0x23
#define DEC_FENCEWIDTH 0x24
#define DEC_TIRE 0x25
#define DEC_STAND 0x26
#define DEC_MUDBALL 0x27
#define DEC_BREAKABLEDOOR 0x28
#define DEC_SANDORNAMENT 0x29
#define DEC_SILVERSHIELD 0x2A
#define DEC_GOLDSHIELD 0x2B
#define DEC_GLASSORNAMENT 0x2C
#define DEC_ROUNDTV 0x2E
#define DEC_CUTETV 0x2F
#define DEC_GLITTERMAT 0x30
#define DEC_JUMPMAT 0x31
#define DEC_SPINMAT 0x32
#define DEC_CLOWNOTEMAT 0x33
#define DEC_DNOTEMAT 0x34
#define DEC_ENOTEMAT 0x35
#define DEC_FNOTEMAT 0x36
#define DEC_GNOTEMAT 0x37
#define DEC_ANOTEMAT 0x38
#define DEC_BNOTEMAT 0x39
#define DEC_CHIGHNOTEMAT 0x3A
#define DEC_SURFMAT 0x3B
#define DEC_THUNDERMAT 0x3C
#define DEC_FIREBLASTMAT 0x3D
#define DEC_POWDERSNOWMAT 0x3E
#define DEC_ATTRACTMAT 0x3F
#define DEC_FISSUREMAT 0x40
#define DEC_SPIKESMAT 0x41
#define DEC_BALLPOSTER 0x42
#define DEC_GREENPOSTER 0x43
#define DEC_REDPOSTER 0x44
#define DEC_BLUEPOSTER 0x45
#define DEC_CUTEPOSTER 0x46
#define DEC_PIKAPOSTER 0x47
#define DEC_LONGPOSTER 0x48
#define DEC_SEAPOSTER 0x49
#define DEC_SKYPOSTER 0x4A
#define DEC_KISSPOSTER 0x4B
#define DEC_PICHUDOLL 0x4C
#define DEC_PIKACHUDOLL 0x4D
#define DEC_MARILLDOLL 0x4E
#define DEC_TOGEPIDOLL 0x4F
#define DEC_CYNDAQUILDOLL 0x50
#define DEC_CHIKORITADOLL 0x51
#define DEC_TOTODILEDOLL 0x52
#define DEC_JIGGLYPUFFDOLL 0x53
#define DEC_MEOWTHDOLL 0x54
#define DEC_CLEFAIRYDOLL 0x55
#define DEC_DITTODOLL 0x56
#define DEC_SMOOCHUMDOLL 0x57
#define DEC_TREECKODOLL 0x58
#define DEC_TORCHICDOLL 0x59
#define DEC_MUDKIPDOLL 0x5A
#define DEC_DUSKULLDOLL 0x5B
#define DEC_WYNAUTDOLL 0x5C
#define DEC_BALTOYDOLL 0x5D
#define DEC_KECLEONDOLL 0x5E
#define DEC_AZURILLDOLL 0x5F
#define DEC_SKITTYDOLL 0x60
#define DEC_SWABLUDOLL 0x61
#define DEC_GULPINDOLL 0x62
#define DEC_LOTADDOLL 0x63
#define DEC_SEEDOTDOLL 0x64
#define DEC_PIKACUSHION 0x65
#define DEC_ROUNDCUSHION 0x66
#define DEC_KISSCUSHION 0x67
#define DEC_ZIGZAGCUSHION 0x68
#define DEC_SPINCUSHION 0x69
#define DEC_DIAMONDCUSHION 0x6A
#define DEC_BALLCUSHION 0x6B
#define DEC_GRASSCUSHION 0x6C
#define DEC_FIRECUSHION 0x6D
#define DEC_WATERCUSHION 0x6E
#define DEC_SNORLAXDOL 0x6F
#define DEC_RHYDONDOLL 0x70
#define DEC_LAPRASDOLL 0x71
#define DEC_VENUSAURDOLL 0x72
#define DEC_CHARIZARDDOLL 0x73
#define DEC_BLASTOISEDOLL 0x74
#define DEC_WAILMERDOLL 0x75
#define DEC_REGIROCKDOLL 0x76
#define DEC_REGICEDOLL 0x77
#define DEC_REGISTEELDOLL 0x78

And that's it! How to make a pokemart!


Custom Item Dialog
Spoiler:

I recently discovered this while decompiling some scripts in my game. It's pretty cool if you ask me.

New commands used in this section:
Code:
loadpointer - According to XSE, it loads a pointer to a bank. :/
giveitem2 - It is the same as giveitem, but it doesn't actually give the item.
It's pretty easy to do. Let's look at an example:
Code:
...
additem 0x169 0x1
loadpointer 0x0 @recieve
giveitem2 0x169 0x1 0x13E
...

#org @recieve
= [player] received a TOWN MAP\nfrom MOM.
What is does is it gives the item, loads a pointer to the custom text, and giveitem2 loads the text, and plays the jingle for it.

That's it! I hoped you found this interesting!


Money Commands!

Yay! Money! In this section, we deal with money, and coins. :)

Givemoney
Spoiler:

Ok, we all like getting money, so let's get to the script
New Commands used in this section:
Code:
Givemoney [amount] 0x0 - Gives money to us! >:)
Let's have a quick example:
Code:
#org @start
lock
faceplayer
msgbox @here 0x2
givemoney 0x64 0x0
release
end

#org @here
= Have [$]100.
What this does is it gives is 0x64 (100) pokedollars. To make the symbole in a string, use [$].

Well, not much else to explain I guess. Enjoy getting money :)


Paymoney
Spoiler:

Most people don't like to pay money, but hey, it's part of life.

New Commands used in this section:
Code:
paymoney [amount] 0x0 - Takes away money
Let's look at our preveous example, but with this command:
Code:
#org @start
lock
faceplayer
msgbox @here 0x2
paymoney 0x64 0x0
release
end

#org @here
= I want my [$]100 back!
It does the opposite of what givemoney does!

I hope you enjoyed making people take your money! (Or not...)


Checkmoney
Spoiler:

Ok, so what if we want to have someone check your money? In this part, we'll do just that!
New Commands used in this section:
Code:
checkmoney [amount] 0x0 - Checks the money and returns the result to LASTRESULT.
Let's look at an example:
Code:
#org @start
lock
faceplayer
msgbox @do 0x5
compare lastresult 0x0
if 0x1 goto @end
checkmoney 0x1F4
compare LASTRESUT 0x0
if 0x1 goto @notenough
countpokemon
compare LASTRESULT 0x6
if 0x1 goto @toomany
paymoney 0x1f4 0x0
fanfare 0x101
msgbox @rec 0x2
givepokemon 0x25 0x5 0x0 0x0 0x0 0x0
msgbox @havegreat
release
end

#org @end
msgbox @ohwell 0x2
release
end

#org @notenough
msgbox @not 0x2
release
end

#org @toomany
msgbox @too 0x2
release
end

#org @do
= Do you want a PIKACHU for [$]500?

#org @ohwell
= Oh well, I'll find someone else.

#org @not
= You don't have enough money.

#org @too
= You have too many Pokemon.\nCome back later.

#org @rec
= [player] recieved a PIKACHU!

#org @havegreat
= Have a great day!
Wow! That's long! Let's look at just the main command:
Code:
checkmoney 0x1F4 0x0
compare LASTRESUT 0x0
if 0x1 goto @notenough
It checks if you have enough money. We compare lastresult to 0x0, for not enough, then it goes somewhere else!

There ya go! Enjoy checking your money!



Hidemoney and Showmoney
Spoiler:

So, let's say we want to see how much money we have. This is pretty easy.
New Commands used in this section:
Code:
showmoney [X] [Y] 0x0 - Shows your money amount in a box
hidemoney [X] [Y] - Hides the money box
updatemoney [X] [Y] 0x0 - Updates a money box
waitkeypress - Waits untill a key is pressed
Let's look at an example:
Code:
#org @start
lock
showmoney 0x0 0x0 0x0 'Show our money
waitkeypress 'Wait...
paymoney 0x64 0x0 'Take away money
updatemoney 0x0 0x0 0x0 'Update money
waitkeypress 'wait...
hidemoney 0x0 0x0 'Hide it
release
end
There you have it! Not much to say, so enjoy!
__________________





My Works:

Coming Soon/Working On:
  • Pokemon Amethyst
  • ?Using HMs via Items?
  • Custom GUIs using ASM (and soon) C



Last edited by Shiny Quagsire; 9th January 2013 at 04:47 AM.
Shiny Quagsire is offline  
Sponsored Links
Old 9th January 2013, 12:02 PM   #2
Elsa
Let it go!
PHO VIP
 
Elsa's Avatar
 
Join Date: Apr 2010
Location: United States
Age: 22
Posts: 365
Elsa
Default

Nice tutorial

Later you'll need to convert it over to SEA~
Elsa is offline  
Old 9th January 2013, 12:13 PM   #3
tajaros
Beginner
Ex-Staff
 
tajaros's Avatar
 
Join Date: Sep 2012
Location: senippilihP
Posts: 59
tajaros
Default

Pretty nifty tutorial Shiny Quagsire

I'll be looking forward to the SEA tut... :3
__________________
tajaros is offline  
Old 10th January 2013, 06:36 AM   #4
Sky0fBlades
Emerald Hacker
Moderator
 
Sky0fBlades's Avatar
 
Join Date: Sep 2012
Location: Ice Path
Age: 26
Posts: 128
Sky0fBlades
Default

Ah, thanks for posting this here.
I've actually gotten a bit lazy with hacking so if I forget any terms like I did the last time I went AWOL, this will definitely come in handy.
Sky0fBlades is offline  
Old 11th January 2013, 05:07 PM   #5
Dylanrockin
Neophyte
 
Join Date: Dec 2012
Posts: 11
Dylanrockin
Default

Alright in XSE I have no idea what I am doing wrong, but this is always happening to me, whenever I compile a simple "hello" script or something like it this happens when I decompile after I insert it into A-Map.

'-----------------------
#org 0x80
virtualjumpif 0x3E 0x784403
givemoney 0x3A1188CB 0x94
spritebehave 0x7CC0 0x63
pokemart2 0xD6AF3CF0
special 0x8BE4
fadein 0xA
setdooropened 0x2172 0xF8D4
if 0x50 call 0x4D454B4F
applymovement 0x204E 0x45524946
getplayerpos 0x5250 0x3045
fanfare 0x96
nop
nop
nop
nop
nop
nop
nop
nop
nop
closeonkeypress
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop

I'm sorry but what? How does this even happen? I have never been able to assemble a script because something like this keeps happening.
Dylanrockin is offline  
Old 11th January 2013, 09:55 PM   #6
Pia Carrot
Orange Developer
Administrator
 
Pia Carrot's Avatar
 
Join Date: Aug 2010
Location: Valencia Island
Age: 23
Posts: 811
Pia Carrot Pia Carrot Pia Carrot Pia Carrot Pia Carrot
Default

Getting some nostalgia from this thread :,) Thanks for reposting.

Also @ Dylanrockin if I'm not mistaken this is the old version of XSE.
Pia Carrot is offline  
Old 11th January 2013, 10:37 PM   #7
Shiny Quagsire
Super Awesome Ninja ASM Guy
PHO VIP
 
Shiny Quagsire's Avatar
 
Join Date: Apr 2010
Age: 20
Posts: 62
Shiny Quagsire
Default

Quote:
Originally Posted by Dylanrockin View Post
Alright in XSE I have no idea what I am doing wrong, but this is always happening to me, whenever I compile a simple "hello" script or something like it this happens when I decompile after I insert it into A-Map.

'-----------------------
#org 0x80
virtualjumpif 0x3E 0x784403
givemoney 0x3A1188CB 0x94
spritebehave 0x7CC0 0x63
pokemart2 0xD6AF3CF0
special 0x8BE4
fadein 0xA
setdooropened 0x2172 0xF8D4
if 0x50 call 0x4D454B4F
applymovement 0x204E 0x45524946
getplayerpos 0x5250 0x3045
fanfare 0x96
nop
nop
nop
nop
nop
nop
nop
nop
nop
closeonkeypress
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop

I'm sorry but what? How does this even happen? I have never been able to assemble a script because something like this keeps happening.
Quote:
Originally Posted by Pia Carrot View Post
Getting some nostalgia from this thread :,) Thanks for reposting.

Also @ Dylanrockin if I'm not mistaken this is the old version of XSE.
Actually, this guide is for the most recent version of XSE (XSE hasn't been updated in ages though.) However, your problem is that you put the script location on the person as 0x80 instead of 0x800000 as seen in this line:
Code:
#org 0x80
Also, make sure you copy down the script location, because it changes as more space is taken up by other additions to your hack.
__________________





My Works:

Coming Soon/Working On:
  • Pokemon Amethyst
  • ?Using HMs via Items?
  • Custom GUIs using ASM (and soon) C


Shiny Quagsire is offline  
Old 11th January 2013, 10:56 PM   #8
Dylanrockin
Neophyte
 
Join Date: Dec 2012
Posts: 11
Dylanrockin
Default

Quote:
Originally Posted by Shiny Quagsire View Post
Actually, this guide is for the most recent version of XSE (XSE hasn't been updated in ages though.) However, your problem is that you put the script location on the person as 0x80 instead of 0x800000 as seen in this line:
Code:
#org 0x80
Also, make sure you copy down the script location, because it changes as more space is taken up by other additions to your hack.
Well what I did prior was; I put in 0x800000 (by the way that space was taken up, but it automatically finds space not sure if this was necessary but eh) and then I inserted into A-Map with the location of "Start" which was the second choice when I compiled it, and when I decompiled it, it turned into that mess.
Dylanrockin is offline  
Old 12th January 2013, 02:34 AM   #9
Shiny Quagsire
Super Awesome Ninja ASM Guy
PHO VIP
 
Shiny Quagsire's Avatar
 
Join Date: Apr 2010
Age: 20
Posts: 62
Shiny Quagsire
Default

Quote:
Originally Posted by Dylanrockin View Post
Well what I did prior was; I put in 0x800000 (by the way that space was taken up, but it automatically finds space not sure if this was necessary but eh) and then I inserted into A-Map with the location of "Start" which was the second choice when I compiled it, and when I decompiled it, it turned into that mess.
Well, obviously you did something wrong when changing the script of whatever it was you were adding one to. Could you post a picture of the sprite/whatever the script is attached to in A-Map? I'm curious why it turns up decompiling 0x80 instead of 0x80xxxx.
__________________





My Works:

Coming Soon/Working On:
  • Pokemon Amethyst
  • ?Using HMs via Items?
  • Custom GUIs using ASM (and soon) C


Shiny Quagsire is offline  
Old 12th January 2013, 03:29 AM   #10
Dylanrockin
Neophyte
 
Join Date: Dec 2012
Posts: 11
Dylanrockin
Default

Quote:
Originally Posted by Shiny Quagsire View Post
Well, obviously you did something wrong when changing the script of whatever it was you were adding one to. Could you post a picture of the sprite/whatever the script is attached to in A-Map? I'm curious why it turns up decompiling 0x80 instead of 0x80xxxx.
Yeah, I have the picture, it was a girl in Palette Town, not sure if it's alright for me to overwrite that but eh, I'm a script n00b. The picture is in the attachment.
Attached Images
File Type: jpg Snapshot 1 (1-11-2013 9-26 PM).jpg (24.8 KB, 7 views)
Dylanrockin is offline  
 

Tags
epic, proportions, quagsire, shiny, tutorial, xse, [Tutorial]

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:20 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc. User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo.
Pokémon Hackers Online (PHO) is in no way affiliated with or endorsed by Nintendo LLC, Creatures, GAMEFREAK inc,
The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast.
All forum/site content (unless noted otherwise) and site designs are © 2006-2013 Pokémon Hackers Online (PHO).
Green Charizard Christos TreeckoLv100

"Black 2" by ARTPOP. Kyurem artwork by XOUS.

no new posts