[FE8] Unit Loading Issue


#1

(I posted on Serenes as well, but I figure there’s more activity for hacking questions here)
I’ve run into this issue whilst hacking FE8 on chapter 2, although I’m not sure if the chapter itself is the problem.

So, when I load my units, everything is fine at first, as seen in this image: https://imgur.com/mWs7e2O
But whenever I restart this chapter, (by using the in-game menu option) for some reason the cleric and the knight change classes to a knight and a paladin respectively: https://imgur.com/sw0q9w5

This doesn’t occur when hard-resetting the emulator or resuming the chapter. (although the changes will be there if resuming after restarting the chapter)
If it does mean anything, the two units in question here are being loaded using the LOAD2 command, as they had appeared in the previous chapter, where they were loaded using LOAD1 and below is the unit pointer bracket which they are being loaded in, along with the other two allied units, who appear to be fine.
And when they change into the class, they retain all of their current stats and weapon ranks and inventory, so they don’t appear to be loading as completely different units.
I’ve attached the event script below, including the code where I load them in. For reference, the two units experiencing this issue are Gilliam (Sword Knight) and Franz (Cleric).

Units:
UNIT Eirika EirikaLord 0x0 Level(1,Ally,False) [1,14] 0x00 0x00 0x00 0x00 [Lightning, Vulnerary] NoAI
UNIT Ephraim EphraimLord Eirika Level(2,Ally,False) [2,14] 0x00 0x00 0x00 0x00 [LightAxe, HandAxe] NoAI
UNIT Gilliam ArmourSword Eirika Level(4,Ally,False) [2,13] 0x00 0x00 0x00 0x00 [IronSword, Vulnerary] NoAI
UNIT Franz Attendant Eirika Level(1,Ally,False) [1,13] 0x00 0x00 0x00 0x00 [LightStaff, Heal] NoAI
UNIT

Enemies:
UNIT Bone Mercenary 0x00 Level(5,Enemy,False) [12,1] 0x00 0x00 0x00 0x00 [IronBlade] AttackInRangeAI
UNIT 0x34 Soldier Bone Level(3,Enemy,True) [4,7] 0x00 0x00 0x00 0x00 [IronLance] AttackInRangeAI
UNIT 0x35 Mercenary Bone Level(3,Enemy,True) [4,8] 0x00 0x00 0x00 0x00 [IronSword] AttackInRangeAI
UNIT 0x36 Fighter Bone Level(3,Enemy,True) [4,9] 0x00 0x00 0x00 0x00 [IronAxe] AttackInRangeAI
UNIT 0x37 Archer Bone Level(3,Enemy,True) [4,10] 0x00 0x00 0x00 0x00 [IronBow] AttackInRangeAI
UNIT

TurnBasedEvents:
END_MAIN

CharacterBasedEvents:
END_MAIN

LocationBasedEvents:
END_MAIN

MiscBasedEvents:
CauseGameOverIfLordDies
DefeatBoss(EndingScene)
END_MAIN

Dunno:
//DO NOT TOUCH
WORD $00

Tutorial:
//DO NOT TOUCH
WORD $00

TrapData:
END_MAIN

ALIGN 4

BeginningScene:
RELOAD(Units) //RELOAD = “_LOAD2 0x1 UnitPointer”
ENUN
LOAD(Enemies)
LOAD(NPCS)
ENUN
ENDA

EndingScene:
STAL 50
MNC2 Ch3
ENDA

// Events

// Manual Movement

// Scripted Fights

// Units

// Shop Data

//Map Starts at B2C880
MESSAGE Events end at offset currentOffset

Let me know if there’s any other information I can provide.


#2

What does the class data look like in nightmare or FEBuilder? I suspect an ID issue, but I could be wrong.


#3

Well, they’re new classes in Nightmare, after having extended and repointed the array that the Class Editor looks at.
They’re number in the lists are 0x87 and 0x89, and their class numbers are set to the same thing. Everything in hex looks to be correct as well.
The class numbers that I’m using in the events are also set to these.
https://imgur.com/ttaoicg (Image of one of the classes in Nightmare)
If it means anything, in Nightmare there are the UNKNOWN pointers in the class editor just beneath where you can set the ‘Default Portrait’. The top one for both is set to 0x00, and the second is set to values that I copied over from similar classes, in this case the standard Armour Knight class at 0x09 and the Sister class, which uses 0x16.


#4

Oh, yeah so I figured this out by the way.
It’s the well known issue that occurs when you don’t apply a patch to allow expansion of the class array.
I wrongly assumed that this was part of the FE8 Essential Fixes patch, so the lesson I guess is to learn to read?