Final Fantasy Hacktics

Modding => PSX FFT Hacking => Topic started by: Glain on October 07, 2011, 07:27:15 pm

Title: Glain's Assorted ASM (Latest: RSM, Skillsets, Jump, ENTD, oh my!)
Post by: Glain on October 07, 2011, 07:27:15 pm
This is my miscellaneous ASM thread, for assorted ASM hacks I've done that don't have a thread, or are scattered throughout miscellaneous threads. Basically I'm starting this thread at Pride's suggestion, as sometimes I'll write some ASM in some other section and it will get buried somewhere in a thread that's hard to find. Also, so I have a place to post some things I've done that don't fit anywhere else.

The latest version of my .XML also comes with (and requires) the latest FFTPatcher suite 0.493, currently available here (https://ffhacktics.com/smf/index.php?topic=7163.msg229430#msg229430).

Applications

MassHexASM - For encoding ASM commands into PSX-ready binary commands (with the little-endian option), or decoding them from binary commands to ASM instructions. This way you don't have to manually switch byte order like you did with Renegade64. Ideally, the output can just be pasted into a patch file.
Thread: http://ffhacktics.com/smf/index.php?topic=7130.0

LEDecoder - Disassemble binary files into ASM commands, with an option for using little endian byte order. I couldn't find any MIPS disassemblers out there that would let you specify little endian, so I wrote this. (I used this program to disassemble some of the files in the EFFECT subdirectory of the ISO and found ASM commands in there...)
Thread: http://ffhacktics.com/smf/index.php?topic=7758.0

Spreadsheet ASM Hacks

UWEntries - Change which base jobs use which UNIT.BIN and WLDFACE.BIN entries. For changing special characters, not generics.
Thread: http://ffhacktics.com/smf/index.php?topic=7833.0

Gear Level ASM Hacks

Gear Level bugfix - Fixes a bug in FFT where the random gear routine could select extremely low level equipment in certain situations (e.g. Linen Robe in Chapter 4).
Post: http://ffhacktics.com/smf/index.php?topic=6971.msg142849#msg142849

Gear level based on Shop Availability (Story Progression) with override (0x16b)
This is the standard gear level patch (based on shop availability) with an FFTPatcher override.  My latest version.

Gear level based on Shop Availability (Story Progression) - Picks random equipment based on what's currently in the shops instead of the levels of the units. Allows enemy levels to scale with you without their equipment scaling.
Post: http://ffhacktics.com/smf/index.php?topic=6971.msg146276#msg146276

Other ASM Hacks

All formulas apply elemental (v2)
All formulas apply elemental.
Affects HP Damage, MP Damage, HP Healing, and MP Healing.

Ability element takes precedent over weapon element, and will be used unless
the ability's "Weapon Strike" and flag under "Hit Allies" are both checked, in which
case the Ability and Weapon elements will be combined.

Optional: You can specify a multiplier to be applied to damage and/or a separate multiplier for healing. 
The format for the multipliers is 16.16 fixed point (e.g. 1.25 = 00014000).
A multiplier of zero (default) will be ignored.

Swordskill strengthen (v2) - Strengthen should work with ability element for Holy/Dark sword; Dark Sword gains strengthen, status proc, (WP+Y)
This version has a variable flag to decide whether to use PA or MA.

Defense (Equipment grants damage reduction) (v2)
In the item data, this patch interprets Unknown 1 as Physical damage reduction (percentage) and Unknown 2 as Magical damage reduction (percentage).
The damage reduction percentage for each piece of equipment is added to determine the total damage reduction.
An ability's classification as physical or magical is determined by the 'Physical Attack' and 'Magical Attack' AI flags for the ability.
If an ability is flagged with both (this shouldn't happen, really), both damage reduction percentages (physical AND magical) will be applied
(the sum of the two)!

Crystals - Learn from any base job
This hack's for learning from crystals where the enemy base job is different from yours. For example, Night Sword from Gafgarion. You'll need to put the ability to learn in the same slot as the skillset you're learning into. Since this one did appear in another thread, there's more info on it here (http://ffhacktics.com/smf/index.php?topic=7685.msg154680#msg154680).

Hide excessive HP/MP recovery
Excessive HP/MP recovery is not displayed.
Post: http://ffhacktics.com/smf/index.php?topic=10535.msg203041#msg203041

Signed Ability Y Values
This allows you to use negative numbers for Y values in formulas. Any Y > 127 is considered as the negative number Y - 256 (e.g. 253 becomes -3). The source for this one is just changing lbu to lb where this particular address (0x801938fa) is read.

Target's Faith in Spell damage calculations becomes XX%

[Half of MP] becomes [No MP Cost]
Might be useful as an enemy-only ability for bosses, to use MP-heavy abilities without depleting their MP.

Require Materia Blade -> Require Item Type X (Default Lance)

Formula Hacks

Formula 3B: Mana Burn/Feedback (v2)
Version 2 of the mana burn hack, which caps damage at MA * Y.  Damages MP and deals equivalent HP damage.

Formula 11: Damage = MA * (WP+Y)

Elemental cancel: Formulas 17,3e,44
This makes formulas [17], [3e], and [44] subject to elemental cancel. Useful if you don't want bosses to be affected.

Formula 54 becomes HealMP_(Y%)

Formula 44: Use HP instead of MP

Fix Reraise Graphic Width
The graphic width for the Reraise status text is slightly too short; this patch fixes that.

Start button skips events, effects, battle and event text, etc.
Thread: http://ffhacktics.com/smf/index.php?topic=11608.0

Speed shortens ability CT
This one uses a curve where CT is affected more at lower speeds, and the effect depends on the CT factor you choose (default 5).  With CT Factor = 5, it begins taking effect at Speed = 5 and ability CT halves by Speed = 10, and would quarter by Speed = 20. 
Basically, for any ability, the CT is affected by a multiplier where ((CT Multiplier) = (CT Factor) / Speed).

Geomancy single ability
Creates a single ability for Geomancy that changes its properties based on the tile the caster is standing on.
Should be used inside a Default skillset.  Ability ID can be specified; default is 0x7E (Pitfall)

JP scroll glitch actual fix (Disable paging on confirm menu)
This patch disables paging up or down while the confirm menu is up on the ability learn screen.  As a result, there is no way to do the JP scroll glitch.

Unit slots backfilled when unit is removed from party
Removing a unit from the party no longer leaves a gap in the party!

Speed up text crawls
Speeds up text crawls significantly.
Text delays longer than a certain amount are changed to that amount.  Default is 2.  Lower is faster.

Switch unit number with L1 and R1 buttons (formation)
Switch unit number with L1 and R1 buttons in the formation screen.  Changes unit order as appropriate.  L1 and R1 still work normally (switching the selected unit) in menus.

Press buttons to win!
Press a button combination (default L1 + Select) to win the current battle.  It needs to be done while the game is processing the battle event conditionals, so between turns, or between a unit moving and acting, or somesuch.  Works even in Bethla Sluice.

Load Formation ignored if unit not in party
Doesn't try to load a unit from the party from the ENTD (Load Formation flag set) if they're not in the party, and instead uses whatever data is in the ENTD for that unit.  You won't normally encounter this scenario, but if it were to happen in the normal game, it would create a messed up unit that would overwrite Ramza when the battle/event was over.

Break out of multi-battle sequences
Break out of multi-battle sequences by pressing a button combination directly after exiting the formation screen.  Default is L1 + R1.
Includes the "Load Formation ignored if unit not in party" patch, because that situation can occur if breaking out of a sequence where a Guest has already left the party.

Equipment duplication glitch fixes
Fixes the equipment duplication glitches that can be triggered from using Best Fit in the shops.

Level down fix
Fixes leveling down to subtract raw stats based on old level instead of new level, so it should subtract the same amount gained in the previous level.  Also fixes level up abilities so that they add the same amount as leveling up via experience gain.

Crits always deal bonus damage
Crit XA bonus minimum is 1 instead of 0.  Maximum is still XA - 1.

Always crit
Always get a critical hit.  Can be useful if you're testing crits or somesuch.

Brave story can point to non-setup events

Enforce level caps
Varies by chapter, like in SCC challenges, but enforced by the game.

Change camera zoom values

Disable Now Loading Message
This hack disables the Now Loading routine entirely, saving the most SCUS space.

Now Loading Routine Rewrite
Rewrites the Now Loading routine to save space.  Includes variables to modify the color of the message.

Expand load and save data
Expands the load and save data to use all 64 blocks of the save file, instead of only 60.

Unit bench (10 extra unit slots)
Add the unit bench, which can hold 10 extra units.  Accessible from the formation screen, with Bench Unit and Unbench Unit menu items.  Units sent to the bench lose EXP and JP.  Joining units will join to the bench if party is full.

----- Latest -----

Jump single ability
Makes an ability function as Jump.  It should be placed in a normal skillset with Default action menu.  Recommended to use the default ability ID, 0x018A Level Jump2.
Range (Both level and vertical) are based on Lancer job level.

Skillset learned ability fix
When determining usable abilities in a skillset, finds the learned abilities based on the job instead of skillset ID.  Fixes an issue where changing the skillset for a generic job to an unused skillset resulted in those abilities all being auto-learned.

Skillset menu hardcoding fix
Skillset menu actions based on action menu instead of being hardcoded to skillset ID.  Fixes some issues resulting from changing action menus on generic skillsets.  Similar to (and mutually exclusive with) Generic Skillset Fix / Skillset Behaviors hack, but based on action menu.

Save between battles after formation screen
Allows saving between battles AFTER the formation screen. 
Loading a save made this way will still load the formation screen, but with the latest changes saved.
Saving before the formation screen still functions as normal.

Gained JP functions as if Gained JP UP was always active

Equippable R/S/M only limited by job innates

All (and only) player human units can find items on moving

Blade Grasp dodge percentage is (Brave * Multiplier) / 1024 and only affects certain weapons

Abandon multiplies evasion by 1024 / Divisor

Require Sword and Require Materia Blade check only first weapon

ENTD Job Level also applies to Job and secondary skillset job

Enhanced ENTD
ENTD can now specify extra parameters for units.  (See description in XML.  Can use extra ENTD slots to modify previous slots.)

Defense Up and Defend status multiply damage by Multiplier / 1024

Stat variation
Base stats for PA and HP vary based on Brave, while MA and MP vary based on Faith.  Starting job stat multipliers also cause further variation.

Base stat decrease
Base speed is 5 for humans and 4 for monsters (instead of 6 and 5, respectively).  Base PA and MA use values of 3.25 and 4 instead of 4 and 5.  Male and female soldier office recruits both have Broad Swords.
Title: Re: Glain's Assorted ASM [Latest: Crystals, Mana burn, (MA+Y)*WP]
Post by: Choto on October 07, 2011, 08:58:54 pm
Thanks for setting this up!

question about mana burn - is there any way to alter how much MP drain/HP damage it does?
Title: Re: Glain's Assorted ASM [Latest: Crystals, Mana burn, (MA+Y)*WP]
Post by: Glain on October 07, 2011, 09:33:31 pm
Not currently. I could think about doing something like that though. A damage formula, or percentage, or something of the sort?
Title: Re: Glain's Assorted ASM [Latest: Crystals, Mana burn, (MA+Y)*WP]
Post by: RavenOfRazgriz on October 18, 2011, 01:44:28 am
For your hacks, could you list other things you've done, like the various Random Equipment Hacks (The original thread contains lots of ASM-talk and is very hard for an ASM-idiot to read and understand what the hacks there actually do, and is buried) and your apps, etc?

Also, were you the one who made a hack so that AI units with <Random> R/S/M chosen would always come into battle with one if chosen?  If so, can you repost that hack here too?  I know -somebody- made that hack and I can't find it.
Title: Re: Glain's Assorted ASM [Latest: Crystals, Mana burn, (MA+Y)*WP]
Post by: Glain on October 26, 2011, 08:04:17 pm
Yeah, the random gear hack thread is sorta crazy... a little while ago I edited it to put the hacks at the top, and attached an XML at the bottom of the post. I figured the patch that does gear level based on shop availability was the one to feature, as once that became available, the other patch options didn't seem to see much use.

Other than that, I could link to the various threads for the other hacks/apps from here, I suppose?

Not sure about the R/S/M thing; I don't think that hack was me. Sounds interesting, actually, because I think I have seen AI come in with nothing on one or more of those slots even though they were set to Random.
Title: Re: Glain's Assorted ASM [Latest: Crystals, Mana burn, (MA+Y)*WP]
Post by: Pickle Girl Fanboy on October 26, 2011, 08:30:39 pm
Either add links to your other threads here, or get them in the sticky.
Title: Re: Glain's Assorted ASM [Latest: Crystals, Mana burn, (MA+Y)*WP]
Post by: RavenOfRazgriz on October 26, 2011, 09:41:24 pm
Quote from: Glain on October 26, 2011, 08:04:17 pm
Yeah, the random gear hack thread is sorta crazy... a little while ago I edited it to put the hacks at the top, and attached an XML at the bottom of the post. I figured the patch that does gear level based on shop availability was the one to feature, as once that became available, the other patch options didn't seem to see much use.


Honestly - I can't tell how to use most of them because with all the shit going on it's impossible to tell what they do.  You have one spot where you try to tl;dr explain them but the names you gave them are too vague to matter and the descriptions are equally so.  Putting them here with better names + better descriptions would be incredibly appreciated.  The Story Progression one is used the most in large part because it's the easiest to understand at a glance, the others aren't even getting a fair shot.

Quote from: Glain on October 26, 2011, 08:04:17 pmNot sure about the R/S/M thing; I don't think that hack was me. Sounds interesting, actually, because I think I have seen AI come in with nothing on one or more of those slots even though they were set to Random.


Maybe it was Pokeytax then?

I could've sworn I saw that ASM at some point.  Maybe I'm insane.
Title: Re: Glain's Assorted ASM [Latest: Crystals, Mana burn, (MA+Y)*WP]
Post by: Glain on November 01, 2011, 11:53:32 pm
All right, I went through and added the links to my apps/hacks/what have you. Not sure I did a better job tl;dr'ing the gear level ones, but at least they're more succinct than in the thread.
Title: Re: Glain's Assorted ASM [Latest: Crystals, Mana burn, (MA+Y)*WP]
Post by: Choto on November 08, 2011, 03:20:32 pm
Requesting this be added to the "important links" list so it doesn't get lost in the mix. I think some of Glains utilities are in there already but in different threads.
Title: Re: Glain's Assorted ASM [Latest: Crystals, Mana burn, (MA+Y)*WP]
Post by: RavenOfRazgriz on January 11, 2012, 12:13:53 am
Does your Formula 11 becomes MA*(WP+Y) hack accept Attack UP / Defense UP / Protect or Magic AttackUP / Magic DefendUP / Shell?  Is there a way to change what it accepts?

I'm going through flagging my AI for a few skills using it, and you don't list whether the skills using the formula are treated as physical or magical, just how to change which evasion it accepts.
Title: Re: Glain's Assorted ASM [Latest: Crystals, Mana burn, (MA+Y)*WP]
Post by: Glain on January 11, 2012, 10:33:54 am
I know we talked about this on IRC, but as a general answer, it should be magic damage and be subject to everything that entails. I used formula [4e] as a base and it uses the same magic damage calculation routine, which should take all that into account, or at least I assumed it did. I should probably test that.
Title: Re: Glain's Assorted ASM [Latest: Crystals, Mana burn, (MA+Y)*WP]
Post by: Pride on January 11, 2012, 10:50:40 am
According to the notes, jal 0x00188964 leads to a section that calculates using magic damage.


00188964: 27bdffe8 addiu r29,r29,0xffe8
00188968: afbf0010 sw r31,0x0010(r29)
0018896c: 0c0617ff jal 0x00185ffc      Elemental Strenghten
00188970: 00000000 nop            
00188974: 0c0621d1 jal 0x00188744      Magical Support/Status/Compat
00188978: 00000000 nop
0018897c: 0c0621df jal 0x0018877c      Elemental XA * YA
00188980: 00000000 nop
00188984: 14400003 bne r2,r0,0x00188994      
00188988: 00000000 nop
0018898c: 0c0621f1 jal 0x001887c4      Elemental Absorb/Status
00188990: 00000000 nop
00188994: 8fbf0010 lw r31,0x0010(r29)
00188998: 27bd0018 addiu r29,r29,0x0018
0018899c: 03e00008 jr r31
001889a0: 00000000 nop


00188744: 27bdffe8 addiu r29,r29,0xffe8      
00188748: afbf0010 sw r31,0x0010(r29)      
0018874c: 0c061881 jal 0x00186204      Magic Attack Up
00188750: 00000000 nop            
00188754: 0c0618c7 jal 0x0018631c      Magic Defense Up
00188758: 00000000 nop            
0018875c: 0c061918 jal 0x00186460      Target's Status Affecting XA (Magical)
00188760: 00000000 nop            
00188764: 0c061259 jal 0x00184964      Zodiac Compat
00188768: 00000000 nop            
0018876c: 8fbf0010 lw r31,0x0010(r29)      
00188770: 27bd0018 addiu r29,r29,0x0018      
00188774: 03e00008 jr r31         
00188778: 00000000 nop   

Title: Re: Glain's Assorted ASM [Latest: Crystals, Mana burn, (MA+Y)*WP]
Post by: RavenOfRazgriz on January 13, 2012, 05:25:40 pm
Hey Glain, you're smart.  How would you like to tackle changing which Reactions are tied to which triggers?  I've got some basic stuff I'd /like/ but don't need on a life-or-death level I'd make use of in Journey of the Five if you're interested:

Brave Up - Share the same trigger as Faith Up.  (Responds to basically anything that happens to the unit.)
Dragon Spirit, Sunken state - Share the same trigger as Regenerator, Caution.  (Responds to anything that inflicts 1+ points of damage.)
Counter Tackle - Share the same trigger as Counter Flood.  (Responds to anything with the 'Counter Flood' flag set.)

Yes, this'd leave just Counter and Blade Grasp on the Countergrasp flag - truly only Countergrasp now!


And something a bit more bold...

Making "copies" of Counter Tackle in unused Reaction slots / Reaction slots I'm no longer making use of.  (By "copies", I mean, make a Reaction with the same properties as Counter Tackle that responds with a skill of my choosing.  Possibly even make an inverted version of this that has the skill used on the caster instead of the target.)  Mostly asking if you'd be interested in this one because it's the easiest way to make "new" Reactions.  If you are, I can give you more details on what I'd like, but feel free to tell me off!
Title: Re: Glain's Assorted ASM [Latest: Crystals, Mana burn, (MA+Y)*WP]
Post by: Glain on January 13, 2012, 06:35:00 pm
I could look at making a patch to change which flags are for which counter abilities. I'm not promising results or anything, but I may look into it. It sounds interesting.

I was hoping, when I looked into the question of "Where does Counter Tackle figure out which ability to counter with?" that it would be something associated with the ability, but from what I saw of the code, it might be hardcoded to ability ID, which would make the second part a lot harder.

(Hardcoded as in, Is my Ability ID [Counter Tackle's Ability ID]? If so, use [Dash's Ability ID])
Title: Re: Glain's Assorted ASM [Latest: Crystals, Mana burn, (MA+Y)*WP]
Post by: RavenOfRazgriz on January 15, 2012, 11:20:05 am
Heh.  I see.

If you can't do it, it's no big.  Like I said, it's not life or death, just a detail I'd like to polish up and something I'd imagine other people would like too.
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: RavenOfRazgriz on January 21, 2012, 06:25:49 pm
Swordskill strengthen - I do hope you mean they gain /everything/, and not /just/ Strengthen.  It'd be pretty derpy if it didn't accept Half/Weak/Cancel/Absorb.  If it is /everything/, this is 90% of an ASM hack I need.  By "Dark Sword", I assume you mean the formula for both Dark Sword and Night Sword.  Would it be possible to get a variation of this hack where the Dark Sword and Night Sword formula are Abs[HP/MP]_(PA*(WP+Y))/2?  That'd be perfect for my needs.
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: Glain on January 22, 2012, 12:22:14 pm
Yes, it seems to be everything (Half/Weak/Cancel/Absorb should all work). And yes, I was referring to the skillset Dark Sword, so that's Dark/Night sword, specifically formulas [2f] and [30].

Regarding "halving" the damage: It seems what the formulas all do is: Load in two factors, then call the damage routine to multiply them. That damage routine is apparently shared by just about every formula (the multiplication to addition change would never have been so easy if it wasn't). You can see it'd be a bit problematic to try to put a division by 2 in there at the end as it would affect every single formula.

So basically what I'm saying is that it'd be a lot easier/better to do [(PA div 2) * (WP+Y)] or [PA * ((WP+Y) div 2)] where div is integer division. It just has a lot more error from truncating decimals than [(PA * (WP+Y)) div 2] does.

EDIT: I can probably just put it in what I have, but I can't think of an easy way to configure whether or not you want Dark/Night sword to be halved, so it'd probably have to be a separate hack.
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: RavenOfRazgriz on January 22, 2012, 02:01:03 pm
You could use X=0 normal, X=1 halved to try and combine both into one hack, Glain.  If you wanted to get ambitious, you could also beef up the Mighty Sword formula (2E) to also accept all this shit and be halved or not halved by X=0 and X=1, since that formula is also NS and likely no-Element as well.  Then you could toss in your MA*WP+Y edit as Formula 18 (Seriously, no one edits Formula 18, man) under the same stuff and have the super obscene all-in-one Swordskill Formula Patch of Awesome.  I'd also say to divide the XA and not the WP, since you generally want the weapon scaling more than the PA scaling.

/total overachiever.
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: Glain on January 22, 2012, 04:15:23 pm
I've got it as (PA / 2^X) * (WP+Y) now. Integer division, of course. Updated the main post with it.

Bah, formula [2e]. Psh. Maybe later or something. It's weird.

I can't centralize all the formulas unless I can introduce another variable, not X or Y since they're both already used; I need a parameter to tell my function which formula we're on (should we be absorbing HP, MP, etc).
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: RavenOfRazgriz on January 22, 2012, 05:11:21 pm
What about the register that holds the "Z" value for Items?  I imagine that's not being used for anything at the time an ability is cast. Unless the "Z" is really either X or Y and Melonhead just labeled it as Z because you can't affect it through a formula, in which case, derp.  The game must have a way of telling which Formula is which.  I don't think FDC and I ever had an issue when designing aspects of his Formula Hack when we needed to see which Formula was being called, but hell if I remember exactly where that info was stored, either.

The other alternative is to topload everything onto Y.  0-7 is PA/1, +0-7 Y, 8-15 is PA/2, +0-7 Y, etc., then use X to determine which formula it is.  Bit ugly, but it does the job.

Still, this suits everything I personally need it for perfectly.  I just like things to exceed what I need them for because I know that either I'll think of a use for the things I didn't think I'd need, or that someone else definitely will use it, at least in a cast like this.  Very much thanks for what you've done so far with it, in any case.
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: Pickle Girl Fanboy on January 23, 2012, 03:40:43 pm
While you're talking about Swordskills, could you make another hack which, along with doing all the things Raven's request does, changes the + Y to - Y.  Unless it was +X, not +Y.  You know what I mean.
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: Sterling LaVaughn on January 24, 2012, 02:51:34 pm
I've been playing through the full game with the Story Progression Gear hack and the Gear Level bugfix. One thing I've noticed is that enemies will still occasionally use old items later in the game; you might see two Knights late in Chapter 4, one with a Rune Blade and another with a Diamond Sword.

It also seems like anytime you have multiple items of the same type available at the same time (Fire/Ice/Thunder Rods, Flame/Ice Shields, etc.), those items will keep coming up too. I'm assuming it counts the "extra" items as their own item types like with the old Linen Robe problem, but I haven't bothered verifying it.

Anyway, the whole thing works great. You won't notice the weird selection thing until long after you're capable of plowing through groups with <Random> across the board, at which point it becomes a cool little flavor bit.
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: RavenOfRazgriz on January 24, 2012, 09:45:28 pm
Important Question: Is your MA*(WP+Y) 100% Status or 19% Status?  If it's only 19% Status, could I get a 100%* Status version?  Same with the Night/Dark Sword hack, if the current setup is only 19% Status.  I've been designing with those hacks and assuming they're 100%* Status, but they don't actually list whether they're 100%* or 19% Status.

(By 100% Status, I mean they function how 2D functions, where Separate is 19%, All or Nothing, Random, Cancel are all 100%.)
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: Pride on January 24, 2012, 09:57:16 pm
It appears his Dark/Night Sword does proc at 100% like formula 2d but his MA*WP is 19% because it goes off of the same routine as the Truth formula, so making it like formula 2D it would affect all the formulas that use the Truth routine.

Battle.bin
0x001217DC
00000000
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: RavenOfRazgriz on January 24, 2012, 10:13:07 pm
Which formula run off the Truth routine?  I don't think it'd affect anything I've done so far, but that could actually be handy to me.
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: Pride on January 24, 2012, 10:18:51 pm
The ones that I know... 1e, 20, 24, 4e, and 5e. I don't believe there are anymore.
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: Glain on January 25, 2012, 03:45:23 pm
Quote from: Pickle Girl Fanboy on January 23, 2012, 03:40:43 pm
While you're talking about Swordskills, could you make another hack which, along with doing all the things Raven's request does, changes the + Y to - Y.  Unless it was +X, not +Y.  You know what I mean.


I could probably make it so that putting in a number for Y > 127 would make it count as negative (two's complement (http://en.wikipedia.org/wiki/Two%27s_complement) rules). There's nothing intuitive about it at all as far as I can tell but it'd allow +/- and I can't imagine anyone would use a Y > 127 anyway because it's just gonna end up 999 once you get PA > 7.

EDIT: It's fairly simple, too... I could probably just change the routine called for that (0x00185e5c) and do an lb instead of an lbu so I'll get sign extension. Of course, that'd end up changing any WP+Y formulas as well, but there's really no reason to use Y > 127 on any of them unless I'm missing something.
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: RavenOfRazgriz on January 25, 2012, 04:03:39 pm
Quote from: Pride on January 24, 2012, 10:18:51 pm
The ones that I know... 1e, 20, 24, 4e, and 5e. I don't believe there are anymore.


So this would affect Geomancy and the basic MA*Y formula...?

...Interesting.

Quote from: Glain on January 25, 2012, 03:45:23 pm
EDIT: It's fairly simple, too... I could probably just change the routine called for that (0x00185e5c) and do an lb instead of an lbu so I'll get sign extension. Of course, that'd end up changing any WP+Y formulas as well, but there's really no reason to use Y > 127 on any of them unless I'm missing something.


Yup. I'd go for it - there's no reason not to, really.  More functionality is always welcome.

This is similar to something FDC and I devised for his Formula Hack to get lots of options in small amounts of space.  I assume you've read through the rewrites in regards to that so far that FDC has posted in the ASM Collective BATTLE.BIN Map thread.  If not, check those out - we do some crazy shit involving multiples of 8.
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: Pride on January 25, 2012, 04:23:39 pm
And HP damaging Draw Out as well, for all its worth. The routine for non-faith HP damaging magic, which is why it affects all those formulas. I just have it labelled in my notes as "Truth" routine which isn't exactly accurate.
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: Pickle Girl Fanboy on January 25, 2012, 04:28:35 pm
@last three posts:
1. I fucking love you guys.
2. This is just what I wanted, thank you so much, did I mention I love you?

I always thought that swordskills should be weaker than Attack, since they are ranged, elemental (can possibly do more damage), and deal status effects.  Now, (by the power of grayskull dot dot dot) I have the power.

I'm so pumped about The Formula Hack.  Yes, it does rate proper noun status.  I don't remember correctly, but will you be able to flag an ability as Magical in the AI box and have it behave as such(as in it is affected by Shell, Magic Attack/Defense Up, and M-Ev), to free up other flags?  Will there be flags or bits you can use to determine if a formula will use or affect PA, MA, SP, and so on?

If I really wanted to be hardcore, I'd request a hack that allows the swordskill formula to act like the Attack formula.  As in, it references the weapon formula, then adds or subtracts (Y) from the XA (or whatever).
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: RavenOfRazgriz on January 25, 2012, 04:36:56 pm
Quote from: Pride on January 25, 2012, 04:23:39 pm
And HP damaging Draw Out as well, for all its worth. The routine for non-faith HP damaging magic, which is why it affects all those formulas. I just have it labelled in my notes as "Truth" routine which isn't exactly accurate.


That's actually important to me since I have a few Draw Out formula skills that inflict Statuses.

Thanks for clarifying.

Quote from: Pickle Girl Fanboy on January 25, 2012, 04:28:35 pmI don't remember correctly, but will you be able to flag an ability as Magical in the AI box and have it behave as such(as in it is affected by Shell, Magic Attack/Defense Up, and M-Ev), to free up other flags?  Will there be flags or bits you can use to determine if a formula will use or affect PA, MA, SP, and so on?

If I really wanted to be hardcore, I'd request a hack that allows the swordskill formula to act like the Attack formula.  As in, it references the weapon formula, then adds or subtracts (Y) from the XA (or whatever).


Yes, yes, and yes.  The third one is actually handled in Formula Hack by just adding a Y value after the WP in the Dmg_Weapon formula in addition to the existing rewrites around it.  You could probably do that as it stands, preferrably with FDC's Weapon Formula Rewrite version.  I believe there's leftover space in there somewhere to be manhandled around with.
Title: Re: Glain's Assorted ASM [Latest: Elemental cancel, Swordskill strengthen]
Post by: Glain on January 25, 2012, 05:55:57 pm
We could probably make Y always accept negative numbers for every formula, except that pesky [1a] (Speed Ruin, etc) uses Y as the hit modifier instead of the effect/damage one for some reason, so it has values > 127.

EDIT: What the heck... making a hack for it anyway.
Title: Re: Glain's Assorted ASM [Latest: Signed Ability Y Values]
Post by: RavenOfRazgriz on January 26, 2012, 01:49:18 am
Haha.  You could just code an exception for 1A?

Also, Celdia just brought to my attention a bug present in the original 2D Formula, at least from her testings in making skills for CCP: If it has a Y of 0, it doesn't apply the status, even if All or Nothing.  Does this behavior still exist with your Swordskill ASM?  If it does, any ideas on how to fix it?
Title: Re: Glain's Assorted ASM [Latest: Signed Ability Y Values]
Post by: Pickle Girl Fanboy on January 26, 2012, 11:58:07 am
Quote from: Glain on January 25, 2012, 05:55:57 pm
We could probably make Y always accept negative numbers for every formula, except that pesky [1a] (Speed Ruin, etc) uses Y as the hit modifier instead of the effect/damage one for some reason, so it has values > 127.

EDIT: What the heck... making a hack for it anyway.

Quote from: RavenOfRazgriz on January 26, 2012, 01:49:18 am
Haha.  You could just code an exception for 1A?

Does it make more sense to instead make 1A act like other formulas?  Switch what X and Y do around so it's not the weirdo, I mean.

Quote from: RavenOfRazgriz on January 26, 2012, 01:49:18 am
Also, Celdia just brought to my attention a bug present in the original 2D Formula, at least from her testings in making skills for CCP: If it has a Y of 0, it doesn't apply the status, even if All or Nothing.  Does this behavior still exist with your Swordskill ASM?  If it does, any ideas on how to fix it?

I encountered that too, while trying to make Night Sword add Darkness, KO, Death Sentence, or Vampire at Random All Or Nothing.  While Dark Sword was getting Silence, Sleep, and Slow, and Stop at Random All Or Nothing. 

Yes, Ramza was getting Dark Swordskills.

Yes it was my first patch.

...

SHUT UP
Title: Re: Glain's Assorted ASM [Latest: Item defense (-Damage%)]
Post by: Glain on April 22, 2013, 08:08:41 pm
So, I've finally done some adding/reorganizing in this thread, notably adding a bunch of hacks that were either in my .482 FFTPatcher XML file, hacks of mine that were in various places throughout the forum, and/or hacks that were randomly sitting somewhere on my hard drive. (e.g. All formulas apply elemental, damage/healing multipliers, item defense, some changes to the swordskill patch, the Require Materia Blade -> Item type hack, etc.)  Most of my ASM should be consolidated into this thread with those additions. There should also be a bugfix here when using the defense hack with the elemental hack.

I even added another gear level hack, because we certainly needed another one of those!
Title: Re: Glain's Assorted ASM [Latest: Item defense (-Damage%)]
Post by: RavenOfRazgriz on April 22, 2013, 08:46:04 pm
Glain, you realize those Unknowns in FFTP actually relate to AI functions, right?

I slapped a post on the forum in the Help section somewhere detailing what most of them do.  You should probably make sure your gear hacks and whatnot don't start making the AI go herp berp derp because they also set it to have a weird priorty.
Title: Re: Glain's Assorted ASM [Latest: Item defense (-Damage%)]
Post by: Glain on April 22, 2013, 09:26:51 pm
In that post, 0x0169 is 0x25 and 0x016b is 0x27 (0x25 and 0x27 are the unlabelled ones).  I'm quite sure they're never set to anything other than 0 for any unit in vanilla.  I also did some other kind of test (read breakpoints or something) and got nothing relevant.  I'm currently using this new one and haven't found anything weird going on.
Title: Re: Glain's Assorted ASM (Universal elemental v2, Swordskill v2, Other v2 hacks)
Post by: Glain on July 19, 2016, 11:12:39 pm
I've made some updates to some of my existing hacks, notably creating a version 2 of the universal elemental hack (all formulas apply elemental) which should be more consistent as far as affecting damage and healing for both HP and MP instead of just modifying HP damage.  The swordskill hack should also be more consistent about strengthening whether using physical (PA) or magic (MA) versions.  I've also updated a few other hacks with new versions, and made use of variables to try to eliminate the patches that had dependencies on other patches.  I've modified the original post to make note of the updates and link to the new XML file!
Title: Re: Glain's Assorted ASM (Modify unit number, insta-win, dupe fixes, etc.)
Post by: Glain on July 12, 2018, 08:32:17 pm
I've finally updated this to include my latest ASMs, some of which were around already but not included here, and a bunch of others that are new, including a variety of things that I had been tinkering around with for a while...

Fix Reraise Graphic Width
The graphic width for the Reraise status text is slightly too short; this patch fixes that.

Start button skips events, effects, battle and event text, etc.
Thread: http://ffhacktics.com/smf/index.php?topic=11608.0

Speed shortens ability CT
This one uses a curve where CT is affected more at lower speeds, and the effect depends on the CT factor you choose (default 5).  With CT Factor = 5, it begins taking effect at Speed = 5 and ability CT halves by Speed = 10, and would quarter by Speed = 20. 
Basically, for any ability, the CT is affected by a multiplier where ((CT Multiplier) = (CT Factor) / Speed).

Geomancy single ability
A single ability for geomancy, having the appropriate effect based on terrain.  Ability ID can be specified; default is 0x7E (Pitfall)

JP scroll glitch actual fix (Disable paging on confirm menu)
This patch disables paging up or down while the confirm menu is up on the ability learn screen.  As a result, there is no way to do the JP scroll glitch.

Unit slots backfilled when unit is removed from party
Removing a unit from the party no longer leaves a gap in the party!

Speed up text crawls
Speeds up text crawls significantly.
Text delays longer than a certain amount are changed to that amount.  Default is 2.  Lower is faster.

Switch unit number with L1 and R1 buttons (formation)
Switch unit number with L1 and R1 buttons in the formation screen.  Changes unit order as appropriate.  L1 and R1 still work normally (switching the selected unit) in menus.

Press buttons to win!
Press a button combination (default L1 + Select) to win the current battle.  It needs to be done while the game is processing the battle event conditionals, so between turns, or between a unit moving and acting, or somesuch.  Works even in Bethla Sluice.

Load Formation ignored if unit not in party
Doesn't try to load a unit from the party from the ENTD (Load Formation flag set) if they're not in the party, and instead uses whatever data is in the ENTD for that unit.  You won't normally encounter this scenario, but if it were to happen in the normal game, it would create a messed up unit that would overwrite Ramza when the battle/event was over.

Break out of multi-battle sequences
Break out of multi-battle sequences by pressing a button combination directly after exiting the formation screen.  Default is L1 + R1.
Includes the "Load Formation ignored if unit not in party" patch, because that situation can occur if breaking out of a sequence where a Guest has already left the party.

Equipment duplication glitch fixes
Fixes the equipment duplication glitches that can be triggered from using Best Fit in the shops.

Level down fix
Fixes leveling down to subtract raw stats based on old level instead of new level, so it should subtract the same amount gained in the previous level.  Also fixes level up abilities so that they add the same amount as leveling up via experience gain.

Crits always deal bonus damage
Crit XA bonus minimum is 1 instead of 0.  Maximum is still XA - 1.

Always crit
Always get a critical hit.  Can be useful if you're testing crits or somesuch.
Title: Re: Glain's Assorted ASM (Modify unit number, insta-win, dupe fixes, etc.)
Post by: 3lric on July 13, 2018, 04:25:37 am
Press buttons to win is fantastic. Thank you Glain. Thats almost enough to make me go finish TLW, since i dont gotta muck around with no OP Ramza derpiness.

Question though. Does this finish the battle or just jump to the next condition, or what?
Title: Re: Glain's Assorted ASM (Modify unit number, insta-win, dupe fixes, etc.)
Post by: 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).
Title: Re: Glain's Assorted ASM (Modify unit number, insta-win, dupe fixes, etc.)
Post by: 3lric on July 27, 2018, 01:21:12 pm
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
Title: Re: Glain's Assorted ASM (Modify unit number, insta-win, dupe fixes, etc.)
Post by: Glain on July 27, 2018, 04:51:11 pm
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
Title: Re: Glain's Assorted ASM (Modify unit number, insta-win, dupe fixes, etc.)
Post by: 3lric on July 28, 2018, 02:32:32 am
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
Title: Re: Glain's Assorted ASM (Modify unit number, insta-win, dupe fixes, etc.)
Post by: Timbo on September 08, 2018, 06:10:48 pm
Can we use your hack to reorder guest units too?
Title: Re: Glain's Assorted ASM (Modify unit number, insta-win, dupe fixes, etc.)
Post by: Glain on September 08, 2018, 06:49:14 pm
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).
Title: Re: Glain's Assorted ASM (Modify unit number, insta-win, dupe fixes, etc.)
Post by: Timbo on September 08, 2018, 07:39:47 pm
That's great. Thanks for the info.
Title: Re: Glain's Assorted ASM (Modify unit number, insta-win, dupe fixes, etc.)
Post by: xjamxx on September 26, 2018, 03:46:28 pm
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):
https://drive.google.com/open?id=1T0RsUT7CPgpTqHW-9R1JKo_pYnUtSFkM (https://drive.google.com/open?id=1T0RsUT7CPgpTqHW-9R1JKo_pYnUtSFkM)


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).
Title: Re: Glain's Assorted ASM (Modify unit number, insta-win, dupe fixes, etc.)
Post by: Glain on June 18, 2020, 09:31:36 pm
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>
Title: Re: Glain's Assorted ASM (Latest: Unit bench (10 extra unit slots))
Post by: Glain on July 01, 2020, 04:03:38 pm
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 (https://ffhacktics.com/smf/index.php?action=dlattach;topic=7864.0;attach=18180)).

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 (https://ffhacktics.com/smf/index.php?topic=7163.msg228438#msg228438).

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.
Title: Re: Glain's Assorted ASM (Latest: Unit bench (10 extra unit slots))
Post by: Ansehelm on July 11, 2020, 09:14:11 pm
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.
Title: Re: Glain's Assorted ASM (Latest: RSM, Skillsets, Jump, ENTD, oh my!)
Post by: Glain on January 10, 2021, 02:25:04 pm
Another update to my XML, brought about by an issue found with the swap units hack when units are on proposition.  That issue should be fixed in this latest update. There are also a bunch of new hacks! The original post has the new version of the XML and include files.
Title: Re: Glain's Assorted ASM (Latest: RSM, Skillsets, Jump, ENTD, oh my!)
Post by: Heisho on January 11, 2021, 02:20:43 pm
Hello there!

First of all, thanks for all these cool hacks Glain!
Second: Regarding the Geomancy and Jump in one ability slot. In Geomancy the Action menu should be Geomancy right? And about the Jump ability, the range will increase with job level am I right?

Regards
Title: Re: Glain's Assorted ASM (Latest: RSM, Skillsets, Jump, ENTD, oh my!)
Post by: Glain on January 11, 2021, 04:25:48 pm
The Geomancy ability is intended to be placed in a Default skillset.  As for the Jump ability, yes, it's based on the Lancer job level.  I probably should have mentioned that.
Title: Re: Glain's Assorted ASM (Latest: RSM, Skillsets, Jump, ENTD, oh my!)
Post by: Heisho on January 11, 2021, 04:47:46 pm
No worries, that is awesome man!
Keep up the good work.
Title: Re: Glain's Assorted ASM (Latest: RSM, Skillsets, Jump, ENTD, oh my!)
Post by: Atroe on March 08, 2021, 10:32:09 am
Tested the skillset fix hack on Equip Change.  Added Cure, Fire, Bolt and Ice to the moveset. Only other ASM used was Choto's "Equip Change uses move instead of Act".

It brought up a spell menu, but clicking any option booted me out of it. I was unable to target, the unit didn't go into Charging, and the AT was left unchanged, but (thanks to Choto's hack) I still had my action for the turn, and movement was unused.

Defend still defended.

Reporting this as it seems like a step towards Dualcasting.
Title: Re: Glain's Assorted ASM (Latest: RSM, Skillsets, Jump, ENTD, oh my!)
Post by: Glain on March 08, 2021, 07:09:02 pm
Thanks for the test/report.  You should be able to use this patch to make Defend and Equip Change work like Default skillsets, along with the other changes (FFTP and the skillset hardcoding patch):

    <Patch name="Defend and Equip Change treated as Default skillset">
        <Description>
            This patch should be applied along with Skillset Menu Hardcoding Fix if changing Defend and Equip Change into Default skillsets in FFTPatcher.
            AI doesn't use abilities in Defend or Equip Change skillsets.
        </Description>
        <Location file="BATTLE_BIN" offset="67594,67598" mode="DATA" offsetMode="RAM">
            D8510780
        </Location>
        <Location file="BATTLE_BIN" offset="675F4,675F8" mode="DATA" offsetMode="RAM">
            58550780
        </Location>
        <Location file="BATTLE_BIN" offset="13628C" mode="ASM" offsetMode="RAM">
            b   0x801362a4
        </Location>
        <Location file="BATTLE_BIN" offset="1692B9" mode="DATA" offsetMode="RAM">
            01 01
        </Location>
    </Patch>
EDITED with potential fix for AI issue, but have yet to test...

I'm not yet sure if some of this should eventually be rolled into the skillset hardcoding patch.  Anyway, let me know if that fixes the issues.

EDIT
The AI only looks at its primary and secondary skillset(s) to find skills that can be used.  Defend and Equip Change have a fair bit of hardcoding.
Either a fairly big rewrite of some AI routines or some fairly sizable new code would probably need to be added to handle this. 
If the goal is for the AI to have more abilities, there are probably better and/or more robust ways to do it... this may not be a useful road to go down.
Title: Re: Glain's Assorted ASM (Latest: RSM, Skillsets, Jump, ENTD, oh my!)
Post by: Atroe on March 08, 2021, 07:52:53 pm
Abilities (both charging and instant) now working properly on both, beautiful. Issues remaining:

No compatibility with Choto's hack, units using skills set to Equip Change still consume their action.

Enemy doesn't use skills in either moveset. I added Night Sword to both, and units with Defend still defend (despite player-controlled units being unable to do so), and units with Equip Change still use basic attacks (or run when in critical HP)

Title: Re: Glain's Assorted ASM (Latest: RSM, Skillsets, Jump, ENTD, oh my!)
Post by: JadeKnightblazer on May 25, 2021, 12:34:01 am
Are there any more Defend / Equip change type slots that are abled to be reused like your ASMs above?
Finding myself about 2 abilities shy of what I may need XD