Qhimm.com Forums

Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: Karifean on 2017-05-05 15:11:28

Title: In-Battle Menu Refresh, and Limit Gauge address
Post by: Karifean on 2017-05-05 15:11:28
Hey there. I've just had some ideas for a mod of mine to make the game balance a little different, but unfortunately I've run into problems with them.

First is to have a fraction of all damage you take persist to your max HP for that battle. Easily done with a Post-Attack Character AI script in WallMarket and works fine; only problem is that the max HP value does not update in the battle menu. It works - you cannot heal above the new max HP value - but the menu doesn't reflect that. Anybody know a way to deal with this issue in the PC version?

Secondly, I'd like to halve the party members' limit gauges after every battle to make it more of a challenge to use higher level Limit Breaks effectively. Fortunately there's a Post-Battle Character AI script I can (hopefully) use for that purpose. Unfortunately, I haven't found anything indicating the address on this address list (http://wiki.qhimm.com/view/FF7/Battle/Battle_Scenes/Battle_AI_Addresses) or WallMarket/ProudClod's dat files. Tifa's Premium Heart uses the value for damage calculation so I'm guessing it's readable? Anybody know this one?
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: nfitc1 on 2017-05-05 16:06:57
Neither are possible with AI.
The Max HP value is not really meant to be manipulated. The Battle Arena actually modifies the correct value, but the AI changes what is essentially a virtual value that is the monitored value rather than the displayed value.
The second one requires you to change the asm that stores the limit value in the save map. Reasonably easy change from 005C6CA4 to 005C6CAC.
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: Karifean on 2017-05-05 16:44:26
Goddamnit. Why can't things ever be as simple as one would hope =P

Regarding max HP, I presume there's no way to modify the correct value then? To, like, call an outside script that can actually do it or something?

Regarding the limit bar, hmm, I haven't done direct .exe asm changes in FF7 before (only editing single hex values). Can you point me to a place where I can start educating myself on how to approach this?
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: Tsuna on 2017-05-05 16:57:33
I can help you with this. What is this code supposed to do exactly? Make the limit do what?
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: Karifean on 2017-05-05 17:03:57
The plan is to make it so that the Limit Gauge halves for all party members when a battle ends. So if they had a full bar and finish the battle it's now at 50%, if they enter another battle and finish it without getting hit at all, it's going to be at 25%.
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: Tsuna on 2017-05-05 17:14:42
Ahh good idea. I thought you were gonna say it empty's again. If i may throw an idea for an addition to this would be to try make poison and such stay affected till you heal it some way. Like FF9.

But yeah i'll try this out soon and post the results
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: nfitc1 on 2017-05-05 17:32:20
Regarding max HP, I presume there's no way to modify the correct value then?

I sense that I misrepresented what's happening and why your approach doesn't have the desired effect.

During battle, each actor (technically even the "set pieces" like the manholes and the tiny bronco) has a unique array of data that stores things like status, attack power, HP, MP, MHP, MMP, etc. For all damage calculations and status considerations the game uses this array to perform its calculations against. However, the menu at the bottom of the screen does not. At the beginning of the battle the battle module reads the data from the save data for the characters and creates the menu from these values. During a normal battle, MHP/MMP are NEVER UPDATED. The only exception is the battle arena which essentially rebuilds the menu from this array at the end of every battle. That's how the break materia/half HP/level down effects work. They adjust the character's data and the menu is rebuilt. There is no way to trigger this in the middle of a normal battle.

As for the limit changes, get a hex editor and make the following changes:

Code: [Select]
Address:     Former Value:     New Value:
=========================================
0x1C60A4          8B               8A
0x1C60A5          45               8A
0x1C60A6          E0               C0
0x1C60A7          8A               8D
0x1C60A8          8A               9A
0x1C60A9          C0               00
0x1C60AA          8D               D0
0x1C60AB          9A               F9
0x1C60AC          00               90

That should halve the limit bar value at the end of each battle for each character. Limits will be hard to get at upper levels after this.
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: Tsuna on 2017-05-05 17:46:21
Oh good, because i tried making a jump/call from the original to your new idea and all it did was make the exp bar indefinitly long.

Not working for me, still getting the same thing
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: Karifean on 2017-05-05 17:48:18
Thanks man! And yeah I'm aware of the implications of this change, but that's part of the intent.

Too bad about the menu. I was really starting to get into that idea too. Oh well, gonna have to think of something...
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: Tsuna on 2017-05-05 17:59:27
SO NFITC1, you'd be adept with asm too?
Once we figure out a solution for this guy think you could help me with something?
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: nfitc1 on 2017-05-05 18:02:17
SO NFITC1, you'd be adept with asm too?
Once we figure out a solution for this guy think you could help me with something?
Sure. You could PM me any time.
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: Karifean on 2017-05-05 18:07:33
Hmm... it seems to work only when it feels like it. Like I'm pretty certain I saw the Limit Bar go down at some point, but at another point both Cloud's and Barret's were nearly full at the end of a battle and they were both still that high when I entered the next battle.
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: Tsuna on 2017-05-05 18:14:18
I couldn't even get it to do that. I have no idea what i did wrong lol
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: nfitc1 on 2017-05-05 21:48:42
Hmm... it seems to work only when it feels like it. Like I'm pretty certain I saw the Limit Bar go down at some point, but at another point both Cloud's and Barret's were nearly full at the end of a battle and they were both still that high when I entered the next battle.

It should happen to every character that survives the end of the battle (meaning if they are dead at the end of the battle their limit bar will not be affected, but at that point it should be 0, right?). There may be some cases where this code doesn't activate, but I'm pretty sure it happens any time experience is gained (you didn't have all characters run from battle).
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: Karifean on 2017-05-05 22:47:17
It should happen to every character that survives the end of the battle (meaning if they are dead at the end of the battle their limit bar will not be affected, but at that point it should be 0, right?). There may be some cases where this code doesn't activate, but I'm pretty sure it happens any time experience is gained (you didn't have all characters run from battle).

Well that's a problem, since your limit bar is saved as-is in those cases. Can something be done so it works on *all* battles?
Title: Re: In-Battle Menu Refresh, and Limit Gauge address
Post by: gaaasstly on 2017-06-07 04:26:50
First is to have a fraction of all damage you take persist to your max HP for that battle. Easily done with a Post-Attack Character AI script in WallMarket and works fine; only problem is that the max HP value does not update in the battle menu. It works - you cannot heal above the new max HP value - but the menu doesn't reflect that. Anybody know a way to deal with this issue in the PC version?

FF7_EN.exe+9BA4AA
FF7_EN.exe+9BA8EA
FF7_EN.exe+9BAD2A