øAslickproductions.org/forum/index.php?PHPSESSID=b2phq0ehqc7umand281jipqej2&topic=1890.30e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index75e9.htmlslickproductions.org/forum/index.php?board=13.140e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index75e9.html.zxª2g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ ,/ÐCOKtext/htmlISO-8859-1gzip@øÕÐCÿÿÿÿÿÿÿÿTue, 10 Mar 2020 06:41:05 GMT0ó°° ®0®P®€§²ð®©2g^ÿÿÿÿÿÿÿÿ×/ÐC Fun with Summons

Author Topic: Fun with Summons  (Read 6841 times)

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Fun with Summons
« Reply #30 on: January 13, 2014, 09:08:32 AM »
Yep, that did it!
So now I know, and I have an unmodified - but saved with FF4kster - ROM that will henceforth be known as "Patch Base.smc," so I can make patches that don't screw up people's hacks.
 :happy:
The patch above will now change Odin into Phoenix.

However, it should be noted that Phoenix's graphics overwrite Odin's, so the Odin enemy will be screwed up (looking). I have no immediate plans to change the Odin enemy into a Phoenix enemy, so just be warned of that if you patch Phoenix into your hack - you'll have to rewrite the King Baron joining you as Odin story a bit. Or, you can use the info in this thread to make a fight-able Phoenix yourself!

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Fun with Summons
« Reply #31 on: January 13, 2014, 01:04:08 PM »
Awesome!

And I'm glad you figured it out - very good to know. I'm still fuzzy on the exact nature of "The Why" but I already small-childlike asked about that over on the other thread - but I wouldn't be much of a scientist if I didn't try to gather as much data as possible.

- They might take away my science merit badge if I didn't - and were I to have such a badge...  :tongue:

I'll listen to anyone who takes time to try and get me straight on what's-what - I'm not exactly the world's most linear thinker - LOL
"Now I know; and knowing makes it even more confusing..."

fedorajoe

  • Mom Bomb
  • *
  • Posts: 123
  • Gender: Male
  • "G...Golbez!"
    • View Profile
Re: Fun with Summons
« Reply #32 on: February 04, 2014, 07:47:39 PM »
I'm almost there!



I made it all the way up to the point where the discussion of the debugger began, and then I got lost.  That part is simply too far beyond my experience and I'm not following it.

I used the Mage spell as the base of my Shadow summon as I was already using the other three item-based summons pretty prominently in the early part of the game.  But now that I'm this far, I don't understand how to find/isolate the spell animation code for Mage.  Has anybody done this?  I'm also not clear on how to get/find the spell animation code for Disrupt that I'm supposed to replace it with...  (The screen shot is only showing the correct attack name because I changed the name of the Mage spell's effect to "Disrupt.")

chillyfeez, care to weigh in?  :)

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Fun with Summons
« Reply #33 on: February 04, 2014, 08:09:38 PM »
Would you be able to achieve the effect using Pinkpuff's editor? I've attached two screenshots from entries under "Edit Spells."
"Now I know; and knowing makes it even more confusing..."

fedorajoe

  • Mom Bomb
  • *
  • Posts: 123
  • Gender: Male
  • "G...Golbez!"
    • View Profile
Re: Fun with Summons
« Reply #34 on: February 04, 2014, 08:10:48 PM »
Sadly, my hack is not compatible with FF4kster.  It didn't use 1.1 as its base.

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Fun with Summons
« Reply #35 on: February 04, 2014, 08:44:37 PM »
sad indeed  :sad:

- two other thoughts:  Disrupt and Teleport use the same animation so you might try and track it down through there. The other is to perhaps try and edit whatever you can using FF4kster on a 1.1 ROM and then copy/paste the modified bricks of code into a 1.0 ROM. I was offered a similar approach - though in reverse: use Yousei's Map Editor on a 1.0 ROM and then copy/paste into a 1.1 to then use FF4kster.

Good luck!
"Now I know; and knowing makes it even more confusing..."

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Fun with Summons
« Reply #36 on: February 04, 2014, 09:28:18 PM »
You'll have to use Geiger's SNES9x debugger. Just changing the spell.animations won't include the instructions for the summon to disappear a an. Trouble is, with 1.0, the offset to breakpoint is probably different. Lemme do a bit of research. I'll get back to you on this one. I'm glad to see someone's trying this out, though. Nice to see that the explanation up to that point was followable!

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Fun with Summons
« Reply #37 on: February 04, 2014, 09:48:54 PM »
This may help


Grimoire Routine -

Code: [Select]
$03/EC0D A9 E5 LDA #$E5 A:00CA X:0002 Y:0000 P:envMxdiZC - Load E5 into A. (Effect to use. E5 is used by Summons to phase the party in and out)
$03/EC0F 8D C4 33 STA $33C4  [$7E:33C4] A:00E5 X:0002 Y:0000 P:eNvMxdizC - Store A in 7E33C4.
$03/EC12 EE ED 38 INC $38ED  [$7E:38ED] A:00E5 X:0002 Y:0000 P:eNvMxdizC - +1 to 7E38ED.
$03/EC15 EE 84 35 INC $3584  [$7E:3584] A:00E5 X:0002 Y:0000 P:envMxdizC - +1 to 7E3584.
$03/EC18 7B TDC A:00E5 X:0002 Y:0000 P:envMxdizC - Transfer Direct Page.
$03/EC19 AA TAX A:0000 X:0002 Y:0000 P:envMxdiZC - Transfer A to X.
$03/EC1A A9 09 LDA #$09 A:0000 X:0000 Y:0000 P:envMxdiZC - Load 09 into A (Likely used as a benchmark of randomness to choose from)
$03/EC1C 20 79 83 JSR $8379  [$03:8379] A:0009 X:0000 Y:0000 P:envMxdizC - Jump to Subroutine (Generate Random Number 0-9)
$03/EC1F AA TAX A:0002 X:0000 Y:0000 P:envMxdizc - Transfer A to X.
$03/EC20 BF EC FE 13 LDA $13FEEC,x[$13:FEEE] A:0002 X:0002 Y:0000 P:envMxdizc - Load A from 13FEEC +X.

(NOTE: 13FEEC is a group of numbers in this order... D1,52,53,54,55,56,D7,58,59,5D - Now the AND 7F below makes it so it can't be above 80 and will always reduce them to 50's. I'm not sure what else this section of data is used for, I'm going to assume, not very much, so you should be able to change them if you are planning on it Not being Summons, because somewhere in the Grimoire Routine is something that makes the party vanish as it assumes Summons are going to be used.)

$03/EC24 48 PHA A:0053 X:0002 Y:0000 P:envMxdizc - Push A into Stack.
$03/EC25 29 7F AND #$7F A:0053 X:0002 Y:0000 P:envMxdizc - Get rid of negative bits.
$03/EC27 8D D2 26 STA $26D2  [$7E:26D2] A:0053 X:0002 Y:0000 P:envMxdizc - Store A in Caster's Next Action to take.
$03/EC2A 8D C5 33 STA $33C5  [$7E:33C5] A:0053 X:0002 Y:0000 P:envMxdizc - Store A in 7E33C5.
$03/EC2D 68 PLA A:0052 X:0001 Y:0000 P:envMxdizc - Pull A from Stack.
$03/EC2E 10 33 BPL $33    [$EC63] A:0052 X:0001 Y:0000 P:envMxdizc Branch if Positive to 03EC63. (This can only be bypassed by Chocobo and Sylph calls)
------------------------------------------------------(Looping Point)-----------------------------------------------------------------------------
$03/EC30 A2 05 00 LDX #$0005 A:00D7 X:0006 Y:0000 P:eNvMxdizc - Load 0005 into X.
$03/EC33 A9 0C LDA #$0C A:00D7 X:0005 Y:0000 P:envMxdizc - Load 0C into A.
$03/EC35 20 79 83 JSR $8379  [$03:8379] A:000C X:0005 Y:0000 P:envMxdizc - Jump to Subroutine (Generate Random Number)
$03/EC38 A8 TAY A:0006 X:0000 Y:0000 P:eNvMxdizc - Transfer A to Y.
$03/EC39 84 A9 STY $A9    [$00:00A9] A:0006 X:0000 Y:0006 P:envMxdizc - Store Y in A9.
$03/EC3B B9 40 35 LDA $3540,y[$7E:3546] A:0006 X:0000 Y:0006 P:envMxdizc - Load 7E3540+RNG into X (Ah! I see, the Grimoire has special targeting, or rather random targeting for the Chocobo and Sylph Summon)
$03/EC3E D0 F0 BNE $F0    [$EC30] A:0000 X:0000 Y:0006 P:envMxdiZc - If not 00 loop back to 03EC30.
------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/EC40 98 TYA A:0000 X:0000 Y:0006 P:envMxdiZc - Transfer Y to A.
$03/EC41 85 DF STA $DF    [$00:00DF] A:0006 X:0000 Y:0006 P:envMxdizc - Store A in DF.
$03/EC43 A9 80 LDA #$80 A:0006 X:0000 Y:0006 P:envMxdizc - Load 80 into A.
$03/EC45 85 E1 STA $E1    [$00:00E1] A:0080 X:0000 Y:0006 P:eNvMxdizc - Store A in E1.
$03/EC47 20 E0 83 JSR $83E0  [$03:83E0] A:0080 X:0000 Y:0006 P:eNvMxdizc - Jump to Subroutine (HP Dealings?)
$03/EC4A A6 E3 LDX $E3    [$00:00E3] A:0000 X:0000 Y:0006 P:envMxdiZc - Load Targeted Monster Slot into X.
$03/EC4C BD 03 20 LDA $2003,x[$7E:2303] A:0000 X:0300 Y:0006 P:envMxdizc - Load Targeted Monster's Status Byte 1 into A.
$03/EC4F 29 C0 AND #$C0 A:0000 X:0300 Y:0006 P:envMxdiZc - Is it Dead or Petrified?
$03/EC51 D0 DD BNE $DD    [$EC30] A:0000 X:0300 Y:0006 P:envMxdiZc - If so loop back to 03EC30.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
$03/EC53 38 SEC A:0000 X:0300 Y:0006 P:envMxdiZc - Set Carry Flag.
$03/EC54 A5 A9 LDA $A9    [$00:00A9] A:0000 X:0300 Y:0006 P:envMxdiZC - Load Targeted Choice into A.
$03/EC56 E9 05 SBC #$05 A:0006 X:0300 Y:0006 P:envMxdizC - -5 to A.
$03/EC58 AA TAX A:0001 X:0300 Y:0006 P:envMxdizC - Transfer A to X.
$03/EC59 09 80 ORA #$80 A:0001 X:0001 Y:0006 P:envMxdizC - Add 80.
$03/EC5B 85 CE STA $CE    [$00:00CE] A:0081 X:0001 Y:0006 P:eNvMxdizC - Store A in CE.
$03/EC5D 7B TDC A:0081 X:0001 Y:0006 P:eNvMxdizC - Transfer Direct Page.
$03/EC5E 20 5F 85 JSR $855F  [$03:855F] A:0000 X:0001 Y:0006 P:envMxdiZC - Jump to Subroutine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/855F 1F FE FE 13 ORA $13FEFE,x[$13:FEFF] A:0000 X:0001 Y:0006 P:envMxdiZC - Add the value in 13FEFE+X into A.
$03/8563 60 RTS A:0040 X:0001 Y:0006 P:envMxdizC - Return.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$03/EC61 80 06 BRA $06    [$EC69] A:0040 X:0001 Y:0006 P:envMxdizC - Branch to 03EC69
------------------------------------------------------------------------------------------------------------------------------------
$03/EC63 A9 80 LDA #$80 A:0052 X:0001 Y:0000 P:envMxdizc - Load 80 into A.
$03/EC65 85 CE STA $CE    [$00:00CE] A:0080 X:0001 Y:0000 P:eNvMxdizc - Store A in CE.
$03/EC67 A9 FF LDA #$FF A:0080 X:0001 Y:0000 P:eNvMxdizc - Load FF into A.
$03/EC69 8D D3 26 STA $26D3  [$7E:26D3] A:00FF X:0001 Y:0000 P:eNvMxdizc - Store A in Next Monster Target
$03/EC6C 60 RTS A:00FF X:0001 Y:0000 P:eNvMxdizc - Return.

There was a wealth of information to find there within! First and possibly most importantly is how the game makes Summons vanish the party.

$03/EC0D   A9 E5   LDA #$E5   A:00CA   X:0002   Y:0000   P:envMxdiZC - Load E5 into A. (Effect to use. E5 is used by Summons to phase the party in and out) - E5 is some sort of effect and it is very definitely an effect, considering if you change the value to say 01, it would use Hold's graphic. 00 it shows no graphic.
$03/EC0F   8D C4 33   STA $33C4  [$7E:33C4]   A:00E5   X:0002   Y:0000   P:eNvMxdizC - Store A in 7E33C4.

Secondly is how the game draws the summons in the first place and how they are specialized.

$03/EC20   BF EC FE 13   LDA $13FEEC,x[$13:FEEE]   A:0002   X:0002   Y:0000   P:envMxdizc - Load A from 13FEEC +X.

(NOTE: 13FEEC is a group of numbers in this order... D1,52,53,54,55,56,D7,58,59,5D - Now the AND 7F below makes it so it can't be above 80 and will always reduce them to 50's. I'm not sure what else this section of data is used for, I'm going to assume, not very much, so you should be able to change them if you are planning on it Not being Summons, because somewhere in the Grimoire Routine is something that makes the party vanish as it assumes Summons are going to be used.)

If you change the E5 as listed above to 00 you can use the Grimoire to use any spell and combination thereof of to spells that you would like it to use. The purpose of the negative values is for spells that only hit one enemy (Chocobo, Sylph) and the negative part allows it to go through a special part of the routine where its targeting becomes randomized, neatly enough.

$03/EC30   A2 05 00   LDX #$0005   A:00D7   X:0006   Y:0000   P:eNvMxdizc - Load 0005 into X.
$03/EC33   A9 0C   LDA #$0C   A:00D7   X:0005   Y:0000   P:envMxdizc - Load 0C into A.
$03/EC35   20 79 83   JSR $8379  [$03:8379]   A:000C   X:0005   Y:0000   P:envMxdizc - Jump to Subroutine (Generate Random Number)
$03/EC38   A8    TAY   A:0006   X:0000   Y:0000   P:eNvMxdizc - Transfer A to Y.
$03/EC39   84 A9   STY $A9    [$00:00A9]   A:0006   X:0000   Y:0006   P:envMxdizc - Store Y in A9.
$03/EC3B   B9 40 35   LDA $3540,y[$7E:3546]   A:0006   X:0000   Y:0006   P:envMxdizc - Load 7E3540+RNG into X (Ah! I see, the Grimoire has special targeting, or rather random targeting for the Chocobo and Sylph Summon)
$03/EC3E   D0 F0   BNE $F0    [$EC30]   A:0000   X:0000   Y:0006   P:envMxdiZc - If not 00 loop back to 03EC30.

The one thing I could not figure out is how the Grimoire's damage is calculated. Their default power according to the item is 00. Maybe it's something I missed in the routine.
"Now I know; and knowing makes it even more confusing..."

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Fun with Summons
« Reply #38 on: February 05, 2014, 04:04:24 PM »
OK, fedorajoe, I gotcha covered.

Turns out, the offsets are really the same for v 1.0 as it is for 1.1. The problem may have been that changing Mage instead of changing Imp led to different routines to change.

So:
Mage's AV code:
Code: [Select]
$01/F7F4 20 A1 FD    JSR $FDA1  [$01:FDA1]   
$01/F7F7 20 17 F3    JSR $F317  [$01:F317]   
$01/F7FA 7B          TDC                     
$01/F7FB 22 5A EB 02 JSL $02EB5A[$02:EB5A]   
$01/F7FF 20 B1 FD    JSR $FDB1  [$01:FDB1]   
$01/F802 6B          RTL         

It's still the JSL you need to change here, at 01/F7FB

Demolish's AV code:
Code: [Select]
$02/EB54 9C 2B F4    STZ $F42B  [$7E:F42B]   
$02/EB57 6C 00 00    JMP ($0000)[$02:ED9C]   
$02/ED9C AD C5 34    LDA $34C5  [$7E:34C5]   
$02/ED9F F0 05       BEQ $05    [$EDA6]     
$02/EDA1 22 B9 F3 01 JSL $01F3B9[$01:F3B9]   
$02/EDA5 60          RTS     

Replace it with the code at 02/EDA1

To put it succinctly - in your v 1.0 ROM with header, change the 22 5A EB 02 at 00/F9FB to 22 B9 F3 01

That should do it. Remember, you'll still have to change the spell sprites (using the data bank at 07/A250 in ROM), or else you'll cast Demolish with birds instead of orbs.
« Last Edit: February 05, 2014, 05:54:57 PM by chillyfeez »

fedorajoe

  • Mom Bomb
  • *
  • Posts: 123
  • Gender: Male
  • "G...Golbez!"
    • View Profile
Re: Fun with Summons
« Reply #39 on: February 05, 2014, 10:10:42 PM »
chillyfeez, you are the man.  I'm blown away by your work.  Thank you so much again for all of your help!

About your tutorial.  I just wanted to say that I was able to follow it with very little difficulty even though it was written well above my current level of expertise.  You did a great job at explaining it all.  Well done!!!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Fun with Summons
« Reply #40 on: February 06, 2014, 12:41:48 AM »
Rock 'n roll. Glad it's working out for you.
This was the culmination of over a year of study and the reason I got into hacking FFIV, so it makes me happy someone's benefitting from it.

Gedankenschild

  • Vargas
  • *
  • Posts: 101
  • Gender: Male
    • View Profile
Re: Fun with Summons
« Reply #41 on: September 03, 2014, 05:40:26 PM »
Thanks a ton for all the info, chillyfeez!
This really helped me reassociate the Balnab-Z palette and also get the new All the Bravest ( :bah:) Golbez inserted!

Regards!
You've got to be kidding me with that Dynasty Warriors registration question??!!
I barely know such a series exists...

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Fun with Summons
« Reply #42 on: September 03, 2014, 06:39:31 PM »
No problem. Glad you found it useful.