Jump to content

FE8 Hacking Notes/Questions


eclipse
 Share

Recommended Posts

I'm not sure where to put this, so if this needs to be thrown somewhere else in this subforum, please let me know!

First, notes. On the off chance someone else decides to hack FE8, they might find this useful.

Messing with item events

I decided to give Eir something that wasn't a Rapier in the Prologue. However, when I disassembled FE8's code, and compared it to the FE7 stuff, it was. . .messy. Furthermore, there's a lot of stuff that's undocumented. I found the place where I thought Eir got the Rapier, but. . .

label26:
CUMO 0x2
STAL 60
CURE
TEXTSTART
TEXTSHOW 0x90F
TEXTEND
REMA
CALL label35
_SETVAL 0x3 0x9
_GIVEITEMTO 0x1
_SETVAL 0x2 0x89EF828
CALL label24
ENDA

_GIVEITEMTO only listed a character? A quick text check showed me that I was in the right place, as the text event fired before Eir got the Rapier. I stared at the Item List for a while before I figured it out:

label26:
CUMO 0x2
STAL 60
CURE
TEXTSTART
TEXTSHOW 0x90F
TEXTEND
REMA
CALL label35
// Commented code is the Rapier; changed _SETVAL is an Iron Sword
// _SETVAL 0x3 0x9
_SETVAL 0x3 0x1
_GIVEITEMTO 0x1
_SETVAL 0x2 0x89EF828
CALL label24
ENDA

I realized that 0x9 was the code for the Rapier, so the _SETVAL beforehand controlled what item Eir got. FE8 will create the item first, then give it to the character. LESSON LEARNED.

Making things drop

So after trolling Eir by giving her a cheap Rapier knock-off, I decided to be merciful and give it to her a bit later. However, there's no settings in FE8's Nightmare modules that makes stuff drop. I decided to turn to assembly. First, I needed a couple of units with droppable items, so I ripped Chapter 3. The unit list in FE8 is far messier than FE7.

UNIT 0x48 0x41 0x0 0x34 [14,1] 0b 0x0 0x1 0x8B451C [0x20,0x28,0x0,0x0] [0x3,0x3,0x9,0x20]
UNIT 0x8E 0x41 0x0 0x1D [7,2] 0b 0x0 0x1 0x8B4524 [0x1F,0x0,0x0,0x0] [0x0,0x3,0x9,0x0]
UNIT 0x8E 0x41 0x0 0x1D [9,8] 0b 0x0 0x1 0x8B452C [0x28,0x0,0x0,0x0] [0x0,0x3,0x9,0x0]
UNIT 0x8E 0xF 0x0 0x15 [15,2] 0b 0x0 0x1 0x8B4534 [0x1,0x6F,0x0,0x0] [0x0,0x3,0x9,0x0]
UNIT 0x8E 0x19 0x0 0x25 [12,9] 0b 0x0 0x1 0x8B453C [0x2D,0x0,0x0,0x0] [0x0,0x3,0x9,0x0]
UNIT 0x8E 0x41 0x0 0x1D [14,6] 0b 0x0 0x1 0x8B4544 [0x20,0x6E,0x0,0x0] [0x0,0x3,0x9,0x0]
UNIT 0x8E 0xD 0x0 0x1D [9,11] 0b 0x0 0x1 0x8B454C [0x1,0x0,0x0,0x0] [0x0,0x3,0x9,0x0]
UNIT 0x8E 0x41 0x0 0x25 [14,11] 0b 0x0 0x1 0x8B4554 [0x28,0x0,0x0,0x0] [0x0,0x3,0x9,0x0]
UNIT 0x8E 0x41 0x0 0x1D [5,9] 10b 0x0 0x1 0x8B455C [0x1F,0x6A,0x0,0x0] [0x0,0x3,0x9,0x0]
UNIT 0x8E 0x41 0x0 0x1D [7,11] 10b 0x0 0x1 0x8B4564 [0x1F,0x69,0x0,0x0] [0x0,0x3,0x9,0x0]

By referencing item codes in the Item List, I deduced that this was the enemy unit list. I stared at the last two entries, until I saw the difference, which was. . .

UNIT 0x8E 0xD 0x0 0x1D [9,11] 0b 0x0 0x1 0x8B454C [0x1,0x0,0x0,0x0] [0x0,0x3,0x9,0x0]

UNIT 0x8E 0x41 0x0 0x25 [14,11] 0b 0x0 0x1 0x8B4554 [0x28,0x0,0x0,0x0] [0x0,0x3,0x9,0x0]

UNIT 0x8E 0x41 0x0 0x1D [5,9] 10b 0x0 0x1 0x8B455C [0x1F,0x6A,0x0,0x0] [0x0,0x3,0x9,0x0]

UNIT 0x8E 0x41 0x0 0x1D [7,11] 10b 0x0 0x1 0x8B4564 [0x1F,0x69,0x0,0x0] [0x0,0x3,0x9,0x0]

The flag in red controls whether or not items drop. Tried it out on my sorry attempt at a patch, and things worked as expected.

I have a lot of item shuffling to do now, but in the meantime. . .

Is there a way to get rid of Knoll's single auto-level? I'll get around to this, but not anytime soon.

Edited by eclipse
Link to comment
Share on other sites

This topic would fit Resources better IMO.

And as for item dropping, a little look at a file called EA Standard library/Unit Helpers.txt:

//Unit flags
#ifdef _FE8_
#define MonsterTemplate 1
#define DropItem 2
#define DunnoFlag1 4
#define DunnoFlag2 8
#endif

and 2 = 10b.

Link to comment
Share on other sites

This topic would fit Resources better IMO.

And as for item dropping, a little look at a file called EA Standard library/Unit Helpers.txt:

//Unit flags
#ifdef _FE8_
#define MonsterTemplate 1
#define DropItem 2
#define DunnoFlag1 4
#define DunnoFlag2 8
#endif

and 2 = 10b.

Wish I'd seen both of these sooner (before I tore out half my hair). Thanks! Will deal with Knoll when I'm finished turning every single chest item into a Slim Sword.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...