• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
April 25, 2024, 01:42:21 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 or our Discord!


Ramza's Job Change

Started by Pride, May 25, 2011, 04:50:52 pm

Pride

Does anyone know what causes Ramza's Job change in between Chapters 1-2 and 3-4? I thought it might be in the events but I can't find anything that even remotely looks correct and due to a lot of crashing, I cannot accurately test this...
  • Modding version: PSX
Check out my ASM thread. Who doesn't like hax?

Glain

I happened to have a save after Zeakden, so I looked into this a little bit...

Ramza's sprite set / base class is changed from 01 to 02 at RAM address 0x5acf4, part of a subroutine call beginning at 0x5ac1c (Itself called at 0x5a9f0). It's a long routine, and it sets a few other things (current job also changes from 01 to 02 here, for example). Looks like it's basically a "change unit parameters" call or something. (or maybe just "change base class / job" but it seemed to be doing too much for just that).

From eyeballing the addresses, that code would be in SCUS. Not sure what exactly causes this code to be called in the first place, but maybe this'll give a starting point?

Other notes:

Before changing the data, it makes a call to a routine at 0x59af0 (note, not the same as 0x5a9f0 that calls it; why do these addresses have to be so similar? grrr) with r4=0 and gets back an address to Ramza's unit data, so I suspect that routine probably gives back an address in memory to the unit with index specified by r4.
  • Modding version: Other/Unknown

Pride

Thank you very much for this information, I'll look more into that routine. Let me know if you find any other information ^_^
  • Modding version: PSX
Check out my ASM thread. Who doesn't like hax?

Glain

I believe I just figured it out. This is very interesting...

It looks like Ramza's base job (and some of his other data) is automatically overwritten if the relevant ENTD places Ramza (base class 01,02,or 03) with Join After Event specified!

I managed to get his base job from 01 to 03 after Zeakden by using 03 Ramza instead of 02 Ramza in the 110 Orbonne Monastery ENTD.
What about Chapter 3 to Chapter 4, you say? Ramza is still 02 Ramza at the scene where he's talking to Rafa and Malak after the whole Riovanes thing happens... but there's another scene between Olan and Orlandu (ENTD 137) that appears before you can start doing anything in Chapter 4. Looking at that scene in ENTD, Olan and Orlandu are there as expected... but wait, what's Ramza doing in there? He's not present in the scene, but he's there in the ENTD, set to invisible, set to 03 Ramza / 03 Squire and Join After Event...

...yeah.

...There must be a few checks in this routine or somewhere else that make sure that we're looking at a Ramza, Join After Event unit in the ENTD and that the unit we're on is Ramza, but anyhow, here's the juicy part:


(...)
0005acb8: 0c0166bc jal 0x00059af0
0005acbc: 02202021 addu r4,r17,r0               # Get unit offset for specified index (out-of-battle data)
0005acc0: 00402021 addu r4,r2,r0
0005acc4: 90830001 lbu r3,0x0001(r4)
0005acc8: 340200ff ori r2,r0,0x00ff
0005accc: 1062002b beq r3,r2,0x0005ad7c                      # If unit didn't exist, skip ?                 
0005acd0: 00000000 nop
0005acd4: 90820000 lbu r2,0x0000(r4)            # Load in base job of specified unit
0005acd8: 00000000 nop
0005acdc: 2c420004 sltiu r2,r2,0x0004            # Are we Ramza? (Base job < 4) (Wonderful hardcoding!!)
0005ace0: 10400026 beq r2,r0,0x0005ad7c            # If not, skip
0005ace4: 00000000 nop
0005ace8: 90820002 lbu r2,0x0002(r4)            
0005acec: 92430000 lbu r3,0x0000(r18)            # Load in base job from the ENTD
0005acf0: 2c420003 sltiu r2,r2,0x0003
0005acf4: a0830000 sb r3,0x0000(r4)               # Overwrite Ramza's base job with it!!!
(Continue overwriting Ramza's data and doing other things...)
  • Modding version: Other/Unknown

Pride

May 28, 2011, 01:20:32 am #4 Last Edit: May 28, 2011, 01:35:03 am by Pride
...

That is wonderful =o

Edit: Big routine >_>
  • Modding version: PSX
Check out my ASM thread. Who doesn't like hax?

RandMuadDib

so that means that if we change that 4 to a 5, we can have a different ramza for each chapter? or even higher to have multiple ramzas during each chapter?
I will show you the power of SARDIIIIINES!!!!

Glain

There might be a few other places you'd have to change, and there are probably a few more pieces to this puzzle, but yeah. You'd have to rearrange base classes, of course (04 is one of Delita's, and you'll encroach upon more as you go higher).

I'm not even sure how general this is. It might not only apply to Ramza, actually... the check is basically (is base job < threshold ? OKAY, OVERWRITE!).
  • Modding version: Other/Unknown