Hi there! My name’s Dragz, and this is a dedicated thread for any ASM/C hacks I make.
Master Github link: GitHub - GigaExcalibur/asm
Awakening Style Durability (DEPRECATED)
Have you ever been annoyed by that unnecessary -- / --
display for weapons or items with infinite durability? Well so have I! So much that I made a quick hack in C to remove it. This hack also removes the weapon max durability display, as I’ve always felt that was redundant information (and it allows space for longer weapon names!)
For buildfile users, simply #include AwakeningStyleDurability.lyn.event
anywhere. For FEBuilder users, insert AwakeningStyleDurability.lyn.event
with EA.
I haven’t tested this, but I’ve been told this hack has compatibility issues with Gaiden Magic as they both hook the draw item name function.
Item Name Expansion (DEPRECATED)
Did you think I was just gonna let all that empty space from Awakening Style Durability go unused? I realized that removing the max durability display made it possible to expand the maximum length an item name could be before being cut off. And so, a few small changes later, now you can have even longer weapon names without the need for NarrowFont or abbreviations:
To install, #include Installer.event
anywhere in your buildfile. For FEBuilder users, Insert EA Installer.event
.
Several important notes:
-Do not install Awakening Style Durability alongside this. The two hacks differ slightly for a few functions, so using them together may end up with incorrectly-sized menus. This hack already includes the necessary changes for durability display, so don’t worry about needing anything else.
-Due to the screen size limits of the GBA, I am only able to expand item names in the status screen, item select screen, and shop screen. In every other menu, weapon names longer than vanilla will be cut off. This is a virtually insurmountable obstacle (until the day we can make item names scroll) but it’s a sacrifice I’m willing to make for the extra flavor.
-As evident in an above screenshot, the shop menu has yet to be widened and recentered to account for the extra space. The functions regarding the shop proc are a bit inscrutable to me right now, but I will fix that the second I know how.
-I didn’t test this, but this hack may be incompatible with Gaiden Magic due to the latter’s HP cost display for spells. If you are using Gaiden Magic, please be careful.
-I may have missed some other bugs. If you see any, please let me know so I can fix them as soon as possible.
Special thanks to Kirb, Tequila, Kao, and 7743 for a discussion in 2018 about the addresses for various menu dimensions. And even more special thanks to Vesly, Contro, Snek, Huichelaar, Pikmin, Camdar, and the others in #gba-coding-help for putting up with my inexperience in programming. You guys rule.
Age Getter
Introducing Age Getter. Character ages used to only be flavor text that detail-obsessed designers would place in personal info boxes, but no longer! Age Getter allows you to define a table for character ages, which you can then read from in events or code. Realistically I’m the only person who has a use case for this but there’s no reason for it not to have a public release.
Eirika’s age here is 17. 12 STR + 5 Iron Sword Mt + 17 years old = 34 attack.
Installation and Customization:
-For buildfile users, #include Installer.event
anywhere in your buildfile. Character ages are set in CharacterAges.event
using the simple macro CharacterAgeTableEntry
macro.
-For FEBuilder users, hold tight. If at all possible, I’ll try to get this implemented as a configurable patch.
-Important note 1: character ages are stored as a byte, so individual ages can’t be greater than 255. Sorry manaketes, your age will have to be stored in dragon years.
-Important note 2: character ages are static and the age for a given character id can never change. If you were thinking of using this hack and celebrating a character’s birthday, maybe think again.
Special thanks to Contro, Vesly, Sme, and Pik for help in setting up the getter and making it read from a table. Nothing I ever do would be possible without them, really.
Ignore Triangle (DEPRECATED)
Introducing Ignore Triangle. This is probably the least flashy hack I’ll ever make, evidenced by the fact that I whipped it together in like 15 minutes. This code zeroes out both combatants’ weapon triangle bonuses if at least one of them has the second bit on the last byte of the weapon ability word set. I could’ve done this a number of ways but I needed the weapon’s skill slot for something else and this was the most eloquent solution I came up with.
What that means in practice is that you can create weapons that belong to an existing type, but don’t have any weapon triangle matchups. For example, you could implement knives as a subgroup of swords that aren’t weak to lances or strong against axes (a la FE9).
Bit not set vs. bit set. Exciting, I know. But I’m using this in my own hack, and as such there’s no reason not to release this on its own.
Installation and Configuration:
- Important: This hack MUST be used with Skillsys since its routine is added to the WTA calc loop. I may make a standalone version someday, but that’ll have to wait.
- Furthermore If you use this hack you have to use consolidated advanced weapon locks. This is because the normal version uses the entire last byte of the weapon ability word, while the consolidated version only uses the last bit.
- Because of this hack’s recency, it may not work with Custom Builds.
-
#include Installer.event
anywhere in your buildfile. - Copy
POIN IgnoreTriangleRoutine
into WTACalcLoop.event (found in EngineHacks/Necessary/CalcLoops/WTACalcLoop) - Copy
#define IgnoreTriangle 0x02000000
into TableDefinitions.event (or anywhere before tables are inserted, really). I don’t think this bit conflicts with anything, but if you’d like to change it you can do so changing the definition here and the number of shifts done in line 10 ofIgnoreTriangle.s
. - Designate weapons being outside the triangle the same way you would if they were a reaver or doubled the triangle.
As usual, let me know if you encounter any errors or have any questions. Have a wonderful day!
Forging
Introducing Forging. This code repurposes a weapon’s durability byte in RAM as its forge count, giving it stat bonuses depending on forge effects in a user-defined table. As a lover of unbreakable weapons, I’ve never felt more vindicated to have a practical application for removing durability.
Installation and Configuration:
- Installation is incredibly simple this time around! Just
#include Installer.event
anywhere in your buildfile, or Insert Installer.event with EA if you’re an FEBuilder user. - Within Installer.event are the configuration options. There are two EA tables that you have to fill in:
ItemForgeTableEntries
andForgeEffectTable
. -
ItemForgeTableEntries
is a table that determines which forging path that item goes down, indexed by item id. Use the macroItemForgeTableEntry()
to avoid having to keep track of the index yourself. -
ForgeEffectTable
is a table that determines the stats boosts of an item per forge level. You can boost (or lower) Might, Hit, Weight, Crit, and even Max Range! Just be aware that every value in the table has to be multiplied by 2 (or 6 in the case of max range), as that’s the easiest way to do increments of 0.5 in the code. - Once the tables are set up, make sure to set every forgeable item as unbreakable in the item table. If you try to add a breakable item to the forge table, it will treat the item as being forged the number of times equal to its durability. Which could be fun as a mechanic of like, weapon rusting, but it’s not intended usage of this hack. Normal breakable weapons should otherwise function normally.
- Alright this is where the fun ends. While the forging architecture is pretty much complete, I don’t even know where to begin creating an interface ingame to allow the player to forge their items in. Currently the only way to forge items ingame is with the SetStatus patch, which is very clunky and not something I’d ever force on a user. My initial idea was to integrate this hack with Sme’s More Shop Types hack, although I’m nowhere near that skill level yet.
I wouldn’t recommend using this hack until the necessary interfacing is complete, which could be anywhere from next week to next decade. But still, I hope you like the architecture of forging! Thank you to the usual wizards for helping me out with this.
Edit: forgot download link, whoops. It’s the same Github as usual: https://github.com/GigaExcalibur/asm/tree/main/Forging
PMD2 Midis (not coding)
Hey guys, slightly different content I have for you all today. I was sick in bed this past week and didn’t really have the energy for hacking, so I fiddled around with some Pokemon Mystery Dungeon: Explorers of Sky midis, formatting them for GBA insertion.
Included in this first set is:
- Chasm Cave
- Ending Theme (main story)
- One for All, All for One!
- Random Dungeon 3
- Sky Peak Prairie
- Temporal Tower
- Time Gear
I don’t feel comfortable putting them in the Music Repo, but they are all F2U/F2E. You can find the midis, .s files, and .event files (for buildfile users) all in their respective folders on my regular Github: https://github.com/GigaExcalibur/asm/tree/main/PMD2Midis
That’s all, have a great day!
Player-Exclusive Class Descriptions
Introducing Player-Exclusive Class Descriptions. This is a small hack that allows you to set different text ids for a class description depending on whether the unit in question is a player or not a player.
You’re just gonna have to trust me that these two units have the same class ID.
There’s no real mechanical purpose for this hack, it’s only used for flavor. But as someone who greatly enjoys flavor, I certainly am going to put it to good use.
Installation and configuration are so simple I’m not even going to write a bulleted list. Just #include Installer.event
anywhere in your buildfile / Insert it with EA for FEBuilder users, and follow the macro defined in Installer.event to set your player class descriptions. Shouldn’t conflict with anything either, but be aware of any future hacks that change class description.
Download link: https://github.com/GigaExcalibur/asm/tree/main/PlayerClassDescs
Thank you as always!
Miscellaneous Inlines
No major release today, just a collection of miscellaneous inline changes.
Battle crit threshold
PUSH
ORG 0x02ACC0
BYTE 0xA // battle crit below this number becomes set to 0
POP
Comment should be self-explanatory.
BWL Position
PUSH
ORG 0x870B8
WORD 0x020040F4 // I can't entirely explain it but the last two bytes here determine position
POP
Self-explanatory once again, the default value moves the BWL display down one tile to fit another line of stats there.
Remove prep support room theme
PUSH
ORG 0x951FC
SHORT 0x46C0 0x46C0 // nop out function call to change music
POP
Literally the simplest hack here, this makes it so the prep theme keeps playing when in the Support submenu there.
Stat Screen Map Sprite Y-Pos
#define MapSpriteYPos 0x97 // pixels, not tiles
PUSH
ORG 0x0886EC
BYTE MapSpriteYPos
ORG 0x087CE6
BYTE MapSpriteYPos
ORG 0x087DBC
BYTE MapSpriteYPos
ORG 0x087E34
BYTE MapSpriteYPos
POP
Self-explanatory (wow, there sure were a lot of these). Moves the unit’s moving map sprite in the stat screen down to the defined pixel, mostly useful if expanding the class name. You can see how it looks with the default value in the BWL position image.
Support screen positions
PUSH
// X-Offset of the support partner name in list
ORG 0x87722
SHORT 0x3104
// X-Offset of the support rank in list
ORG 0x87748
SHORT 0x340D
POP
For the first time in this list, not self-explanatory. This changes how far to the right each element of a support line is drawn to the affinity. This is really only useful if you’re doing what I did and split page 3 of the stat screen up into two columns.
Movement Cost Table Terrain Display
PUSH
ORG 0x8CA5C
POIN 0x80BB96 // address of the flying move cost table
POP
In vanilla, whether or not a given terrain type displays its hit and avoid bonuses is determined by its movement cost in the Berserker’s movement cost table (located at 0x80B90C). IS decided to tie this to the Berserker’s movement costs because it’s the vanilla class that can cross the most terrain types while still receiving terrain bonuses from them, but hackers could have a few edge cases where that’s not the case.
Namely I’ve seen a few hacks that make some classes (but not Berserkers) able to cross Thickets, so if you wanted to make the terrain window display Thickets’ Def/Avo bonuses you’d have to make Berserkers able to stand on them too. If that’s not something you want, point to a different movement cost list at the address above. It defaults to writing terrain bonuses for all terrain that fliers can cross, but if you only want this for thickets I recommend writing a new custom movement cost instead of using a vanilla one.
Infinite Status Duration
PUSH
ORG 0x188F8
SHORT 0x46C0 // status duration no longer ticks down
POP
PUSH 0x873F8
SHORT 0x46C0 0x46C0 // status duration no longer displays in statscreen
POP
Do you like Thracia 776? No? Well uh, in that case please avert your eyes. This was a funny idea I had during a status discussion in FEUcord and realized I could make it a reality by just noping out the line of code that ticks status down (and the line that displays status duration in the stat screen). Note that this doesn’t change the flickering status duration in the vanilla MMB, although nobody uses the vanilla MMB so I’m comfortable leaving that as is.
If anyone actually plays a hack that uses this, I’m sorry in advance.
These won’t go in the GitHub, so just copy the text from here and paste it wherever.
Base Theme by Chapter
Introducing Base Theme by Chapter. Another very simple hack, this allows you to customize the theme that plays in the Support / Base Convo menu in the prep screen by chapter.
A gif won’t do anything here so you’re just gonna have to trust me that it works. I called it “Base” theme by chapter because if you’re not using Snek’s base convos there’s no reason to use this. Hell, I’m not even using this myself, a friend requested it for their hack and I figured it was within my skill level. Regardless, there’s no reason not to make this public and if someone else has a use for it, all the better.
The usual simple installation: #include Installer.event
in your buildfile, or Insert EA with FEBuilder. Use the defined macro ChaptersWithBaseThemeEntry
to set the base theme for that specific chapter, and leaving a chapter out or setting the base theme to 0 will make the prep theme continue playing in the menu. This hack doesn’t require SkillSys and shouldn’t conflict with anything else.
Download link: https://github.com/GigaExcalibur/asm/tree/main/BaseThemeByChapter
That’s all for this time, have a great day as usual!
Cryptocurrency
Introducing… uh. Introducing, uh, Cryptocurrency. This is yet another tiny hack that was requested by a friend of mine for his hack, and I figured I’d oblige.
This hack allows you to define one item id as being “crypto”, meaning its base sell price fluctuates by chapter and every time you enter the shop screen its prices changes by some random variance. There is literally no use for this hack besides being making a joke sellable item, but wizard’s creed and all that.
Installation is simple as usual, #include Installer.event
in your buildfile or Insert it with EA for an FEBuilder user. All of the cryptocurrency parameters have labels in the file that exist to be edited on the user end: you can change the crypto item id, the bounds of random variance, and set the base price modifier per chapter with ModifierPerChapterEntry()
. This doesn’t require SkillSys and shouldn’t conflict with anything.
Note that due to the way random numbers work in GBAFE, the player can very easily save scum the random variance by moving the cursor back and forth in the shop menu. If for some reason you’re actually using this hack (and care about your economy being balanced, which if you’re using cryptocurrency is unlikely), I recommend skewing the variance below 100% so the player can’t manipulate it as easily.
Download link: https://github.com/GigaExcalibur/asm/tree/main/Cryptocurrency
Anyway that was all for today, I hope you at least enjoyed this implementation of crypto in GBA. Have a great day!
Weapon Triangle Coefficients
Introducing Weapon Triangle Coefficients. This hack lets you set coefficients that multiply the weapon triangle hit/mt bonuses per difficulty. I actually made this hack several months ago but it wasn’t compatible with SkillSys and the code in general was just very shoddily-written. Now that I have more experience I figured I’d rewrite it to be SkillSys-compatible and better.
You can make the weapon triangle bonuses higher on a lower difficulty to help newer players learn the mechanic, remove the weapon triangle on the hardest difficulty a la Radiant Dawn, or even reverse the triangle on a specific difficulty for a special “Reaver Mode”. Weapon triangle coefficients can be any multiple of 1/12.
Included in the download link are two folders: one for SkillSys users and one for non-Skillsys users. Installation and configuration steps for each:
SkillSys Users:
-
#include Installer.event
anywhere in your buildfile. - To make these functions run when calculating weapon triangle bonuses, add
POIN IgnoreTriangle
andPOIN WtByDifficulty
to the bottom of the WTA calc loop (EngineHacks/Necessary/CalcLoops/WTACalcLoop/WTACalcLoop.event). - To change the coefficients per difficulty, alter the bytes within the labels in
Installer.event
. Make sure the values in each byte are multiplied by 12 in order to support coefficients that are multiples of 1/12. If you have a negative coefficient, make sure you enclose the entire value in parentheses. - To designate items as ignoring the weapon triangle entirely, add their weapon ids to
IgnoreTriangleList
.
Non-SkillSys Users:
-
#include "Installer.event"
anywhere in your buildfile, or Insert Installer.event with EA if you’re an FEBuilder user. - To change the coefficients per difficulty, alter the bytes within the labels in
Installer.event
. Make sure the values in each byte are multiplied by 12 in order to support coefficients that are multiples of 1/12. If you have a negative coefficient, make sure you enclose the entire value in parentheses. - To designate items as ignoring the weapon triangle entirely, add their weapon ids to
IgnoreTriangleList
.
If you read the installation/configuration options, you’ll recognize that this hack also comes with an updated version of my Ignore Triangle hack. My previous Ignore Triangle hack was functional, but involved repurposing an item ability bit when it wasn’t necessary. It also required SkillSys to work, which the new version does not.
The old version of Ignore Triangle will still be available on my GitHub, albeit with (DEPRECATED)
in the folder name.
Download link: https://github.com/GigaExcalibur/asm/tree/main/WeaponTriangleCoefficients
Thank you for reading, and have a great day!
Increase Weapon Level ASMC
Two releases in one day? Unheard of. Anyway, introducing Increase Weapon Level ASMC. Exactly what it says on the tin: it gives you an event command that increases a unit’s weapon exp to the next rank. Technically different from Set Unit Status because it bumps your unit up to the next rank instead of setting it to an absolutely value, hopefully that’s enough justification for it to exist.
Installation is simple: #include Installer.event
anywhere in your buildfile, and for FEBuilder users wait until 7743 adds this as a patch.
Structure and parameters in the example event:
ALIGN 4
ASMCTest:
SVAL s1 Klaudia // s1 = unit to increase rank for
SVAL s2 Light // s2 = weapon type to increase rank of
SVAL s3 0x0 // s3 = whether to give E rank if unit doesn't have any rank
ASMC IncreaseWLvl|1
NoFade
ENDA
Comes with the macro IncreaseWeaponLevel(unit, type, restriction)
for your convenience.
Download link: https://github.com/GigaExcalibur/asm/tree/main/IncreaseWLvlASMC
Stat Screen Terrain Bonus
Hey there! Been a little while. Introducing Stat Screen Terrain Bonus. Have you ever been annoyed that terrain bonuses don’t show up on the unit’s stat screen? Well this is because terrain bonuses are only applied to the unit’s “battle defense” stat instead of their base defensive stat, which makes it very difficult to check. This hack changes it so terrain bonuses are applied to the base stat, which doesn’t change anything practically but allows the true value to be more directly conveyed to the player.
Finally, everyone will see Thrones’ hidden resistance bonus for how bullshit it truly is (under normal circumstances, the Def/Res bonus wouldn’t show up in the MMB either).
This hack was directly inspired by Catball doing the same thing, but their version is incompatible with SkillSys. In contrast, my version is exclusive to SkillSys, so please seek them out if you’re not using SkillSys and would like this quality of life.
Installation instructions:
-
#include "Installer.event"
anywhere in your buildfile. - Add
POIN TerrainDefenseBoost
toEngineHacks/Necessary/StatGetters/Defense.event
- Add
POIN TerrainResistanceBoost
toEngineHacks/Necessary/StatGetters/Resistance.event
The stat getter does all the heavy lifting on its own, all we’re really doing is moving the terrain bonus there from the battle stat calculation. As such, the only place this hack can potentially conflict with others is if they hook ComputeBattleUnitDefense
. Aside from that, this hack should not conflict with anything.
Download link: https://github.com/GigaExcalibur/asm/tree/main/StatScreenTerrainBonus
As usual, let me know if there are any bugs or things that can be improved! Thank you Catball for letting me steal your idea, and everyone please have a good day!
-Dragz