Author Topic: SOLVED: Stop mega-all disabling 4x cut effect  (Read 20342 times)

yarLson

  • *
  • Posts: 708
  • spr nrd
    • View Profile
SOLVED: Stop mega-all disabling 4x cut effect
« on: 2011-03-06 05:53:51 »
just wondering if anyone knows of a program I can use to edit the effects of materia. More specifically I just want to do one thing for now. Remove slash all effect from mega all materia so I can use 4x cut with it. Thanks for the help :lol:
« Last Edit: 2012-01-16 13:08:09 by Bosola »

AlbusJC

  • *
  • Posts: 120
  • If you really love something let it go
    • View Profile
Re: request for materia editor
« Reply #1 on: 2011-03-06 09:11:10 »

yarLson

  • *
  • Posts: 708
  • spr nrd
    • View Profile
Re: request for materia editor
« Reply #2 on: 2011-03-06 11:55:02 »
thanks. However I already tried wallmarket but I don't really know what I am doing plus I don't understand how to read hex so it didn't quite work out and everything in my kernel got all messed up just from trying to tweak a few things. Luckily I made a back up but I was just wondering if there was a more newb friendly program, if not is there some kind of imformation page for wallmarket that explains how to modify materia more in depth?

Armorvil

  • *
  • Posts: 621
  • Working on : FFVII Total Grudge
    • View Profile
Re: request for materia editor
« Reply #3 on: 2011-03-06 19:17:06 »
There are some things not in the Kernel, but in FF7.exe. What you're looking for (making Double Cut have priority over Slash All, if both effects are equipped) is one of those things.

Sadly, just like with the damage algorithms, we don't how to edit this (AFAIK, and I've been hanging around the forums for a while). The only person who might be able to help is Terence Fergusson, and he visits Qhimm maybe once a year :P

As for your second question, everything known about the Kernel is in the wiki (which, sadly, doesn't work at the moment). And WallMarket can edit it all (which I always found quite newbie-friendly *note that it also features a "help" section*, but don't hesitate to ask if you need further help).
« Last Edit: 2011-03-06 19:25:41 by Armorvil »

Tenko Kuugen

  • Public Enemy
  • *
  • Posts: 1416
    • View Profile
    • Twitter
Re: request for materia editor
« Reply #4 on: 2011-03-06 19:45:37 »
well, isn't it possible to track the function, as in, equip double slash, and then equip and unequip slash-all? Since you can do that in the materia menu, theres no need to test it in a fight.
My knowledge of debugging is limited so yeah, only a wild guess here

Armorvil

  • *
  • Posts: 621
  • Working on : FFVII Total Grudge
    • View Profile
Re: request for materia editor
« Reply #5 on: 2011-03-06 19:52:44 »
Don't ask me ; I probably have even less debugging knowledge than you, Kuugen ^^;
Guess we'll have to wait for someone who knows of these things.

Bosola

  • Fire hazard!
  • *
  • Posts: 1752
    • View Profile
    • My YouTube Channel
Re: request for materia editor
« Reply #6 on: 2011-03-06 20:44:45 »
OK. In the NTSC PSX build's memory, there's an array of ten 0x6-long elements that describe the properties of each attack, including whether or not MegaAll affects it. They start at 8009D898. The fifth byte of each element stores a command's mega-all status.

Now, some...thing writes 0xFF to those values when the command in question is 4xCut, Flash, 2xCut or Slash-All. These seem to disable mega-all status for those commands.

4xCut will be the first equipped attack, so I think that if you set a breakpoint on something writing 0xFF to 8009C89C, you'll find the function that decides what's affected by MegaAll, and isn't. If you find where this function gets its data, you'll be able to change these rules.

Be warned. Making quadcut hit all targets is likely to create an animation error (the infamous Data Error).

Now, if you want to do this for PC, you'll have to find the matching addresses for the PC version. I can't really help you there - you'd have to ask NFITC1 if he has a PC build memory map.

yarLson

  • *
  • Posts: 708
  • spr nrd
    • View Profile
Re: request for materia editor
« Reply #7 on: 2011-03-07 01:46:20 »
OK. In the NTSC PSX build's memory, there's an array of ten 0x6-long elements that describe the properties of each attack, including whether or not MegaAll affects it. They start at 8009D898. The fifth byte of each element stores a command's mega-all status.

Now, some...thing writes 0xFF to those values when the command in question is 4xCut, Flash, 2xCut or Slash-All. These seem to disable mega-all status for those commands.

4xCut will be the first equipped attack, so I think that if you set a breakpoint on something writing 0xFF to 8009C89C, you'll find the function that decides what's affected by MegaAll, and isn't. If you find where this function gets its data, you'll be able to change these rules.

Be warned. Making quadcut hit all targets is likely to create an animation error (the infamous Data Error).

Now, if you want to do this for PC, you'll have to find the matching addresses for the PC version. I can't really help you there - you'd have to ask NFITC1 if he has a PC build memory map.

hey thanks for the info, though i don't really want quad cut to hit all the targets. What I wanted was to remove the slash all property from the mega all materia so that I can use quad cut (unmodfied) when i have mega all equiped.

Bosola

  • Fire hazard!
  • *
  • Posts: 1752
    • View Profile
    • My YouTube Channel
Re: request for materia editor
« Reply #8 on: 2011-03-07 01:54:53 »
I still don't understand what you want to do.

Tell me which commands you'd like to alter, and the targets each will hit.

Tenko Kuugen

  • Public Enemy
  • *
  • Posts: 1416
    • View Profile
    • Twitter
Re: request for materia editor
« Reply #9 on: 2011-03-07 02:34:48 »
He wants this
Stop mega-all from turning attack into attack-all, so he can use 4x attack while also equipping mega-all
essentially, mega-all affects a list of commands right now ( attack, morph, steal iirc, etc ) and he wants to remove attack from that list

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: request for materia editor
« Reply #10 on: 2011-03-07 03:08:43 »
He wants this
Stop mega-all from turning attack into attack-all, so he can use 4x attack while also equipping mega-all
essentially, mega-all affects a list of commands right now ( attack, morph, steal iirc, etc ) and he wants to remove attack from that list

Sounds pretty easy, actually. However, WallMarket is incapable of doing these things. You could make Mega-All into something else, but that's not what you want. I'll have a look at it tomorrow. Note that any findings will be for the 1.02 PC version.

I'm pretty sure Mega-All does equip Slash-All as the standard attack. For some reason, Independent Materia effects are handled after other materia (although the only evidence I have of that is that Mega-All overrides any other Attack command). I think the battle menu for each character is generated with the "equip materia" function which is only accessed while out-of-battle and in the battle arena.
I'm not particularly a fan of this behavior either. I might be able to cook something up that would either rescind Mega-All's priority over Command Materia (preferred) or just eliminate the Slash-All command from it's functions all together. I feel this would be a worthy contribution if it could work.

xLostWingx

  • *
  • Posts: 801
  • No Comment
    • View Profile
    • FFVII Lost Wing Mod/Hacks
Re: request for materia editor
« Reply #11 on: 2011-03-07 03:11:44 »
Materia Equipped:  Double Cut Materia with 4x-Cut Ability, Mega All Materia

Effect Desired:  Use 4x-Cut when Mega-All Materia is equipped.  *Disable Mega-All's effect on Attack Command.

Requester has no desire to work with Hex data.

He wants to be able to use the 4x-Cut Command even when the Mega-All materia is equipped.  I don't think he can do this using WallMarket.  Using WM he could do the opposite, make 4x-Cut hit all opponents or replace 4x-Cut with Slash-All but Slash-All takes priority over 4x-Cut.

So YarLson needs to find a way to play with 8009C89C if he wants to achieve his goal.

EDIT:  Or NFITC1 will figure it out, hopefully this is what happens.
« Last Edit: 2011-03-07 03:15:43 by xLostWingx »

yarLson

  • *
  • Posts: 708
  • spr nrd
    • View Profile
Re: request for materia editor
« Reply #12 on: 2011-03-07 04:30:37 »
 I might be able to cook something up that would either rescind Mega-All's priority over Command Materia (preferred) or just eliminate the Slash-All command from it's functions all together. I feel this would be a worthy contribution if it could work.
[/quote]
that would be great. Really great. Although i dunno if making command materia take priority over mega all would work or not because i know the slash all materia has priority over double cut materia so maybe this is the core of the issue. Also I have the 1.02 PC version thats fine by me :D

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: request for materia editor
« Reply #13 on: 2011-03-07 17:14:12 »
(I just realized that Feedback was a weird place for this. Isn't there/shouldn't there be a request forum?)

Good news! I found where Mega-All is handled and how it's handled. Here's the way it looks:

At some arbitrary point after equipping a materia the game loops through ALL the equipped materia and sees if one is a mega all. It does this a-like so:

Code: [Select]
For x = 0 to 15
     HandleMegaAll( EquippedMateria(x) );
Loop

void HandleMegaAll ( dword x )
{
    If ( (x AND 15) != 4 ) ;Materia is not type X4
        exit;
    ...
}

A little odd to add the check inside the function that handles the MegaAll. Anyway, inside this loop if it DOES find a Mega-All, then it will begin assigning all magics (BIG NOTE ON THIS LATER!!) and applicable commands the ability to be "Alled" X number of times depending on its AP Level (unlike its AP Level Stat. That could be changed, but not easily).
It then begins looping through the 56 allowed magics (yes, that's 56! Not 54 like the menu offers! This means that the Character data can store 2 extra magics than the menu allows! Now if only someone would figure out how to extend the menu) and adds (note on that at the bottom) the "All x [AP Level]" flag to them. It will then loop through the Characters Battle Menu to add [AP Level] to its "All" property. Then it does the most heinous thing. It calls the "Put command" function using Slash-All in the position Attack should be in! :O There are two things I can think to do about this.

First of all, and most simply. We can easily bypass this command reassign function. That would remove the "Slash-All" property from the Mega-All permanently. That's a VERY simple fix. You just have to use a Hex editor to change the value at 0x001CC449 from 74h, to EBh (unconditionally jumps over the replacement). There you go! No more Slash-All with Mega-All! It doesn't really fit into the spirit of Mega-All, but it's more Attack friendly. There have been some cases where I didn't want Slash-All even if I did want the Mega-All effect on other things.

Second, this will be much more complicated and I couldn't really "teach" anyone how to do it, we could check for the presence of one of the "Attack Replacers" and tell this function to NOT enable Slash-All if there is one. All it's doing now is checking if Slash-All exists in the top slot. If it doesn't then it will add it. Good news for advanced assembly editors is that this routine is very isolated (using no external variables) it could easily be replaced entirely by a call function followed by a bunch of nops. Here's what it looks like:

Code: [Select]
loc_5CD03C:
     mov     eax, ActiveCharData
     xor     ecx, ecx
     mov     cl, [eax + 4Ch]
     cmp     ecx, 1Ah             ;Slash-All's Index
     jz      short loc_5CD057     ;End of relevant function
     push    0
     push    18h
     call    AddBattleMenuAction
     add     esp, 8

loc_5CD057

Simple, right? This could be replaced by something like this:

Code: [Select]
loc_5CD03C:
     mov     eax, ActiveCharData
     xor     ecx, ecx
     mov     cl, [eax + 4Ch]
     push    ecx
     call    ConditionalAddSlashAll
     add     esp, 8
     nop (x6)
loc_5CD057

loc_XXX                           ;Some arbitrary location not being used
ConditionalAddSlashAll
     [esp manip]
     cmp     arg_0, 18h
     jl      Loc_YYY
     cmp     arg_0, 1Bh
     jg      Loc_YYY
     jmp     Loc_ZZZ
Loc_YYY
     push    0
     push    18h
     call    AddBattleMenuAction
loc_ZZZ
     retn

Then if the command for Slash-All, 2x-Cut, 4x-Cut, or Flash already exists in place of Attack, Slash-All would not be added. I'll develop this more later.
I wonder if this could be integrated into Aali's modifications like my MDef bug fix was.


NOTE: It would seem that the Mega-All "All" stacks on magics. However, the player would NEVER SEE THIS unless they cheated to add level 1 Mega-Alls in their inventory, or did the multiple Mega-All glitch with Vincent at the bottom of North Crater. Alls are limited to performing it 5 times. When a Mega-All is Mastered it is level 5 so it will add 5 "All" times to all the magics. Someone try this out, I want to know if that's true or not. Equip two level 1 Mega-Alls and a non-Master Magic Magic Materia and see if it gives you 2x All those magics.

yarLson

  • *
  • Posts: 708
  • spr nrd
    • View Profile
Re: request for materia editor
« Reply #14 on: 2011-03-07 18:02:21 »
dood thanks a million for the super pro tip, works like a charm :D

Armorvil

  • *
  • Posts: 621
  • Working on : FFVII Total Grudge
    • View Profile
Re: request for materia editor
« Reply #15 on: 2011-03-07 19:14:10 »
NFITC1 rocks ^^

Anyways, I just tested it and it's as you said : the Mega-Alls stack (Lv4 + Lv1 = Lv5 Mega-All). Easy for me to test, since Mega-Alls are buyable in the mod I'm working on. And I'm gonna use your first fix, too :D

EDIT:

Level 5 is not even the maximum for Mega-All. I just achieved a x18 All effect. I wonder what the maximum is.
« Last Edit: 2011-03-07 19:38:52 by Armorvil »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: request for materia editor
« Reply #16 on: 2011-03-07 20:15:20 »
NFITC1 rocks ^^

Heh. Yeah. ;)

Anyways, I just tested it and it's as you said : the Mega-Alls stack (Lv4 + Lv1 = Lv5 Mega-All). Easy for me to test, since Mega-Alls are buyable in the mod I'm working on. And I'm gonna use your first fix, too :D

Buyable Mega-Alls? For shame. That's too much power. At least you're taking off the Slash-All. You could also change the command it gives by changing 0x001CC44E from 18h to the command index you want. Just know that if you add something that Mega-All would effect (like Steal) that you'll have to equip or unequip a materia AFTER equipping the Mega-All for it to take effect. Of course, we know you'll want to make it 14h anyway so it doesn't matter. ;)

Level 5 is not even the maximum for Mega-All. I just achieved a x18 All effect. I wonder what the maximum is.

Interesting! I never bothered to check this. I suppose multiple Fire=All combos on one character would have the same effect. I think the maximum might be higher than we could reach. Seeing as you can't go above 75 (15 Mastered Mega-Alls + Fire) even if you wanted, I suppose this question is specious. I always assumed that if you needed more than 5 Alls on one magic attack per character in one battle that you were doing something wrong. :D
If you want to know more, that info is stored at 0x00DBA5A0h + 2h + 8 * i. I can't find where that's even checked so there may not be a "limit" on it.

Armorvil

  • *
  • Posts: 621
  • Working on : FFVII Total Grudge
    • View Profile
Re: request for materia editor
« Reply #17 on: 2011-03-08 09:01:32 »
Quote
Quote
NFITC1 rocks ^^

Heh. Yeah. ;)

Such modesty !  ;D

Quote
Quote
Anyways, I just tested it and it's as you said : the Mega-Alls stack (Lv4 + Lv1 = Lv5 Mega-All). Easy for me to test, since Mega-Alls are buyable in the mod I'm working on. And I'm gonna use your first fix, too :D

Buyable Mega-Alls? For shame. That's too much power. At least you're taking off the Slash-All. You could also change the command it gives by changing 0x001CC44E from 18h to the command index you want. Just know that if you add something that Mega-All would effect (like Steal) that you'll have to equip or unequip a materia AFTER equipping the Mega-All for it to take effect. Of course, we know you'll want to make it 14h anyway so it doesn't matter. ;)

Too much power ?... ...Nah, it's just an upgrade over the normal All materias. At a point in my mod, you'll want to sell your mastered All to afford Mega-Alls for everyone, to free materia slots :)
And I'm too lazy to check what is command 14h at the moment (my money is on 4x Cut), but I won't change it. With your first fix, I consider Mega-All perfect ^^

On a side note, I'll try to make this fix on the PSX version, too (should be easy enough to search for the same string of bytes in FF7.exe, with a hex editor). Problem is, I don't know in which file these values are stored. Is it in SCUS_941.63 ? Or in a menu file ?... ...If nobody knows, I'll just search tonight and post my findings here - if no one beats me to it that is :P

EDIT:

OK, I understand why no one beat me to it. This particular string of bytes is nowhere to be found - and I looked everywhere  :(
« Last Edit: 2011-03-08 19:55:14 by Armorvil »

yarLson

  • *
  • Posts: 708
  • spr nrd
    • View Profile
Re: request for materia editor
« Reply #18 on: 2011-03-08 21:22:58 »
haha sorry about your fail but the PC version is best anyway :P

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: request for materia editor
« Reply #19 on: 2011-03-08 21:43:54 »
On a side note, I'll try to make this fix on the PSX version, too (should be easy enough to search for the same string of bytes in FF7.exe, with a hex editor). Problem is, I don't know in which file these values are stored. Is it in SCUS_941.63 ? Or in a menu file ?... ...If nobody knows, I'll just search tonight and post my findings here - if no one beats me to it that is :P

EDIT:

OK, I understand why no one beat me to it. This particular string of bytes is nowhere to be found - and I looked everywhere  :(

I knew that wouldn't work. PC and PSX have fundamentally different instruction sets. Just searching for a string of bytes or even an assembler block won't get you any closer to what you want.

Armorvil

  • *
  • Posts: 621
  • Working on : FFVII Total Grudge
    • View Profile
Re: request for materia editor
« Reply #20 on: 2011-03-08 22:06:43 »
That sucks.

haha sorry about your fail but the PC version is best anyway :P

Yeah, but the problem is you can't put the PC version in your PSP :P

Bosola

  • Fire hazard!
  • *
  • Posts: 1752
    • View Profile
    • My YouTube Channel
Re: request for materia editor
« Reply #21 on: 2011-03-09 18:37:38 »
The assembly-level algorithms on PC and PSX will not be the same, because the PC and MIPS compilers will work in different ways, and both applications access resources differently.

You should probably trace the code using the breakpoint I describe above.

xLostWingx

  • *
  • Posts: 801
  • No Comment
    • View Profile
    • FFVII Lost Wing Mod/Hacks
Re: request for materia editor
« Reply #22 on: 2011-03-09 20:08:47 »
I apologize in advance for my lack of understanding.

Quote from: Bosola
4xCut will be the first equipped attack, so I think that if you set a breakpoint on something writing 0xFF to 8009C89C, you'll find the function that decides what's affected by MegaAll, and isn't. If you find where this function gets its data, you'll be able to change these rules.
...
You should probably trace the code using the breakpoint I describe above.

So, is there somewhere I can learn to do this?  Or can I simply use a Gameshark code like 8009C89C 00FF (or 0001 or FFFF, what would I stick here??).  Is 8009C89C what I want, or were you just using that to point someone in the right direction.  Sorry, but this all seems to have gone right over my head.

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: request for materia editor
« Reply #23 on: 2011-03-09 21:01:37 »
OK. In the NTSC PSX build's memory, there's an array of ten 0x6-long elements that describe the properties of each attack

You sure it's ten and not 10h? On the PC it's 10h.

...can I simply use a Gameshark code like 8009C89C 00FF...

That would likely blank out your attack command entirely. It's not really the right way to go about this either. The first command is never nulled like that. It's forcibly replaced by a function called by materia types 12h and always set to 01 otherwise. You also can't "All" it, but you can set it to Absorb MP/HP, Steal as Well, and Added Cut with a GS.
You want to check when it's set to 18h after equipping a Mega-All. That'll give you the place that this happens at.

Armorvil

  • *
  • Posts: 621
  • Working on : FFVII Total Grudge
    • View Profile
Re: request for materia editor
« Reply #24 on: 2011-03-09 21:22:39 »
Good luck LW, I'm right behind you ;D