Author Topic: Grimoire LD's Notes, Patches, and Hacks (Dark Knight/Paladin Swap In Battle!)  (Read 78631 times)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
While getting ready to put the finishing touches on Sing (Harp Dependent) I noticed that the Slot command, A6 I was using didn't necessarily correspond to the stored weapon selection. Instead that uses some numerical slot rather than place in data.

Now I think I'm just missing this numerical slot command, I don't recall seeing it anywhere. Do you happen to know what the other Slot commands are Chillyfeez? In this case it would be in regards to placement, not order from 7E2000. Because as it stands now Sing would only reliably be able to be used if you have the Singer in a correct slot in data which corresponds to where his weapon is. (For instance, I have Edward in Slot3, but I only have two characters at the moment, so his data doesn't read the area correctly). If Edward is in any of the normal slots, then its fine, but when he's not the command doesn't work (it will read 00's into the Magic Routine, which is just "Nothing Happened".


chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
I'm having trouble visualizing what you're saying. Can you post the code for the command as is so far?

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Yeah, it was... nearly 4 AM when I wrote that and needed to head to bed, haha! Let me get the code for you then. It's a very simple piece of work, actually...

Code: [Select]
$03/E900 A5 A6 LDA $A6    [$00:00A6] A:0000 X:0010 Y:0000 P:envMxdizc - Load Caster's Current Slot into A.
$03/E902 AA TAX A:0000 X:0010 Y:0000 P:envMxdiZc - Transfer A to X.
$03/E903 D0 1F BNE $1F    [$E924] A:0000 X:0000 Y:0000 P:envMxdiZc - If not 00 branch to next Slot Check.
-------------------------------------------------------------------------------------------------------------------
$03/E905 7B TDC A:0000 X:0000 Y:0000 P:envMxdiZc - Set A to 00 (It's all I've ever seen this instruction used for)
$03/E906 AA TAX A:0000 X:0000 Y:0000 P:envMxdiZc - Transfer A to X.
$03/E907 E8 INX A:0000 X:0000 Y:0000 P:envMxdiZc - +1 X
$03/E908 E8 INX A:0000 X:0001 Y:0000 P:envMxdizc - +1 X
$03/E909 7B TDC A:0000 X:0002 Y:0000 P:envMxdizc - Clear A (from when returning from loops.)
$03/E90A AD 80 26 LDA $2680  [$7E:2680] A:0000 X:0002 Y:0000 P:envMxdiZc - Load Character ID.
$03/E90D C9 60 CMP #$60 A:0085 X:0002 Y:0000 P:eNvMxdizc - Is it below 60? (Thereby, left handed)
$03/E90F 90 08 BCC $08    [$E919] A:0085 X:0002 Y:0000 P:envMxdizC - Branch to Left Handed version of this.
$03/E911 BD D9 32 LDA $32D9,x[$7E:32DB] A:0085 X:0002 Y:0000 P:envMxdizC - Load Equipped Weapon Right Hand into A.
$03/E914 CD B3 26 CMP $26B3  [$7E:26B3] A:0044 X:0002 Y:0000 P:envMxdizC - Is it the same as the Equipped Weapon according to Main Stats?
$03/E917 F0 05 BEQ $05    [$E91E] A:0044 X:0002 Y:0000 P:envMxdiZC - If so branch to Magic Implement.
----------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E919 CD B5 26 CMP $26B5  [$7E:26B5] A:0040 X:0002 Y:0000 P:eNvMxdizc - Does the weapon match what is in the Left Hand?
$03/E91C D0 E9 BNE $E9    [$E907] A:0040 X:0002 Y:0000 P:envMxdizC - If not, loop back to above branch.
-------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E91E E8 INX A:0044 X:0002 Y:0000 P:envMxdiZC +1 to X.
$03/E91F BD D9 32 LDA $32D9,x[$7E:32DC] A:0044 X:0003 Y:0000 P:envMxdizC - Load A from Equipped Weapon+1 (thereby the Spell)
$03/E922 80 23 BRA $23    [$E947] A:0001 X:0003 Y:0000 P:envMxdizC - Branch to Finishing Routine.
------------------------------------------------------------------------------------------------------------------------------------------
$03/E924 E0 80 00 CPX #$0080 A:0080 X:0080 Y:0000 P:envMxdizc - Is it 0080? (Slot 2)
$03/E927 D0 05 BNE $05    [$E92E] A:0080 X:0080 Y:0000 P:envMxdiZC - If not, branch to next Slot Check.
$03/E929 A2 08 00 LDX #$0008 A:0080 X:0080 Y:0000 P:envMxdiZC - Load 0008 into X (to keep pace with the location of the weapons. 8 bytes per character 4 bytes per hand.)
$03/E92C 80 D9 BRA $D9    [$E907] A:0080 X:0008 Y:0000 P:envMxdizC - Loop back to main finding routine above.
----------------------------------------------------------------------------------------------------------------------------------------------------
$03/E92E E0 00 01 CPX #$0100 A:0100 X:0100 Y:0000 P:envMxdizC - Is it 0100? (Slot 3)
$03/E931 D0 05 BNE $05    [$E938] A:0100 X:0100 Y:0000 P:envMxdiZC - If not branch to next Slot Check.
$03/E933 A2 10 00 LDX #$0010 A:0100 X:0100 Y:0000 P:envMxdiZC - Load 0010 into X.
$03/E936 80 CF BRA $CF    [$E907] A:0100 X:0010 Y:0000 P:envMxdizC - Loop back to main finding routine.
---------------------------------------------------------------------------------------------------------------------------------------------
03/E938 E0 80 01 CPX #$0180 A:0180 X:0180 Y:0000 P:envMxdizC - Is it 0180? (Slot 4)
$03/E93B D0 05 BNE $05    [$E942] A:0180 X:0180 Y:0000 P:envMxdiZC - If not branch to next Slot Check.
$03/E93D A2 18 00 LDX #$0018 A:0180 X:0180 Y:0000 P:envMxdiZC - Load 0018 into X.
$03/E940 80 C5 BRA $C5    [$E907] A:0180 X:0018 Y:0000 P:envMxdizC - Loop back to main finding routine.
-----------------------------------------------------------------------------------------------------------------------------------------
$03/E942 A2 20 00 LDX #$0020 A:0200 X:0200 Y:0000 P:envMxdizC Load 0020 into X  (Slot 5)
$03/E945 80 C0 BRA $C0    [$E907] A:0200 X:0020 Y:0000 P:envMxdizC  - Loop back to main finding routine.
$03/E947 8D D2 26 STA $26D2  [$7E:26D2] A:0001 X:0003 Y:0000 P:envMxdizC - Store Spell in Next Action to take.
$03/E94A 4C 3E CD JMP $CD3E  [$03:CD3E] A:0001 X:0003 Y:0000 P:envMxdizC - Jump to Magic Routine.


I hope that makes it a little clearer. The entire method of this routine is to look for the proper slot the character is in, calculate the amount of extra X that is needed to reach the weapon to go through the main loop at the start.

7E32DA is composed of 40 Bytes (In decimal) 4 for each hand. Now the order doesn't correspond to ID Slot (as in 7E2000-2080-etc.) as most matters are but is dependent on the location slot and will change location in that regards. The problem is I'm not sure what that corresponding might be... Unless... hmm...

352F appears to be my answer in this case. Let's try it out...

 :edit: That did the trick! Now my only issue is whether the Comparisons to Equipped Weapon is really necessary. If I get rid of those bytes I might be able to work in some FFIII like functionality by looking at the User's Will and using the spell twice as a result.

 :edit: They are not. That should give me enough room at the end to do something special with this.
« Last Edit: January 12, 2014, 01:08:26 PM by Grimoire LD »

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
So... You're good, then?

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Alright! Now that this debacle is done (it wasn't really a debacle, I learned a lot about properly using loops and where to look for assigned slots) I can release the FFIII Sing patch.

First off the code, it differs fairly significantly than what was in the last post in some key sections that were shortened when old pieces didn't work to what the new code needed.

There was one piece I couldn't working optimally and that's because of the lack of space to do so, in FFIII NES, an ability of the Bard is Cheer which raises Atk based on the amount of Cheers used. Now unfortunately there isn't enough space for me to have this run through all of the slots, so I had to go with having it only raise the Singer's Attack by 5 each time he or she sings, I couldn't get the reference to FFIII NES to fit in the amount of space I had left to use, unfortunately.

I'll post the finalized code and patch soon enough.

Yeah, I should be fine. I think.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
I hate to say it, but this is probably one of the only routines I've made that I am not 100% proud of. I really wanted to get an effect similar to FFIII Cheer, but I didn't have the space required for a look at every character's battle data with loops. Regardless the heart of this will be what will make a future "Magic Weapons" work. I just need to re-point the Fight Command to either empty space or another command, load in a jump to the fight routine and then plug in what I used for much of the Sing-Harp Routine, and that's that. That will be my next endeavor though.

Sing-Harp Dependent Code

Code: [Select]
$03/E900 AD 2F 35 LDA $352F  [$7E:352F] A:0003 X:0010 Y:0000 P:envMxdizc - Load Singer's Slot into A.
$03/E903 AA TAX A:0003 X:0010 Y:0000 P:envMxdizc - Transfer A to X.
$03/E904 D0 16 BNE $16    [$E91C] A:0000 X:0000 Y:0000 P:envMxdiZc - If not Slot 0 (Middle) branch to Slot Checking
$03/E906 7B TDC A:0000 X:0000 Y:0000 P:envMxdiZc - Set A to 00.
$03/E907 AA TAX A:0000 X:0000 Y:0000 P:envMxdiZc - Transfer A to X.
-------------------------------(Looping Point)-----------------------------------------------------------------
$03/E908 E8 INX A:0000 X:0000 Y:0000 P:envMxdiZc - +1 to X.
$03/E909 7B TDC A:0000 X:0001 Y:0000 P:envMxdizc - Set A to 00
$03/E90A AD 80 26 LDA $2680  [$7E:2680] A:0000 X:0001 Y:0000 P:envMxdiZc - Load Character's ID into A.
$03/E90D C9 60 CMP #$60 A:0085 X:0001 Y:0000 P:eNvMxdizc - Are they left handed?
$03/E90F 90 02 BCC $02    [$E913] A:0085 X:0001 Y:0000 P:envMxdizC - If so, branch to +4 X branch.
$03/E911 80 02 BRA $02    [$E915] A:0085 X:0001 Y:0000 P:envMxdizC - Branch to Spell Loading.
--------------------------------------------------------------------------------------------------------------------------------------------------
E8 E8 (+2 X) (This allows a left handed character to reach their weapon check.)
------------------------------------------------------------------------------------------------------------------------------------------------
$03/E915 E8 INX A:0085 X:0001 Y:0000 P:envMxdizC - +1 to X
$03/E916 E8 INX A:0085 X:0002 Y:0000 P:envMxdizC - +1 to X.
$03/E917 BD DA 32 LDA $32DA,x[$7E:32DD] A:0085 X:0003 Y:0000 P:envMxdizC - Load A from Character's Weapon Spell.
$03/E91A 80 20 BRA $20    [$E93C] A:009F X:0003 Y:0000 P:eNvMxdizC - Branch to +5 Power Branch.
-------------------------------------------------------------------------------------------------------------------------------------------------
$03/E91C C9 01 CMP #$01 A:0001 X:0001 Y:0000 P:envMxdizc - Is it Slot 2 (Top Spot)
$03/E91E D0 05 BNE $05    [$E925] A:0001 X:0001 Y:0000 P:envMxdiZC - If not branch to next Slot Check.
$03/E920 A2 08 00 LDX #$0008 A:0001 X:0001 Y:0000 P:envMxdiZC - Load 0008 into A (To reach Weapon Spell)
$03/E923 80 E3 BRA $E3    [$E908] A:0001 X:0008 Y:0000 P:envMxdizC - Loop back to Weapon Spell Loading
-------------------------------------------------------------------------------------------------------------------------------------------------
$03/E925 C9 02 CMP #$02 A:0002 X:0002 Y:0000 P:envMxdizC - Is it Slot 3? (Bottom Spot)
$03/E927 D0 05 BNE $05    [$E92E] A:0002 X:0002 Y:0000 P:envMxdiZC - If not, branch to next Slot Check.
$03/E929 A2 10 00 LDX #$0010 A:0002 X:0002 Y:0000 P:envMxdiZC - Load 0010 into A (To reach Weapon Spell)
$03/E92C 80 DA BRA $DA    [$E908] A:0002 X:0010 Y:0000 P:envMxdizC - Loop back to Weapon Spell Loading.
-----------------------------------------------------------------------------------------------------------------------------------------------
$03/E92E C9 03 CMP #$03 A:0003 X:0003 Y:0000 P:envMxdizC - Is it Slot 4? (Upper Middle)
$03/E930 D0 05 BNE $05    [$E937] A:0003 X:0003 Y:0000 P:envMxdiZC - If not branch to next Slot Check.
$03/E932 A2 18 00 LDX #$0018 A:0003 X:0003 Y:0000 P:envMxdiZC - Load 0018 into A (To reach Weapon Spell)
$03/E935 80 D1 BRA $D1    [$E908] A:0003 X:0018 Y:0000 P:envMxdizC - Loop  to Weapon Spell Loading.
--------------------------------------------------------------------------------------------------------------------------------------------
$03/E937 A2 20 00 LDX #$0020 A:0004 X:0004 Y:0000 P:envMxdizC - Load 0020 into X (To reach Weapon Spell)
$03/E93A 80 CC BRA $CC    [$E908] A:0004 X:0020 Y:0000 P:envMxdizC - Loop to Weapon Spell Loading.
---------------------------------------------------------------------------------------------------------------------------------------------
$03/E93C 48 PHA A:009F X:0003 Y:0000 P:eNvMxdizC - Push A onto Stack.
$03/E93D AD 9D 26 LDA $269D  [$7E:269D] A:009F X:0003 Y:0000 P:eNvMxdizC - Load Singer's Physical Attack into A.
$03/E940 69 05 ADC #$05 A:0066 X:0003 Y:0000 P:envMxdizC - Add + 05
$03/E942 8D 9D 26 STA $269D  [$7E:269D] A:006C X:0003 Y:0000 P:envMxdizc - Store A in Singer's Physical Attack.
$03/E945 68 PLA A:006C X:0003 Y:0000 P:envMxdizc - Pull A from Stack (Spell Chosen)
$03/E946 8D D2 26 STA $26D2  [$7E:26D2] A:009F X:0003 Y:0000 P:eNvMxdizc - Store A in Next Action to Take.
$03/E949 4C 3E CD JMP $CD3E  [$03:CD3E] A:009F X:0003 Y:0000 P:eNvMxdizc - Jump to Magic Routine.
------------------------------------------------------------------------------------------------------------------------------------------

I made some space (was left with 5 spare bytes) but not enough, I'm afraid...



Enough about the future though, let's talk about now. This patch will make Sing:
A - Target All Allies.
B - Use a Spell dependent on the Harp Equipped (Note: If spells have 0 Power from the weapon they cannot be used successfully from the Item Menu, (there may be exceptions) but can be easily used for other purposes. Which is what this routine is built upon)
C - Will raise the Singer's Physical Attack by 5 each time you use Sing.

Now because FFIII is the theme, this tries its best to try and mimic the effects from the FFIII DS's Harps because of this there are now three new harps in replacement of two axes (will use the empty slot that was used as the Dark Crystal Sword in my other patch as well)


Sing Effect -
Madhura Harp - Casts Protect
Dream Harp - Casts Remedy (10% Max HP recovery)
Apollo Harp - Casts Shell
Loki Harp - Casts Haste
Lamia Harp - Casts Angelic(Music) - Restores a small amount of MP per cast.


Paladin Cecil will be able to Sing and equip Harps (only because I'm out of usable spots to give it to anyone else and Kain singing is a little silly...ier than Cecil.) and I plan on each of my patches being stackable.) so don't throw those Harps away when Edward leaves!

You will be able to get Loki Harps as Uncommon and Rare drops from Moon enemies. Full party Haste with no downside, can't complain with that, no?







« Last Edit: January 12, 2014, 07:59:28 PM by Grimoire LD »

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Grimoire LD's Notes, Patches, and Hacks (Patch-FFIII Style Sing in FFIV!)
« Reply #231 on: January 12, 2014, 11:47:16 PM »
Though not in reference in anything particular take this as more of a general response to your efforts as of late: In the words of Michael J. Fox: (during his appearance on Scrubs)

"I believe the words you're looking for are 'holy crap.'"

- So yeah - Holy crap dude! And of course I mean that in the best way possible! You =  :yabin:

I've been thinking that for a while but  what put me over was seeing your use of Fission for Backfire. I LOLed with that one: that was one of the first things I tried with FF4kster: only in my case it wsa an ability I was testing out with Palom to simulate his overreaching a bit. I took Sing and replaced the calls with Fire 1,2,3 and Fission - with responses of "Lame...", "I guess", "ALRIGHT!", & "uh-oh..."

So yeah - LOL  :childish:

That said, great job! Hopefully I'll be able to carve out a bunch more space in the ROM so you can really go nuts - see upcoming post on "Apropos..."  :wink:
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Patches, and Hacks (Patch-FFIII Style Sing in FFIV!)
« Reply #232 on: January 13, 2014, 11:26:22 PM »
Thanks LordGarmonde! I needed to finish up all of my planned major projects before... today came, and I succeeded and even threw in FFIII Sing for good measure. Starting from today (well now yesterday) though I have a punishing assortment of classes, American Literature then Environmental Sciences, then four hours later Teaching Techniques for the Classroom and eventually will need to do some on-site observation again. Tuesdays and Thursdays should be a bit of a relaxer though. I only have one class each those days which is World Literature 2. So... busier schedule than I've ever had. Likely don't expect me to see post too much on Mondays, hehe.

I have a scheme to get Magic Weapons working, something odd happens when that 352F value (Slot Value) is connected to normal attacks rather than skills and it's no longer accurate because of it. I'll have to take my Sing routine and make it look at a different pointer which refers to character's equipment rather than what they currently have equipped. Needles to say, my original plans for it didn't work out.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Grimoire LD's Notes, Patches, and Hacks (Patch-FFIII Style Sing in FFIV!)
« Reply #233 on: January 14, 2014, 02:32:29 AM »
That's quite the class-load; best of luck. I'll never hold against you not posting - you do more than your fair share, you've got big buffer built up.

As for you pointer problem - G.I. Joe says knowing is half the battle; there's a way to be found.  :finger:
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Patches, and Hacks (Patch-FFIII Style Sing in FFIV!)
« Reply #234 on: January 15, 2014, 01:09:57 AM »
Finally after hours of searching I located where the game in a default sense stores Weapon Info. in LoROM and draws it into RAM once battle begins!

This is excellent. Every other attempt to set up a semblance of sense with my Magic Weapons Routines failed Miserably, but now I have a firm starting point and an end point, with this I should even be able to improve my Sing-Harp Dependent. I just need to take the default Magic Weapon Routine as seen...

Code: [Select]
$03/EBDE BF 70 90 0F LDA $0F9070,x[$0F:9077] A:0007 X:0007 Y:0000 P:envMxdizc - Load A from 0F9070+X. (Spell's Power as designated by weapon)
$03/EBE2 8D EC 38 STA $38EC  [$7E:38EC] A:0001 X:0007 Y:0000 P:envMxdizc - Store A in 7E38EC. - Store A in Spell Power.
$03/EBE5 EE EB 38 INC $38EB  [$7E:38EB] A:0001 X:0007 Y:0000 P:envMxdizc - +1 to 7E38EB. - +1 to Ignore Accuracy. (Thereby ignoring the accuracy of the weapon spell)
$03/EBE8 A0 03 00 LDY #$0003 A:0001 X:0007 Y:0000 P:envMxdizc - Load 0003 into Y. (To get to the Spell)
$03/EBEB B1 80 LDA ($80),y[$7E:32E9] A:0001 X:0007 Y:0003 P:envMxdizc - Load A from Character's Hand Data - Spell.
$03/EBED 8D D2 26 STA $26D2  [$7E:26D2] A:0048 X:0007 Y:0003 P:envMxdizc - Store A in 7E26D2.
$03/EBF0 80 03 BRA $03    [$EBF5] A:0048 X:0007 Y:0003 P:envMxdizc - Branch to 03EBF5.
------------------------------------------------------------------------------------------------------------------------------------
$03/EBF2 EE 2A 35 INC $352A  [$7E:352A] A:0000 X:0002 Y:0000 P:envMxdiZC - +1 to 7E352A.
$03/EBF5 20 3E CD JSR $CD3E  [$03:CD3E] A:0000 X:0002 Y:0000 P:envMxdizC - Jump to Subroutine (Magic Call)
$03/EBFB F0 03 BEQ $03    [$EC00] A:0000 X:0680 Y:001A P:envMxdiZC - Branch if 00 to EC00.

Here. This accomplishes in roughly 30 (hex) bytes what it took me nearly double that to figure out. This is something I should have been looking at from the start. How to set it up is very simple when this is used as a template. Ignoring pointers, and all of that sorry business, all this formula will need to do this...


Check for character's handedness.
----------------------------------
If Right Hand - Read Character's Weapon
If 00 Return
-------------------------------
Reset Processor Status (Allows A to read two bytes)
Load Character's Weapon (+x to reach left hand)
LSR x3 = (Equals 8 times its value, lucky for us this section of rom stores items in 8 byte values!)
Add +03 to A
Transfer A to X
Load Address 0F9100+X (To reach Weapon Spell) into A
Store A in Next Action to take
Set Processor Status
Jump to Magic Routine.
-----------------------------------
If Left Handed read Weapon Number.
If it is 00 Return
------------------------------------
 branch to LSR routine above.

And this idea worked flawlessly! The code is so much cleaner and compact that I should be able to add a Slot Check to my previous Sing-Harp Dependent code.

It is late, tomorrow I have school, but I will leave you with a picture of my success...






Once I stopped looking for Pointers everything fell right into place. Expect a Weapon Magic Activates with Attack Patch tomorrow!
« Last Edit: January 15, 2014, 01:15:13 AM by Grimoire LD »

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Grimoire LD's Notes, Patches, and Hacks (Patch-FFIII Style Sing in FFIV!)
« Reply #235 on: January 15, 2014, 03:21:31 AM »
That school better look out for you - you continue to ace the course in kickassery over here :wink:

Enjoy your win; you earned it!

I was about to ask a follow up - but I don't have to: you nailed it  :banonsmash:

Different followup did come to mind: Certainly not a problem in this case (unless there's something you neglected to tell me) but how does the game interpret two handed weapons? (apologies if I missed the answer somewhere) Looking at your algorithm my first thought was "Hmm...so what about that Poison Axe...would that get read twice" which became "No, stupid - he said look at the character's handedness" - so then I'm left with "What about Edge & Yang, would they read twice?" If I gave Yang two Ice Claws and I wanted to build something off of that: not sure what, but I'm sure you could dream up something :P - But how would that work? I feel like I must be missing something because in trying to work it out I can't pinpoint the exact course of action:

I swear it was a simple question when I clicked "Reply..." For me to to try and work it out in my head I have your code split into 5 sections:

(ST = Start Turn), (RH = R-Hand Check), (LH = L-Hand Check), (CA = Calculate, etc.), & (ET = End Turn)

Would the order be:

Path A)   ST --> RH (True) --> CA --> ET
or
Path B)   ST --> RH (True) --> CA --> LH (True) --> CA --> ET
The actual code looks (to me) like Path A - but the description looks like Path B    me = :blits:
"Now I know; and knowing makes it even more confusing..."

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Grimoire LD's Notes, Patches, and Hacks (Patch-FFIII Style Sing in FFIV!)
« Reply #236 on: January 15, 2014, 03:53:43 AM »
So will this patch make it so that you:

* Cast instead of physical damage? (so, attacking with ice rod never causes physical damage and always casts Ice-1)
* Cast in addition to physical damage, always? (so attacking with the ice rod always causes physical damage and always casts Ice-1)
* Cast in addition to physical damage, sometimes? (so attacking with the ice rod always causes physical damage but may or may not cast Ice-1)
Let's dance!

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Grimoire LD's Notes, Patches, and Hacks (Patch-FFIII Style Sing in FFIV!)
« Reply #237 on: January 15, 2014, 04:18:01 AM »
A couple other things that came to mind:

Paladin Cecil will be able to Sing and equip Harps (only because I'm out of usable spots to give it to anyone else and Kain singing is a little silly...ier than Cecil.)

 - He does have his unused casting animation - maybe he was born to sing - perhaps that's where he's falling short with Rosa   :wink:

...and I plan on each of my patches being stackable.

- Just thinking about keeping all that organized hurt me in the brain-box: but quite sincerely I have no doubts you; but best of luck there all the same - and if I can somehow help I'd certainly like to  :happy:

Hopefully when I get the Exp/TNL mod going my hope is to leave you with more room than even you know what to do with - yes, I know it's not that much :tongue:

But I did have an idea: You're down to Cecil & Kain as the only ones with room left. What if skills were not fixed? FF5 popped into mind: << [Fight] / [Skill] / [Empty] / [Item] >> I'm certainly not suggesting going as far as that game did - but what if say in each town (maybe in the Training Room) - someone is hanging out with a unique skill to offer: something like "OK Kain - your voice is terrible - I say forget [Sing] - learn [Kick] instead - sound good? [Yes/No]"

I don't know - but I think it's a thought experiment worth the time. The pointer for the currently learned skill would have to be stored somewhere in the RAM, not sure where to most easily work it in - but Phoenix really went after that problem for the Shadow Data - and as to where exactly it failed if my mod doesn't bypass the problem I'd bet you could tie up that loose end.

- Another thought would be the storage points for the Event Flags; take out one of the Behemoth battles in Bahamut's Cave and there's a freebee - or hijack some of the code that checks the Flags and consolidate: 3 Behemoths (A,B,C) need only 8 index values to describe every combination (2^3 *) for if allowed to encounter them in any order: or only 4 if it must be A->B->C (how many are dead, 0,1,2,or 3?) - But then you only need one Byte for all 3 - there's always some way

* My brain refuses to memorize that: CP - Choices to the Power of People - 2 choices, 3 people - Instead I take "the scenic route..."
   all yes + all no = 2 & 3 singles = 5 & 3 pairs = 8  - thus leaving efficiency to be approximately  :sad:
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Patches, and Hacks (Patch-FFIII Style Sing in FFIV!)
« Reply #238 on: January 15, 2014, 07:56:01 AM »
That school better look out for you - you continue to ace the course in kickassery over here :wink:

Enjoy your win; you earned it!

I was about to ask a follow up - but I don't have to: you nailed it  :banonsmash:

Different followup did come to mind: Certainly not a problem in this case (unless there's something you neglected to tell me) but how does the game interpret two handed weapons? (apologies if I missed the answer somewhere) Looking at your algorithm my first thought was "Hmm...so what about that Poison Axe...would that get read twice" which became "No, stupid - he said look at the character's handedness" - so then I'm left with "What about Edge & Yang, would they read twice?" If I gave Yang two Ice Claws and I wanted to build something off of that: not sure what, but I'm sure you could dream up something :P - But how would that work? I feel like I must be missing something because in trying to work it out I can't pinpoint the exact course of action:

I swear it was a simple question when I clicked "Reply..." For me to to try and work it out in my head I have your code split into 5 sections:

(ST = Start Turn), (RH = R-Hand Check), (LH = L-Hand Check), (CA = Calculate, etc.), & (ET = End Turn)

Would the order be:

Path A)   ST --> RH (True) --> CA --> ET
or
Path B)   ST --> RH (True) --> CA --> LH (True) --> CA --> ET
The actual code looks (to me) like Path A - but the description looks like Path B    me = :blits:

I should have been clearer, that code above is drawn straight from the Item Routine in regards to Spell Weapons which was an initial inspiration but in the end my code turned out to be a... little different.

Ah, Ambidextrous would look at Right Hand. As in my original code for Sing-Dependent Harp it looks at 60 as the Dividing Line, no Left Handed ID goes up that high and no Right Handed character starts that low. It is indeed Path B. Check if Right Hand is Applicable, if not, Check Left Hand. (This is nothing new for FFIV, even the original code has Right Hand Priority in some cases, Edge with Boomerang in Right Hand for full damage from back-row with Katana in Left Hand comes immediately to mind. (At the end of this I'm going to need to Completely rewrite the tutorial rooms to make mention of all the new things, hehe.)

So will this patch make it so that you:

* Cast instead of physical damage? (so, attacking with ice rod never causes physical damage and always casts Ice-1)
* Cast in addition to physical damage, always? (so attacking with the ice rod always causes physical damage and always casts Ice-1)
* Cast in addition to physical damage, sometimes? (so attacking with the ice rod always causes physical damage but may or may not cast Ice-1)

This patch will make is so that it is C - Cast in Addition to Physical Damage, Sometimes (Either a straight 25% or possibly basing it on Wisdom in some way) What you see above was just a proof of concept to see if it would all fall together smoothly and it worked marvelously. After the successful "does it have magic" check it will be run through an RNG with a CMP 19 (25) and return if it reads more than 25. (Base 25 seems best, if its based on Wisdom the more Magically Apt characters could have it more, but it makes it only decent chances near end game.) then casts the spell if it succeeds.

A couple other things that came to mind:

Paladin Cecil will be able to Sing and equip Harps (only because I'm out of usable spots to give it to anyone else and Kain singing is a little silly...ier than Cecil.)

 - He does have his unused casting animation - maybe he was born to sing - perhaps that's where he's falling short with Rosa   :wink:

...and I plan on each of my patches being stackable.

- Just thinking about keeping all that organized hurt me in the brain-box: but quite sincerely I have no doubts you; but best of luck there all the same - and if I can somehow help I'd certainly like to  :happy:

Hopefully when I get the Exp/TNL mod going my hope is to leave you with more room than even you know what to do with - yes, I know it's not that much :tongue:

But I did have an idea: You're down to Cecil & Kain as the only ones with room left. What if skills were not fixed? FF5 popped into mind: << [Fight] / [Skill] / [Empty] / [Item] >> I'm certainly not suggesting going as far as that game did - but what if say in each town (maybe in the Training Room) - someone is hanging out with a unique skill to offer: something like "OK Kain - your voice is terrible - I say forget [Sing] - learn [Kick] instead - sound good? [Yes/No]"

I don't know - but I think it's a thought experiment worth the time. The pointer for the currently learned skill would have to be stored somewhere in the RAM, not sure where to most easily work it in - but Phoenix really went after that problem for the Shadow Data - and as to where exactly it failed if my mod doesn't bypass the problem I'd bet you could tie up that loose end.

- Another thought would be the storage points for the Event Flags; take out one of the Behemoth battles in Bahamut's Cave and there's a freebee - or hijack some of the code that checks the Flags and consolidate: 3 Behemoths (A,B,C) need only 8 index values to describe every combination (2^3 *) for if allowed to encounter them in any order: or only 4 if it must be A->B->C (how many are dead, 0,1,2,or 3?) - But then you only need one Byte for all 3 - there's always some way

* My brain refuses to memorize that: CP - Choices to the Power of People - 2 choices, 3 people - Instead I take "the scenic route..."
   all yes + all no = 2 & 3 singles = 5 & 3 pairs = 8  - thus leaving efficiency to be approximately  :sad:

Haha! While Kain does have an unused Magic Animation, I couldn't see someone giving up Kain's Almighty Jump to have him use any spell from the Harp that wasn't Angelic Song or Full-Party Haste. Whereas with Cecil they might be encouraged to use some of the other magics, for no other reason than the +5 Attack that the party will receive, in a stackable sense.

Unfortunately with commands... they handled them in a pretty terrible way in FFIV...

1. They are read from Rom. Every battle they are reset to what they look like in Rom's specifications. If you make a change to this, you make a change Permanently to that character that even a New Game Start won't erase. I toyed with the idea of the Apples and Drop being able to teach a Character a Command if they had a Command Slot of FF anywhere in their information. And while this would work it would cause the issue as labelled above.

2. They are tied to Actor in a way that I'm not 100% sure I've ever really looked at.

Now if we could find some free space in RAM to copy down this data (an excellent application of the free space your Experience mod will bring) and with the pointers on hand that should be able to solve that dastardly problem. Until then though, it is a bit unfeasible,

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Grimoire LD's Notes, Patches, and Hacks (Patch-FFIII Style Sing in FFIV!)
« Reply #239 on: January 15, 2014, 09:18:15 AM »
Damn it Square  :wtf:

I'd like to read about new commands in the training room - I already know how to save the game  :wink:

I'm going to think about the command swapping some more - but in the meantime allow, if you will, my feelings on that to be best expressed through the words of HCBailly:   "GAME...!!!"
"Now I know; and knowing makes it even more confusing..."