Pawkkie Pokes at ASM

Tags: #<Tag:0x00007f0e234082c8> #<Tag:0x00007f0e23408200> #<Tag:0x00007f0e23408138>

I’m really new to the ASM scene here, but I’ve got two different things working now and I told myself that as soon as I had more than one I’d make one of these ASM collection threads in case anything is useful to anyone else. Let me know if you run into problems with anything here, I’ll see what I can do.

Can’t thank the folks in #hacking-help and #spell-academy enough for their generous tolerance of all my questions and willingness to help me learn rather than just telling me stuff, you’re all fabulous and the community is lucky to have you.

Working on getting more comfortable with GitHub, so that’s where all my files will be hosted. Here’s a generic link to what I’ll use as my ASM page, but specific links to each hack are found in their sections.

Stat Screen Range to Attack Speed - MSS version

Done

This is the first hack I wanted to make after going through Teq’s tutorial, thinking it would be a relatively simple place to start and get my bearings; turns out I was wrong, the range display was complicated as heck at least to a new person, but we got there in the end.

If you’re not using ModularStatScreen, check out @knabepicer’s version here; it accomplishes the exact same thing, but as you might expect his version doesn’t work with MSS. Mine does work with MSS, but doesn’t work without it. Go with the version that suits your needs. :slight_smile:

Download
StatScreenRng2AS Github

Installation
Download the two linked files from GitHub. Include StatScreenRng2AS.event into your buildfile, and include as_instead_of_rng.s into your mss_defs.s just beneath all the .equ lines.

How To Use

Basic Use

Once you’ve finished installation, all you need to do is add the line as_instead_of_rng into the MSS page you’re drawing the stats box to. Assuming you’re using the standard page 2, your file will look like:

.thumb
@draws the items screen
.include "mss_defs.s"

.global MSS_page2
.type MSS_page2, %function


MSS_page2:

page_start

draw_stats_box

draw_items_text

as_instead_of_rng

page_end

And that’s it, you’re good to go. Reassemble this using your AssembleLynEvent.bat and it should work just fine out of the box.

How It Works

Right so this hack works in a super hacky way that’s a bit scuffed but y’know what it’s functional so I’m happy with it. This section will go in more detail about how you can customize the hack, and hopefully make it clearer to understand exactly what it’s doing.

We’ll start with the obvious question first: “MSS has a function to draw a text ID, and it also has a function to get attack speed, and it ALSO has a function to draw a number. Given these three things, why is this hack even necessary when I can just use those?”

The answer is this, in a big image so it’s easy to see:

ASwMSS

What a crappy looking vertical bar next to the AS. It almost looks like it’s the left hand side of a capital R… suspicious. This shows because MSS draws things at specific tile locations, and the tile location that you’d want to draw the AS text at happens to be slightly to the right of where the stat screen is already drawing the Rng text independently of MSS. Rng text behaves super weirdly compared to other texts even in this stat box as we’ll see, but this is basically what this hack exists to both solve and simplify.

Great, so we know we don’t want to write the Rng text using MSS. Can we just change the Rng text as a text change? This was the first thing I thought of honestly, forgetting that the text “Rng” also has to show up in the Rtext of weapons in the equipment screen, so we can’t replace it entirely.

This is what StatScreenRng2AS.event does, but it also does a little bit more. This hack accesses the specific addresses that are called by just the stats screen, so changing the text being referenced won’t mess up your Rtext. It turns out that all these texts are grouped together, so when I found Rng I found the whole stats box. Let’s change them all to Sword (it’s the ID right next to AS and I’m lazy) and see what happens.

Sword

Well now we can change what every occurence of text on the stat screen says, but are still limited by how many tiles we’re allocated for each text item; if it has too much text, it spills over into the next one. This kind of sucks, and may pose a problem to anyone who tries to change any of the other texts; fortunately that person isn’t me, but I’ve left all the locations for these textIDs set to their defaults in the hack file I’ve provided so you’re welcome to experiment if you wish.

Happily, as it always is, Rng text is weird and doesn’t have the same limitation because of how it’s being drawn. You can fit nice thick words in its place without issue, so go wild if you have any other ideas, I just happened to want AS.

“Well if this fixes the text, then why is there also a new macro to include in our mss_defs.s file?” To be clear, this macro isn’t necessary, it just saves typing and is simpler for people who are using MSS but are also a bit scared of it. The macro looks like this:

.macro as_instead_of_rng
  draw_textID_at 23, 13, 0x0001 @" "
  draw_textID_at 24, 13, 0x0001 @" "
  draw_textID_at 25, 13, 0x0001 @" "
  draw_textID_at 26, 13, 0x0001 @" "
  get_attack_speed
  draw_number_at 27, 13
.endm

“Okay so I see get_attack speed and draw_number_at, which were mentioned earlier and make total sense now that you’ve fixed the text somewhere else. Why the heck are you drawing a bunch of spaces?!”

BigRange

Because RANGE TEXT IS WEIRD. It isn’t just drawing a number, it’s constructing a string based on an upper and lower bound (check out Teq’s range fix stuff in skill system if you want to go through the details it’s super cool). These spaces are assuming you somehow have an item with the fattest possible range values, and “covering them up” with spaces, which show up as blank. Then it draws the attack speed number on the new blank space.

I told you this was a bit scuffed lol

Credits

Learning ASM / Q&A

  • Huichelaar
  • Snakey1
  • epicer
  • Vesly
  • Sme
  • Pikmin1211
  • hypergammaspaces
  • everyone else in #hacking-help and #spell-academy who puts up with me, I’m sure I’ve missed at least one

Resources

  • Teq Doc and Tutorial: Tequila
  • Modular Stat Screen: Circles & Tequila
Stat Screen Skill Names - MSS

FE8_hack_02

A macro that does this already exists in MSS in theory, draw_skillname_at. As is this macro doesn’t actually work at all, so I set out to make something that’d do what I wanted that macro to do.

A point of clairty: the default macro is draw_skillname_at and my macro is draw_skill_name_at. I found this less confusing, but you’re welcome to just replace the existing macro if you want, or rename this to something clearer for you if you wish, it won’t break anything.

Download
StatScreenSkillName Github

Installation
Download the linked file from GitHub. Include draw_skill_name_at.s into your mss_defs.s just beneath all the .equ lines. Check mss_example.s for sample implementation.

How To Use

Basic Use

Open up the ModularStatScreen file for whichever page you’re drawing your skills on, and open up the mss_example.s file I’ve provided. If you’re already drawing skill icons, the first half of this file should look remarkably similar, with all the new stuff occuring between SkillEnd: and page_end.

Copy these lines and paste them into the same spot, between SkillEnd: and page_end, in your mss file. It can probably be elsewhere, but I haven’t tested that extensively because I haven’t found a good reason to; it works quite happily where it is.

The three parameters you’ll see next to the macro calls are the text’s x and y position, and the colour you’d like the text to be; you can check out the colour options in your mss_defs.s file if you’re feeling experimental. Change the x and y positions to be wherever you want, and reassemble the page file using your AssembleLynEvent.bat. You’re good to go!

How It Works

Basically what all this is doing is iterating through the skills the selected unit has, grabbing the skillID of each one, and drawing each of the corresponding names based on that ID by calling the new macro.

The macro works by indexing the skill description table using the skillID to find the appropriate RText description, for which every skill shares a format - Skillname: Skill description. The macro takes this description and sends it to a function that loops through the description until it hits a colon, and builds a new string using what it finds; because of the way skill RText works, this will always return the name of the skill.

The biggest quirk with this functionally is this annoying thing right in the middle of mss_example.s

SkillNameHalfway:
cmp r0, #0
beq SkillNameEnd

This is here because I’m checking whether or not a unit actually has a skill in each slot using beq, which doesn’t have a large enough range to hop over all 6 macros; it can only hop over three of them. So the first three macro calls skip to the halfway point if they have no skill, which itself checks if they have a skill, and jumps to the end if not. This is like a jumping pad for the comparison check.

I spent HOURS trying to write up the macro in a bunch of different ways to get it to mirror the setup of the skill icons for ease of use, and this is ultimately what I felt was the best hybrid of easy installation (including one new file) and mirrored setup (identical to the icons, except for that midway jump). Anyone’s welcome to do this better, but because it works the way I wanted it to I’m unlikely to keep iterating on this for neatness’ sake on my own. :slight_smile:

Credits
Learning ASM / Q&A

  • Vesly
  • Sme
  • Pikmin1211
  • Leonarth
  • epicer
  • everyone else in #hacking-help and #spell-academy who puts up with me, I’m sure I’ve missed at least one

Resources

  • Modular Stat Screen: Circles & Tequila
Separate Player and Enemy Class Growths (now supporting negative player class growths!)

Before (Vanessa has 0 personal growths, Nomad has 100 class growths):
Vanessa100Nomad100

After (Vanessa has 0 personal growths, player Nomad has 100 class growths, enemy Nomad has standard class growths):
Vanessa1002NomadNormal

I like concept of creatively using class growths. As a big fan of split promotions, I find class growths make for a more unique set of interesting decisions. However, the character + class growths included with SkillSystem (which is great) has what I feel is one problem with it: player and enemy classes use the same set of growths. This means that if you’re using very swingy growths to make interesting class decisions, the enemy autolevelling will scale up using those same growths, messing up your balance.

This hack separates out a table to define player class growths separately from enemy class growths, so you can have your cake and eat it too.

UPDATE: This now also supports negative player class growths as well, with the caveat that these cannot push a character’s growths below 0.

Download
PlayerClassGrowths Github
PlayerClassGrowthsWithNegative Github

Installation
Download the linked file from GitHub. If you’re using StrMagSplit, navigate to SkillSys\ExternalHacks\StrMagSplit\GrowthGetters and replace the files there with the ones I’ve provided. If you’re not, navigate to SkillSys\Necessary\GrowthGetters and replace these files instead, except for the one involving magic. Note that the non-strmag version isn’t as thoroughly tested, so let me know if you run into problems.

Move the .csv and .nmm files wherever you’re storing the rest of your tables for use with c2ea. I keep mine in the “Class & Character editors” folder, feel like it’s the best fit. Make sure the next time you run your MAKEHACK, you do the full version to rebuilt the .event files for your tables.

How To Use

Basic Use

You’ll now be able to customize the growths for player classes in Player Class Growths.csv. These are all populated with the standard values by default, so nothing will change initially unless you make an alteration.

The table itself is pretty self explanatory, just set the values for each to whatever you like.

UPDATE: The first 8 columns of the table are the same as before, but now there are an addition 8 columns filled with 0s titled “[Stat] Neg”. If you want to make the value in a growth negative, say Strength, all you need to do is go to the Str Neg column and change the 0 to a 1. That’s it! Anytime you want a growth value to be considered negative, just change the appropriate 0 to a 1.

How It Works

Pretty short explanation here. This hack just adds a few lines that pull the class value from my table rather than the standard class table in the Growth Getters if the appropriate Config.event option is checked. Nothing too saucy, the ASM files have my new section commented thoroughly enough you should be able to figure it out if you want to replicate something similar. Feel free to ask questions if you want more clarification :slight_smile:

Credits
Learning ASM / Q&A

  • Vesly
  • Pikmin1211
  • everyone else in #hacking-help and #spell-academy who puts up with me

Resources

  • DSFE Growths (referenced): Venno
Separate Unit and Class Bases

This isn’t a gameplay hack, but a hack to make my (any perhaps your) life easier while doing unit and enemy balancing. After I put my first few units on a map with some enemies, I decided to give a certain class an extra point of speed to avoid being doubled, and when I rebuild the hack a player unit of the same class also had that extra point. I was immediately flooded with terrifying thoughts of regularly having to go back and forth between character and class tables to tweak values as I was balancing, and decided to fix the problem before it became a problem.

This hack adds an extra table that is used to flag whether or not a character adds class bases to its own character bases or not, with the intend of turning it off for the main cast so you can tune the enemies and character independently without needing to change the numbers of both of them. The default setup has all of the Sacred Stones characters and bosses set to “character bases only”, but this is all easily toggleable.

The stats this affects are HP / Str / Mag / Skl / Spd / Def / Res.

IMPORTANT NOTE: This hack currently works only with SkillSystem’s Str/Mag split, as I’m using that for my project and it overwrites some of the default base stat behaviour. I’ll likely make a version of this that works for vanilla instead at some point. If you DON’T use the Str/Mag split and you DO want to use this hack, let me know and I’ll bump it up in priority on my to do list.

Download
SeparateUnitBases Github

Installation
Download the linked file from GitHub. Move WriteBasestoRAM.s, WriteBasestoRAM.dmp, and AutolevelSave.event to the ExternalHacks\StrMagSplit\StrMagSplit\AutolevellingSaves folder in your SkillSys hack and replace the existing ones with the new ones.

Put HPStrSklSpdBase.asm, HPStrSklSpdBase.dmp, SeparateUnitBasesInstaller.event, and SeparateUnitBasesTable.event together in the same folder, and #include SeparateUnitBasesInstaller.event into your buildfile.

UPDATE: .csv file and .nmm are no longer necessary, but are still included in this section of the Github because any aspiring asm hackers may find it useful to directly compare an event table implementation with a csv table implementation. Instead of changing a column there to indicate which units you’d like to split bases for, you’ll use a macro in SeparateUnitBasesTable.event. Thanks to @Vesly for convincing me this was the better option.

How To Use

Basic Use

Once the hack has been installed, the only thing that needs to be changed to use it is found in SeparateUnitBasesTable.event. Using the indicated macro, you can set specific character IDs to True (use this hack) or False (use vanilla behaviour); by default, the first 64 slots are set to use this hack. Check out Notepad++'s column editing feature, it’s lovely.

How It Works

Also a very short explanation here. This hack just hooks where the bases are set for each unit, and adds a section to reference the new .csv table to decide whether or not to skip the line that would add a class base to a character base. Note that this may cause conflicts with any other hacks you’re using that change how bases get calculated, as was the case with the Str/Mag split.

Credits
Learning ASM / Q&A

  • Vesly
  • Sme
  • everyone else in #hacking-help and #spell-academy who puts up with me

I’ll update this first post with new stuff using this same format every time I have something new to keep it all organized, though I’ll make a new post for each as a means of announcement.

14 Likes

Had a pretty productive weekend between this and the MSS guide, but have something new to share that isn’t related to the stat screen for a change.

This hack separates player class growths from enemy class growths when you’re in “growths = character + class growths” mode with SkillSystem. I really like custom class growths but wanted to be able to make dramatic changes to what my units have access to without worrying about affecting enemy balance, and this is my solution.

Vanessa here has 0 personal growths and 100 player class growths, while the enemy Nomad is using the unmodified enemy growths.
Vanessa1002NomadNormal

Links and details in the main post :slight_smile:

2 Likes

Spent some time getting some extra business working with these player class growths to allow for negative player class growths as well. Might be useful if you want, say, promoting to General to give a massive amount of defense growth, at the cost of some speed growth.

Note that if a negative class growth would push a character’s growth into the negatives, instead it’s locked to a minimum growth of 0.

This stuff is hard to take interesting pictures for, but here’s Vanessa with 100 personal growths and -10 class growths.

NegativeClassGrowths

Links and details once again in the main post, check for anything flagged UPDATE: in the Separate Player and Enemy Class Growths section.

4 Likes

Somehow made a hack that’s even HARDER to take an interesting picture for than the growth split, and that is Separate Unit and Class Bases.

This is not a gameplay hack, but is instead a “making a hacker’s life simpler” hack. It allows a hacker to decide on a character-by-character basis whether that character’s bases should be added to their class bases, or whether they shouldn’t, with a simple .csv file (Edit: Vesly convinced me that using an event table and a macro was cleaner. He was right. That’s what this uses now instead of a .csv)

The application here, or at least my motivation for writing this, is that I was iteratively tuning enemy class bases for balance purposes and super quickly got annoyed at the prospect of having to constantly update my character bases every time I changed their respective class’s tuning.

Hopefully someone finds this helpful! Details and download in the main post :slight_smile:

1 Like