Change a Units Affinity Based on Tactician Affinity?

I understand how to change the name of a unit to match the tactician and even how to change the gender of a unit based upon the choice of Tactician’s gender but what I want to know is how I can go about doing this?

If the Tactician’s affinity is Wind. I want Eliwood’s Affinity to change to Wind, based on this decision. If the Tactician’s affinity is dark I want Eliwood’s Affinity to change to dark.

Is there anyone willing to lend a hand in this? It’s complicated but I imagine it’s doable.

You’d need to have multiple unit slots based on the tactician affinity and have a routine that checks for their affinity and loads a unit based on that result. It’s certainly doable.

I think affinity is otherwise not stored in the RAM IIRC.

2 Likes

Mmm. No way to avoid using multiple unit slots since it would essentially mean using twelve slots total. Male and Female.

Actually, it gives me an idea.

Can anyone help me write this?

EDIT: Never mind I managed it. Hue.

you could write code

No way…!

I did. Script looks something like this.

[quote]IFAF 0x05 0xD45001 //Fire Affinity
IFAF 0x03 0xD42901 //Decides Gender
LOU1 Male1 //Loads Male
ELSE 0x04
ENIF 0x03
LOU1 Female1 //Loads Female
ENIF 0x05
//
IFAF 0x06 0xD45041 //Thunder Affinity
IFAF 0x07 0xD42901 //Decides Gender
LOU1 Male2 //Loads Male
ELSE 0x08
ENIF 0x07
LOU1 Female2 //Loads Female
ENIF 0x06
//
IFAF 0x09 0xD45081 //Wind Affinity
IFAF 0x0A 0xD42901 //Decides Gender
LOU1 Male3 //Loads Male
ELSE 0x0B
ENIF 0x0A
LOU1 Female3 //Loads Female
ENIF 0x09
//
IFAF 0x0C 0xD450C1 //Ice Affinity
IFAF 0x0D 0xD42901 //Decides Gender
LOU1 Male4 //Loads Male
ELSE 0x0E
ENIF 0x0D
LOU1 Female4 //Loads Female
ENIF 0x0C
//
IFAF 0x0F 0xD45101 //Dark Affinity
IFAF 0x10 0xD42901 //Decides Gender
LOU1 Male5 //Loads Male
ELSE 0x11
ENIF 0x10
LOU1 Female5 //Loads Female
ENIF 0x0F
//
IFAF 0x12 0xD45141 //Light Affinity
IFAF 0x13 0xD42901 //Decides Gender
LOU1 Male6 //Loads Male
ELSE 0x14
ENIF 0x13
LOU1 Female6 //Loads Female
ENIF 0x12
//
IFAF 0x15 0xD45181 //Anima Affinity
IFAF 0x16 0xD42901 //Decides Gender
LOU1 Male7 //Loads Male
ELSE 0x17
ENIF 0x16
LOU1 Female7 //Loads Female
ENIF 0x15
//[/quote]

I did this in my modular battle demo hack. I had sever consecutive characters corresponding to the affinities, then these codes: https://www.dropbox.com/sh/gf92wmr16ddp3c7/AAB74Ol71358aGsKoktUduH8a?dl=0

Hella inefficient tho… Every character slot matters. It works fine for tech demos and short hacks, I guess, but not for a full-scale ROM hack.

Which is why you need code although easier said than done etc