Users browsing this thread: 1 Guest(s)
RAM $11E4 and adding Gau to a party?

#1
Posts: 377
Threads: 34
Thanks Received: 10
Thanks Given: 7
Joined: Dec 2018
Reputation: 18
Status
Moog
Okay, so the least-significant bit of Ram address $11E4 is set when Gau is on the Veldt, indicating that he can be returned to the party.

I'm trying to wrap my head around an edge case: what if an event adds Gau to the party while this bit is set?


Let me set up a scenario for you: the player ditches Gau on the Veldt before tackling the Floating Continent.  The World of Ruin sequence that follows has been altered to make Gau mandatory; he is forced into the party during a side-scenario.
So... what happens?

(1) Is Gau just not added to the party because he's on the Veldt? [Bad]
(2) Is Gau added to the party but still present on the Veldt, potentially creating an event crash when Gau comes back with Gau in the party? [Very Bad]
(3) Is the bit automatically cleared because Gau is in the party? [Very Good]
(4) Does the bit have to be cleared manually by the event script? [How? It's less than $1DC9, there doesn't seem to be a command to manipulate bits that low in RAM]

The only instance in the game where Gau is added to a party is Cyan's Dream.  Since he has to be present beforehand, though, this situation doesn't come up.

Has anyone done anything like this before?  If it is a problem (as I suspect it is), how would you address it?  A subroutine in the battle loop to check for certain event bits and then clear $11E4?  Reworking Veldt functionality to never set the bit and never remove Gau from the party?  Something I haven't even considered?
  Find
Quote  

#2
Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
haha, i've never coded anything involving this..  but remember being confused about a hypothetical related to it, and asking Lenophis for help making sense of it.

there's a dummied event in Albrook where if Gau is in the party when Terra and Locke are about to go to Thamasa, he'll decline to accompany them, and then Gau gets removed from the party, un-enlisted, and Byte $1F46, bit 7 (which iirc governs his presence in Vector Cafe) gets set.

normally, this can't happen, as he'd already been removed from the party and put walking around in Vector.  however, the question stemmed from: what if you had leapt Gau previous to the Vector deal, and had the airship now to retrieve him for Albrook?

would he magically be teleported to Vector anyway after the dummied convo?  and would he simultaneously be pacing around there *and* recruitable on the Veldt?

i forget the exact questions and whether there were more, and even the answers.  but it was interesting, and a bit mind-racking with the contradictions and trying to figure out what takes precedence.

------

as for your current deal, i think it's #3 and that you'll be fine.

see the code starting at C2/2FB0.  looks like the recruitment/enlistment flag in $1EDF wins out.

there are a number of things that can clear $11E4 bit 0:
- that C2/2F2F function (also due to party count and enemy formation [as in group]), called at battle start.
- Function C2/2E68 (due to encounter formation [type]), called at battle start and on formation switches.
- C2/4845 (reached upon ending/winning a battle), oddly even when you randomly branch and Gau *doesn't* rejoin.  can't say i understand the reasoning.

with all those things able to clear $11E4 bit 0 so readily, there's gotta be *something* to restore it entering or between battles.  i'm not seeing Bank C2 battle code offhand to initialize the variable or fill its vicinity with FFhs.  so i wanna say it's defaulted to enabled (by Bank EE or C0 or something) when you're on the Veldt.  EDIT: yeah, it and the other 3 bottom bits of $11E4 are set for Veldt steps at C0/C17B.  and it (and most others) are cleared right before a non-Veldt battle at C0/C270.

all this back-and-forth, with broad setting sometimes followed by worry-free clearing, reflects that there's a more persistent variable to keep track of Gau's enlisttment: Variable $1EDF Bit 3.  iow, $11E4 is a bit imprecise.  fwiw, i think the answer to my "and would he simultaneously be pacing around there *and* recruitable on the Veldt?" question was "yes", but would have to double-check.

to avoid nonsense like hypothetical Vector, guess you'd have to recalculate things like a room's possible denizens every time it's entered?

also, i think Square was probably wrong to un-enlist Gau in the dummied event (just party removal should have sufficed), because i don't believe there's a way to keep him off the Veldt once that's happened.  but i can't fault Square, because it's ...well... dummied. Tongue
Quote  
[-] The following 1 user says Thank You to assassin for this post:
  • C-Dude (12-19-2019)

#3
Posts: 377
Threads: 34
Thanks Received: 10
Thanks Given: 7
Joined: Dec 2018
Reputation: 18
Status
Moog
Thank you Assassin. Knowing that the "Gau is Available" event flag appears to take precedence is reassuring.

Looking at the "On that day" script, they just remove him from the party. Since his normal WoR recruitment involves simply going to the Veldt to fetch him, that leads me to believe adding him to the party will fix any Veldt roaming.
I suspect this because:
(1) Cyan's dream removes him from the party in the same fashion as the end of the world (thereby setting the "on the veldt" status again).
(2) Cyan's dream simply re-adds him during Dream Stooges; no event bits relevant to the Veldt are set.
(3) After losing and recovering Gau in the dream, he isn't roaming the Veldt, implying there's some cleanup there somewhere preventing a double-Gau.

If it's not the case, though... I have another idea.
I can set up an enemy set to exclusively call Formation 458 (Gau returns from the Veldt). His caseword doesn't distinguish whether he's on the Veldt or unrecruited, so maybe I can check if it's set, call the enemy set with formation 458 if it isn't, and then jump back to the check. If the player scares him off with an attack, the battle will trigger again until he joins the party. Since the spot I'm doing this in doesn't have party selection and only has two characters in the current party, the loop would guarantee that Gau has his Veldt status removed before continuing.
A bit inelegant, but as a last resort it wouldn't be terrible. I'll let you know if that setup turns out to be necessary.
  Find
Quote  

#4
Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
C-Dude Wrote:Looking at the "On that day" script, they just remove him from the party. Since his normal WoR recruitment involves simply going to the Veldt to fetch him, that leads me to believe adding him to the party will fix any Veldt roaming.

to be sure, it also un-enlists (as in, removes them from the roster) everybody besides Celes at CA/5310 - CA/532B.
Quote  

#5
Posts: 377
Threads: 34
Thanks Received: 10
Thanks Given: 7
Joined: Dec 2018
Reputation: 18
Status
Moog
(12-20-2019, 10:37 PM)assassin Wrote:
C-Dude Wrote:Looking at the "On that day" script, they just remove him from the party. Since his normal WoR recruitment involves simply going to the Veldt to fetch him, that leads me to believe adding him to the party will fix any Veldt roaming.

to be sure, it also un-enlists (as in, removes them from the roster) everybody besides Celes at CA/5310 - CA/532B.

Verily.  I modified that section to also remove (almost) everybody from the shop lists (to add increased suspense to the World of Ruin, and to hide graphics changes to two of the characters before their re-recruitment).  Part of my event cleanup is making sure all those bits get re-enabled at the right time, but, since I'm setting event bits $2FB and $2EB when Gau is added to the party, I'm hoping it'll work as a straight-up reversal to his removal when the world is destroyed.

If all else fails, I'll throw in a caseword check for him right at the top of the "Find the Floating Continent" segment, forcing the player to go fetch him from the Veldt before confronting Gestahl and the Triad (something along the lines of "We're going to need all hands on deck for this, better go fetch Gau from the Veldt").  Then, instead of unrecruiting him I can just tuck him into an unusable party (like Celes gets put in Party 6 during the opera), and pull him back into the primary party when he's supposed to 'rejoin'.  Since there are no character select screens between the departure and the reunion in my scenario adjustment, that should step around the problem.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite