[FE7/FE8][Major Bugs] Making The Active Unit Disappear

I’m checked the code that writes to the map of deployment IDs, and when it’s written to. Obvs, 0 is written to it when you select the unit. When I wait back in the same space, 0801989C writes the unit ID back into it (if we want to remove the unit, we need to bypass this and set the unit status to 0x9)

Edit: That seems to be in a loop that updates the unit map? Maybe if we set it to not update units with 0x9?

080181CF bitmasks the turn status with 0111 1001.
08018250 makes sure the 0x1 bit is not set.


That being said, we can force it to not rewrite invisible/nondeployed units. Change
08019880 to 09
Which adds the check for the invisible bit.

Edit: Then again, it seems to require 0x9 for the turn status to be invisible. I’ll see if I can change that to just 0x8…

Edit: Maybe also changing
08025BF4 to 09
Might do the trick? Applying these effects makes 08 an effective invisible status.

[1:47:49 PM] Crazy Colorz: Basically, we could never have set a unit to invisible through an afev’s asmc because the wait code automatically unsets 0x1, and the game needs 0x1 to be set to not draw the unit. Thus, I made 0x8 an invisible status.

Yeah… that works. Now to write to accompanying asmc.


	ldr r0, Active_Unit
	ldr r0, [r0]
	mov r1, #0x8
	strb r1, [r0, #0xD]
	bx lr

	.long 0x03004690

or, 02 48 00 68 08 21 41 73 70 47 C0 46 90 46 00 03


Also, apparently my modifications makes UNCM work too.


yeah it works
just UNCM Unit 0x08

love love love love love love

1 Like

How to make an escape mission:

  • Change 19880 and 25BF4 to 09 (they should both be 01).

  • Set the co-ordinates for the tile marker to your escape tile in the Chapter Data Editor.

  • Implement Hextator command menu hack. It writes the additional routine to DA0240, you can change that pointer at 4A588. Since this space is commonly used for maps, you can implement the hack by applying the patch to a clean ROM and creating a .ups - the JFP will likely return “unsafe to apply patch” errors, which cannot be ignored, but use the Ignore button in NUPS (it won’t overwrite your existing data). Apply that patch and paste this dump wherever you’d like, change the pointer (add +1 to the offset and reverse - D502C0 becomes C1 02 D5 08). If the space is free in your ROM there’s no need to move anything, so skip this step.

  • At the end of this routine is another pointer to the list of command name changes to make. Again, make that whichever offset you’d like to write the list. Entries are reversed, exactly like pointers. Two four-byte words: CH0CTEXT 071DTXT2. For example, to change ‘Seize’ into ‘Exit,’ one would write CA 10 0C CH C9 10 1D 07. CHapter number corresponds to the index in Chapter Data Editor.

1 Like

When exactly does one use the UNCM, then? As an AFEV?

I believe it can be placed directly in the upon-seized event.


AFEV 0x00 Arrive2 0x11

ENUT 0x11
IFET 0x01 0x06
IFCA 0x00 0x07 Legault
TEX1 0x9C6
UNCM Legault 0x08
ENUT 0x22
ENIF 0x07
IFCA 0x00 0x08 Jan
TEX1 0x9C7
UNCM Jan 0x08
ENUT 0x23
ENIF 0x08
IFCA 0x00 0x09 Nando
TEX1 0x9C8
UNCM Nando 0x08
ENUT 0x27
ENIF 0x09
IFCA 0x00 0x0A Opal
TEX1 0x9C9
UNCM Opal 0x08
ENUT 0x25
IFCA 0x00 0x0B Everrett
TEX1 0x9CA
UNCM Everrett 0x08
ENUT 0x26
ELSE 0x02
ENIF 0x01
TEX1 0x9CB
ENIF 0x02

IFET 0x01 0x22
IFET 0x02 0x23
IFET 0x03 0x27
IFET 0x04 0x25
IFET 0x05 0x26
JUMP EndingEvent
ENIF 0x05
ENIF 0x04
ENIF 0x03
ENIF 0x02
ENIF 0x01
ENUF 0x11

This is the source from Legault’s tale. I used event IDs to check for an “escape all” type mission. Although I don’t know what’ll happen with rescued units…

oh yeah that might cause some issues uhhh uhhh uhhhhhhhhhhhhhhhhhhhhhh. How does FE9 handle it? The rescued unit laeves as well? I’ll write an ASMC routine to say “If Legault invisible, win”?

Actually no that won’t work, uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

I can make a recursive UNCM that sets the carried unit to invisible as well?

FE8: Set 19fb8 and 2769c to 09 (should be 01).
3004e50 contains the ram pointer to the active unit.

Also, the asmc above should say 0xC instead of 0xD.

Derp that’s why Arch was getting weird errors

OH guys so, this has serious errors. Basically, the unit is invisible but still /there/. The AI will still attack it and such. I’m thinking of intercepting the method that rewrite the position of the active unit to the unit map/unit data, if possible. I’ll let you know how that goes. Until then, don’t do this.

Hm, interesting… the enemy seems to attack the invisible unit exactly once before deciding that it actually doesn’t exist and then moving through it from then on. The Status screen, however, displays the correct number of units currently on the map.
And now I’m getting ideas for invisible phantom assassin allies

The easiest solution might be to make the escape code move the character somewhere offscreen by coding in a change to the coordinate bits in RAM.

EDIT: changing character data doesn’t work, but changing the coordinates stored at the 0xEth byte of 0x203a958 does. Seems to be where movement data is “locked in”. [Note: FE8 location.]


ldr r0, Active_Unit
ldr r0, [r0]
mov r1, #0x8
strb r1, [r0, #0xC]
mov r1, #0xFF
@strb r1, [r0, #0x10]
ldr r0, Mvt_thing
strb r1, [r0, #0xE]
strb r1, [r0, #0xF]
bx lr

.long 0x03004E50
.long 0x203a958

Screws up the cursor, though (although I suppose that’s probably fixable).
Okay, yeah, this isn’t ideal…

Yeah, the cursor coordinates stem directly from that memory value, so the fix feels super hacky.

Hmm, so playing around with memory, the problem seems to be the “0x08” designation, which is making the enemies still able to see you. 0x09 doesn’t do that. Most likely there’s another spot designating aspects of undeployed status that got missed with the current two changes…

The 0x1 bit of the turn status is unset as part of the code run when un-selecting the unit (as well as re-writing its current position back and adding it to the unit map. So I plan on doing something about that, if possible. I’ve found several of the locations. Not-messing with the end turn code just seems unavoidable at this point.

well, i got it to work eventually

altering the AI to ignore units that are invis was doable, but then this happened

you can clear it by setting a repeated area event on the entire map that sets the X coord of whoever’s invis to FF; hacky and inelegant solution but it works

(i’ll release a proper bundle once i clean up a few things; EN is my demo)

Alternate but still hacky solution: put a turn event at the beginning of every Enemy Phase looping through characters and changing all “08” statuses to “09” statuses.

We had other glitches involving units waiting on the same tile. So good idea, but one oversight.