Users browsing this thread: 2 Guest(s)
Shock Ability

#45
Posts: 617
Threads: 49
Thanks Received: 0
Thanks Given: 5
Joined: Feb 2017
Reputation: 25
Status
None
So, with RAM settings, there are RAM settings that remain constant, and RAM settings that get re-written and cleared at regular intervals. There are 2 reasons that GrayShadows chose $3F2F for this code:
1. It gets cleared at the end of every battle. The exception for this is the Final Battle, which has special code to clear the byte between tiers. When I looked at "what is different about the air force brigade", it struck me that it's one of only 4 battles in the game I could think of where the battle doesn't end when enemies are defeated. I am making a HUGE assumption here, which is that it MIGHT be calling the line of code that clears bytes between Final Battle tiers. In looking through the ASM, that's the only only section of code that looked like it might have an error in it.

2. Only half the byte is used. Here's a quick crash course:

Each byte contains a number 00-FF (hexadecimal value. 0-9 is the same, A=10, B=11 ... F =15). For many places in FF6 though, they use a shorthand on a byte that treats it as a flag instead of as a number. This allows them to track up to 8 different binary settings on the same byte. The following values are mapped:
1 = 01 5 = 10
2 = 02 6 = 20
3 = 04 7 = 40
4 = 08 8 = 80
By doing it this way, every combination of 8 has a unique value. if 1, 2, and 6 are set to yes, then the byte reads "23".

The Desperation Attack byte is mapped like this:
Party Characters that have used a desperation attack: (values 1-4)
Character 1 = 01
Character 2 = 02
Character 3 = 04
Character 4 = 08

GrayShadows added this
Party Characters that have used Shock: (values 5-8)
Character 1 = 10
Character 2 = 20
Character 3 = 40
Character 4 = 80

Anyway, here's what I think might be happening. In the final battle, characters are allowed to use a Desperation Attack once per tier, because there is code that comes and zeroes out the first digit of the byte (TRB $3F2F). GrayShadow's code tells it to also zero out the second digit, allowing Shock to also be used again. However, I believe he made 2 typos.
1. In an early version of his code, he used $3F2E (the summon byte) instead of $3F2F (the desperation attack byte). I think he forgot to change this 2E to a 2F when he made that changeover.
2. He mistyped the first number, writing $2F2E instead of $3F2E.

$2F2E, unfortunately, is one of those static RAM options that doesn't get changed or re-written. It probably doesn't even follow the 8-value format. So zeroing out the 2nd digit on this value is what we would call "corruption". Either way, this RAM byte is only read during the battle initialization, so you wouldn't know there was a problem until you hit a tiered battle, finished it, and then loaded the next one. Also key to this is that fixing the ROM's code and then loading up a savestate or a save file won't change anything. The problem is that the RAM byte is corrupted. You need to load a save file from BEFORE the byte got corrupted, play through the Air Force battle again, and then see if you have the trouble.

As for why this can't be reproduced, keep in mind that this code tracks Shock usage by the character's party placement. If Shadow/Leo was character 1, and your next test had him as character 2, you might get different results.

I'm happy to help break down what I think the issue might be, but understand that with custom code requests, it is ultimately up to YOU to do the testing. GrayShadows is a great guy, but he didn't need to code this in the first place. He's certainly not using it in his own hack, and I am not using it in mine. If it's not working after this, read back through this thread and see if what you've learned sparks any other ideas of where things might be going wrong.


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  
[-] The following 2 users say Thank You to PowerPanda for this post:
  • Turbotastic (09-10-2018), Warrax (09-10-2018)



Messages In This Thread
Shock Ability - by Lightning - 05-22-2018, 01:48 AM
RE: Shock Ability - by madsiur - 05-22-2018, 02:34 AM
RE: Shock Ability - by Lightning - 05-22-2018, 11:16 AM
RE: Shock Ability - by ShadowDreamer - 05-23-2018, 12:48 AM
RE: Shock Ability - by Turbotastic - 05-25-2018, 06:18 PM
RE: Shock Ability - by Tenkarider - 05-24-2018, 11:41 AM
RE: Shock Ability - by GrayShadows - 05-26-2018, 11:15 AM
RE: Shock Ability - by Turbotastic - 05-27-2018, 04:19 PM
RE: Shock Ability - by Lightning - 05-27-2018, 04:33 PM
RE: Shock Ability - by madsiur - 05-27-2018, 05:43 PM
RE: Shock Ability - by Lightning - 05-27-2018, 10:52 PM
RE: Shock Ability - by madsiur - 05-28-2018, 01:33 AM
RE: Shock Ability - by GrayShadows - 05-31-2018, 07:32 PM
RE: Shock Ability - by Lightning - 05-31-2018, 08:46 PM
RE: Shock Ability - by GrayShadows - 06-01-2018, 10:33 AM
RE: Shock Ability - by Lightning - 06-01-2018, 01:51 PM
RE: Shock Ability - by Warrax - 06-01-2018, 03:37 PM
RE: Shock Ability - by GrayShadows - 06-01-2018, 04:26 PM
RE: Shock Ability - by Lightning - 06-01-2018, 10:26 PM
RE: Shock Ability - by Turbotastic - 06-02-2018, 09:21 AM
RE: Shock Ability - by Lightning - 06-02-2018, 10:15 AM
RE: Shock Ability - by dn - 06-02-2018, 01:53 PM
RE: Shock Ability - by Turbotastic - 06-02-2018, 07:21 PM
RE: Shock Ability - by Lightning - 06-02-2018, 08:35 PM
RE: Shock Ability - by GrayShadows - 06-05-2018, 09:38 PM
RE: Shock Ability - by Lightning - 06-05-2018, 10:38 PM
RE: Shock Ability - by Lightning - 07-10-2018, 06:37 PM
RE: Shock Ability - by Lightning - 09-06-2018, 12:28 AM
RE: Shock Ability - by Gi Nattak - 07-10-2018, 07:35 PM
RE: Shock Ability - by Lightning - 07-10-2018, 11:05 PM
RE: Shock Ability - by Lightning - 07-19-2018, 03:52 PM
RE: Shock Ability - by GrayShadows - 07-20-2018, 12:53 AM
RE: Shock Ability - by Warrax - 07-20-2018, 01:24 AM
RE: Shock Ability - by PowerPanda - 07-20-2018, 12:19 PM
RE: Shock Ability - by GrayShadows - 07-20-2018, 12:26 PM
RE: Shock Ability - by Lightning - 07-20-2018, 05:44 PM
RE: Shock Ability - by Warrax - 07-20-2018, 05:56 PM
RE: Shock Ability - by Lightning - 07-20-2018, 05:58 PM
RE: Shock Ability - by PowerPanda - 09-10-2018, 10:53 AM
RE: Shock Ability - by Lightning - 09-10-2018, 01:01 PM
RE: Shock Ability - by PowerPanda - 09-10-2018, 01:37 PM
RE: Shock Ability - by Lightning - 09-10-2018, 01:42 PM
RE: Shock Ability - by PowerPanda - 09-10-2018, 02:13 PM
RE: Shock Ability - by Lightning - 09-10-2018, 03:20 PM
RE: Shock Ability - by PowerPanda - 09-10-2018, 04:22 PM
RE: Shock Ability - by Lightning - 09-10-2018, 06:44 PM
RE: Shock Ability - by PowerPanda - 09-10-2018, 07:46 PM
RE: Shock Ability - by Lightning - 09-10-2018, 09:03 PM
RE: Shock Ability - by madsiur - 09-10-2018, 09:31 PM
RE: Shock Ability - by Lightning - 09-10-2018, 09:41 PM
RE: Shock Ability - by PowerPanda - 09-10-2018, 10:35 PM
RE: Shock Ability - by Subtraction - 09-11-2018, 02:16 AM
RE: Shock Ability - by Lightning - 09-11-2018, 03:57 AM
RE: Shock Ability - by Warrax - 09-11-2018, 08:39 AM
RE: Shock Ability - by madsiur - 09-11-2018, 10:52 AM
RE: Shock Ability - by PowerPanda - 09-11-2018, 09:15 AM
RE: Shock Ability - by Lightning - 09-11-2018, 03:47 PM
RE: Shock Ability - by PowerPanda - 09-11-2018, 06:28 PM
RE: Shock Ability - by Lightning - 09-11-2018, 06:47 PM

Forum Jump:

Users browsing this thread: 2 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite