Modular mounted aid calc?

Is there a way to make the Mounted aid calcs more modular?

Currently, there is only the option to change the base amount (19+1), and the bonus if unit is not female (5).

I think it would be great if there was a way to have it be more modular, and set different numbers for the aid calc per-class.

Because one thing I wanna do is have armors have infantry aid-5, and have all tier 1 mounts have cav aid without bonus, and then get 5 extra aid upon promotion, independant of gender.

I’m assuming you’re talking about skillsys AidGetter? It is modular. You can reference HelperDefinitions for functions to use. For example your new mounted aid would look like this:

prAdjustAidIfMounted:
{
	rIfUnitHasAttribute(CA_MOUNTEDAID)
		rCallSequence(_prNegate _prAddBaseMountedAidBonus _prAddMoreIfPromoted)

_prNegate:
	rMinus(rCurrent)

_prAddBaseMountedAidBonus:
	rAddConst(19)

_prAddMoreIfPromoted:
	rIfUnitHasAttribute(CA_PROMOTED, rAddConst(5))
}

For armors you’ll have to run a check for class id (for each armored class you have), then do the subtraction.

2 Likes

You’re also in luck that a tutorial on modifying mounted aid exists. It was also part of your homework on learning asm.

Oh, thank you! I’ll look into this to see how it works.

Could the armor one be based off of the effectiveness table? If so, how could I do that?

I’ll not mark it as solved yet, until I manage to implement this. I will reach you again if I have any issues. Thanks so much!

Uh maybe? I feel like copypasting the same row with different ID’s is easier takes way less effort though.

But if I attach it to the effectiveness table, then I can edit the table in FEBuilder and the aid penalty will still apply to the new classes without me having to rebuild the ROM. Correct?

You can make it read from a table (say class IDs) and edit the table in febuilder by using the original address the table was at each time you reinsert the ea for the table.

1st time:

ALIGN 4 
MyTable:
...

Febuilder’s .sym says MyTable is at 0x1234564

Later edits:

ORG 0x1234564
MyTable:
...

You can do this with whatever data, but tables are typically fixed lengths. If you’re expanding something, you can’t do this unless you added padding of free space (eg. WORD 0 a bunch of times). Otherwise you need to then repoint data.