Class Number Jankyness

So for the Camp Class, I used index 0x65 after i repointed the class table and expanded the class list. Everything was going fine, until I changed the ‘Class Number’ in Nightmare. The game will black screen if i R menu the Camp, with the class number of 0x65. But I if I use an existing class number, like 0x43 (Transporter) it loads fine and its good. So a couple questions:

  1. What exactly does the ‘class number’ do?

  2. Is it safe to use existing class numbers for new classes?

  3. Why is the current class number acting all fucky?

Just don’t edit that. Do you really need to change that?
I guess it decides the moving map sprite of the class.

The class number is referenced whenever the game needs to know, at a glance, what class the unit is. The biggest time this would be is when drawing map sprites, but also when writing to/loading from save, and probably a bunch more i’m not thinking of right now.

I wouldn’t recommend reusing old ones because that fucks with resume, but I can’t remember offhand how to fix it.

i think i understand now. Since the Camp doesn’t use a new map sprite, using the Transporter (tent) pointer in Class Number should be fine, right?

And using 0x65 crashes the game because there isn’t any data for that pointer, since I’m just using an existing pointer for an existing map sprite?

I’ll be entirely honest and say I’m not sure. I can’t offhand think of a reason it would crash the game, your guess is about as good as mine.

if you use the tent pointer, however, a suspend-resume will make your new class transform into a tent anyway

ugh, dammit. yeah it does turn it into a transporter fuuuuuuuck.

I’ll see what happens if i put map sprite data with the 0x65 pointer.

okay so going in the map sprite pointer table editor and going to 0x65, then copy and pasting the graphics and animation pointers from the transporter tent to that one, also doesn’t work.

so im gonna try just reinserting the tent map sprite in free space. Next question though,
The graphics pointer points to the sheet in gbage/ the game. But what is the Animation Pointer? And what do i change it to if i’m creating a new entry, instead of replacing an existing one?

ffs. Okay, so I thought maybe if I edited the entry at 0x61 (Empty, Make a custom Class!) then maybe it would work then , because i was thinking maybe my problem came from trying to load class information that preceded nothing.
But when I used (Empty, make a custom class!) the ‘active’ map sprite animation didn’t actually show up and it was just no map sprite in the R menu.
Then after suspending/resuming. The whole unit entirely didn’t appear at all.

I seriously can’t be the only one who’s had something like this happen to them, has anyone whos ever expanded the class table ever had this problem?

the “empty, make your own class!” entries in the class editor are actually the map sprites used when you rescue/release mounted units; i’m not sure why the nightmare modules ahven’t been updated to match

there’s no actual map sprite (nor do they stick after suspend/resume) because they really don’t exist as classes

oooooooh… I see. Well now that that’s clear. The class number problem now exists again. This is really frustrating. Can someone who has expanded and used class indexes after the ones from Nightmare help me out please??

I wrote this for someone for FE8(it’s just a copy paste), so just keep in mind the offsets and class table size are for FE8, but the concept is still the same. This is designed for using the full 255 classes. Just remember if you use Icecube’s patch, old .savs won’t work. Sorry if it isn’t helpful.

To do this you just need to repoint the table which is what
the FE7 tutorial does for items in FE7 as an example I believe. This
might get a bit long… I included an example patch at the bottom. This
patch is part of what I’m using for my class package project/my FE8
hack, so it already has some stuff repointed, added sound effects for
classes, and some new map tiles added in from FE7 and FE6.

This is how I do it:

The first thing to do is find the class table offset. The class
table offset is 0x807110 as mentioned in the class editor nightmare
module. Reversing the bytes, this is 10718008 when you search for it in a
hex editor like HxD and there should be only 4 occurrences of it.

The next thing you need to do is find where you want to place
your new table. For my animation package, the class table is located at
0x1338480.Once you have a new location for the class table decided, you’ll
want to copy the whole length of the original class table. This is most
easily done by using the goto function of HxD to go to 0x807110(though
you don’t need the 0x in front for goto) and then use the select block
function. For select block, make sure that you are selecting it by
length and not end offset, and that you are using it in decimal not
hex(you could do hex but decimal is easier to calculate for most
people). So you’ll want to select a block of 10752.What’s nice about FE8 is that it’s class table is already of length 0x7F/128, so when you copy the class table once, you just have to
paste it twice into your new class table location.

After pasting the
table in the two times, at the end of the table add in 16 bytes of 00
for good measure since I think that’s what lets the game know to stop
looking through the table, though this is something I could be wrong
about hence only doing it for good measure.

The next thing you’ll have to do is repoint the class table. So
using the replace command, replace all occurrences of 10718008 with your
new table’s offeset (for me this would be 80843309). As mentioned
before, you should only have 4 occurrences replaced.

After repointing the table, there are still two more things you
have to do(well, four if you want truly dynamic classes). These things
are repointing the standing map sprite table, the moving map sprite
table, fixing the class numbers in the class table, and adding in Ice
cubes patch.

The fixing the class table numbers and moving map sprite
table are the most important.For repointing the moving map sprite table, you just follow the
same idea as repointing the class table. This table is located at
0x9A2E00. So you’ll want to replace 002E9A08 with whatever new table
location you use for your ROM, just remember to reverse the bytes. The
default moving table for FE8 is only 127 entries in length however, so
pasting it twice would mean you have one extra entry 8 bytes in length
left over by default. For this reason, by default I recommend pasting
the table in once, skipping 8 bytes, and pasting it in again. The moving
sprite table has it’s moving sprite correspond to the class table entry
plus 1. So entry 0x00 in the moving table is Ephraim’s moving sprites,
but his entry in the class table is 0x01. So the 8 bytes you skip would
be for the copied 0x00 entry in the class table. Obviously you can fix
those two entries latter. I wouldn’t touch 0x00 in the class table
though since it would also have no moving map sprite to correspond with.
The copied version which is entry 0x80 is fine. At the end of the
moving map sprite table I’d add in 02 00 00 00 for good measure to
signify the end of the table. Again, I don’t know if you actually have
to do this.The standing map sprite table follows the same kind of idea
however to set a class to use the standing map sprite entry in the array
with the corresponding point in the class table. So Ephraim’s standing
sprite is 0x00 and his class table entry uses 0x00 for his standing map
sprite.

THIS IS IMPORTANT For entries 0x80 and beyond,
if you’ve just copied the class table/in general, you will need to make
sure the class number is the same as the index the class is in the array
or it will cause problems when you try and save. The patch I attached
already does this part for you so you can just copy paste those entries
from 0x80 on. In this patch, this point starts from 0x133AE80, so just
copy the 10752 bytes there like before and add them to the end of your
class table. Failing to do this means that when you save and resume,
characters in these classes and beyond will revert to the class that
their class number says they are.

The last part is where Icecubes patch comes into play and is also
very important. Without this, the player cannot use any of the classes
in entries 0x80 and beyond. To use Icecube’s patch, you just apply his
patch like you would any .ips patch and you’re good to go.

thanks, but im not sure it is helpful…

I’m just trying to figure out entries after Nightmare ends. Right now I’m on 0x66. And I’m having really weird glitches going on. This is happening again.

and if i resume a second time, Dewey’s map sprite just appears. Keep in mind, i didn’t use Make a custom class!" this time… i used 0x66

If you want to use more entries than what the default table gives you, you need to repoint the class table. walking map sprite table, and maybe the standing map sprite table if the space you’re trying to use is already being used by the ROM for something that isn’t a class. The class number of a class should just always be the same as the entry in the class array it is.

It’s probably worth saying, at this point, that we solved the problem. Turns out @ghast forgot to hit “Replace All” when he was replacing the old class table pointers.

In short, @ghast, you fucked up.

2 Likes

we didn’t solve it yet! L
i gotta repoint the shit properly.

But yes,

I am basic

okay yes we solved it.

and by we

i for sure mean agro

i finally wrestled this gator to submission.

1 Like