Author Topic: Stupid Menu Opcode with Master Materia Fusion.  (Read 2480 times)

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Stupid Menu Opcode with Master Materia Fusion.
« on: 2016-08-24 22:07:04 »
OK - so here's the issue. As most us know by now, FF7 is a glorious mess. Glorious in the literal meaning, because it is obviously a great game, but a mess because you can clearly see how slap dash it was all thrown together. It reminds me of the first programs I wrote - where I just heaped on code to fix crap code - and kept coming up with workarounds because I was too lazy, or too far down the rabbit hole, or wanted it done and dusted.

FF7's engine suffers with this all over the place. One such place is the ridiculous specialist menu opcode in the field module. It's where the programmers realized "Shit... our engine doesn't support that - Let's just add another operation to fix it. We'll shoehorn it into the Menu function."  When, really, the game should have been thought out in advance, so that no slap dash fix was even needed.

That brings me to the field 'bugin1b', where mastered materia can be fused into a Master Command, Master Magic, or Master Summon. One operation checks whether the relevant materias are present and mastered - and if this check is successful, the next adds a Master materia and removes the mastered materias that were 'fused'.  The problem is, this function tries to add the Master materia BEFORE removing the mastered materias that were fused.  So, if your inventory is full, you will lose all your individual mastered materias and gain absolutely nothing for it.  Clearly a huge oversight.

How to fix?  That's why I am here. One operation that exists is "amount of materia".  I haven't checked if this is working, but if it is, then it should be possible to manually check for each materia.  This would be a bit annoying and time consuming.

The other operation seems to be broken.  I first add a materia (let's say MP plus) to see if the inventory is full.  If it is, the materia is not added and I don't proceed.  But if it isn't, the first thing that is done is to remove an MP Plus.  Sadly, this operation is yet another that is broken in the PC version.

http://wiki.qhimm.com/view/FF7/Field/Script/Opcodes/5C_DMTRA

Maybe I am just here to hope that I don't have to manually check for each bloody materia.

Edit

Oh, it's absent in PC. 

http://wiki.qhimm.com/view/FF7/Field/Script/Opcodes/5D_CMTRA

So there we have it... I think I am screwwwwed haha.
« Last Edit: 2016-08-24 22:12:09 by DLPB »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Stupid Menu Opcode with Master Materia Fusion.
« Reply #1 on: 2016-08-24 22:09:21 »
Looking to me like I may have to look at assembly and see if I can remove the mastered materias BEFORE the new one is added.  But I bet that's a right nightmare.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Stupid Menu Opcode with Master Materia Fusion.
« Reply #2 on: 2016-08-25 01:53:41 »
The function to remove materia has been removed.  It's at  6CC2ED.

The AP value is fed into it - and what should occur is then a comparison with

ecx * 4  + dc04b4

Where ecx is incremented by 1 up to 200 materias (0 - 199).  If there is a match, FF FF FF FF would be written. This isn't too hard to program back in.  Will test :)

edit.

Added function back in via assembly.
« Last Edit: 2016-08-25 03:27:08 by DLPB »