• Welcome to Final Fantasy Hacktics. Please login or sign up.
 

ASM Requests

Started by The Damned, October 29, 2014, 09:16:45 pm

aacroke

Quote from: Hyppocritamus on September 02, 2019, 12:50:48 am
Why not just export the weapon sheet in shishi, erase the rugs, and import it again?  Same basic result, no ASM needed


Using Shishi included with v0.492, there is no "weapon sheet". If you're referring to replacing the rug graphic within ITEM.BIN, this has already been done, and only affects the menus.

I'm looking to replace the actual attack animation, and I think ASM editing is far more appropriate than editing graphics for this situation. I might not know how to pore through the ASM or modify it, but I am logical enough to know that, somewhere, there's a case selection where the attacking weapon type is considered, and the appropriate animation is selected based on it; I also imagine that changing one byte somewhere (and possibly a checksum or two as a result) would be the only requirement in achieving my goal.

The rugs have been replaced with fists, much like Tifa uses. I've hijacked the vanilla gauntlets for the task, and replaced the rugs - but instead of my Brawlers punching Algus in the face, they whip out a silly carpet and lash him - and we all know his face deserves to be punched.
  • Modding version: PSX

CONMAN

I'm using .491 shishi and maybe I missed something but not the item sheet but the weapon sheet.  I'm sure editing this will change it.
  • Modding version: PSX

aacroke

Alrighty, so firstly, this is also present in 492, and I missed it completely. Thank you CONMAN, I did find it and modified WEP sufficiently. The yellow attacking effect is left behind when these weapons are attacked with - but this differentiates it from an unarmed attack, and probably other attacks share the effect (so I don't need to remove it).

Problem solved! I now have a completed mod. Time to read some important info on whether my mod qualifies and how to share it!
  • Modding version: PSX

bizenboat

Hi!

I'm new here and trying a little FF7 project to learn more about ASM and events. I've made some progress but could use some guidance if anyone has the time.

Right now I'm trying to modify Absorb Used MP to absorb MP based on the amount of damage done. I was hoping to use MP as a proxy for the limit bar. Ideally it could absorb (dmg/max hp*20) MP, but anything related to the damage would be nice. I don't know what math can be done with ASM.

I'm using the documentation here http://ffhacktics.com/wiki/Face_Up_and_Absorb_Used_MP_usability and comparing to http://ffhacktics.com/wiki/Damage_Split_Usability since that uses damage.

I haven't been successful in understanding the debugger and hex yet but here is what I have right now in ASM mode.

<Patch name="Absorb Used MP -> Limit Bar">
    <Location file="BATTLE_BIN" offset="125F74" mode="ASM">
   lui r3,0x8019
   lw r3,0x2d90(r3)
   addiu r29,r29,0xffe0
   sw r31,0x0018(r29)
   sw r16,0x0010(r29)
   sw r17,0x0014(r29)
   lhu r17,0x0004(r3)
        nop
   nop
   </Location>
</Patch>


This does absorb some MP when hit by some abilities, but it's not an amount that makes sense to me. One ability absorbs 2 MP, another absorbs 255 MP... doesn't seem tied to damage or mp used so I don't know what I did wrong. Any pointers would be appreciated!

Thanks
  • Modding version: PSX

Glain

November 08, 2019, 01:22:36 am #284 Last Edit: November 11, 2019, 07:18:14 pm by Glain
Just eyeballing it, you also need to copy the HP damage into r2.  Also, why remove the branch?

   (...)
   lhu r17, 4(r3)
   (...)                                        # <-- Would need intermediate instruction here to avoid load delay
   move r2, r17
   beq r2, r0, 0x0018cfd0         # Branch to end if No HP damage was dealt


Then look at what's happening at 0x18cfc4.  In the current modification, it's taking the HP damage, interpreting it as a RAM address and loading from it.
Instead, once again, just copy the HP damage into r2:

   move r2, r17


This would just try to absorb the full HP damage.  If you want to do a calculation like (dmg * 20 / maxHP) then you would need some more code space, and may need to use some free/kanji space.
  • Modding version: Other/Unknown

bizenboat

Thank you Glain!! I didn't know that "move" was an option, I thought lhu/lbu were the same as move. Awesome! I mostly just removed the branch for debugging purposes and to clear up more room while I was testing things. If I need more room I might remove the chance to react branch because I want this to happen all the time anyway.

OK, this is absorbing the full damage and now I can just play around with calculations.... Thanks again!
  • Modding version: PSX

Glain

Actually, looking at this again, there would be a load delay issue with trying to copy the r17 value into r2 here.  While that could be avoided by loading r17's value earlier, there's no need to copy the value into r2 at all.  Just use r17 in the relevant locations.


   (...)
   lhu r17, 4(r3)
   nop
   beq r17, r0, 0x0018cfd0      # Branch to end if No HP damage was dealt


0x18cfcc:

   sh  r17, 0x0026(r3)


0x18cfc4 becomes free and could just be replaced with a nop (or a call to a routine in free space for a calculation?).
  • Modding version: Other/Unknown

bizenboat

That's true, but it's good to know about the move command. I haven't seen that command documented anywhere for r3000 or psx codes, but it works, so that's cool!

I ended up getting rid of the reaction % check so this will happen every time, and I moved the "skip if 0" to after the math. Not sure if this would be of use to anyone else but here's the patch I'm using anyway. Thanks again for the help!

<Patch name="Absorb Used MP -> Limit Bar">
    <Location file="BATTLE_BIN" offset="125F74" mode="ASM">
lui r3,0x8019
lw r3,0x2d90(r3) <!-- action -->
addiu r29,r29,0xffe0
sw r31,0x0018(r29)
sw r16,0x0010(r29)
sw r17,0x0014(r29)
lhu r17,0x0004(r3) <!-- hp damage -->
        nop
addu r16,r4,r0
lui r4,0x8019
lw r4,0x2d98(r4) <!-- defender -->
nop
lhu r2,0x002a(r4) <!-- max hp -->
nop
sll r17,r17,0x04 <!-- dmg*16 -->
div r17,r2 <!-- dmg*16/max hp -->
mflo r17
beq r17,r0,0x0018cfd0 <!-- skip if =0 -->
    </Location>
    <Location file="BATTLE_BIN" offset="125FC4" mode="ASM">
move r2,r17
    </Location>
</Patch>
  • Modding version: PSX

TheKillerNacho

Has anyone created an ASM to fix the AI such that they can Charge Guns? Apparently, even though charging Guns works in the base game, an AI glitch (or perhaps intended, idk) prevents the AI from doing so like they can every other weapon type. However, after searching, I haven't seen any ASM fix for this.
  • Modding version: PSX
  • Discord username: TheKillerNacho#0666

TheKillerNacho

Also, just making sure, but no one's found a way to have an item grant a passive skill, right (for example, having the Monster Dict grant Monster Skill or an armor that grants Magic Defense Up)?
  • Modding version: PSX
  • Discord username: TheKillerNacho#0666

yamish

December 20, 2019, 06:18:21 pm #290 Last Edit: December 20, 2019, 06:38:13 pm by yamish
Quote from: TheKillerNacho on December 20, 2019, 02:28:07 pm
Also, just making sure, but no one's found a way to have an item grant a passive skill, right (for example, having the Monster Dict grant Monster Skill or an armor that grants Magic Defense Up)?


Yes. The ALMA spreadsheet does this. I'm using it in the overhaul I'm working on. It can cause issues if you aren't aware of certain conflicts inherentin fft. But it works beautifully in my experience after testing.

Edit: http://ffhacktics.com/smf/index.php?topic=6664.0
  • Modding version: PSX & WotL
  • Discord username: riggz raggz

TheKillerNacho

Quote from: yamish on December 20, 2019, 06:18:21 pm
Yes. The ALMA spreadsheet does this. I'm using it in the overhaul I'm working on. It can cause issues if you aren't aware of certain conflicts inherentin fft. But it works beautifully in my experience after testing.

Edit: http://ffhacktics.com/smf/index.php?topic=6664.0

Thanks!
  • Modding version: PSX
  • Discord username: TheKillerNacho#0666

TheKillerNacho

December 24, 2019, 01:17:03 pm #292 Last Edit: December 24, 2019, 02:03:48 pm by TheKillerNacho
Quote from: TheKillerNacho on December 10, 2019, 09:59:51 am
Has anyone created an ASM to fix the AI such that they can Charge Guns? Apparently, even though charging Guns works in the base game, an AI glitch (or perhaps intended, idk) prevents the AI from doing so like they can every other weapon type. However, after searching, I haven't seen any ASM fix for this.


So after doing a little digging on my own I found where abilities are loaded by the AI: http://ffhacktics.com/wiki/Ability_Loading

These lines seem to be the culprit, unless it's also elsewhere:
Quote0019a804: 2602ffb9 addiu r2,r16,0xffb9      Weapon ID - 0x47 (Romanda Gun)
0019a808: 2c420006 sltiu r2,r2,0x0006
0019a80c: 14400083 bne r2,r0,0x 0019aa1c      Branch if Weapon is a Gun


I tried doing this to fix it and it seemed to work after a simple test (removing the branch to a nop):

<Patch name="AI Can Charge Guns">
<Location file="BATTLE_BIN" offset="0013380C">
00000000
</Location>
  </Patch>


Does anyone with more experience with ASM coding know if this will have any unintended side effects or I should not do it this way for whatever reason?
  • Modding version: PSX
  • Discord username: TheKillerNacho#0666

TheKillerNacho

Hey guys. Me again.

I found an ASM hack that claimed to use Wall CT for another status: http://ffhacktics.com/smf/index.php?topic=9050.0.

In this case, I want Confusion to have a CT.

  <Patch name="XX-Confusion uses Wall CT">
<Description>Wall CT is always 0. The CT of the new status is adjustable in Wall CT in FFTPatcher

Status number:

00 Blank Status
01 Crystal
02 Dead
03 Undead
04 Charging
05 Jump
06 Defending
07 Performing
08 Petrify
09 Invite
0A Darkness
0B Confusion
0C Silence
0D Blood Suck
0E Dark / Evil Loocking
0F Treasure

</Description>
<Location file="BATTLE_BIN" offset="12693c">
BC770508
00000000
00000000
00000000


</Location>
<Location file="BATTLE_BIN" offset="f6ef0">
07000234
07004410
21100000
02008104
21108000
07008224
C3100200
53360608
00000000
0B000534 </This is the line I inserted 0B>
01000834
1980073C
982DE78C
0700A330
2128E800
BB01A290
07306900
5A360608
00000000


</Location>
</Patch>


Except it doesn't seem to work... units still don't seem to have a CT limit on Confusion. In FFTPatcher, I have Wall set to the default CT of 24, which from what I understand, should apply to Confusion.

What am I doing wrong? Is there another way to accomplish this?
  • Modding version: PSX
  • Discord username: TheKillerNacho#0666

Xifanie

You're probably not doing anything wrong and the hack was just not thoroughly tested
  • Modding version: PSX
Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

TheKillerNacho

Ah, crap. Thanks anyway.
  • Modding version: PSX
  • Discord username: TheKillerNacho#0666

saw2th

  • Modding version: PSX

Elric

Quote from: saw2th on January 17, 2020, 11:51:34 pm
It works!


Elaborate more. If it didnt work for one person, what did you do to make it work. Don't just say 'it works' after another person tested it and found it not working >.<
  • Modding version: PSX
<@Angel> Teach a man to fish and he'll open up a fishery to compete against yours.


Journey of the Five Youtube ChannelThe Lion War Current Status
  
Jot5 Leader :: Eventer :: OtherTLW Leader :: Eventer :: Other

saw2th

Ah, my bad :) **Pride's CT hack works when adding a ct to confuse - just add the asm and set the ct in patcher!

I had another question.

Sorry if this is the wrong place to ask,
But does there already exist a hack that grants all Monsters the ability to use basic Attack? thus freeing up a slot on their monster skills while still giving them access to regular physical damage. I have noticed monsters call regular attack or possibly frog attack while under berserk (this might call to the same attack slot?) so maybe the asm just gives monsters that option ? i am not sure.
  • Modding version: PSX

saw2th

I also have another request. Not sure if this already exists either, but please link me if it does  :v/:

-ASM Hack that tells the AI to stop using brave/faith-raising skills after the unit hits 0 or 100? Have noticed that the AI will raise a unit's brave to 100 and just keep using their skill afterwards.

  • Modding version: PSX