Trainer 781
Guest
- 0
- Posts
I present to you a bunch of features that some people were requesting and some that I decided to port/upgrade. Those are relatively small projects and I hope to add new ones as time goes on.
Github page link
Current features are: (thanks for Tetra for writing descriptions of some of them)
Upgraded BW's Repel system
Playing specific music in a battle
WildPokeBattleMusic - allows you to assign a song that will be always played upon coming across a pokemon.
It uses the padding bytes in pokemon basestats. If 0 it'll play normal encounter music.
TrainerMusicVar - a var of your choice, it should contain a song ID that you want to be played in a trainer battle. If the var is set to 0, music plays normally.
Competitive Trainers:
Max Money 9 999 999:
New Evolution Methods:
Nature Colored Stats:
Moving the level cap:
Pokéball Expansion:
Menu options toggle:
The options in the menu, such as Bag, Save, Exit and more can now be toggled with the use of a flag! Once again, in the build.py file, there should be several labels such as
"FlagPokedex", "FlagBag", and "FlagTrainerCard" (There should be a flag for every menu option).
You can change these to any free unused flags to avoid problems later on.
Screenies:
Fire Red style fishing:
Chain fishing:
Shiny Charm:
Hall of Fame Expanded Pokémon Fix:
New Specials:
Installation:
I'm open to any ideas, so if there's something you'd like to see in EM, tell.
Github page link
Current features are: (thanks for Tetra for writing descriptions of some of them)
Upgraded BW's Repel system
Spoiler:
Similarly as in the Black/White series, you will be prompted to use another repel upon expiring. I added an option to choose which kind of repel to use provided the player possesses at least two.
Images:
Images:
Spoiler:
Playing specific music in a battle
Spoiler:
WildPokeBattleMusic - allows you to assign a song that will be always played upon coming across a pokemon.
It uses the padding bytes in pokemon basestats. If 0 it'll play normal encounter music.
TrainerMusicVar - a var of your choice, it should contain a song ID that you want to be played in a trainer battle. If the var is set to 0, music plays normally.
Competitive Trainers:
Spoiler:
Similarly as Doesnt's EV Trainers my method works by setting the "EV" byte in trainer pokemon's data. It allows you to set pokemon's EVs, IVs, nature and pokeball. Only trainers that use pokemon with custom moves and custom items are affected(note that even if you assign custom items, a pokemon can still hold nothing).
The layout is like this:
You can have up to 255 different sets. Note that the first set is assigned by byte 0.
The table of sets gets created upon building the project. You can find its location in the offsets.ini file by name "config_table".
Here's an image of a trainer sending out his pokemon with a master ball:
The layout is like this:
Spoiler:
hp/atk/def/spd/sp.atk/sp.def ev
hp/atk/def/spd/sp.atk/sp.def iv
ability(0 for first, 1 for second)
nature (enumerated like this)
0 HARDY
1 LONELY
2 BRAVE
3 ADAMANT
4 NAUGHTY
5 BOLD
6 DOCILE
7 RELAXED
8 IMPISH
9 LAX
10 TIMID
11 HASTY
12 SERIOUS
13 JOLLY
14 NAIVE
15 MODEST
16 MILD
17 QUIET
18 BASHFUL
19 RASH
20 CALM
21 GENTLE
22 SASSY
23 CAREFUL
24 QUIRKY
Other values will make it random.
pokeball
padding byte
hp/atk/def/spd/sp.atk/sp.def iv
ability(0 for first, 1 for second)
nature (enumerated like this)
Spoiler:
0 HARDY
1 LONELY
2 BRAVE
3 ADAMANT
4 NAUGHTY
5 BOLD
6 DOCILE
7 RELAXED
8 IMPISH
9 LAX
10 TIMID
11 HASTY
12 SERIOUS
13 JOLLY
14 NAIVE
15 MODEST
16 MILD
17 QUIET
18 BASHFUL
19 RASH
20 CALM
21 GENTLE
22 SASSY
23 CAREFUL
24 QUIRKY
Other values will make it random.
pokeball
padding byte
You can have up to 255 different sets. Note that the first set is assigned by byte 0.
The table of sets gets created upon building the project. You can find its location in the offsets.ini file by name "config_table".
Here's an image of a trainer sending out his pokemon with a master ball:
Spoiler:
Max Money 9 999 999:
Spoiler:
Moves the money cap from 999 999 to 9 999 999. A simple hack, although required a hook for properly displaying money while buying items.
Images:
Images:
Spoiler:
New Evolution Methods:
Spoiler:
All(I think) new evo methods have been implemented.
If your hack has 8(or more) evolutions per pokemon change the "EvosPerPoke" line in the build.py script.
However instead of expanding entries, I present a better solution below.
Eeevee evolution Table:
Gen3Tools ini:
PGE ini, credits to Gamer2020:
Here's an image of Illumise evolving by an item that works on only female species.
If your hack has 8(or more) evolutions per pokemon change the "EvosPerPoke" line in the build.py script.
However instead of expanding entries, I present a better solution below.
Eeevee evolution Table:
Spoiler:
Instead of expanding the evolution table from 5 entries to 8, this feature now creates a new, special table that is used for
Pokémon that need more than 5 entries. An example of this is Eevee, who has 8 evolutions. This feature was implemented to save space
and only give more entries to Pokémon that need it.
Pokémon that need more than 5 entries. An example of this is Eevee, who has 8 evolutions. This feature was implemented to save space
and only give more entries to Pokémon that need it.
Gen3Tools ini:
Spoiler:
Code:
...
old ones remain unchanged
...
10=Knows Move
11=In certain map
12=Level-up at day
13=Level-up at night
14=Holding item at day
15=Holding item at night
16=Level-up if male
17=Level-up if female
18=Level-up if raining
19=Specific Pokemon in party
1A=Level-up if pokemon with type in party
1B=Using item if male
1C=Using item if female
Spoiler:
Code:
EvolutionName16=Knows Move
Evolution16Param=attack
EvolutionName17=In certain map
Evolution17Param=mapname
EvolutionName18=Level-up at day
Evolution18Param=level
EvolutionName19=Level-up at night
Evolution19Param=level
EvolutionName20=Holding item at day
Evolution20Param=item
EvolutionName21=Holding item at night
Evolution21Param=item
EvolutionName22=Level-up if male
Evolution22Param=level
EvolutionName23=Level-up if female
Evolution23Param=level
EvolutionName24=Level-up if raining
Evolution24Param=level
EvolutionName25=Specific Pokemon in party
Evolution25Param=species
EvolutionName26=Level-up if pokemon with type in party
Evolution26Param=bankandmap
EvolutionName27=Using item if male
Evolution27Param=item
EvolutionName28=Using item if female
Evolution28Param=item
Spoiler:
Nature Colored Stats:
Spoiler:
I wrote an ASM routine(that can be found here) for this already. This one is in C. Reason why I bothered is because next feature uses a hook in the same location, so we'd have a conflict there.
Images:
Images:
Spoiler:
Moving the level cap:
Spoiler:
Surprisingly people weren't as enthusiastic about this one as I thought. I moved the level cap four/five months ago I think, although it had few oddities and imperfections. :P This time I changed a bit the way I made it and used look-up tables instead of calculating values at run-time. Also made it a bit nicer to display 4-digit stats(sadly EM's stat display wasn't made in mind with such large stats, Fire Red's one is much better for that). I tested it and should work all fine except for displaying 4-digit HP in battle which I'm yet to figure out.
You can choose the max level for pokemon, so theoretically instead of upping the cap you could bring it down to something like 50.
Screenies:
This Blissey is legit I swear
You can choose the max level for pokemon, so theoretically instead of upping the cap you could bring it down to something like 50.
Screenies:
Spoiler:
This Blissey is legit I swear
Pokéball Expansion:
Spoiler:
Every Pokéball from Gen 4 onwards have been implemented. This means Kurt's Apricorn Balls have all been included with the correct effects, and the new Pokéball from Gen 7, the Beast Ball.
You can enable this by going into the build.py file. There should be a label called
"BallsExpansion" and "FirstNewBallID". To enable the ball expansion, simply change "False" to "True".
The second label is where the first new ball's index will be. Make sure you choose a suitable place
with several free indexes, as all the new balls will be given indexes here and afterwards.
HUGE credits for: Tetra, AngryBird, Kabby and Bela who made all the sprites.
Also thanks for Tetra who was kind enough to send me all the images in a hex format.
Screenies:
You can enable this by going into the build.py file. There should be a label called
"BallsExpansion" and "FirstNewBallID". To enable the ball expansion, simply change "False" to "True".
The second label is where the first new ball's index will be. Make sure you choose a suitable place
with several free indexes, as all the new balls will be given indexes here and afterwards.
HUGE credits for: Tetra, AngryBird, Kabby and Bela who made all the sprites.
Also thanks for Tetra who was kind enough to send me all the images in a hex format.
Screenies:
Spoiler:
Menu options toggle:
Spoiler:
The options in the menu, such as Bag, Save, Exit and more can now be toggled with the use of a flag! Once again, in the build.py file, there should be several labels such as
"FlagPokedex", "FlagBag", and "FlagTrainerCard" (There should be a flag for every menu option).
You can change these to any free unused flags to avoid problems later on.
Screenies:
Spoiler:
Fire Red style fishing:
Spoiler:
You can now enable Fire Red style fishing instead of the R/S/E style fishing. This means there will be no biting, but either
an encounter or a fail. This can be enabled/disabled in the build.py file under the label "FireRedFishing", by setting it to
"True" or "False".
an encounter or a fail. This can be enabled/disabled in the build.py file under the label "FireRedFishing", by setting it to
"True" or "False".
Chain fishing:
Spoiler:
From 6th Gen, chain fishing has been implemented. If you hook a fish several times in a row, the shiny rate will increase.
To enable this, go to the build.py, and look for the label "Chain Fishing". Change "False" to "True" to enable this feature.
To enable this, go to the build.py, and look for the label "Chain Fishing". Change "False" to "True" to enable this feature.
Shiny Charm:
Spoiler:
Introduced in 5th Gen, the Shiny Charm is an item that increases shiny odds for every encounter by a specific amount.
This effect can be assigned to an item ID, for which you are using for the Shiny Charm. To set the item ID, go to
build.py, and look for the label "ShinyCharm". Set to what item ID you want it to be. (0x1 would be how you'd write 1 in hex, and
if you want to write the item ID in decimal, don't use the 0x prefix.)
This effect can be assigned to an item ID, for which you are using for the Shiny Charm. To set the item ID, go to
build.py, and look for the label "ShinyCharm". Set to what item ID you want it to be. (0x1 would be how you'd write 1 in hex, and
if you want to write the item ID in decimal, don't use the 0x prefix.)
Hall of Fame Expanded Pokémon Fix:
Spoiler:
Expanded Pokémon from the Poké Expansion don't display properly when viewed in the Hall of Fame. A fix has been implemented.
To apply this fix, go to build.py, and look for the "HallofFameFix" label. Change it to "True" if you want to enable it, and "False"
for disabling it. (If you aren't using the expansion).
To apply this fix, go to build.py, and look for the "HallofFameFix" label. Change it to "True" if you want to enable it, and "False"
for disabling it. (If you aren't using the expansion).
New Specials:
Spoiler:
A bunch of new specials has been added to make it easier for romhackers to do things that are not possible just by using scripting commands.
Here's the full list of them along with descriptions and script examples.
0x20F check move compatibility
Args: pokeID, moveID, to_check
Returns: bitfield of moves that can learn set in to_check
0x210 get attributes
Args: pokeID, attribute
Returns: attribute
0x211 set attributes
Args: pokeID, attribute, new value
Returns: nothing
0x212 ability switcher
Args: pokeID
Returns: 0 if didnt switch, because has only one ability, otherwise 1
0x213 safariballs adder
Args: amount to add/sub
Returns: nothing
0x214 safaristep adder
Args: amount to add/sub
Returns: nothing
0x215 set player nick
Args: none
Returns: nothing
Stores in 0x800D 0 if didnt change name, otherwise 1
0x216 set timer
Args: none
Returns: nothing
0x217 get timer
Args: none
Returns: time that passed in seconds
0x218 buffer timer
Args: none
Returns: nothing
0x219 stop timer
Args: none
Returns: nothing
0x21A continue timer
Args: none
Returns: nothing
0x21B new multichoice
Args: no of options, pos X, pos Y
PointerArgs: option text pointers (amount of them depends on the first argument)
Returns: nothing
0x21C prepare multichoice
Args: none
Returns: nothing
0x21D add to prepared multichoice
Args: no of options to add
PointerArgs: option text pointers (amount of them depends on the first argument)
Returns: nothing
0x21E display prepared multichoice
Args: posX, posY
Returns: nothing
0x21F display next message with text moving on its own
Args: text speed(8 - slow, 4 - medium, 1 - fast, 0xFFFF use the one in the menu options)
PointerArgs: pointer to text message
Returns: nothing
0x220 give pokeblock
Args: none
PointerArgs: pointer to pokeblock data
Returns: 1 if pokeblock was given, 0 if no room for it
0x221 create rbox
Args: pos X, pos Y, width, height
Returns: rboxID
0x222 put text on rbox
Args: rboxID
PointerArgs: pointer to text message
Returns: nothing
0x223 delete rbox
Args: rboxID
Returns: nothing
0x224 delete pokemon
Args: pokeID
Returns: nothing
0x225 set lvl
Args: pokeID, new level
Returns: old level poke had
0x226 setword
Args: none
PointerArgs: word to write, destination
Returns: nothing
0x227 get attributes2
Args: pokeID, case(0 = nature, 1 = gender, 2 = shininess)
Returns: value or 0xFFFF if the case was wrong
0x228 set attributes2
Args: pokeID, nature(0xFF to keep the current one), gender (0xFF to keep the current one), shininess
Returns: nothing
0x229 create custom pokemon
Args: species, lvl, nature (0xFF random). shininess
Returns: nothing
0x22A set attributes of custom pokemon
Args: attribute, new value
Returns: nothing
0x22B give custom pokemon
Args: none
Returns: 0 - poke was given to party, 1 - poke was transferred to PC, 2 - not enough space, poke could not be given
Here's the full list of them along with descriptions and script examples.
Spoiler:
0x20F check move compatibility
Args: pokeID, moveID, to_check
Returns: bitfield of moves that can learn set in to_check
0x210 get attributes
Args: pokeID, attribute
Returns: attribute
0x211 set attributes
Args: pokeID, attribute, new value
Returns: nothing
0x212 ability switcher
Args: pokeID
Returns: 0 if didnt switch, because has only one ability, otherwise 1
0x213 safariballs adder
Args: amount to add/sub
Returns: nothing
0x214 safaristep adder
Args: amount to add/sub
Returns: nothing
0x215 set player nick
Args: none
Returns: nothing
Stores in 0x800D 0 if didnt change name, otherwise 1
0x216 set timer
Args: none
Returns: nothing
0x217 get timer
Args: none
Returns: time that passed in seconds
0x218 buffer timer
Args: none
Returns: nothing
0x219 stop timer
Args: none
Returns: nothing
0x21A continue timer
Args: none
Returns: nothing
0x21B new multichoice
Args: no of options, pos X, pos Y
PointerArgs: option text pointers (amount of them depends on the first argument)
Returns: nothing
0x21C prepare multichoice
Args: none
Returns: nothing
0x21D add to prepared multichoice
Args: no of options to add
PointerArgs: option text pointers (amount of them depends on the first argument)
Returns: nothing
0x21E display prepared multichoice
Args: posX, posY
Returns: nothing
0x21F display next message with text moving on its own
Args: text speed(8 - slow, 4 - medium, 1 - fast, 0xFFFF use the one in the menu options)
PointerArgs: pointer to text message
Returns: nothing
0x220 give pokeblock
Args: none
PointerArgs: pointer to pokeblock data
Returns: 1 if pokeblock was given, 0 if no room for it
0x221 create rbox
Args: pos X, pos Y, width, height
Returns: rboxID
0x222 put text on rbox
Args: rboxID
PointerArgs: pointer to text message
Returns: nothing
0x223 delete rbox
Args: rboxID
Returns: nothing
0x224 delete pokemon
Args: pokeID
Returns: nothing
0x225 set lvl
Args: pokeID, new level
Returns: old level poke had
0x226 setword
Args: none
PointerArgs: word to write, destination
Returns: nothing
0x227 get attributes2
Args: pokeID, case(0 = nature, 1 = gender, 2 = shininess)
Returns: value or 0xFFFF if the case was wrong
0x228 set attributes2
Args: pokeID, nature(0xFF to keep the current one), gender (0xFF to keep the current one), shininess
Returns: nothing
0x229 create custom pokemon
Args: species, lvl, nature (0xFF random). shininess
Returns: nothing
0x22A set attributes of custom pokemon
Args: attribute, new value
Returns: nothing
0x22B give custom pokemon
Args: none
Returns: 0 - poke was given to party, 1 - poke was transferred to PC, 2 - not enough space, poke could not be given
Installation:
Spoiler:
- Download devkitpro from here.
Follow the instructions.
(Note: you can only install devkitARM)
- Download the latest version of python(3.5).
After downloading and before proceeding to install make sure that the 'add to path' checkbox is ticked, otherwise you'll have to add the python path in the environment variables manually.
- Download the master folder from the github page here.
(click 'Clone or Download', then 'Download Zip')
- Place your rom it the main(master) folder.
- Go into scripts folder and open 'build.py' with a text editor and modify it accordingly to your will.
Graphical representation of what you're to do.
You can apply any features you want, they're all compatible with each other and work on their own.
- Run the cmd.exe in the main folder.
You can do this by typing 'cmd' and hitting enter in the url address or selecting 'run command prompt from here' from right clciking on empty space while holding the shift key.
- In command prompt window, type 'python scripts//build.py' and press enter.
A new gba file will appear named as test.gba along with 'offsets.ini' that provides addresses of everything that was built.
Follow the instructions.
(Note: you can only install devkitARM)
- Download the latest version of python(3.5).
After downloading and before proceeding to install make sure that the 'add to path' checkbox is ticked, otherwise you'll have to add the python path in the environment variables manually.
- Download the master folder from the github page here.
(click 'Clone or Download', then 'Download Zip')
- Place your rom it the main(master) folder.
- Go into scripts folder and open 'build.py' with a text editor and modify it accordingly to your will.
Graphical representation of what you're to do.
You can apply any features you want, they're all compatible with each other and work on their own.
- Run the cmd.exe in the main folder.
You can do this by typing 'cmd' and hitting enter in the url address or selecting 'run command prompt from here' from right clciking on empty space while holding the shift key.
- In command prompt window, type 'python scripts//build.py' and press enter.
A new gba file will appear named as test.gba along with 'offsets.ini' that provides addresses of everything that was built.
I'm open to any ideas, so if there's something you'd like to see in EM, tell.
Last edited by a moderator: