Author Topic: Unprecedented Crisis now on RHDN  (Read 27553 times)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #45 on: July 08, 2015, 12:14:35 PM »
Can it use the usual explode routine and then just heal him for 1 after?

...Maybe. The normal Explode routine doesn't actually lower HP but just kills the character outright (Sets Death). It would require just a few more bytes in the new Bomb routine to remove that Dead bit and set the Caster's HP to 0001. It's untested but it is worth a shot.


Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #46 on: July 08, 2015, 12:16:42 PM »
I don't really know enough about the details of the inner workings of the game to have a meaningful opinion so whatever you think is best works for me.
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #47 on: July 08, 2015, 01:00:51 PM »
Well that was a little trickier than I expected and a little more expensive, but there should still be ample room for Lancet...

Peep to 1-HP Bomb

Code: [Select]
$03/E153 A6 A6 LDX $A6    [$00:00A6] A:0003 X:0028 Y:0000 P:envMxdizc - Load Character ID into X.
$03/E155 DA PHX A:0003 X:0000 Y:0000 P:envMxdiZc - Push X (to retrieve later)
$03/E156 A9 A0 LDA #$A0 A:0003 X:0000 Y:0000 P:envMxdiZc - Load Explode into A.
$03/E158 8D D2 26 STA $26D2  [$7E:26D2] A:00A0 X:0000 Y:0000 P:eNvMxdizc - Store A in Next Action to take.
$03/E15B A9 32 LDA #$32 A:00A0 X:0000 Y:0000 P:eNvMxdizc - Load Bomb (Summon) Graphic into A.
$03/E15D 8D C5 33 STA $33C5  [$7E:33C5] A:0032 X:0000 Y:0000 P:envMxdizc - Store A in Audiovisual.
$03/E160 20 44 CD JSR $CD44  [$03:CD44] A:0032 X:0000 Y:0000 P:envMxdizc - Jump to after the Audiovisual check has been looked at in the Spell Routine.
$03/E163 FA PLX A:0080 X:0680 Y:001A P:eNvMxdizC - Pull X.
$03/E164 BD 03 20 LDA $2003,x[$7E:2003] A:0080 X:0000 Y:001A P:envMxdiZC - Load Character's Status Byte 1 into A.
$03/E167 29 7F AND #$7F A:0080 X:0000 Y:001A P:eNvMxdizC - Get rid of 80 (Death)
$03/E169 9D 03 20 STA $2003,x[$7E:2003] A:0000 X:0000 Y:001A P:envMxdiZC - Store Character's Status Byte 1.
$03/E16C C2 20 REP #$20 A:0000 X:0000 Y:001A P:envMxdiZC - Reset Processor Status (Allows for 2 byte dealings for A.)
$03/E16E A9 01 00 LDA #$0001 A:0000 X:0000 Y:001A P:envmxdiZC - Load 0001 into A.
$03/E171 9D 07 20 STA $2007,x[$7E:2007] A:0001 X:0000 Y:001A P:envmxdizC - Store A in Character's HP.
$03/E174 E2 20 SEP #$20 A:0001 X:0000 Y:001A P:envmxdizC - Set Processor Status (Back to 8 bit)
$03/E176 A9 01 LDA #$01 A:0001 X:0000 Y:001A P:envMxdizC - Load 01 into A. (Critical)
$03/E178 9D 06 20 STA $2006,x[$7E:2006] A:0001 X:0000 Y:001A P:envMxdizC - Store Critical in Status Byte 4.
$03/E17B 60 RTS A:0001 X:0000 Y:001A P:envMxdizC - Return

And that's that! it works perfectly! Cid explodes, drops to 1 HP with the Critical Status.

Lancet will be coming a little later today then.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #48 on: July 08, 2015, 01:03:38 PM »
Thanks! I take it then that getting him to visually tackle the monster is out of the question given the lack of space?
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #49 on: July 08, 2015, 01:10:31 PM »
Thanks! I take it then that getting him to visually tackle the monster is out of the question given the lack of space?

Well... Cid has no graphics for tackling, his special stance is now unused though so if you ever wanted to replace it with a new sprite (not my area) I could give that a shot, but I should note that character movement during battle is a large unknown, hence why Chillyfeez said focusing on Kain's Jump would probably be the best idea for us hackers to understand why the characters move as they do. Kain's Jump is unique as it is the only command in FFIV that actually touches the enemy (or character's) sprite. Kick has a preset pattern of movement from one side of the screen to the other. When it has come to figuring out the movement of sprites and graphics Chillyfeez has always been ahead of me in that regard.

If we do get the information ideally, then it would just be a matter of changing the graphic set from Bomb (Summon) (32) to Peep's command number +C0.


Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #50 on: July 08, 2015, 01:13:49 PM »
Ok well let's leave it as a bomb and if Chillyfeez or anyone else feels inclined to research the character movement we can figure out how to splice that in on top of what you have done here.
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #51 on: July 08, 2015, 03:09:49 PM »
Actually, I think the normal explode routine doesn't deal HP damage to the user, it just adds death. So adding one HP after the normal explode routine would be a much trickier prospect than it sounds.
Far easier to just:
Load current HP
Subtract 1
Store that value in damage to target
Store that value in damage to caster
That whole thing would be twelve bytes by my count.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #52 on: July 08, 2015, 03:44:37 PM »
You have a good point Chillyfeez, but since this is a Command and not a Spell I am out of my element, I couldn't quite figure out how to properly display damage (also the problem I'm having with the prescribed Lancet to display damage and healing) if you know how it is done outside of spells then it would probably be best for you to handle this one.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #53 on: July 08, 2015, 08:54:22 PM »
Sorry, when I wrote that I didn't see that there was all that other conversation after Pinkpuff asked about "bomb + 1HP."

You have a good point Chillyfeez, but since this is a Command and not a Spell I am out of my element, I couldn't quite figure out how to properly display damage (also the problem I'm having with the prescribed Lancet to display damage and healing) if you know how it is done outside of spells then it would probably be best for you to handle this one.
Did you try having the routine put the damage into 00A2-A3 (for the target) and 00A4-A5 (for the attacker)?
That's always the last place the numbers end up before actually being subtracted from (or added to) the proper parties. That's in the Bab-il docs, in the "spell effect subroutines" document, but it applies to commands, too. I don't know whether the numbers will show , but they will certainly apply. Certain flags (somewhat unexplored) may need to be set for the numbers to show for both user and target...
Ok well let's leave it as a bomb and if Chillyfeez or anyone else feels inclined to research the character movement we can figure out how to splice that in on top of what you have done here.
I definitely will once I get this chocobo thing down... I'm getting there. Haven't had a whole lotta free time lately, sorry.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #54 on: July 10, 2015, 05:55:13 AM »
Did anything happen with Lancet after? Don't mean to seem greedy or impatient, just want to make sure it didn't get forgotten in all the bomb and tackle conversation.
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #55 on: July 10, 2015, 10:37:57 AM »
Did anything happen with Lancet after? Don't mean to seem greedy or impatient, just want to make sure it didn't get forgotten in all the bomb and tackle conversation.

As per your instructions with the space left to me and Chillyfeez's suggestion I still could not get the game to display the damage done since this is a Command and not a Spell I cannot get it to read matters properly. Every attempt to display damage has failed.

Something I might be able to do is change Kain's temporal stats around. For instance having his Attack Power become his Strength and Will put together and use that for the single power of the Drain Attack. Or if you had any other ideas for what you want done with it because outside of Spells the game doesn't really have that much in place to display damage in an easy manner (Kick and Dark Wave are the only exception)



Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #56 on: July 10, 2015, 10:46:47 AM »
Ok so the issue is with specific damage amounts. If we use the regular attack routine it's doable?

Maybe it can be a straight up drain attack at half power? Would that work? Are other fractions possible? And can we restrict it to having a spear equipped?
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #57 on: July 10, 2015, 11:04:12 AM »
The problem, if I remember right, is that the game sees, "oh, we're using the Peep command" and so it doesn't set the internal flag to display damage to the target and user because, well,  Peep doesn't deal damage (nor does it heal),  so no need to run that subroutine. As we've done in the past with "cheating in" command stances/poses (before we knew how to change them at the source), we just need to find this bit of RAM and make sure that the Lancet command's routine involves turning it on.
I promise I will help with this eventually...
If you're feeling industrious, Grimoire, I think I've seen this stuff before... Run a bunch of commands (ones that show and don't show damage), set a breakpoint to the beginning of the command, then "Step Out" at the break and observe which subroutines run after the command subroutine, and which RAM flags determine whether or not they do run. Somewhere in there is bound to be the determination to run or not run the damage display subroutine.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #58 on: July 10, 2015, 11:19:02 AM »
Ok so the issue is with specific damage amounts. If we use the regular attack routine it's doable?

Maybe it can be a straight up drain attack at half power? Would that work? Are other fractions possible? And can we restrict it to having a spear equipped?

That would not be a difficult scenario. Creating a weapon tied skill shouldn't be difficult just as long as all of the Spears are sequentially placed which they are in Unprecedented Crisis.

It can easily be a drain at 1/2 power (just dividing Attack Power by 2 and applying the Drain Elemental to Kain) and we could also use other fractions such as 2/3, 1/4 etc.

The problem, if I remember right, is that the game sees, "oh, we're using the Peep command" and so it doesn't set the internal flag to display damage to the target and user because, well,  Peep doesn't deal damage (nor does it heal),  so no need to run that subroutine. As we've done in the past with "cheating in" command stances/poses (before we knew how to change them at the source), we just need to find this bit of RAM and make sure that the Lancet command's routine involves turning it on.
I promise I will help with this eventually...
If you're feeling industrious, Grimoire, I think I've seen this stuff before... Run a bunch of commands (ones that show and don't show damage), set a breakpoint to the beginning of the command, then "Step Out" at the break and observe which subroutines run after the command subroutine, and which RAM flags determine whether or not they do run. Somewhere in there is bound to be the determination to run or not run the damage display subroutine.

I believe it deals something with F8 04 when placed in the AV Code, and I have been poring over the Dark Wave/Kick routine and despite everything I tried to do I couldn't get any damage to display, but I am working with limited space and I can't expend too much space on that regard for this or else there won't be room for the actual routine. If it takes 10-16 bytes just to display damage properly it doesn't really seem worth it for this scenario. That said I will take a closer look into Kick and see if I can't pinpoint what matters go into a successful damage generator.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Unprecedented Crisis now on RHDN
« Reply #59 on: July 10, 2015, 11:22:42 AM »
Cry is also unused if that helps
Let's dance!