0x008If (BitCount( (BattleAddr(&20A0).BattleAddr(&4000) == 1) ) == 1)It seems to be checking to see if exactly one player has Death, but after testing this check didn't seem to do anything; the Jumping appeared to have a 1/2 chance of using Club Sword regardless of how many players were dead (it's supposed to have a 1/4 chance of using the attack if the check passes).

TF seemed to think this check will always fail, aswell

I have been trying and trying to figure this one out. It seems that the 4X family SKIPS character 0. I'm still looking into this, but in my test character 0 was definitely dead and the count of successes was still 0.

EDIT:I got it! 20A0 is the LIVING enemy actors. So testing the death status against living targets will always result in a 0.

^^ Awesomness dude, that one was bugging me for a while. It did inspire me to work with Cheat Engine a bit more closely. I've mapped out all of the six enemy slots LocalVar addresses, which helps to see what is going on in real-time. I've also found the address that deals with the next Formation ID, so I can do tests on any formation I want without having to load save files or mess around with MR lol.

OK, after staring at Ultimate Weapon for hours, I now know precisely what's going on. The A0 opcode was throwing me off for a bit, but I figured it all out in the end (without having to ask for help lol). It's interesting to note that a small bug occurs once its HP has dropped to less than 65,536; it won't store the lower byte's value and will undercut the stored HP by up to 255.

Anyway, I've observed that the 0x004 flag in 0x0C1F of the save map is not a flag indicating that Ultimate has been killed; it's a flag that signifies that its HP has reached 'critical' and is ready to move onto the Cosmo Canyon phase. 0x001 is used to indicate that it has been killed, which is also used by the Battle Square, but technically 0x001 should be "Ultimate killed", and 0x004 should be "Ultimate HP Critical" or something to that effect.

edit I didn't realise how easy it was to make an account and edit the wiki (at http://wiki.ffrtt.ru). I'm gonna start updating the save map as and when.

double edit - there is no glitch with Ultimate Weapon; I had the value stored as 2 bytes, not 3 (dur). Cheat Engine doesn't allow for three bytes, just 2 or 4, which means if I set it to 4 bytes, the value overspills into the next byte. I've had to separate out its HP into three separate bytes, which isn't too hard to manage: (Byte3 * 65,536) + (Byte2 * 256) + (Byte1).

Dunno. The only other enemy that I can think that uses RunScript is Mystery Ninja. However, she uses it to end the battle after 10 turns without triggering the death script that the WM scripts are checking for. Maybe Diamond was going to do something similar (or a placeholder was added in case something came up). As it is the WM script to trigger the battle just engages the battle and begins an FMV after the battle is over. Maybe there could have been other outcomes to the battle. That would have been neat.

It's peculiar that Helletic Hojo opts to uses 402D to lift the Death Status of the Right Arm..

I see; it's because it has to use "Right Arm Revive" on itself as an animation; it does not target the Right Arm.

If the script is setting the 4000 (death status) of the Right Arm to 0, why is it necessary to also toggle the 402D flag? Is it necessary? The Nibel Wolf do not need to use this flag.

I'm going to assume that any ability that removes the Death Status also toggles the 402D flag in the background. I know that 4000 is used for the 'Death' checks, but what does 402D actually do? When Carry Armor imprisons you, it also flags you as dead for the subsequent checks, but, the character's HP does not drop to 0, and, it will not show in red. Is this due to the fact that 402D isn't being toggled? If you try to use a battle item such as a Megalixir, the imprisoned character's HP *will* show in red.

Just guessing here; I'm curious to know what's going on with 402D. So far, only the Pyramid and Waterpolo have made use of 402D, so I haven't looked too deeply into it till now.

In fact, while on the subject of Hojo, I'd like to raise the question of the test formations soft locking for instances where the "Next Battle" flags are used. Instead of spawning in the subsequent test formation, the game will freeze, I've always been curious as to why this is.

Looking at Lifeform Hojo, I can see that three will spawn in, two being invisible and non targetable. The AI script for Lifeform even goes out of its way to ensure that these enemies have 0 HP, and are flagged as dead. TF has documented that the reason for this is to fill the two slots left over from the Right Arm and Left Arm, to stop the game from trying to access values from the left over templates, which makes sense.

Would this be the reason the test enemy formations crash when trying to make use of the Next Battles; because the enemy slots that contained enemy details are not being set to 0, so the game tries to load enemies that are not part of the new formation being loaded? Obv Heli/Hundred uses one enemy in each battle, so the problem will not occur there.

Even more things to consider if/when I ever start working on a mod...

Oooh, just spotted a flaw in the Right Arm's script that needs raising. It tries to use an attack that is not assigned to it's Attack list; it tries to use the 11F no-named attack instead of the 120 no-named attack that is assigned to it. Doesn't this create a bug of sorts? I recall another instance where an enemy tries to use an attack it doesn't have, was it the Admanataimai? I think it is...... why doesn't the Right Arm fall victim to a similar bug? Is it due to the fact that the action 11F is loaded into the scene?

Nuts, I've just spent the last hour scratching my head as to why Helletic will never set its anim ID to 14 - it's because I'd copied the same script for the Right Arm onto the file I'm working on for the Left Arm LOL, no wonder things weren't making sense.

Could this be something to do with the positioning of the "Target" icons that appears when you press R1 (or L1)? I can't really move on from Jen Synth until I've solved the 4278 mystery. It's possible that it could be a dummied out function; an educated assumption suggests that the N Crater was designed independently from the rest of the game, as opposed to sequentially; the $GM jump supports this.

It's also curious that the Jen Synth battle overwrites the same addresses in the save map used for Ultimate's HP (and Pandora's Box, seeing as P Box uses the fourth unused byte for U Weapon's HP). I'll look more into 005B - 005E when I get to Biz Seph, as I think that's what they are controlling. Obv the developers didn't account for the Yuffie warping glitch, so overwriting the UWeapon and PBox vars makes sense, as they won't be needed again for anything else.

I wonder what would happen if you Yuffie warped from the Jen fight to any point after the first UWeapon encounter, but before defeating it properly? My guess is that that the vars would be set to 0, so when UW spawns in at Junon it'll have 0 HP; one hit would trigger the death counter to set its HP to 20,000 and fly to Cosmo.

Also, what's the difference between 2008 and 2150? They both seem to have the same function (index of the last action performed)

What could it be toggling? It's not Elemental resistances, I've tested for that....

All other battles have these values set to FF, so maybe it's not that it's toggling the bits ON, but rather, it's toggling all of the other bits OFF. Or maybe it's just a dummied function that does nothing at all. I'd very much like to know.

-edit- Wow, there's quite a lot going on with the final bosses. I'm gonna leave 4278 until I've looked as Biz Seph, Safer and Emerald, as they all have something going on with 4278

2180 is another mystery only seen thus far with Carry Armor.

2165 is definitely 'disable rewards screen', as I tested it on a random encounter. I didn't clock the Formation Pre-Battle Script with Jen Synth; I'm glad I found it, I was banging my head against the wall trying to find the field script that disabled the Rewards flag (I was convinced it was set via the same BTLMD opcdode used in the Flashback lol).

It's not a bit-flag at all. The value is indicating which section of the actor's body to select The penny dropped while battling the Zemzelett. Toggling 4278 mid-battle had no effect, however, setting it to 1 pre-battle meant that it would instead target the tail. I went through fifteen battles incrementing the value by one each time, and each time the finger icon would target one of various parts; its back, its beak, its right shoulder, its right wing, the base of its tail, the tip of its tail......

So that's it! 4278 = Body part of the actor selected! I've spent about 8 hours on that today. I gave up and watched three hours of TV then came back to it with a fresh perspective, and solved it within an hour Now I can go to bed Soooo glad to put that one behind me

Lol. If you set Jenova Synthesis 'B' 4278 to 10 instead of 16 (decimal), then it will instead target the actual tentacle, and not the part of the body where the tentacle stems out of. The finger icon even sways with the tentacle, it looks cooler than the default setting

Does anyone know how Cloud's Limit is being set to lv 4 for the final Sephiroth encounter?

I can see that Safer uses 2160, and toggles 0x10. After testing, I can see that this will allow Cloud to learn all Limits following the battle; however, it does not automatically set the available Limit ability to Omnislash.

Sephiroth toggles 0x08 of 2160, which does a number of things, one of which *isn't* setting Cloud's Limit to Lv 4. After testing against Rnd Encounters, Cloud's Limit Level will say Lv 4 in the command window, but the previous abilities will be available from the level that was selected prior (Meteorain and Finishing Touch). This is after having done a battle with 0x10 ON, then doing another battle with 0x08 ON.

Also, I can see that there are a few additional animations used for the final battle. Firstly, the intro to the battle does a little "face flash" to Cloud then Seph a few times; Cloud's battle model uses a different model; Omnislash uses a slightly different animation (does a quick "face flash" on the final blow). Would it be safe to assume these are being handled via the AB files in the battle.lgp? Would it be possible that Cloud's Limit ability being set to Omnislash is also being handled by the same script?

That top row used in the camera data of the formation seems to be involved in some way, I think it triggers the dynamic camera flashes, etc and they won't play if you change it to something else. You also probably already know that if the battlebg is used Cloud's hi-res model will be called for it in place of his regular one.

That entire battleBG must have scripts running in the back of it though; odd things will happen if it's used for a normal encounter, such as looping animations, moving models, replaying the wrong sound-effects, etc.

That entire battleBG must have scripts running in the back of it though;

Yeah, I agree, there's definitely stuff going on in the background. I was testing with 0x08 Flag ON for 2160 on some random encounters, and a few things were constant every battle, such as the Limit command being available even without the Limit gauge being filled. I would also lose control of the characters after the first action performed by the enemy.

The thing that changed every battle is the use of the other command; sometimes I would only have the Limit Command available with no other option, and sometimes the normal command window would open. Also, sometimes the player's ATB would start filled, and sometimes they would start at random positions. There's definitely stuff going on in the background somewhere that makes sure this battle plays out properly.

Most of it I'm not too bothered about - the main query is exactly how Omnislash is becoming available as the Limit ability. I can't see anywhere that toggles this.

0x000BattleAddr(&2160) <- BattleAddr(&2160) OR 80x00ABattleAddr(&2160) <- BattleAddr(&2160) OR 320x014BattleAddr(&2180) <- 2220x01ASCRIPT END0x20 is toggling the custom "No Rewards Screen" (which is also toggled via 2110 OR 8 as part of the "Custom Event 8").

0x08 is toggling the "Final Battle Paramaters" which sets up the unique conditions for the final battle (Limits always filled, lose command window after one action by the enemy, ATB starts filled etc; it also works in conjunction with 2180 to allow the Limit to fill at a specific rate of 222).

0x000BattleAddr(&2160) <- BattleAddr(&2160) OR 480x00ASCRIPT END0x20 again toggles the no rewards screen

0x10 allows Cloud to learn all limit breaks following the battle; however, Omnislash is *not* automatically set as the available ability to use (after testing against random encounters). The "Limit Level" will say Lv 4 when bringing up the in-battle Limit menu, but the abilities available will be the ones set previously (after doing one battle with 0x10 toggled then a second with 0x08 toggled):

It doesn't matter what condition I set up, Cloud never has Omnislash ready by default. The *only* time that Omnislash is available when recreating the steps used for the final two battles is during the final two battles; somewhere after defeating Safer and battling Sephiroth Cloud's Limit ability is set to Omni. I've scoured the field scripts thoroughly; it's not there (95% sure). I can only assume that there is some special script running somewhere for this battle....

Ah, that could be it. I've tried changing 2140 as the battle begins, but that's not the address I need to edit. I'll have a play around with Cheat Engine at some point. I tried activating the final battle flag for the Pagoda enemies with Yuffie, as they also make use of Battle Type 8; obviously, the final battle flag is for Cloud only, so I couldn't really test there. I guess I could just edit the scene.bin, but it would be quicker to find the appropriate addr in CE.

It seems Ruby makes use of a special "Pincer Attack" (Formation Type 4). All characters will be front-facing for this battle, but they will all still take double damage from the first use of Big Swing.

Also, if you command a character to feed another character a healing item such as an X-Potion, they will then face the opposite direction to then take double damage from Big Swing (Ruby's only Physical attack).

Also, the default "Attack from both sides"! prompt will not be displayed. Any idea what's controlling all of this?

I know the Save Map has this down as "0x20: World map Ruby Weapon form. bit=0: Small Form (before first encounter). bit=1: Big Form (after first encounter).", but, is there any chance that this could also be triggering some special battle flag?

Also, I can't work out exactly how to get the characters to face the tentacles when they are not buried; some weirdness is definitely going on here...

"The PC version has no restrictions on the use of Whirlsand and it will use it often at the start until only one character is alive or remaining. Ruby Weapon is invulnerable to everything, even defense-ignoring attacks or status effects until its tentacles are exposed.

I've had a look at the '97 PC version scene.bin and the Steam version, I can't see any difference in the AI script compared the PSX Pal version, or any other version for that matter (excluding the JORG and JINT versions).

Am I mistaken? Is there a difference in Ruby's use of Whirlsand in the PC version(s)?