# Qhimm.com Forums

## Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: DLPB_ on 2018-05-13 12:17:09

Title: Yuffie Conformer Bug
Post by: DLPB_ on 2018-05-13 12:17:09
If the flag added when Power is 0 at
5DA71D

is skipped, the Conformer will then correctly show damage and effects when targeting allies (damage 1).  But this check may be needed for other effects to disable damage and normal effects, like sound.

With Yuffie's conformer, there are three possibilities to what the developers wanted:

1. That when targeting allies, the damage will be 1 and that this damage be displayed.

2. That when targeting allies, the damage will be 0 and that this damage is not displayed.

3. That when targeting allies, the power rating be 1 - and thus damage will be at its minimum for allies.

I suspect that there was a miscommunication.  The normal minimum for any physical attack that lands a hit is 1.  The reason Yuffie's weapon takes 1 off is that the variance formula does it's job and makes it 1.

But because of the power check being 0 (since allies' level isn't checked), the damage display and other effects are disabled by the flag at the address above.

The two possible fixes are:

Disable the ability to skip damage and effects when power is 0 (might break other effects)

Force Yuffie's conformer formula to have a minimum power rating of 1 (which would then affect allies with damage greater than developers intended)

It would be a lot of work to make a workaround that made her attack = 1 and display 1 when her power alone is 0.  Because then you'd be checking if her conformer is equipped.  That's possible,  but i'd prefer to not go down that route.

Question first is how many things are affected if 5DA71D = EB 1A

Too many are.  Frog Song, for example, will show damage being 0 instead of just doing the effect.

I think best way to fix this now is to just make the Conformer take off the minimum when targeting allies (power = 1).

Code: [Select]
`5DCD8C = C7 45 E0 01000000 `
Will fix it.
Title: Re: Yuffie Conformer Bug
Post by: DLPB_ on 2018-05-13 13:46:03
And it is a bug that the Conformer power can be 0 leading to no animation / sound but 1 HP deduction.

Programmer simply forgot that allies being targeted would result in 0 power.  He either should have done what I have above - or added 1 when ally targeted.  OR added in ability for ally levels to also be used.
Title: Re: Yuffie Conformer Bug
Post by: nfitc1 on 2018-05-14 03:13:58
I had a discussion with DynamicDJ on GFAQs about a Conformer-related issue. Specifically reintroducing the Morph reduction to it. My proposed formula would correct this issue that you're encountering:

Code: [Select]
`Power = 1 + ((Power * Avg_Targets_Level) / 16)`
This follows most of the other ultimates' power modification calculations and would limit Morph's power AND would prevent power from being 0 or lower.

That check CANNOT be skipped as it is used during every action that has a 0/0 damage calculation. This is used primarily with actions from enemies that have no direct effect on a targets' HP (think Guard Scorpion's Search Scope is the earliest example of this), but it can include status changes. That flag is used to skip the part where the target is to play some reaction animation. Since reaction sounds/damage indicators almost always happen in the reaction animation scripts then nothing typically happens.
Oddly enough, the status changes magics (Toad/Sleepel/etc) typically use 2/2 with a power of 0 rather than 2/0 which would prevent damage completely even if a power were a non-zero value.
Title: Re: Yuffie Conformer Bug
Post by: DLPB_ on 2018-05-14 10:43:06
I spoke with DynamicDJ in Discord last night and looked into this.  I don't think the Morph issue is a bug.  Like DynamicDJ  said to me, the Conformer and Morph are conveniently in the same place - and the developers may have known that the weapon Power value would be used rather than the Morph Power.
Title: Re: Yuffie Conformer Bug
Post by: nfitc1 on 2018-05-14 13:32:13
...the Conformer and Morph are conveniently in the same place...

No they're not... Conformer is in the Gelnika and Morph is in the Temple of the Ancients. However, the Gelnika is where all the enemies that morph into sources reside. You wouldn't know that unless you were trying to morph anyway.
Title: Re: Yuffie Conformer Bug
Post by: DLPB_ on 2018-05-14 15:36:33
ha. i got confused. yeah thats pretty decent proof it was deliberate id say. i think it was a delib action. It's a tough one to call.

Quote
DLPB - Today at 11:05 PM
ok well im gonna go for deliberate
on basis that she is the thief
and the timing of it aboard that ship
Title: Re: Yuffie Conformer Bug
Post by: spy__dragon on 2018-05-18 20:30:40
We've found the code on PSX version, but we don't know how to fix

In PC version is:
mov     [ebp+var_20], 0
mov     [ebp+var_24], 0
mov     [ebp+var_28], 4

And the equivalent on PSX is:
ori r3,r0,0x0004

This you can find on file battle.x descompressed: 0x9330

What should we make a fix on PSX version?

Regards
Title: Re: Yuffie Conformer Bug
Post by: DLPB_ on 2018-05-19 05:50:04
I don't know R3000 mips.  All I'd say is, the code you have there looks about right and you need to set her default attack power to 1.  Probably by setting one of those zeroes to 1/
Title: Re: Yuffie Conformer Bug
Post by: Xinlus on 2018-05-20 19:34:02
This should work:

ori r5,r0,0x0001