Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources

Notices
For all updates, view the main page.

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.



Reply
 
Thread Tools
  #1    
Old September 29th, 2014 (12:21 AM). Edited October 15th, 2014 by Turtl3Skulll.
Turtl3Skulll's Avatar
Turtl3Skulll
Blue Turtl3
 
Join Date: Jun 2013
Location: Utah, U.S.A.
Age: 19
Gender: Male
Nature: Bold
Pokemon Fire Red Hacked Engine For Dummies
Pokémon Engine hacks and additions tutorial
By: Turtl3skulll


While working with JPAN's hacked engine, I've noticed a lot of the instructions are very poorly written; many assume you know every little thing that is going on, and thus a lot of examples are completely voided. I've began rewritting his manual in a friendlier way, one which (hopefully) any beginner with scripting knowledge may be able to look at and understand without the need of carefully reading every word of the document and having to put one-and-one together to figure out an example that was briefly talked about before that is needed.
I will attempt to update the manual to make it as user friendly as possible, and include every special as soon as I get it fully working.

I'll use this format:

NAME OF SPECIAL & ITS NUMBER
BRIEF DESCRIPTION
A SCRIPT EXAMPLE
EXTRA NOTES ON IT

DISCLAIMER:
I will not include everything the original manual had. These will be examples of how to script the specials he created, and therefore they will not be explained in full detail, that's what his manual is for & you may look at that for in-depth explanation on his code.

If anything is wrong, needs more explaining, or I missed a special and you know how to explain it feel free to tell me & I'll add it onto this. Hope this helps some of you out



Multichoice boxes

Spoiler:
Multichoice boxes have 2 special, being special 0x24 and special 0x25

They contains 7 boxes to use, ranging from 0x20 – 0x25, which define how many choices you wish to have.
0x20 – 2 Choices
0x21 – 3 Choices
0x22 – 4 Choices
0x23 – 5 Choices
0x24 – 6 Choices
0x25 – 7 Choices

Special 0x25 - Load Pointer from Script Bank
Spoiler:
Special 0x25 uses pointers given in the script to load the data into the multichoice boxes
Uses Setvar 0x8006 --multichoice slot
Example Special 0x25:
Spoiler:
For 2 choices:
Spoiler:
#org @start
lock
setvar 0x8006 0x0 ------------------'sets 1st choice slot
loadpointer 0x0 @1 -----------------'loads '@1' to the 1st choice slot
special 0x25 -----------------------'prepares the 1st choice slot to be shown
setvar 0x8006 0x1 -----------------'sets 2nd choice slot
loadpointer 0x0 @2 -----------------'loads '@2' to the 2nd choice slot
special 0x25 ------------------------'prepares the 2nd choice slot to be shown
Multichoice 0x0 0x0 0x20 0x0 --------'the 3rd 0xYY, is which box you'll use; 0x20-0x25, accordingly. Rest are filler
release
end

#org @1
= Choice 1 'This is the text which will appear in choice slot 1
#org @2
= Choice 2 'This is the text which will appear in choice slot 2

To add a 3rd or 4th choice you just add another 'setvar 0x8006 0xYY' another 'loadpointer 0x0 @something' and 'special 0x25', as shown below, as well as changing the Multichoice from 0x20 to the box with the desired choice amount.

For 3 choices:
Spoiler:
#org @start
setvar 0x8006 0x0
loadpointer 0x0 @1
special 0x25
setvar 0x8006 0x1
loadpointer 0x0 @2
special 0x25
setvar 0x8006 0x2
loadpointer 0x0 @3
special 0x25
multichoice 0x0 0x0 0x21 0x0

#org @1
= Choice 1

#org @2
= Choice 2

#org @3
= Choice 3


Special 0x24 - Load Pointer by Variables
Spoiler:
Special 0x24 uses pre-defined variables to load the data into the multichoice boxes
It uses:
Spoiler:
Setvar 0x8004 --to load the lower half of a pointer (B in 0xAAAABBBB)
Setvar 0x8005 --to load the upper half of a pointer (A in 0xAAAABBBB)
Setvar 0x8006 --multichoice slot

Example Special 0x24:
Spoiler:
#org @start
lock
setvar 0x8004 0x3848 ------'The pointer is 08803848, this takes the lower half
setvar 0x8005 0x0880 ------'The pointer is 08803848, this take the upper half
setvar 0x8006 0x0
loadpointer 0x0 0x0203f4a0
special 0x24
setvar 0x8004 0x383f ------'The pointer is 0880383f, this takes the lower half
setvar 0x8005 0x0880 –----The pointer is 0880383f, this take the upper half
setvar 0x8006 0x1
loadpointer 0x0 0x0203f4a0
special 0x24
multichoice 0x0 0x0 0x20 0x0
release
end
#org 0x803848
= Text 1
#org 0x80383f
= Text 2


The max number of choices allowed are 7, if you attempt to load 'Setvar 0x8006 0x7' or higher (which would be 8 choices) it will fail.
Every single loadpointer must be pointed to some offset whether or not it contains text, else game will crash.
Multichoice box text must be under 20 characters to be properly displayed, and According to JPAN will not display special characters such as the \v\hxx or coloring, but its worked fine for me.


Runtime Trainer Customization
Spoiler:

The trainer OW, trainer backsprite, and Trainer card can now be changed as well, but may require a map change to take effect.

The variables below contain the variable to use according to what you wish to change:
Spoiler:
Variable Changes
0x4054 Standing & Walking
0x4055 Bike
0x4056 Sitting (Surfing)
0x4057 VS Seeker
0x4058 Fishing
0x4059 VS Seeker on Bike


Examples:
Spoiler:
Trainer Sprite
Spoiler:
#org @start
setvar 0x4054 0x025----------'variable 4054 will change the standing and walking sprite’s
end--------------------------'0x025 will change to the little girl; this can be changed according to the OW you want to become, Example: 0x87 will change the OW to the Lapras OW.

For the sprite to change, a new map must be entered, or a warp can be done to the same location for smoother transitions.

Trainer Card
Spoiler:
For Boy
Spoiler:
#org @start
setvar 0x4060 0x8
end

For Girl
Spoiler:
#org @start
setvar 0x4061 0x8
end

0x8 is just the image that will replace the original
Trainer cards use variables 0x4060 for boys and 0x4061 for girls.
To switch back to the original hero/heroine you use 0x87 & 0x88 accordingly.

Trainer Backsprites
Spoiler:
This is practically its own little tutorial and thus I won't explain, since it requires changing palletes and images, if anyone wants to make a tutorial of this or has made their own, let me know and I'll link to your tutorial.


Poke-Decrypt Specials:

Spoiler:
The following specials are used to change a Pokémon's internals, such as EV/IV Pokeball, capture location, Ribons, and Pokerus.

Special 0x6 – Pokemon Decrypt/encrypt
Spoiler:
A toggle to open and close a Pokemon's 'DNA' to alter, alone its useless therefore I'll explain a few more specials and then I'll give an example.


BufferPartyPokemon
Spoiler:
Bufferpartypokemon 0x0 0x0
Explanation:
The first 0x0 chooses the pokemon to buffer from slots 1-6 (0x0 – 0x05)
The second 0x0 is the buffers that will be used.
Examples:
#org @start
Bufferpartypokemon 0x0 0x0 -----‘buffers 1st pokemon, & the buffer set to \v\h02; the buffer in the script MUST have 2 added when using it as “\v\h0X”, thus this one will be \v\h02 since our pointer is 0x0
Bufferpartypokemon 0x1 0x1 -----‘buffers 2nd pokemon, & the buffer set to \v\h03
Bufferpartypokemon 0x2 0x2 -----‘buffers 3rd pokemon, & the buffer set to \v\h04; \v\h04 (0x2) is the max amount of pokemon to buffer, no more than 3 pokemon can be buffered at a time, after this, the game will load, the rival name and some other things.
Msgbox @hi 0x6
end

‘strings
#org @hi
= \v\h02, then \v\h03 ‘meaning it’ll be read [buffer1], then [buffer2]


Read & Check Specials
The Read & Check will use their specials as 'special2 0x8005 0xZZ'
Spoiler:
Special 0x7 – Read EV/Contest Stats
Spoiler:
Read Evs
Uses Setvar 0x8005 0xY
The 'Y' being the following stats:
Spoiler:
0x0 HP
0x1 Attack
0x2 Defense
0x3 Speed
0x4 Special Attack
0x5 Special Defense
0x6 Coolness
0x7 Beauty
0x8 Cuteness
0x9 Smartness
0xa Toughness
0xb Luster
Else Fails (F400)


Example:
Spoiler:

#org @start
Bufferpartypokemon 0x0 0x0------'fetches pokemon in slot 1
setvar 0x8004 0x0 ---------------'stores (0x0) slot 1 Pokemon to variable 0x8004; replace 0x0 with 1-5 to pick which pokemon slot to use, 0 being the 1st and 5 being 6th pokemon
special 0x6 ----------------------'Open the pokemon to edit
setvar 0x8005 0x6 ---------------'sets the var to the “coolness” stat
special2 0x8006 0x7 --------------'reads EV/Stat (This case a Stat) and WRITES its value to var 0x8006 0x7 to read for later.
compare 0x8006 0x80 ------------'compares the Pokemon's coolness to 0x80;
if 0x0 goto @fail
msgbox @coolest 0x6
special 0x6 ----------------------'Closes the Pokemon and saves its changes
release
end

#org @fail
msgbox @not_cool 0x6
special 0x6 ----------------------'Closes and saves pokemon if not cool enough, pokemon MUST always be closed before ending the script
release
end

#org @coolest
= That \v\h02 is the Coolest \npokémon I've ever seen!

#org @not_cool
= That \v\h02 of yours is lame. ---'\v\h02 is the special text to load whatever is stored at [buffer1].




Special 0x8 – read IVs
Spoiler:
Reads the IVs
Uses Setvar 0x8005 0xY
The 'Y' being the following stats:
Spoiler:
0x0 HP
0x1 Attack
0x2 Defense
0x3 Speed
0x4 Special Attack
0x5 Special Deffense
Else Fails


Example:
Spoiler:
This is exactly the same as special 0x7.
The only difference is Setvar 0x8005 must be set below 6. given 0x5 is the last stat that can be checked.
The compare must also be change to anything between 0x0 to 0x1F (0-31), Since IVs go to 31 max.


Special 0x9 – Check Ribbon Flags
Spoiler:
Checks Flags
Uses Setvar 0x8005 0xY
The 'Y' being the following stats:
Spoiler:
0x0 to 0x1F – Active flags, not named in FireRed
Else Fail
Returns the Value and status of flag (0 or 1)
Only one flag has a name, and it’s the champion’s flag (key 0xf), awarded at register Hall of Fame special.

Example
Spoiler:
Same as special 0x8, just change the special to 0x9
Uses 0x0 to 0x1F for Setvar 0x8005
The compare 0x8006 must be set to 0x1



Special 0xa – Check Pokerus Timer
Spoiler:
Does not take any arugments
Returns Timer value (0xF – 0x0) or 0x10 if the Pokemon is immune.

Example:
Spoiler:
#org @start
lock
Bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
special2 0x8005 0xa
compare 0x8005 0x10
–--------'0x10 means it had the sickness, but not anymore
if 0x1 goto @fine
compare 0x8005 0x0 –----------'zero means it never got the sickness
if 0x1 goto @fine
buffernumber 0x1 0x8005------'Buffers the number returned to \v\h03
msgbox @sick 0x6
special 0x6
release
end
#org @fine
message @good 0x6
special 0x6
release
end

#org @sick
= Your \v\h02 is sick.\nIt will take \v\h03 cycles to heal.

#org @good
= That's the healtiest \v\h02\nI've ever seen!



Special 0xb - Check Pokeball
Spoiler:
Does not take any arguments
Returns the Item value of the Pokeball its stored in.

Example:
Spoiler:
#org @start
lock
Bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
special2 0x8005 0xb
compare 0x8005 0x0
----------'When Pokemons are hatched their Pokeball value is 0; this checks for that.
if 0x1 goto @none
bufferitem 0x1 0x8005 --------'buffers the Pokeball value to \v\h03.
msgbox @ball 0x6
special 0x6
release
end
#org @none
message @hatched 0x6
special 0x6
release
end

#org @ball
= Your \v\h02 is kept in a\n\v\h03.

#org @hatched
= You hatched your \v\h02?\nI'm impressed!



Special 0xc - Check Capture Location
Spoiler:
Does not take any arguments
Returns the location where the pokemon was captured or hatched.

Example:
Spoiler:
You'd need to know the Location table to work this one, so no example.



Special 0xd - Check Happiness
Spoiler:
Does not take any arguments
Returns the Pokemon Happiness.

Example:
Spoiler:
#org @start
lock
Bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
special2 0x8005 0xd
compare 0x8005 0x0

if 0x1 goto @none
buffernumber 0x1 0x8005 --------'buffers the happiness number to \v\h03.
msgbox @happy 0x6
special 0x6
release
end

#org @none
message @hate 0x6
special 0x6
release
end

#org @happy
= Your \v\h02 happiness is \n\v\h03.
#org @hate
= Your \v\h02 hates you.



Special 0xe – Check Pokemon Held Item
Spoiler:
Does not take any arguments
Returns the Pokemons held item.

Example:
Spoiler:
#org @start
lock
Bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
special2 0x8005 0xe
compare 0x8005 0x0

if 0x1 goto @none
bufferitem 0x1 0x8005 --------'buffers the Pokemon's Item to \v\h03.
msgbox @item 0x6
special 0x6
release
end

#org @none
message @no_item 0x6
special 0x6
release
end

#org @item
= Your \v\h02 has \n\v\h03.
#org @no_item
= Your \v\h02 isn't holding an item



Write & Editor Specials
The Write & Editor Specials will use their specials as 'special 0xZZ'
Spoiler:

Special 0xF – EV/Contest Stat Editor
Spoiler:
Used to change a Pokemon's EV values, useful for contests
Uses Setvar 0x8005 0xY
The 'Y' being the following stats:
Spoiler:
0x0 HP
0x1 Attack
0x2 Defense
0x3 Speed
0x4 Special Attack
0x5 Special Deffense
0x6 Coolness
0x7 Beauty
0x8 Cuteness
0x9 Smartness
0xa Toughness
0xb Luster
Else Fails (F400)

Uses Setvar 0x8006 0x0ZZ or Setvar 0x8006 0x1ZZ
The 'ZZ' being the number by which the EV will increase or decrease
the 0 before the ZZ means add, while the 1 means subtract; therefore 0A would add 10 Evs while 1A would subtract 10EVs

Example:
Spoiler:
Stat Editor (PLAIN SCRIPT)
#org @start
bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
setvar 0x8005 0x3 ‘reads stat of speed
setvar 0x8006 0x80 'adds 0x80 Evs to speed
special 0xf 'special to make code work
special 0x6
release
end


Special 0x10 – IV Stat Editor
Spoiler:
Used to change a Pokemon's IV values.
Uses Setvar 0x8005 0xY
The 'Y' being the following stats:
Spoiler:
0x0 HP
0x1 Attack
0x2 Defense
0x3 Speed
0x4 Special Attack
0x5 Special Deffense

Uses Setvar 0x8006 0x0ZZ
The 'ZZ' Being the value of the IV it will replace. This will not add or subtract from the original, only replace the current IV with the one told to use.

Example:
Spoiler:
Stat Editor (PLAIN SCRIPT)
#org @start
bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
setvar 0x8005 0x3 ‘reads stat of speed
setvar 0x8006 0xa 'Make Speed EV 10
special 0x10 'special to make code work
special 0x6
release
end


Special 0x11 – Ribbon Flag set/clear


Special 0x12 – Pokerus Set/Immunize
Spoiler:
Sets or removes Pokerus
Uses Setvar 0x8005 0xY
The 'Y' being the following cylces:
Spoiler:
0x0 = make pokémon good or remove immunization
0x1 to 0xf = Make Pokémon sick
0xf = 15 cycles ; 0x1 = 1 cycles ; 2=2, 3=3, 4=4, 5=5, 6=6, 7=7, 8=8, 9=9, a=10, b=11, c=12, d=13, e=14
0x10 or Elese = immunize pokémon


Example:
Spoiler:
Gives Pokerus
Spoiler:
#Org @start
bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
setvar 0x8005 0xf ----------'Sets Pokerus to 15 cycles
special 0x12
special 0x6
release
end

Removes Pokerus
Spoiler:
Org @start
bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
setvar 0x8005 0x0 ----------'Sets Pokerus to 0 cycles
special 0x12
special 0x6
release
end

Makes Immune To Pokerus
Spoiler:
Org @start
bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
setvar 0x8005 0x10 ---------'Sets Pokemon to be immune from Pokerus
special 0x12
special 0x6
release
end


Special 0x13 – Increase/Decrease Happiness
Spoiler:
Used to increase/decrease Pokemon Happiness
Uses Setvar 0x8005 0xY
The 'Y' being the following:
Spoiler:
0x0 to 0xFF = Adds Happiness
0x100 to 0x1ff = Subtracts Happiness


Example Increase:
Spoiler:
#org @start
bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
setvar 0x8005 0xA ----------'Increases Happiness by 10
special 0x13
special 0x6
release
end

Example Decrease:
Spoiler:
#org @start
bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
setvar 0x8005 0x1A ----------'Decreases Happiness by 10
special 0x13
special 0x6
release
end




Special 0x14 – Change Ball
Spoiler:
Change the Pokeball a Pokemon is stored at
Uses Setvar 0x8005 0xY
The 'Y' being the following Pokeballs:
Spoiler:
0x0 Poke-ball (Hatched)
0x1 Master-ball
0x2 Ultra-ball
0x3 Great-ball
0x4 Poke-ball
0x5 Safari-ball
0x6 Net-ball
0x7 Dive-ball
0x8 Nest-ball
0x9 Repeat-ball
0xa Timer-ball
0xb Luxury-ball
0xc Premier-ball


Example:
Spoiler:
#Org @start
bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
setvar 0x8005 0xC ----------'Sets Pokemon's currnt Pokeball to Premier Ball
special 0x14
special 0x6
release
end


Special 0x15 – Give Held Item
Spoiler:
Gives a selected Pokemon an item
Uses Setvar 0x8005 0xY
The 'Y' being the Item ID

Example:
Spoiler:
#org @start
bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
setvar 0x8005 0xX –------'The X can be replace with the item ID
special 0x15
special 0x6


Special 0x16 – Change Pokemon Species
Spoiler:
Changes selected Pokemon Species
Uses Setvar 0x8005 0xY
The 'Y' being the Pokemon ID

Example:
Spoiler:
#org @start
bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
setvar 0x8005 0xX –------'The X can be replace with the Pokemon ID
special 0x16
special 0x6

DISCLAIMER: The species switched to MUST have the same EXP curve as the current or game will crash upon looking at the POKEMON screen.
According to JPAN entering a battle fixes this issue, but haven't tested it.


Special 0x17 – Change Pokemon Attacks
Spoiler:
Changes selected Pokemon Attacks
Uses Setvar 0x8005 0xY
The 'Y' being the Slot number 0-5
Uses Setvar 0x8006 0xZZ
The 'ZZ' being the attack number, 0x0 can be used to erase the attack

Example:
Spoiler:
#org @start
bufferpartypokemon 0x0 0x0
setvar 0x8004 0x0
special 0x6
setvar 0x8005 0xX –------'The X can be replace with the attack ID
special 0x17
special 0x6

This code can (and usually should) be used in conjunction with another special, this one original from the game. Special 0xdc not only accesses the pokémon slot at 0x8004 (the one used at the decryption code) and opens the status screen’s Attack screen, and the chosen attack is saved in 0x8005
This code will automatically check for empty slots first, and then, if all are occupied
replace the slot with the given attack. It also restores that attack PP fully, and removes
all PPup slots used.



Party Specials
Spoiler:
Party Specials seem to fail me, all status flags equal sleep & hp does not check correctly, I will keep looking, but the scripts should be the correct way of doing it

Special 0x62 - Earase Party Pokemon
Spoiler:
Uses 0x8004 0xY 'Slot to delete, 0xf deletes whole party

Examples:
Spoiler:
Example #1 - 1st slot Pokemon:
Spoiler:
#org @start
setvar 0x8004 0x0
special 0x62

release
end


Example #2- Erase full party:
Spoiler:
#org @start
setvar 0x8004 0xf
special 0x62

release
end


Example #3 - Keep 1 Pokemon:
Spoiler:
#org @start
special 0x9f ------------'Pokemon selection screen
special 0x6 -------------'Decrypts pokemon to RAM
setvar 0x8004 0xf ------'selects whole party
special 0x62 ------------'Deletes whole party
setvar 0x8004 0x0 ------'Setvar to 0
special 0x6 -------------'Encrypt Pokemon to 0x8004 0x0; slot 0.
release
end


Special 0x63 - Status Checker
Spoiler:
Uses Setvar 0x8004 0xY 'Pokemon Slot

Returns The Status of asked Pokemon
Status Key is same as Special 0x52


Special 0x64 - Party Status Modifier
Spoiler:
Uses Setvar 0x8004 0xY 'Pokemon Slot
Uses Setvar 0x8005 0xY 'Status Flag
Spoiler:
0-2: Sleep bits.
3: Poison
4: Burned
5: Frozen
6: Paralysis
7: Badly poisoned



Special 0x65 - HP Checker
Spoiler:
Uses Setvar 0x8004 0xY 'Pokemon Slot

Example:
Spoiler:
#org @start
setvar 0x8004 0x1
special 0x65
msgbox @m 0x2
release
end

#org @m
= Your Pokemon HP is \v\h03.
'HP does not appear to update, just give full HP


Special 0x66 - Change Party HP
Spoiler:
Uses Setvar 0x8004 0xY 'Pokemon Slot
Uses Setvar 0x8005 0xY 'Quantity of HP
Uses Setvar 0x8006 0xY '1 to heal, else to damage

Example:
Spoiler:
#org @start
setvar 0x8004 0xF ----'Entire Party
setvar 0x8005 0xB ----'11 HP
setvar 0x8006 0x0 ----'Damages
special 0x66
release
end


Wild Battle Pokemon
Spoiler:

Special 0x51 - Shiny Battle
Spoiler:
Makes the next Pokemon shiny

Example:
Spoiler:
#org @start
special 0x51 -------------'Makes Shiny
wildbattle 0x1 0x1 0x0 ----'Starts wild battle to show shiny
release
end

Special 0x56 – Swarm-roaming Pokémon Changer
Spoiler:

Vars Used:
Spoiler:
Uses Setvar x8004
Quote:
This is the only one I will explain, until I practice the others:
0 to 0x3fff-> The number of the Pokemon wanted (Use YAPE to see correct numbers as there is a gap between Celebi and Treecko)

0x4000-> 0x8015: The pokemon number IN the variable stored in 0x8004
0x8000-> 0xfffc: not defined
0xfffd-> specific pokemon stored at a pointer kept in two variables, 0x8008 0x8009.
0xfffe-> specific pokemon stored at a pointer, that must be placed by hand in 0x0203f488
0xffff-> specific pokemon stored at the LoadPointer location
Uses Setvar x8005
Quote:
Chance pokemon will appear out of 65536
0x0-0xffff (0-65536)
50% is 7fff (32767)
Uses Setvar x8006
Quote:
Amount of roaming Pokemon 0x1,0x2,etc.
0x0 means unlimited, will keep appearing
Uses Setvar x8007
Quote:
uses lower and upper halves:

Lower half is location given by:
each bit either being 0 or 1 depending on what you want
Bit 0 = Grass
Bit 1= Surfing
Bit 2 = Tree/rock-smash
Bit 3 = Fishing
1001 (bit 0=1, bit 1=0, bit 2=0, bit 3=1) would make pokemon available on grass and fishing
1110 (bit 0=1, bit 1=1, bit 2=1, bit 3=0) would activate it in grass, surfing, & tree/rock-smash
it must be written in hex though, so 0x9 and 0xE respectively

The Upper half is the pokemon level:
level 80 being 0x50
Example:
Spoiler:
#org @start
setvar 0x8004 0x85 ------' sets pokemon to Eevee
setvar 0x8005 0xfd70 –--' make the chances of appearance 99% (64880)
setvar 0x8006 0x1 -------'Will appear once
setvar 0x8007 0x500e –' appear by all except fishing
special 0x56
release
end

You can only replace the level for Roaming codes, that is, only for the ones in that 0x8006 = 1. For swarms, however, you cannot.


Special 0x57 - Swarm-roam Pokemon Canceller
Spoiler:
Cleans Special 0x56 for its next use.


Special 0x97 - Random Grass Battle
Spoiler:
No Arguments
Creates a random grass wild battle
Wild pokémon data (of grass) must exist on that map.


Special 0x98 - Random Water Battle
Spoiler:
No Arguments
Creates a random grass wild battle
Wild pokémon data (of water) must exist on that map.


Special 0x9c - Old Man Battle For All
Spoiler:
The Old Man battle for any Pokemon
Uses Setvar 0x8004 0xY 'being the Pokemon species
Uses Setvar 0x8005 0xY 'being the Pokemon level

Example:
Spoiler:
#org @start
setvar 0x8004 0x1 -----' Bulbasaur
setvar 0x8005 0xA -----' Pokemon level 10
special 0x9c -----------' The special
release
end

The old man can catch no legendary except for the bird trio, Blissey and a few others in the legendary region.


Speical 0x156 - Ghost Pokemon Battle
Spoiler:
The Old Man battle for any Pokemon
Uses Setvar 0x8004 0xY 'being the Pokemon species
Uses Setvar 0x8005 0xY 'being the Pokemon level
Uses Setvar 0x8006 0xY 'being the held item

Example:
Spoiler:
#org @start
setvar 0x8004 0x1 -----' Bulbasaur
setvar 0x8005 0xA -----' Pokemon level 10
setvar 0x8006 0x0 -----' No Held Item
special 0x9c -----------' The special
release
end

This code also can use all Pokemon legendary except for the bird trio (ask not why), blissey and a few others in the legendary region.
I remind you that this code is originally meant to make a battle with an uncatchable ghost pokémon that has no ghost on its type.
This will also not crash if you don't have the SILPH SCOPE, so it will work w/o it.



Walking Scripts
Spoiler:
Quote:
"Basically, this feature allows you to create your own special scripts that are activated each time you take a step, well, most of the times you take a step.
There are some other scripts that will always run first. The Egg hatching script, the whiteout script or every step-on (green) script will always beat this one into execution, so you have to take these into consideration if you need that script to run all the time (such as calling the walking script before starting a normal step-on one).
Also, this script is, by definition, a blocking script, meaning that every script you make here must end with the release or releaseall commands.
This script is indicated to make some small checks, manipulate the landscape, and the occasional message, like the Phone script in Gold."
-JPAN
This special contains a max 4 slots to store the walking scripts into as a table.
They are located 0x1a4e2c.
Only 1 can be executed at a time, they are selected by using:
Quote:
Setvar 0x407e 0x(1-4)
An extra walking script can be set temporarily by setting 0x407e to 0 and loading a pointer to the RAM address 0x0203f4f0, this one will take priority over the ROM table.

Special 0x81 - Load Walking Script Pointer
Spoiler:
Loads the pointer from the loadpointer bank 0 to the 0x0203f4f0 address to allow execution, is also needed for wildbattles to be activated through this.


Instructions:
Spoiler:
Quote:
Instructions to this are:

"First, you have to make the script you want to activate on every step. Once the script is compiled, you open a hex editor and navigate to offset: 0x1a4e2c

There are 4 slots for pointers there. Place the offset (reversed) of the script you want to execute with every step in the first slot.

Then, at whatever point you want the walking script to be active (be it through an event script or a level script) just put:
Code:
setvar 0x407e 0x1 ---'tells game to access 1st pointer at offset 0x1a4e2c
special 0x81 ---------------' starts the script to activate on every step.
So that's how special 0x81 works, in case anyone else was having trouble with the instructions."
(Credit to metapod23)
Examples:
Spoiler:
Example #1:
Spoiler:
Master Script
Spoiler:
#org @start
setvar 0x407e 0x1
special 0x81
release
end


Money On Step
Spoiler:
#org @start
givemoney 0xA 0x0 ---------------'Gives $10 on every step
release
end

This example uses the 1st pointer in the offset 0x1a4e2c.
Assuming the offset for the 'Money On Step' script was 0x8003f9, you'd go to a hex editor and in the 1st slot you'd write over '00 00 00 00' with 'f9 03 80 08'


Example #2
Spoiler:
Master Script
Spoiler:
#org @start
setvar 0x407e 0x2
special 0x81
release
end

Random Wild Battle
Spoiler:
#org @start
random 0x64 ----------------------'Creates a random number from 0-100
compare LASTRESULT 0xA ---------'Compares if the number is 10
if 0x0 goto @none ----------------'If not it ends
special 0x97 ----------------------'If it equals 10, it creates a willbattle
releaseall

#org @none
releaseall

This example uses the 2nd pointer in the offset 0x1a4e2c.
Assuming the offset for the 'Random Wild Battle' script was 0x8003d8, you'd go to a hex editor and in the 2nd slot you'd write over '00 00 00 00' with 'd8 03 80 08'



Key Detection Specials
Spoiler:
Detects when a player presses certain keys.

Special 0x2b – AB checker
Spoiler:
No Arguments

Uses special2 0x8006 0xY
The 'Y' being the following:
Spoiler:
0x0 if none is pressed
0x1 if A is pressed
0x2 if B is pressed
0x3 if both are pressed


Example:
Spoiler:
#org @Start
lock
special2 0x8006 0x2b ----------'0x2b is the AB Checker
compare 0x8006 0x3 -----------'0x3 compares if both A&B are pressed
if 0x0 goto @not_yet
msgbox @did_it 0x6

#org @not_yet
msgbox @no_good 0x6
goto @Start

#org @no_good
= Keys Pressed Wrong!
#org @did_it
= Keys Pressed Correctly!


Special 0x2c – D-Pad checker
Spoiler:
No Arguments

Uses special2 0x8006 0xY
The 'Y' being the following:
Spoiler:
0x0 if no direction is pressed
0x1 if up is pressed
0x2 if left is pressed
0x3 if down is pressed
0x4 if right is pressed
0x5 if up-left is pressed
0x6 if up-right is pressed
0x7 if down-left is pressed
0x8 if down-right is pressed


Example:
Spoiler:
#org @Start
lock
special2 0x8006 0x2c ----------'0x2c is the D-Pad Checker
compare 0x8006 0x3 -----------'0x3 compares down is pressed
if 0x0 goto @not_yet
msgbox @did_it 0x6

#org @not_yet
msgbox @no_good 0x6
goto @Start

#org @no_good
= Keys Pressed Wrong!
#org @did_it
= Keys Pressed Correctly!


Special 0x2d – Select\start checker
Spoiler:
No Arguments

Uses special2 0x8006 0xY
The 'Y' being the following:
Spoiler:
0x0 if none is pressed
0x1 if select is pressed
0x2 if start is pressed
0x3 if both are pressed


Example:
Spoiler:
#org @Start
lock
special2 0x8006 0x2d ----------'0x2d is the select/start Checker
compare 0x8006 0x2 -----------'0x2 compares if start is pressed
if 0x0 goto @not_yet
msgbox @did_it 0x6

#org @not_yet
msgbox @no_good 0x6
goto @Start

#org @no_good
= Keys Pressed Wrong!
#org @did_it
= Keys Pressed Correctly!


Special 0x2e –RL checker
Spoiler:
No Arguments

Uses special2 0x8006 0xY
The 'Y' being the following:
Spoiler:
0x0 if none is pressed
0x1 if R is pressed
0x2 if L is pressed
0x3 if both are pressed


Example:
Spoiler:
#org @Start
lock
special2 0x8006 0x2e ----------'0x2e is the R&L Checker
compare 0x8006 0x2-----------'0x2 compares if L is pressed
if 0x0 goto @not_yet
msgbox @did_it 0x6

#org @not_yet
msgbox @no_good 0x6
goto @Start

#org @no_good
= Keys Pressed Wrong!
#org @did_it
= Keys Pressed Correctly!


Special 0x2f – Key Dumper
Spoiler:
This Special dumps the keys pressed & returns them to be compared against a specific combination entered.

No Arguments

Returns values? Yes
Spoiler:
0x0 to 0x3ff, one bit per key, following the same key as the GBA specifications, that is
Key per bit, starting at the lowest:

0 A
1 B
2 Select
3 Start
4 Right
5 Left
6 Up
7 Down
8 R
9 L


But what if I want the player to press a wacky combination involving A+B+L, then you would just add them up in a calculator in binary mode:

A | B | Select | Start | Right | Left | Up | Down | R | L
1-|-1-|---0---|--0---|--0---|--0--|--0-|--0---|-0-|1

now you just add it backwards, that would be 1000000011, 0x203 hexadecimal.


Example:
Spoiler:
#org @Start
lock
special2 0x8006 0x2f
compare 0x8006 0x203
if 0x0 goto @not_yet
msgbox @did_it 0x6
release
end

#org @not_yet
msgbox @no_good 0x6
goto @Start

#org @no_good
= You cannot escape this deadly trap!
#org @did_it
= No! You escaped!


Misc.
Spoiler:
SetHealingPlace Difference
Spoiler:
Vars Used:
Spoiler:
Uses Setvar 0x405a 0xmmBB - Map
Spoiler:
mm= Map Number BB= Banks Number

Uses Setvar 0x405b 0xXX - X Position
Uses Setvar 0x405c 0xYY - Y Position


Example:
Spoiler:
#org @healing
Msgbox @heal 0x6
Sethealingplace 0x0
Setvar 0x405a 0x000d -----'map 0, and Bank d =13; Indigo Plateau
Setvar 0x405b 0x0d -------'x coordinate of player
Setvar 0x405c 0x0c -------'y coordinate of player
Release
End

#org @heal
= I’ll set your healing place here.

Sethealing 0x0 -----‘plays nurse joy Pokecenter Script
Sethealing 0x1 -----'Does NOT plays nurse joy Pokecenter Script; useful for bed resting places


Increasing Max Money Amount
Spoiler:
You can now hold up to 999 999 999 money! That's nearly 1000 times more money!
This was never added to the manual, but JPAN talked about adding this in a future release, i dunno if it was added as of version 1.1, but here it is anyways:
This replaces 7 bytes, and here's how to do it:

Spoiler:
In a Hexeditor goto:
0809fdd4 replace |3f 42 0f 00| with |ff c9 9a 3b|------------------' (999999 for 999999999)
In the following offsets replace that one byte from |06| to |09| ----'(6 digit display for 9 digit display)
0808a006
0809fe52
0809fe62

Done, you should be able to have that much money now.


Fixes for the engine:

Reply With Quote
  #2    
Old October 12th, 2014 (10:26 PM).
Phasesaber
 
Join Date: Oct 2014
Gender: Male
Looks fancy, I''l have to look into his engine some more.
Reply With Quote
  #3    
Old October 13th, 2014 (11:07 AM).
Turtl3Skulll's Avatar
Turtl3Skulll
Blue Turtl3
 
Join Date: Jun 2013
Location: Utah, U.S.A.
Age: 19
Gender: Male
Nature: Bold
Quote originally posted by Phasesaber:
Looks fancy, I''l have to look into his engine some more.
If You want to check it out, here's the link to his post:

http://www.pokecommunity.com/showthread.php?t=194241


You'll have to patch with this first:

http://www.pokecommunity.com/showpost.php?p=5005730&postcount=252
Reply With Quote
  #4    
Old October 15th, 2014 (03:18 AM).
GoGoJJTech's Avatar
GoGoJJTech
http://GoGoJJTech.com (WIP!)
Community Supporter
 
Join Date: Nov 2012
Location: Earth
Age: 16
Gender: Male
Nature: Quiet
You should link to the fixes for the engine's bugs. Karatekid has a thread on PHO about it.
__________________
Reply With Quote
  #5    
Old October 15th, 2014 (10:03 AM).
Turtl3Skulll's Avatar
Turtl3Skulll
Blue Turtl3
 
Join Date: Jun 2013
Location: Utah, U.S.A.
Age: 19
Gender: Male
Nature: Bold
Quote originally posted by GoGoJJTech:
You should link to the fixes for the engine's bugs. Karatekid has a thread on PHO about it.
That's actually a really good idea, I just wanted to make a tutorial on the specials themselves, but I assume you're right, it would make this better, I'll update it and add those under the "Misc." section. thanks
Reply With Quote
  #6    
Old October 15th, 2014 (10:07 AM).
Turtl3Skulll's Avatar
Turtl3Skulll
Blue Turtl3
 
Join Date: Jun 2013
Location: Utah, U.S.A.
Age: 19
Gender: Male
Nature: Bold
Also if there are other fixes please let me know, pm them to me or add them here & I'll include them, so far the one posted is the only one I've seen
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 09:04 PM.