øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1883.msg19995e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index5385.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1883.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index5385.html.zx÷g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ…¬fjOKtext/htmlISO-8859-1gzip8:ÖfjÿÿÿÿÿÿÿÿTue, 10 Mar 2020 04:59:58 GMT0ó°° ®0®P®€§²ð®÷g^ÿÿÿÿÿÿÿÿò6fj Grimoire LD's Notes, Patches, and Hacks (Dark Knight/Paladin Swap In Battle!)

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

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Back Attacks/First Strike Info!)
« Reply #180 on: January 05, 2014, 05:19:34 PM »
Now for my most ambitious hack yet. Turning the Pray command into the Hunt command.

Now I absolutely love Final Fantasy Tactics and one of things I always thought was really neat in it was Poaching and the Fur Shop where you could use your ill-gotten gains to get powerful equipment.

So I thought "Why not add a similar thing to FFIV?"

Originally I scoffed at myself, but after completing the Barrage commands, I got to thinking that it Might be possible... so I wrote up a check list of what it would need.

Hunt Command - Can be used to automatically kill a Critical Beast and Obtain an Item

-Load Weapon Swing Animation
-Load Boss Byte (2770)
-If a Boss, branch to Fight Routine
-----------------------------
-Load Creature Type (2740)
-If Not Reptile branch to Fight Routine
-----------------------------------------
-Load Enemy's Status Byte 4. (2706)
-If Not Critical, branch to Fight Routine
------------------------------------------
- Jump to Steal Command Success (03E249)
- Place 80 in Status Byte 1 (Dead)
- Place 80 in Creature Type (Zombie, to prevent Revival)
- Jump to Return
-----------------------
- Jump to Fight Routine (03C499)
- Return

Not a very difficult thing to make work on paper. But is there enough room in Pray for this? Well only one way to find out...

Hunt Command

Code: [Select]
$03/E852 A9 C0 LDA #$C0 A:0003 X:0016 Y:0000 P:envMxdizc - Load Weapon Swing into A.
$03/E854 8D C4 33 STA $33C4  [$7E:33C4] A:00C0 X:0016 Y:0000 P:eNvMxdizc - Store A in Audiovisual Code
$03/E857 AD 40 27 LDA $2740  [$7E:2740] A:00C0 X:0016 Y:0000 P:eNvMxdizc - Load Creature Type into A.
$03/E85A C9 04 CMP #$04 A:0004 X:0016 Y:0000 P:envMxdizc - Is it Reptile?
$03/E85C D0 13 BNE $13    [$E871] A:0004 X:0016 Y:0000 P:envMxdiZC - If not branch to 03E871
---------------------------------------------
$03/E85E AD 06 27 LDA $2706  [$7E:2706] A:0004 X:0016 Y:0000 P:envMxdiZC - Load Creature Status Byte 4.
$03/E861 C9 01 CMP #$01 A:0001 X:0016 Y:0000 P:envMxdizC - Is it in Critical?
$03/E863 D0 0C BNE $0C    [$E871] A:0001 X:0016 Y:0000 P:envMxdiZC - If not branch to 03E871.
---------------------------------------
$03/E865 20 49 E2 JSR $E3FF  [$03:E3FF] A:0001 X:0016 Y:0000 P:envMxdiZC - Jump to Hunt Rewards Routine.
$03/E868 A9 7B LDA #$7B A:001D X:0008 Y:0002 P:envMxdizc - Load Vanish into A.
$03/E86A 8D D2 26 STA $26D2  [$7E:26D2] A:007B X:0008 Y:0002 P:envMxdizc - Store Vanish in Next Action to Take.
$03/E86D 4C 3E CD JMP $CD3E  [$03:CD3E] A:007B X:0008 Y:0002 P:envMxdizc - Jump and Stay with Magic Call Routine
--------------------------------------------
$03/E871 4C 99 C4 JMP $C499  [$03:C499] A:0000 X:0016 Y:0000 P:eNvMxdizc - Jump and Stay with Fight Routine


And that's all it took! Granted I had to make a few concessions because of space and weirdness (apparently in "commands" you're unable to inflict status but you can in Spell Subroutines or Fight... go figure. I also had to get rid of the boss check, which means... well be careful with placing your boss Reptiles. Just be sure to give them another creature type in addition and that will send it down to the normal fight routine.

I would also ideally want the stealing procedure to be different so you would steal one item, while poaching another. Unfortunately that is currently not possible. You can steal what you poach and vice-versa. Now the game doesn't tell you what you've stolen, likely because those are programmed only to appear at the end of the Steal Routine, but you can see you have a new Item in the Item menu.

Note: In the pictures I use Imps changed to the Reptile Creature Type. So no worries there.







And that will do it! This is probably my favorite command I've created yet. I just need to differentiate it from Steal and it will be golden!

 :edit:Updated with JSR to Hunt Rewards System.
« Last Edit: January 07, 2014, 12:48:46 AM by Grimoire LD »

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #181 on: January 05, 2014, 05:40:35 PM »
Nifty. I considered a while ago writing a command like this (inspired by FFIV's Morph, not by Poaching, but same diff). You could, maybe, rewrite the monster's item byte before running the steal routine...
Perhaps:
Load Monster's level
Store into item byte
Run steal routine

Or:
Load level
Add item byte
Store in item byte
Run steal

Or even:
RNG
Store in item byte
Run steal

Or however you want to determine the "new" item byte. Whatever you do would just be a few bytes of code. Doesn't matter that you're changing it because pending success, the monster is gone after the command is done.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #182 on: January 05, 2014, 05:58:52 PM »
That sounds like it would be a great idea! The only issue being that I have only two free bytes left to work with... I guess I could move it to another command, hmm... you did mention free space at the end of the section, didn't you? Maybe I could use a few bytes to set that up? Change the Steal Routine to this unused portion write a couple of bytes for the RNG and the steal routine and go from there. With that I could create a item drop section entirely for Poaching. Great thinking Chillyfeez!

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Back Attacks/First Strike Info!)
« Reply #183 on: January 05, 2014, 06:04:24 PM »
I don't like how its used here because it cuts down on what you can logically do with the instruction. As a tool to set things to FFFF it saves one or two bytes and those bytes may be quite precious in the long run....

- Gotcha: thank you for your insight; it's good to have reasoning for things floating around in my head - it helps me to understand what's going on more-so than just reading it somewhere. In fact, as I think about it: were I ever to know enough about Assembly (or programming in general even) to teach a course, I think I would spend some time going through this game. The more and more I read into it the more variety I see making up the spectrum of coding quality:

 surprisingly clever --- cute  --- decent --- good enough --- almost had it --- doesn't quite work --- flat-out broken

 - With special consideration, of course for my favorite:  --- not only broken, but wouldn't have worked anyway  :tongue:

Also, given the conversation at present I must also say that this is one of the things I like most about Assembly: the constant challenge to be clever
"Now I know; and knowing makes it even more confusing..."

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #184 on: January 05, 2014, 08:13:51 PM »
Well for hackers the goal is to be clever. We're normally using limited space in many situations. Back then though programmers did have to be clever as well, yeah. There was only so much space and so much they could shove into that space.

And thanks to Chillyfeez for his inspiration! (Some inspiration was taken from the Aura hack, granted he could probably make it even thinner) We now have a fully realized Poach system! (sort of....)

Hunting Rewards System

Code: [Select]
$03/FEE3 AD 02 27 LDA $2702  [$7E:2702] A:0001 X:0016 Y:0000 P:envMxdiZC - Load Target's Level into A.
$03/FEE6 A2 01 00 LDX #$0001 A:0003 X:0016 Y:0000 P:envMxdizC - Load 0001 into X.
$03/FEE9 69 14 ADC #$14 A:0003 X:0001 Y:0000 P:envMxdizC - Add 14 (20) to A.
$03/FEEB 20 79 83 JSR $8379  [$03:8379] A:0018 X:0001 Y:0000 P:envMxdizc - Jump to RNG (1 to Enemy Level +20)
$03/FEEE A2 3F 00 LDX #$003F A:000E X:0000 Y:0000 P:envMxdizc - Load 003F (End of Item Index) into X.
$03/FEF1 C9 3C CMP #$3C A:000E X:003F Y:0000 P:envMxdizc - Is the amount in A (Enemy Level + 20 (RNG)) 3C (60) or above?
$03/FEF3 B0 0B BCS $0B    [$FF00] A:000E X:003F Y:0000 P:eNvMxdizc - If so branch to end.
------------------------------
$03/FEF5 CA DEX A:000E X:003F Y:0000 P:eNvMxdizc - -1 to X (3F is now unavailable.)
$03/FEF6 C9 28 CMP #$28 A:000E X:003E Y:0000 P:envMxdizc - Is the amount in A 28 (40) or above?
$03/FEF8 B0 06 BCS $06    [$FF00] A:000E X:003E Y:0000 P:eNvMxdizc - If so branch to end.
---------------------------------------
$03/FEFA CA DEX A:000E X:003E Y:0000 P:eNvMxdizc - -1 to X (3E is now unavailable.)
$03/FEFB C9 14 CMP #$14 A:000E X:003D Y:0000 P:envMxdizc - Is the amount in A 14 (20) or above?
$03/FEFD B0 01 BCS $01    [$FF00] A:000E X:003D Y:0000 P:eNvMxdizc - If so branch to end.
----------------------------------------
$03/FEFF CA DEX A:000E X:003D Y:0000 P:eNvMxdizc -1 to X (3D is now unavailable.)
$03/FF00 8A TXA A:000E X:003C Y:0000 P:envMxdizc - Transfer X to A. (For the purposes of correct RNG figuring)
$03/FF01 A2 3A 00 LDX #$003A A:003C X:003C Y:0000 P:envMxdizc - Load 3A (Lowest Item Index possible) into A.
$03/FF04 20 79 83 JSR $8379  [$03:8379] A:003C X:003A Y:0000 P:envMxdizc - Jump to RNG (3A-3F at Max, but since all checks failed the range the possible item bytes are now only 3A to 3C)
$03/FF07 8D 73 27 STA $2773  [$7E:2773] A:003C X:0000 Y:0000 P:envMxdizc - Store 3A-3F in Target's Item Byte. (Despite having a fairly low RNG to go on , 3C was still achieved!)
$03/FF0A 20 49 E2 JSR $E249  [$03:E249] A:003C X:0000 Y:0000 P:envMxdizc - Jump to Steal Success Routine.

And there you have it! With this method you can get 1 of 6 items for poaching and the higher level Reptile you fight, the more likely you will get something good! Granted, if a hack were to use this it would be suggested to make 3A-3F specific to Hunted Enemies though. I do wish I could change the Actual drop, but that would require writing a dummy Steal routine for just this alone. I think 1/6 items is good enough. At lower levels you only have access to 3 (if you're lucky, 4) of them and at higher levels there's a chance to get some really good items.




chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #185 on: January 06, 2014, 01:45:43 AM »
I don't think I would/could make this one thinner. I like what you've done here. Nice work!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #186 on: January 06, 2014, 03:36:09 PM »
So while at work today (I work retail, alone.) I decided to jot down a couple of hack ideas that I might be able to implement... Since I saw that I could take an outline, as I did with Hunt, and make what I have written into a reality with my knowledge.

As a fan of FFT, I decided to include "Sword Spirit" (or rather it will be shown as (Katana symbol)Soul) as possibly a Replacement to Dart.

There are two plans for this one...

Katana Soul
-Unleash the Power of the Sword in the Right Hand. The Power unleashed is Sword Dependent and the Sword may Shatter on use.

Planned Process

Load Weapon in Right Hand
Is it Weapon 2B? (Short)
If so Load Magic Routine
Branch to RNG Portion
-------------------------
Is it Weapon 2C? (Middle)
If so Load Magic Routine
Branch to RNG Portion
-------------------------
Is it Weapon 2D? (Long)
If so Load Magic Routine
Branch to RNG Portion
------------------------
Is it Weapon 2E? (Ninja)
If so Load Magic Routine
Branch to RNG Portion
------------------------
Is it Weapon 2F? (Murasame)
If so Load Magic Routine
Branch to RNG Routine
------------------------------------------------------
Is it Weapon 30? (Masamune)
Retarget to All Allies
Branch to RNG Routine
Cast Protect, Shell, and Haste in that Order (If Possible!)
--------------------------------------------------
All other Weapons Return
-----------------------
(RNG Section)
Load Weapon Attack Power
Divide it by 2.
Load this value into First character's boss byte (its never used anyhow and these aren't getting anywhere Close to 80 with their power divided in half.)
Load 0001 into X
Load 64 (100) into A
RNG Routine
Compare it to Boss Byte Value
If more than Value branch to Return
If Less than Value Load 00 00 into Caster's Right Hand Weapon Data.

Or I need to learn more about Dart's default targeting,

Another thing FFIV is sorely lacking is Elemental Boosting. My plan to fix this is simple, but then the issue becomes, where can I plug this in at?

Element Amplify Routine

(Off of Spell Routine)
Load Caster's Weapon Element into A.
Compare it to Spell Element.
If both are same load Spell Power into A.
Transfer A to X.
LSR X * 2
Add X to A. (Thereby giving it +25% Power)
Return to Main Routine

In addition to that I think I have what it takes now to load a Spell on Swing which doesn't need to correspond to the Cast Spell nor does it need to be a new command. It can fit right into the Fight routine (part of it anyhow)

This plan takes advantage of the Broken Calcify effect which happens because of the Medusa Blade (which also freezes the game sometimes) Any weapon with Calcify enabled would enter in this area if it is successful in making the effect happen.

In addition there is a byte in the Weapon data I never figured out which might be useful for this purpose...

Lord 0001 int X
Load 0064 into A (100)
RNG
Compare Value to Caster's Wisdom, if more than Return
-------------------------------------------------
Load Caster's Slot
(Here is the only problem. The data for each character's weapon and armor are at 7E2780 and each piece is 11 (decimal) bytes each, but I can't think of a way to find a specific starting place for characters that aren't in the first slot.)
Load Unused Byte into A.
Load it into Character's Next Action
Return

Piercing Sight is basically ready, I just need to add a random factor to Chillyfeez's Aura instead of Wisdom and that should be good to go.

And the most ambitious idea current would be to emulate (and add a few) Break Skills from FFT.

Break Skills/ - use Swordskills to lower the attributes of your enemy.

Boss Byte Check
----------------------
Load Stored Elemental Byte
---------------------
01 - Fire - Power Break
Load Target's Attack
Lower it by Caster's Vitality/8
Branch to Return
-------------------
02 - Ice - Speed Break
Load Target's Speed
Lower it by Target's Level/8
Branch to Return
------------------
04 - Lit - Mind Break
Load Target's Spell Power
Lower it by Caster's Vitality/8
------------------
08 - Dark - Armor Break
Load Target's Defense
Lower it by Caster's Vitality/16
-------------------
10 - Holy - Seal Break
Load Target's Magic Defense
Lower it by Caster's Vitality/8
------------------
20 - Air - Claw Break
Load Target's Status to Inflict on Hit 1
Store Zero
Load Target's Status to Inflict on Hit 2
Store Zero
-------------------------
40 - Ele Break
Load Target's Resistance
Store Zero
------------------------
80 - Fate Break
Load  1 into X
Load 40 into A
Go through RNG
Store result in Status to Inflict 1 Byte
Jump to Status Routine
--------------------------

Which of these (if any) would you like to see completed first?
« Last Edit: January 06, 2014, 04:21:11 PM by Grimoire LD »

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #187 on: January 06, 2014, 03:48:14 PM »
-------------------
02 - Ice - Magic Break
Load Target's MP
Lower it by Vitalityx8
Branch to Return
------------------

MP? Is this a skill intended to be used on monsters? If so what will it do? They don't have MP...
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #188 on: January 06, 2014, 03:55:21 PM »
I thought Deathlike2 said that an enemy's MP is 1/4 of its HP... let me check that out...

Okay...

When a Monster has 10,000 HP it will have... 625 MP... What equation is that even?

Ah!

Monster's MP is 1/16 of their HP. Alright, fair enough I suppose. It explains why Osmose is pretty worthless at the start then.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #189 on: January 06, 2014, 03:59:43 PM »
But it's just for Osmose right? I mean, monsters don't actually use their MP to cast spells and run out and such do they? I've certainly never seen anything like that happen ever.
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #190 on: January 06, 2014, 04:02:30 PM »
That is a good point... let me see...

Wow. You are absolutely correct. I don't know why I thought otherwise... I never recalled seeing them react that way either. Back to the drawing board on that one then.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #191 on: January 06, 2014, 04:23:07 PM »
I guess I'll go with Speed Break (which is a skill in FFT) it will lower an Enemy's speed by 1/8 of its level so its power is consistent the entire game.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #192 on: January 07, 2014, 12:58:32 AM »
Immense update on the first page including links to all of my (at least I think that's all of them...) custom command routines and bug fixes.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #193 on: January 07, 2014, 09:34:43 AM »
Mage characters, who use regular black magic spells, have and can run out of MP. It doesn't kill them like in FFIV. Still, unless you gave an MP value to each monster skill (no reason you couldn't), MP Break would be pretty useless.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Grimoire LD's Notes, Methods, and Hacks (Poaching from FFT put into FFIV!)
« Reply #194 on: January 07, 2014, 01:36:54 PM »
Hmm, that's what I tested originally Chillyfeez, I gave Imp's 10000 HP, saw they had 625 MP and allowed them to use Cure4 every cast. Their MP never went down, despite that I was using the "Use Black or White Magic" AI command. And just now tested it with "Use Special Spell"and I never saw MP budge, like you I was under the impression that monster's had finite supply of MP, but it doesn't appear that they do unfortunately. Also I think you meant it doesn't kill them like in FFVI, hehe.

This was addressed yesterday though, I decided to change Mind Break for Speed Break. Lower Enemy Speed by 1/8 of its level.