Advertiser Content

Resource [EM] Dizzy's Hacked Engine

Started by Chacha Dinosaur January 16th, 2017 8:11 AM
  • 31502 views
  • 137 replies
Age 25
Male
Seen August 31st, 2019
Posted August 31st, 2019
455 posts
6.2 Years
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
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:
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:
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)
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:
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:
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.

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

PGE ini, credits to Gamer2020:
Spoiler:

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

Here's an image of Illumise evolving by an item that works on only female species.
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:
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:
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:
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".

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.

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.)

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).

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


I'm open to any ideas, so if there's something you'd like to see in EM, tell.

Gamer2020

Accept no Imitations!

Male
Distant Land
Seen 4 Weeks Ago
Posted January 6th, 2019
942 posts
11.3 Years
...
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
These should be the ones for PGE.

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
Male
Seen January 18th, 2017
Posted January 17th, 2017
263 posts
9.3 Years
Hey Dizzy, I used your previous Emerald patch that raises the max level to 255 but saw that it may not display a 4 digit stats correctly. If I reuse the new one on my already applied mod, would it work properly still?
John 3:16
For God so loved the world that He gave His only begotten Son, that everyone who believes into Him shall by no means perish but have eternal life.

Acts 2:21
And everyone who calls on the name of the Lord will be saved.

I believe in Jesus Christ my Savior. If you do too, and aren't too scared to admit it, then copy and paste this into your signature.

Jesus is Lord!

LCCoolJ95

Limited Capacity

Age 24
Male
The World That Never Was
Seen 11 Hours Ago
Posted 1 Day Ago
608 posts
10.4 Years
Very awesome my man, but why didn't you make it into an optional feature in the upgraded engine, like what you did with Capture EXP? And will this work together with the engine?
"The greatest obstacle in life is Yourself. Overcome it, and you will achieve the greatest accomplishment of all." -Art Beins, 1982

Pokémon Theta Emerald EX: https://www.pokecommunity.com/showthread.php?t=386240

DizzyEgg

Age 22
Male
Poland
Seen 22 Hours Ago
Posted 1 Week Ago
785 posts
5.7 Years
Hey Dizzy, I used your previous Emerald patch that raises the max level to 255 but saw that it may not display a 4 digit stats correctly. If I reuse the new one on my already applied mod, would it work properly still?
There may be problems with hooks. Damn, I just deleted the repository so I may not remember all the hooks locations but if you still have it here's what you do. Check hooks file, go into every offset there is in a hex editor and replace bytes there with what was in the original rom.
If you'll have problems, send me your rom via PM and I'll release a patch fix for it.

Very awesome my man, but why didn't you make it into an optional feature in the upgraded engine, like what you did with Capture EXP? And will this work together with the engine?
Because Battle Engine is just that, a battle engine. I simply don't want to mix everything into one project. And Capture Exp is related to battles. :P
All my works are compatible with each other.

DizzyEgg

Age 22
Male
Poland
Seen 22 Hours Ago
Posted 1 Week Ago
785 posts
5.7 Years
wanted to ask you one thing,
is the coloured stats hook conflicting with the hook of level cap or some else feature ???
Yeah, they both use the same hook location.

Jeesh

The Emerald Rights Activist.

Male
Seen 1 Week Ago
Posted August 25th, 2019
53 posts
3 Years
All(I think) new evo methods have been implemented. I'll try to provide inis for them later(or if could someone else do it I'd be grateful ).
Heeeey,
I have a problem with the new evos.
When I try to evolve using a move, after the mon learns it from level up in battle, as the screen transitions to overworld it just stops and freezes on a black screen. Also, when I try to use an item on a specific gender mon, it says it won't have any effect. Levels above 100 and the nature colored boosts are operational, but NONE of the new evolutions are working. Is there something I did wrong?
>Emerald hacks need to come back.
>Make EMerica great again.
>I'm a Hoenn PROenn.
>Free the E.
>All hacks are created equal...but Emerald is cool.
>Charizard got nothin' on Rayquaza.
>Learn to hack the hard way. Go with Emerald.

DizzyEgg

Age 22
Male
Poland
Seen 22 Hours Ago
Posted 1 Week Ago
785 posts
5.7 Years
Heeeey,
I have a problem with the new evos.
When I try to evolve using a move, after the mon learns it from level up in battle, as the screen transitions to overworld it just stops and freezes on a black screen. Also, when I try to use an item on a specific gender mon, it says it won't have any effect. Levels above 100 and the nature colored boosts are operational, but NONE of the new evolutions are working. Is there something I did wrong?
Whoopsie! My bad, I forgot to update the linker file with given offset. The freezing was caused because the compiler assumed everything was being built at 0xF00000 even though the location may have differed.
I fixed it now, so re-download and it should work. :)

Jeesh

The Emerald Rights Activist.

Male
Seen 1 Week Ago
Posted August 25th, 2019
53 posts
3 Years
Whoopsie! My bad, I forgot to update the linker file with given offset. The freezing was caused because the compiler assumed everything was being built at 0xF00000 even though the location may have differed.
I fixed it now, so re-download and it should work. :)
Oh, great! Thanks :D

EDIT: Actually, now theres a syntax error when I run the build script with a file in the devkit folder.
>Emerald hacks need to come back.
>Make EMerica great again.
>I'm a Hoenn PROenn.
>Free the E.
>All hacks are created equal...but Emerald is cool.
>Charizard got nothin' on Rayquaza.
>Learn to hack the hard way. Go with Emerald.

Jeesh

The Emerald Rights Activist.

Male
Seen 1 Week Ago
Posted August 25th, 2019
53 posts
3 Years
Whoopsie! My bad, I forgot to update the linker file with given offset. The freezing was caused because the compiler assumed everything was being built at 0xF00000 even though the location may have differed.
I fixed it now, so re-download and it should work. :)
This thing:

Says it has a problem with line 30 and/or 32 in the linker.ld file, which is just a "}."

EDIT: I tried deleting and editing some charaters in the lines with errors. After a few tries, it made a rom. But the evolutions didn't work. They just went straight to overworld. This may have been made even worse, cuz I didn't have this error with the old one.
>Emerald hacks need to come back.
>Make EMerica great again.
>I'm a Hoenn PROenn.
>Free the E.
>All hacks are created equal...but Emerald is cool.
>Charizard got nothin' on Rayquaza.
>Learn to hack the hard way. Go with Emerald.

DizzyEgg

Age 22
Male
Poland
Seen 22 Hours Ago
Posted 1 Week Ago
785 posts
5.7 Years
This thing:

Says it has a problem with line 30 and/or 32 in the linker.ld file, which is just a "}."

EDIT: I tried deleting and editing some charaters in the lines with errors. After a few tries, it made a rom. But the evolutions didn't work. They just went straight to overworld. This may have been made even worse, cuz I didn't have this error with the old one.
Seems to be a problem with newlines. Check it out now.

LCCoolJ95

Limited Capacity

Age 24
Male
The World That Never Was
Seen 11 Hours Ago
Posted 1 Day Ago
608 posts
10.4 Years
Have this glitch when leveling up...empty spots in party level up:
"The greatest obstacle in life is Yourself. Overcome it, and you will achieve the greatest accomplishment of all." -Art Beins, 1982

Pokémon Theta Emerald EX: https://www.pokecommunity.com/showthread.php?t=386240

DizzyEgg

Age 22
Male
Poland
Seen 22 Hours Ago
Posted 1 Week Ago
785 posts
5.7 Years
Have this glitch when leveling up...empty spots in party level up:
Tell what you applied that caused it. If you don't know, apply one thing after the other and see when the bug shows up.

Jeesh

The Emerald Rights Activist.

Male
Seen 1 Week Ago
Posted August 25th, 2019
53 posts
3 Years
Seems to be a problem with newlines. Check it out now.
It still didn't work.
Like, it doesn't even look implemented.
To be specific, everything's operating. But the evolutions (I'm mainly testing the "Know Move" evolution type) are not. When I set it up in PGE, and have the mon learn the move on level up, it doesn't evolve when it LEARNS the move, and it doesn't evolve when it LEVELS UP knowing the move. Again, everything else works, but evolutions don't.
>Emerald hacks need to come back.
>Make EMerica great again.
>I'm a Hoenn PROenn.
>Free the E.
>All hacks are created equal...but Emerald is cool.
>Charizard got nothin' on Rayquaza.
>Learn to hack the hard way. Go with Emerald.

LCCoolJ95

Limited Capacity

Age 24
Male
The World That Never Was
Seen 11 Hours Ago
Posted 1 Day Ago
608 posts
10.4 Years
Tell what you applied that caused it. If you don't know, apply one thing after the other and see when the bug shows up.
Apparently the engine is causing it. Do you want me to send you the ROM?
"The greatest obstacle in life is Yourself. Overcome it, and you will achieve the greatest accomplishment of all." -Art Beins, 1982

Pokémon Theta Emerald EX: https://www.pokecommunity.com/showthread.php?t=386240

DizzyEgg

Age 22
Male
Poland
Seen 22 Hours Ago
Posted 1 Week Ago
785 posts
5.7 Years
It still didn't work.
Like, it doesn't even look implemented.
To be specific, everything's operating. But the evolutions (I'm mainly testing the "Know Move" evolution type) are not. When I set it up in PGE, and have the mon learn the move on level up, it doesn't evolve when it LEARNS the move, and it doesn't evolve when it LEVELS UP knowing the move. Again, everything else works, but evolutions don't.
Everything else works fine, right?
Did you expand the evo slots from 5 to 8?

Jeesh

The Emerald Rights Activist.

Male
Seen 1 Week Ago
Posted August 25th, 2019
53 posts
3 Years
Everything else works fine, right?
Did you expand the evo slots from 5 to 8?
Yes. Is that a problem?
I hope not, I want 8 evos.
>Emerald hacks need to come back.
>Make EMerica great again.
>I'm a Hoenn PROenn.
>Free the E.
>All hacks are created equal...but Emerald is cool.
>Charizard got nothin' on Rayquaza.
>Learn to hack the hard way. Go with Emerald.

DizzyEgg

Age 22
Male
Poland
Seen 22 Hours Ago
Posted 1 Week Ago
785 posts
5.7 Years
DizzyEgg, could you explain how does "Music in a battle with a specific pokemon" feature work?. I would like to test it but I don't know what I should write in the padding bytes (music ID, offset...?). I guess I can use any song in the game. Could I use inserted songs?
My bad for not specifying it. :P
You store a halfword(a two-byte value) in the padding bytes. The value is a songID the same one you use for scripting commands like playsong or changesong that get the song from the songtable.

Jeesh

The Emerald Rights Activist.

Male
Seen 1 Week Ago
Posted August 25th, 2019
53 posts
3 Years
It was a problem. Now I added a line that lets you set number of evolutions.
New error, yaaay:
>Emerald hacks need to come back.
>Make EMerica great again.
>I'm a Hoenn PROenn.
>Free the E.
>All hacks are created equal...but Emerald is cool.
>Charizard got nothin' on Rayquaza.
>Learn to hack the hard way. Go with Emerald.
Advertiser Content