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.
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.
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.]
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.