• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
June 05, 2020, 01:36:08 am

News:

Don't be hasty to start your own mod; all our FFT modding projects are greatly understaffed. Find out how you can help in the Recruitment section.


Equip X ability limitation? [solved]

Started by Verdeni, March 30, 2020, 02:51:41 am

Verdeni

March 30, 2020, 02:51:41 am Last Edit: March 30, 2020, 11:05:06 pm by Verdeni
Hey all! So, I've been trying to expand my knowledge by going into the bin files of the ISO with HxD and manually applying ASMs myself. I've had success with almost everything I've done, and learned quite a bit! But now I've run into a small snag I didn't expect. :oops:

I finally decided to modify some of my Equip X abilities, and had no issues changing tables and values until I tried to set Equip Spear to allow poles as well. I've changed the values 90 and A0 to 94 and A4 to activate the secondary slots, but the behaviour doesn't seem to be as black and white as I thought. I have it set to table 4B to allow it and 4C as the secondary, in theory... but It doesn't actually give the unit access to poles? It gives them access to the armors in tables 4C if I set those values, but not the weapons--so even if I add value 80 for example, it still doesn't make poles available.

I, in my desperation through extensive searching both on Google and here at home, did find out that philsov intended to do the same thing for FFT: ASM'd. I even downloaded the demo to check it out and see if I could learn from what had been done. Used FFtpatcher to make Equip Spear immediately available. The name is changed to "polearms", but still doesn't allow poles for the unit.

So... is this a known issue? Or am I missing something in the sequencing that allows weapons or armor exclusively on the respective ability?
  • Modding version: PSX
  • Discord username: V3rdeni

Xifanie

What's your code like?

From looking at the code you should be using ori 0x0001 on unit stats 0x004B and ori 0x0080 on unit stats 0x004C.
It sounds like you're using 0x0001 on 0x004C which is the flag for armor.
  • 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

Verdeni

I'm making sure to use table 4B, and values 01 as the primary and 80 as the secondary.
4B x0001 = Spear and 4C x0080 = Pole, right? D:


What you're suggesting is what I thought initially, so I reversed the numbers and got Staves and... nothing lmao.
  • Modding version: PSX
  • Discord username: V3rdeni

Xifanie

I think your issue is that you're loading from 4B and 4C, but only storing in 4B.
  • 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

Verdeni

If that were the case wouldn't it only load from 4A if I switched the values to it? When I switch it to 4A it gives me the first two tables and seems to work fine. :oops:


EDIT: This is what I have from offset 4CB1C:

4B 00 82 94 00 00 00 00 01 00 42 34 4B 00 82 A4 02 00 83 90 05 00 00 10 01 00 00 00
  • Modding version: PSX
  • Discord username: V3rdeni

Xifanie

Wow I can't believe you had me manually enter hex in my emulator's memory just so I could know what the code was. :v
I wouldn't have done it if I didn't still have it open at the right spot... just give me the code the next time lol.

You're using lh/sh on a non-aligned address. This is not a good idea and I can't say what sort of issues it could cause, but it will probably vary from emulator to emulator and with the live console.

i.e.
lb/sb can be used with memory addresses ending with 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
lh/sh can be used with memory addresses ending with 0,2,4,6,8,A,C,E
lw/sw can be used with memory addresses ending with 0,4,8,C

Using your code above with 01 80 42 34 (ori r2, r2, 0x8001) instead of 01 00 42 34 (ori r2, r2, 0x0001), will accomplish what you want, and you can use it for your own personal mods, but you should never release code like this to the public.
  • 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

Verdeni

Ack! Sorry.

But, okay, I think I understand.
I'm still figuring this out obviously, but the goal is to be able to release stuff publicly!
So I'll keep working at it.

Thank you Xifanie :oops:
  • Modding version: PSX
  • Discord username: V3rdeni

Xifanie

ori r2, r2, 0x8001
The PSX memory/registers being little-endian, that means that it will OR 0x01 on 0x004B's value and OR 0x80 on 0x004C's value, which is what we want and why it works.

I can explain more if you're still confused
  • 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

Verdeni

o:... I would appreciate it! But I imagine you've got your hands full with your own projects, so only if it's not a big deal! (:

I have a feeling part of my issue might be the program I'm using... I don't get the different codes. Are there any you would recommend?
  • Modding version: PSX
  • Discord username: V3rdeni

Xifanie

I use pSX's r3000 debugger to view code live and edit the memory directly, but otherwise to compile your own code in MIPS there's MassHexASM or my FFT Hack Template Spreadsheet
  • 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