Sme’s ASM and Miscellany

See, this is how Yanik should’ve opened the door. Too bad we didn’t have the tech back then lol

1 Like

I actually remember this annoying me back in 2005. The community always comes through, it just might take a couple of decades! :laughing:

1 Like

[ASM] Split Promo Preview (FE8)

This is an addon for Split Promo Items that displays information about the class you are promoting to when hovering over the item in the menu. Made it a few months ago for a project that’s now pretty dead, so here’s a standalone release.

Displays class name, usable weapon types, class skill if applicable, and movement type if applicable.

Download

To install, just #include PromoPreview.event and define the following text entries:

## PromotesToText
Promote to:[X]

## NoUseText
Cannot Use[X]

This shouldn’t conflict with anything else, but it won’t work without the Split Promo Items lists defined. With very minor modifications this could be made to work with character-based promos instead, but this is left as an exercise for the interested user.

17 Likes

A quick update to Split Promo Items, before it would have undefined behavior if you did not have a class defined for a promo item, now it will use vanilla default promoted class instead, same download link as before

2 Likes

A quick obscure bugfix hack

[ASM] Fix CLEN Rescuing (FE8)

There’s an obscure bug with the CLEN event opcode brought to my attention by this skill system bug report: namely, if a player unit is rescuing a green unit and CLEN is used to clear all green units, it won’t remove the reference to the green unit from the player unit and viewing their stat screen will subsequently crash the game trying to load the name of their rescuee.

This is a very minor hack that adds an extra check when clearing unit structs that will remove the reference to the cleared unit from their rescue partner.

Download

To install, just #include NewClearUnit.event.

This hack completely replaces the function ClearUnit 080177F4, so anything else that affects this function directly will conflict.

13 Likes

Got 3 things today, in service of enabling hacks to internally handle gameplay modifiers, rather than needing a separate version of it with the relevant change(s) or the user having to do the work themselves:


[ASM] RN By Flag (FE8)

Based on this hack by Pikmin1211 and rewritten from the ground up, this allows you to enable/disable various hit RNG modes by setting flags. Included modes are as follows:

  • Display Hit - Hitrate is as displayed. Also known as 1RN.
  • Fates Hit - Lower hitrates are as displayed, but higher hit rates land more often. The actual Fates hitrate formula when hit >= 50 is complex enough to potentially cause performance issues, so this is using the (3A+B)/4 approximation instead.
  • False Hit - Higher hitrates land less often, while lower hitrates land more often. Also known as EvilRN.
  • Perfect Hit - Hits always land if hitrate is >0.
  • Nice Hit - True Hit, but hit rates of 69 always land. previously had a standalone release from someone else but now i can’t find it
  • Coin Toss - Every hit has a 50% chance to hit and 50% chance to miss.

Download

In the installer, you’ll find 6 definitions for the IDs of the flags for each hit RNG mode. There’s a hierarchy to what will work if multiple are enabled, where entries higher on this list overwrite entries lower:

  • 1RN
  • FatesRN
  • EvilRN
  • NiceRN
  • PerfectHit
  • CoinToss
  • 2RN

I’d generally not recommend enabling multiple at the same time.

This hack entirely replaces the function 08000CB8 Roll2RN, so isn’t compatible with anything that also touches this function.


[ASM] More Growths Options (FE8)

This allows setting 2 growths modes via flags: 100% growths and 0% growths. In 100% growths mode, every growth rate is rounded up to the nearest multiple of 100. In 0% growths mode, every growth rate is set to 0.

Download

This gets appended to the skill system’s GrowthGetters growth bonus calc loop by adding GrowthModifierModes to the POIN for the loop’s contents. Modes are enabled via flags configurable from the installer.


That’s all fine and well, but setting up a method by which to allow the player to select which of these flags are enabled at the beginning of a playthrough is pretty time-consuming, which is why this also exists:


[ASM] Starting Options Menu (FE8)

Architecture heavily borrowed from the menu in Circles’ self-randomizing rom, and fair warning that this is a bit haphazard and not too configurable. This adds a menu just after difficulty selection where you can configure 3 settings that a hack may want to offer on starting a new playthrough: Casual Mode, Growths Mode, and Hit RNG Mode:

VBA-rr-svn480+LRC4_U0xQn89vjR

Download

Casual Mode uses Circles’ version where it’s a flag, like every other setting here. Growths Mode uses the skill system’s inbuilt fixed growths system as well as the 100% and 0% growths modes from the previous hack. Hit RNG Mode uses all of the RN By Flag settings. Displayed on the screen is a brief description of the currently-selected menu option.

In order to carry the information selected here over into a new save file, it needs to be placed somewhere in memory such that it gets written to the initial save file but doesn’t get overwritten by 0s when initializing that save file. As such, we slightly alter the function responsible for clearing out global flag memory so it doesn’t clear the last 4 bytes of it. This then gets saved to a new file, and no save file layout-related shenanigans are necessary. A consequence of this is that the last 32 global flags are unusable, but only until the data is initialized. The data stored in this area is meant to be used by another function called in the opening event of the first chapter, SetOptionFlagsASMC. Calling this with an ASMC, as the name alludes to, sets the flag for each selected setting, and consequently, the last 32 global flags become free to use again.

The only changes this entails are changing the pointer for one function called by the difficulty select proc and the aforementioned change to global flag clearing behavior. As such, it doesn’t conflict with anything that doesn’t touch one of these two things. However, it does have a number of dependencies to work correctly. Circles’ casual mode hack for the casual mode option as a flag, the skill system’s growth getters for the fixed growths option, and the above 2 hacks for the other growths options and all the hit RNG options are all necessary for this to work as intended. The only reference to these other hacks is via definitions of flag IDs referenced by this one, so by setting these references to 0 you can effectively remove the option’s functionality. However, the menu is structured in such a way that removing options from it will require editing the C source file and recompiling. The build script I used is included with the download to make this somewhat easier. Additionally, there is a non-negotiable requirement for the spin proc from FE7; a copy of this is included with the download. I understand if this menu is a bit too specific in function to be generally useful, which is why the relevant modifiers as flag-based toggles are standalone releases.

25 Likes

o/

[ASM] New Promo Screen (FE8)

This hack replaces the class description display on the split promo screen with a display for stat bonuses upon promotion, as well as using icons to show usable weapon types, class type, and class skill.

Weapon type icons are drawn dynamically and spaced so that all 8 can fit without overlapping anything, as shown with Great Knight in this example.

Download

To install, #include "NewPromoScreen.event". The only hard requirement for this to work with how it’s written is Icon Rework for the separate icon sheets for weapon types & class types, but if you really wanted to you could slightly alter it to remove this dependency and it should work entirely standalone.
Soft requirements are the skill system for skill icons and str/mag split for separate str and mag promo bonus display, but for both of these, there are settings to remove them. Str/Mag split compat is automatically controlled by the USE_STRMAG_SPLIT definition: when installed str and mag will be split promo bonuses, when not installed, if the unit has any magic ranks their pow bonus will be under Mag and otherwise under Str. If you manually define NO_SKILL_SYSTEM, the installer will define labels for the mag class table & class skill table pointing to a blank table, so that the references to these labels won’t error from them not existing but the information at them won’t result in anything being drawn from them.
This hack works by replacing the OnHover function for each menu option on the split promotion menu, and shouldn’t conflict with any other hacks that I’m aware of. Note that this will not work correctly for trainee autopromotions, for a series of contrived reasons relating to the spaghetti of that entire system. It will, however, work for normal prep screen item use promotions, and 3-branch promotions not initiated as a trainee auto-promotion.

28 Likes

Holy shit. The madwoman actually did it. This looks great!

2 Likes

Does this work w/ enemy AI? As in, will AI set to “break walls and snags” know that they can now break doors, too?

1 Like

Not by default, but it should be easy to allow it to be. At $5A814C is a null-terminated list of terrain IDs used by that AI to determine where it should look for breakable terrain traps. By default, it contains 0x1B 0x33 0x00, you can repoint it and add more to the list, but if you only need to add the 1 terrain ID you can just PUSH; ORG $5A814E; BYTE 0x1E; POP since there’s a byte of padding after the list that’s also 0x00

2 Likes

Very cool – thanks for confirming. Looking forward to trying this out.

1 Like

Hi. I’ve been trying to install More Shops and Shop Unit, but I can’t get it to work.
I don’t get any error messages, but when testing with the shop unit, no shop appears.

[ASM] Advance Wars Fog (FE8)

This hack adds 2 fog of war mechanics from Advance Wars: terrain that boosts your vision range, and terrain that’s obscured unless you’re adjacent to it.

VBA-rr-svn480+LRC4_pR6heohEnI

Download

To install, just #include AW_Fog.event. Within that file are 2 lists of terrain IDs that function as high terrain and obscured terrain respectively, use these to define what terrain operates as each. This hack overwrites the function GetUnitFogViewRange, which means it’s incompatible with anything else that touches that function, notably including changes to the thief vision range bonus. Incidentally, it also nerfs thief vision range bonus to +2 from +5, but it stacks with high ground for a total of +7.

23 Likes

I have the high ground, it’s over, O’Neill.

idk if that quote was coreect I didn’t watch that movie.

I’ve been trying to install fatigue for awhile now according to the instructions, but I have no idea what’s causing this. It says errors have occurred but it has written nothing. Am I doing something wrong?

Include it earlier in your installers.

1 Like

To clarify, include it in the master installer?

You have to install it before the error as to where the null identifier is thrown. The first thrown error is line 12 of PostBattleCalcLoop.event, so you just have to include the fatigue event file before that file is referenced. I’d have to check your buildfile to know for sure where this is, so just look for a file with #include PostBattleCalcLoop.event I guess.

how do i add this to febuilder? i managed to load the event files but i have no clue on how to set the effects in the item editor

Installing the event file gives you functions named AumUsability and AumEffect somewhere in your ROM. Take the location of each and set them as the desired item’s usability and effect pointers (Advanced Editors -> Item "Use" Effect -> 0=Determine whether items can be used, 1=Define the effect of using items); staves are just spicy items so they use the same system as items