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

#31
Posts: 175
Threads: 11
Thanks Received: 10
Thanks Given: 8
Joined: May 2013
Reputation: 13
Status
Well-Fed
Per the other thread, TA DA. Shock usable once (PER CHARACTER!) per battle.

I can't imagine you're giving Shock to more than one character, but it makes the patch a little more versatile/extensible for other people's use. Uses the upper nibble of $3F2E in battle; the lower nibble tracks whether or not a character has used an esper. $3F2F could also have been used, as it uses the low nibble to track whether or not a character has used a Desperation Attack.

Code:
hirom
; header

; Allow Shock only once per battle

; Defines
!Freespace_1 = $C2A65A              ; 26 bytes, or 68 total
!Shock_ID = $1B

org $C2171A
orgShock:   JMP newShock
           NOP
       
org $C24A62
           JSR finalShock          ; Adding a jump for an extra TRB so Shock is usable
                                   ; on each tier of the final battle
       
org $C252C6
           LDX #$0008
           CMP.l c2_table1,X       ; Moved table to free space because it's being expanded        
       
org $C252D2
           JSR (c2_table2,X)       ; Moved table to free space because it's being expanded
           
org $C2531B
C2531B:                             ; Setting label for branch below to Magic/Lore code            
           
org $C252E9
; Using space cleared by moving two expanded tables
dis_Shock:  LDA $3018,Y             ; Get character bit
           ASL #4                  ; And shuffle it into the high nibble
           BIT $3F2E               ; Check if this character has used Shock
           BNE C2531B              ; Branch and set carry if so
           RTS                     ;
       
       
org !Freespace_1
; New function adds bit check on Shock            ; 15 Bytes
newShock:   LDA $3018,Y             ; Get character bit
           ASL #4                  ; and shuffle it into the high nibble
           TSB $3F2E               ; Set bit 7 of $3F2F to show that Shock has been used
           PHX : TYX
           INC $2F30,X             ; Set character's menu to be redrawn
           PLX
           LDA #$82                ; ("Megahit" spell, which is what has Shock's data)
           JMP $1720               ; (go set that as spell/animation)
           
finalShock: TRB $3F2F               ; Make eligible for a Desperation attack
           ASL #4                  ; Shuffle bit into high nibble
           TRB $2F2E               ; And make eligible for another Shock
           RTS
           
; Two tables moved to make room to expand them
c2_table1:  db $03, $0B, $07, $0C                 ; 9 Bytes
           db $17, $02, $06, $00
           db !Shock_ID

c2_table2:  dw $5326, $5322, $531D, $5314         ; 18 Bytes
           dw $5314, $5314, $5310, $5310
           dw dis_Shock  

Like all my code lately, it seems, it's not SUPER heavily tested, but so far it works the way it's supposed to. I haven't actually checked the code that reallows Shock for successive tiers of the final battle, but I can't see why it WOULDN'T work as written.

ETA: Oh, and yeah, the original patch would definitely conflict with all three of those, Gi Nattak, some of them game-breakingly.


Current Project: FF6: Tensei | Discord ID: TristanGrayse
  Find
Quote  
[-] The following 3 users say Thank You to GrayShadows for this post:
  • madsiur (07-20-2018), PowerPanda (07-20-2018), Warrax (07-20-2018)

#32
Posts: 208
Threads: 3
Thanks Received: 0
Thanks Given: 8
Joined: May 2013
Reputation: 0
Status
None
Your enthusiasm for coding Assembly is really appreciated GrayShadow, you rock!



  Find
Quote  

#33
Posts: 617
Threads: 49
Thanks Received: 0
Thanks Given: 5
Joined: Feb 2017
Reputation: 25
Status
None
I checked this against the Resilient Morph patch, and it looks like it will be compatible. Resilient Morph uses $3F30.

The wildcard is Gogo, as always. Here would be my testing plan, if I were using this.
1. Set Shock as a command that can be used by Gogo.
a. Use Shock with one character.
b. Confirm that it can still be used by Gogo.
c. Start a second battle and confirm this works in reverse.

2. Set shock to be a mimicable command by Gogo, then Mimic it.
a. Did it work, or was it blocked out?
b. Was 3F2E changed?
b. If so, did it write to the original character, or to Gogo?
c. Was Gogo able to mimic Shock, and then use it again on his next turn?


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  

#34
Posts: 175
Threads: 11
Thanks Received: 10
Thanks Given: 8
Joined: May 2013
Reputation: 13
Status
Well-Fed
I can't see scenario A breaking things; Gogo using Shock as a command should be fine, because it'll set his specific bit in th e upper nibble of $3F2E. I'd have to flow through Mimic to check scenario B, though, but I thiiiiiiink it would stop him from Shocking on his own if he mimic'd it first.


Current Project: FF6: Tensei | Discord ID: TristanGrayse
  Find
Quote  

#35
Posts: 313
Threads: 20
Thanks Received: 0
Thanks Given: 1
Joined: Dec 2017
Reputation: 2
Status
None
Ok, so I did some of the testing suggested by PowerPanda. The good news is that Leo's Shock ability seems to work flawlessly without interference from Gogo. If Gogo uses the shock command, it will not stop Leo from then using it. The bad news is that Gogo has unlimited uses with the Shock command. Somehow, this patch does not seem to apply to Gogo at all. I guess the shock ability could be disabled with Gogo altogether if that is easy to accomplish (similar to how he cannot morph). I noticed that for some reason, the throw command does not show up on Gogo's list anymore despite the fact I have added this ability to Setzer in my mod (since there is no more Shadow). Perhaps the throw command will re-appear in Gogo's list if the Shock command goes away, thus killing two bugs with one stone. I don't mind the Shock command being completely unique to Leo. Maybe Leo is just so awesome that nobody can copy his ability. Tongue
  Find
Quote  

#36
Posts: 208
Threads: 3
Thanks Received: 0
Thanks Given: 8
Joined: May 2013
Reputation: 0
Status
None
I think there's a graphical limit to the amount of commands listed in Gogo's status screen, you probably reached the maximum hence not seeing the one that goes beyond that limit (and also causes a glitch in the status screen of any character at some point during the game, when getting new characters (which add their respective command to Gogo's command list)). If you remove one or two commands from the list, Throw should appear again.



  Find
Quote  

#37
Posts: 313
Threads: 20
Thanks Received: 0
Thanks Given: 1
Joined: Dec 2017
Reputation: 2
Status
None
(07-20-2018, 05:56 PM)Warrax Wrote: I think there's a graphical limit to the amount of commands listed in Gogo's status screen, you probably reached the maximum hence not seeing the one that goes beyond that limit. If you remove one command from the list, Throw should appear again.

That was my exact thought as well, so I figure if we just remove the Shock command from his list, the throw ability will come back. Also, that will prevent GrayShadows from having to fix the shock command with Gogo and just keep it unique to Leo.
  Find
Quote  

#38
Posts: 313
Threads: 20
Thanks Received: 0
Thanks Given: 1
Joined: Dec 2017
Reputation: 2
Status
None
(06-05-2018, 09:38 PM)GrayShadows Wrote: Let me know if you have any issues with it, but it should be working fine.

I found a bug. The hack works as it should until the battle with the Airforce aboard the airship (while trying to land on the floating continent for the first time).  It is at this point that the once per battle resctiction for the Shock command no longer applies, and Leo can use it as many times as he pleases. The hack is disabled in the very first battle against the Sky armors and Spit fires. Something about this particular moment in the game disables Leo's one-shock per battle code.  Any ideas?

Edit:  Ok, so this bug is odd.  When I fought another battle back on land, Leo's shock code worked. Then I reset my game, went to the Veldt and fought another battle, and the graphical glitch was back!  I am referring to the bug in which the window box theme in-battle is a random theme that doesn't match the rest of the boxes.  In other words, the box that says "Shock" during the battle when Leo uses his ability is some random theme from the game and not the default blue theme I have...

Edit #2: I am going to have to put a pause on my playthrough of the mod until this hack is fixed.  It is just far too buggy as is!  I hope someone can get to the bottom of this sooner rather than later, so I can get back to my playthrough!

Edit #3: I also confirmed that these major bugs occur without any other patches applied on a 1.0 or 1.1 ROM of FF3.  So, this is not a conflict.
  Find
Quote  

#39
Posts: 617
Threads: 49
Thanks Received: 0
Thanks Given: 5
Joined: Feb 2017
Reputation: 25
Status
None
Sounds like we created another Sketch Bug! Laugh 

I don't know the source of the Gogo getting unlimited Shocks bug, but I wonder if the Air Force battle runs the Final Battle Tier Transition code? If it does, there are 2 other battles that I can think of that might run Tier Transition Code:
1. Barren Falls Rizopas Battle
2. Sr. Behemoth
Can anyone else think of a time where you have to do a 2nd battle without exiting the first one?

Anyway, in the Final Battle tier transition code, there is a line that I'm almost certain is wrong (marked with ***):

Code:
finalShock: TRB $3F2F               ; Make eligible for a Desperation attack
           ASL #4                  ; Shuffle bit into high nibble
***         TRB $2F2E               ; And make eligible for another Shock
           RTS

When $2F2E is called elsewhere in C2, it is distinguishing between the Short Command Window and the normal one.
Code:
C2/2472: AD 4D 1D     LDA $1D4D      (from Configuration menu: Battle Mode, Battle Speed,
                                     Message Speed, and Command Set)
C2/2475: 30 03        BMI $247A      (branch if "Short" Command Set)
C2/2477: 9C 2E 2F     STZ $2F2E      (otherwise, it's "Window")

My best guess is that the line should be "TRB $3F2F". However, I am nowhere near as good at ASM as GrayShadows.

The other think you can try is to write Shock to a different bit. Right now it's using the top half of the Desperation Attack bit ($3F2F). You could change all instances of that to the Summon Bit ($3F2E) and try again.

Also, as an FYI, between when GrayShadows wrote that patch for you and now, he's started a new job that is taking everything he has to give. He will probably be out of the scene for a little while.


Projects:
FFVI: Divergent Paths (Completed) - a complete storyline and gameplay hack of FF6 that adds Leo as a playable character
  Find
Quote  

#40
Posts: 313
Threads: 20
Thanks Received: 0
Thanks Given: 1
Joined: Dec 2017
Reputation: 2
Status
None
(09-10-2018, 10:53 AM)PowerPanda Wrote: Sounds like we created another Sketch Bug! Laugh 

I don't know the source of the Gogo getting unlimited Shocks bug, but I wonder if the Air Force battle runs the Final Battle Tier Transition code? If it does, there are 2 other battles that I can think of that might run Tier Transition Code:
1. Barren Falls Rizopas Battle
2. Sr. Behemoth
Can anyone else think of a time where you have to do a 2nd battle without exiting the first one?

Anyway, in the Final Battle tier transition code, there is a line that I'm almost certain is wrong (marked with ***):

Code:
finalShock: TRB $3F2F               ; Make eligible for a Desperation attack
           ASL #4                  ; Shuffle bit into high nibble
***         TRB $2F2E               ; And make eligible for another Shock
           RTS

When $2F2E is called elsewhere in C2, it is distinguishing between the Short Command Window and the normal one.
Code:
C2/2472: AD 4D 1D     LDA $1D4D      (from Configuration menu: Battle Mode, Battle Speed,
                                     Message Speed, and Command Set)
C2/2475: 30 03        BMI $247A      (branch if "Short" Command Set)
C2/2477: 9C 2E 2F     STZ $2F2E      (otherwise, it's "Window")

My best guess is that the line should be "TRB $3F2F". However, I am nowhere near as good at ASM as GrayShadows.

The other think you can try is to write Shock to a different bit. Right now it's using the top half of the Desperation Attack bit ($3F2F). You could change all instances of that to the Summon Bit ($3F2E) and try again.

Also, as an FYI, between when GrayShadows wrote that patch for you and now, he's started a new job that is taking everything he has to give. He will probably be out of the scene for a little while.

So you are saying I could try changing "TRB $2F2E" to "TRB $3F2F", and it might solve the window issue?  As for your other suggestion, do you mean to only change the one instance of $3F2F in the new code to $3F2E? 

By the way, I also noticed that the shock code randomly works in certain battles, and stops working in other battles.  That is, after I pass the battle with Airforce (which seems to permanently glitch out Leo's Shock command).
  Find
Quote  



Forum Jump:

Users browsing this thread: 2 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite