• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
October 30, 2020, 03:24:35 am

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!


Glain's Assorted ASM (Latest: Unit bench (10 extra unit slots))

Started by Glain, October 07, 2011, 07:27:15 pm

Glain

Haha, yeah... I think it's a cleaner way to just win a battle without having to create uber Wish or what have you.

It finishes the battle by running the (first) victory event.  It also makes the game think all enemies are defeated (to make it work with random battles).
  • Modding version: Other/Unknown

Elric

Quote from: Glain on July 13, 2018, 10:34:37 am
Haha, yeah... I think it's a cleaner way to just win a battle without having to create uber Wish or what have you.

It finishes the battle by running the (first) victory event.  It also makes the game think all enemies are defeated (to make it work with random battles).


It took me a few tries to get it to work, but since it is, it is very very helpful.

I do have a request and feel free to tell me to stuff it, but I was wondering if you could possibly make a similar ASM, but instead of jumping directly to the victory event, it jumps to the next condition in line? Is that doable? Something like that would be extremely helpful to me in cases such as now, where I am completely rearranging the entire game (attack.out GUI, attack.out conditions spreadsheet, worldmap conditions, event offsets, event script numbers, etc.) so that I make sure I don't miss anything.

Again, if you feel it's not worth the trouble, I completely understand as I know the amount of people who would use it aside from possibly Pride and myself is likely very few, but for the few that do, it would be used a shit ton
  • 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

Glain

Hmm.... I think the patch could be adapted to do something like that.  The main difference is probably having to keep track of which scenario is the "current" one... but it also makes me think there could be multiple button combinations.

(Base button combination): Play the current event
(Base button combination) + Left: Go to previous event (roll around to the end if already at the first?)
(Base button combination) + Right: Go to next event (roll around to the start if already at the last?)

Or maybe different button combinations based on which event you want to play? (First, second, third, etc.)

Things can get weird if you keep repeatedly running the same event though (without reloading). When I was still developing the patch, I had a bug where it would always play the intro event instead of the victory event, and after that happened enough times, things became... interesting to say the least :D
  • Modding version: Other/Unknown

Elric

If you can swing it it would be awesome. But dont lose any sleep over it. It would be a help, but im not trying to force anything like that on ya lol.

And yeah the same thing happens when you try to jump to the wrong event in the attack.out, used to happen to me all the time when I first started eventing a million years ago lol
  • 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

Timbo

  • Modding version: PSX
  • Discord username: Timbo

Glain

Looking over the code again, it should only work for non-guests (first 16 slots).  The unit backfill hack will change unit numbers of guests however (when a guest leaves the party).
  • Modding version: Other/Unknown

Timbo

  • Modding version: PSX
  • Discord username: Timbo

xjamxx

I rewrote some hacks in asm mode mostly, should i post them here? start a new thread? or keep them for myself? :?
I will upload my work here (merged old files - added new PRE):

Ok, done with all the hacks i wanted (i pulled them in vanilla code, they are in the non - PRE file). Here is my fft version (based on fft - complete with all my hacks (don't count the first ones till draw out fix), no hooking - plus some modded sprites from this site):


I guess that's all, i will take a long break. Cya all.

UPDATE (Nov-25) added better transition hack and fixed PRE ch1 fix (for some reason i forgot entd 188, added now).
  • Modding version: PSX
<Random> This seems to be a PSX issue.
<Elric> A psx issue? That makes no sense. Sounds more like an issue with your OS.

Glain

I'll have a better consolidation of this later, reflecting the newer version of my XML coming in .493.  But for now...

Now Loading Routine Rewrite

This is a rewrite of the routine that builds the Now Loading message in order to make it shorter.  This frees up 1272 bytes in SCUS.   Also has variables to set the color of the Now Loading message!

    <Patch name="Now Loading Routine Rewrite">
        <Location file="SCUS_942_21" offset="40BD8" mode="ASM" offsetMode="RAM">
             #   ROUTINE: Build Now Loading Message (Rewrite)
            build_now_loading_message:
                    addiu   sp, sp, -48
                    sw      s0, 16(sp)
                    sw      s1, 20(sp)
                    sw      s2, 24(sp)
                    sw      s3, 28(sp)
                    sw      s4, 32(sp)
                    sw      s5, 36(sp)
                    sw      ra, 40(sp)
   
                    move    s1, a1
                    move    s2, a2
   
                    lui     s3, 0x8005
                    addiu   s0, s3, -0x28e0
                    sw      a0, 0x8004760c
                    move    a0, s0
       
                    li      v0, 9
                    sb      v0, -0x28dd(s3)
                    li      v0, 0x2c
                    sb      v0, -0x28d9(s3)
       
                    li      t0, 0x80
                    li      t1, 0x80
                    li      t2, 0x80
                    sw      zero, -0x1a48(s3)
                    sb      t0, -0x28dc(s3)
                    sb      t1, -0x28db(s3)
                    sb      t2, -0x28da(s3)
   
                    jal     0x80023c68
                    li      a1, 0
   
                    li      v0, 0x1f
                    sh      v0, -0x28ca(s3)
                    li      v0, 0x7887
                    sh      v0, -0x28d2(s3)
       
                    li      s5, 1
                    addiu   s4, s0, 40
       
                copy_loop:
                    move    a0, s4
                    move    a1, s0
                    jal     copy_words
                    li      a2, 40
                    addiu   s5, s5, 1
                    sltiu   t0, s5, 7
                    bne     t0, zero, copy_loop
                    addiu   s4, s4, 40
   
                    #   "No" block
                    la      a0, 0x8004d720
                    addiu   a1, s2, 200
                    addiu   a2, s1, 160
                    addiu   a3, s2, 208
                    addiu   t0, s1, 172
                    li      t1, 155
                    li      t2, 228
                    li      t3, 163
                    jal     write_and_copy_block
                    li      t4, 240
       
                    #   "w" block
                    la      a0, 0x8004d748
                    addiu   a1, s2, 200
                    addiu   a2, s1, 171
                    addiu   a3, s2, 208
                    addiu   t0, s1, 178
                    li      t1, 163
                    li      t2, 228
                    li      t3, 171
                    jal     write_and_copy_block
                    li      t4, 235
       
                    #   "loa" block
                    la      a0, 0x8004d770
                    addiu   a1, s2, 200
                    addiu   a2, s1, 183
                    addiu   a3, s2, 208
                    addiu   t0, s1, 195
                    li      t1, 85
                    li      t2, 173
                    li      t3, 93
                    jal     write_and_copy_block
                    li      t4, 185
   
                    #   "d" block
                    la      a0, 0x8004d798
                    addiu   a1, s2, 200
                    addiu   a2, s1, 195
                    addiu   a3, s2, 208
                    addiu   t0, s1, 200
                    li      t1, 96
                    li      t2, 209
                    li      t3, 104
                    jal     write_and_copy_block
                    li      t4, 214
       
                    #   "i" block
                    la      a0, 0x8004d7c0
                    addiu   a1, s2, 200
                    addiu   a2, s1, 199
                    addiu   a3, s2, 208
                    addiu   t0, s1, 202
                    li      t1, 82
                    li      t2, 124
                    li      t3, 90
                    jal     write_and_copy_block
                    li      t4, 127
       
                    #   "n" block
                    la      a0, 0x8004d7e8
                    addiu   a1, s2, 200
                    addiu   a2, s1, 201
                    addiu   a3, s2, 208
                    addiu   t0, s1, 206
                    li      t1, 204
                    li      t2, 206
                    li      t3, 212
                    jal     write_and_copy_block
                    li      t4, 211
   
                    #   "g" block
                    la      a0, 0x8004d810
                    addiu   a1, s2, 202
                    addiu   a2, s1, 205
                    addiu   a3, s2, 210
                    addiu   t0, s1, 210
                    li      t1, 164
                    li      t2, 235
                    li      t3, 172
                    jal     write_and_copy_block
                    li      t4, 240
   
                    la      a0, 0x800459e0
                    li      a1, 0x70
                    jal     0x80022d78
                    li      a2, 0x1e2
   
                    lw      ra, 40(sp)
                    lw      s5, 36(sp)
                    lw      s4, 32(sp)
                    lw      s3, 28(sp)
                    lw      s2, 24(sp)
                    lw      s1, 20(sp)
                    lw      s0, 16(sp)
                    jr      ra
                    addiu   sp, sp, 48



            #   ROUTINE: Write and copy block
            #       Combines write block with copy segment.
            #       Parameters: Same as Write Block
            write_and_copy_block:
                    addiu   sp, sp, -16
                    sw      s0, 4(sp)
                    sw      ra, 8(sp)
       
                    jal     write_block
                    move    s0, a0
       
                    addiu   a0, s0, 0x118
                    move    a1, s0
                    jal     copy_words
                    li      a2, 40
       
                    lw      ra, 8(sp)
                    lw      s0, 4(sp)
                    jr      ra
                    addiu   sp, sp, 16
       

       
            #   ROUTINE: Write block
            #       Writes a block corresponding to a graphic.
            #       Parameters:
            #           a0 = Base pointer for block
            #           a1 = Top Y Position (Screen)
            #           a2 = Left X Position (Screen)
            #           a3 = Bottom Y Position (Screen)
            #           t0 = Right X Position (Screen)
            #           t1 = Top Y Position (Bitmap)
            #           t2 = Left X Position (Bitmap)
            #           t3 = Bottom Y Position (Bitmap)
            #           t4 = Right X Position (Bitmap)
            write_block:
                    sh      a1, 10(a0)
                    sh      a1, 18(a0)
                    sh      a2, 8(a0)
                    sh      a2, 24(a0)
                    sh      a3, 26(a0)
                    sh      a3, 34(a0)
                    sh      t0, 16(a0)
                    sh      t0, 32(a0)
                    sb      t1, 13(a0)
                    sb      t1, 21(a0)
                    sb      t2, 12(a0)
                    sb      t4, 20(a0)
                    sb      t2, 28(a0)
                    sb      t3, 29(a0)
                    sb      t4, 36(a0)
                    jr      ra
                    sb      t3, 37(a0)

       
       
            #   ROUTINE: Copy words
            #       Word-aligned memcpy.  Size must be multiple of 4.
            #       Parameters:
            #           a0 = dest, a1 = src, a2 = size
            copy_words:
                    beq     a2, zero, copy_words_end
                    nop
                    lw      t0, 0(a1)
                    addiu   a2, a2, -4
                    sw      t0, 0(a0)
                    addiu   a0, a0, 4
                    j       copy_words
                    addiu   a1, a1, 4
                copy_words_end:
                    jr      ra
                    nop           
        </Location>
        <Variable name="Color Red Value" file="SCUS_942_21" offset="40C24" offsetMode="RAM" bytes="1" default="80" />
        <Variable name="Color Green Value" file="SCUS_942_21" offset="40C28" offsetMode="RAM" bytes="1" default="80" />
        <Variable name="Color Blue Value" file="SCUS_942_21" offset="40C2C" offsetMode="RAM" bytes="1" default="80" />
    </Patch>
  • Modding version: Other/Unknown

Glain

I'm releasing another version of my XML (and Include files), including the Unit bench hack (10 extra unit slots)!  It's attached to the original post in this thread (direct download).

This update includes the Now Loading routine rewrite, a patch that can expand load and save data, and the Unit bench hack (which includes the former).
This version of my .XML also comes with (and requires) the latest FFTPatcher suite 0.493, currently available here.

EDIT - Uploaded new version of XML to fix problem with circle menu regarding the bench hack.
EDIT - Uploaded new version of XML to add the option to change the checksum end block for the Expand Load and Save Data and Unit Bench hacks.  Changing 3C to 40 (hexadecimal values) will cause saves made without the patch not to load!
EDIT - Uploaded new version of XML to fix issues regarding Tutorials.

EDIT - Uploaded new version of XML to fix an issue with the Speed shortens Ability CT patch where AI routines were unaware of the CT change.
  • Modding version: Other/Unknown

Ansehelm

Just wanna say thanks for making this hack - there have been a lot of cool developments and breakthroughs lately, but the unit bench hack in particular stands out at something that has been requested for many years, and is a must-have for every mod.  It's awesome to be able to save a human unit for later, or have a variety of monsters in the bench so you can breed only the ones you need at any given time.  Heck, you can even potentially have 30 units (if 4 are guests), but that's being greedy.
  • Modding version: PSX