Users browsing this thread: 1 Guest(s)
Condensing Spell List in Battle

#71
Posts: 2,380
Threads: 93
Thanks Received: 358
Thanks Given: 326
Joined: Aug 2009
Reputation: 44
Status
Nattak\'d
(10-24-2017, 03:36 PM)seibaby Wrote: In vanilla, characters that don't have a Magic command don't get in-battle MP. Could that be the case here?

If so, Lenophis' patch Summon This! contains a fix for that.
http://slickproductions.org/ff6patch.php...mon%20This

However, since that patch contains a lot more, here's the code that's responsible for this:
Code:
C2/53F9: 46 F8        LSR $F8        (Carry gets set if character has Magic/X-Magic command
                                     and at least one spell known, Magic/X-Magic and an
                                     Esper equipped, or if they simply have Lore.)
C2/53FB: B0 0B        BCS $5408
C2/53FD: A3 02        LDA $02,S      (retrieve the X value originally passed to the function.
                                     iow, the index of the party member whose menu is being
                                     examined)
C2/53FF: AA           TAX
C2/5400: C2 20        REP #$20       (Set 16-bit A)
C2/5402: 9E 08 3C     STZ $3C08,X    (zero Current MP)
C2/5405: 9E 30 3C     STZ $3C30,X    (zero Max MP)
C2/5408: 28           PLP
C2/5409: FA           PLX
C2/540A: 60           RTS

If this is the issue, a solution to Nattak's problem could be to give those CAAMs a Magic command, or to kill that branch.

A damn fine guess, but alas I am already using Summon This! and have magic command set on the caam.
Still getting: https://imgur.com/tJocYKT


We are born, live, die and then do the same thing over again.
Quote  

#72
Posts: 182
Threads: 1
Thanks Received: 70
Thanks Given: 20
Joined: Oct 2015
Reputation: 18
Status
None
1) regarding Gi Nattak's changes without this patch: is the spell the CaaM casting actually known (as in learned) by any of your active, battle-present party?  if not, try giving it to somebody, and see whether it's still free.

2) regarding the patch: what's to stop the .findSpell loop from going past the end of the Magic list and reading gibberish when the spell isn't known?  (and because of the intent of the patch, i.e. operating on everybody's separate Magic list, it's enough for the one character to not know it.)
Quote  

#73
Posts: 2,380
Threads: 93
Thanks Received: 358
Thanks Given: 326
Joined: Aug 2009
Reputation: 44
Status
Nattak\'d
(10-30-2017, 07:38 PM)assassin Wrote: 1) regarding Gi Nattak's changes without this patch: is the spell the CaaM casting actually known (as in learned) by any of your active, battle-present party?  if not, try giving it to somebody, and see whether it's still free.

2) regarding the patch: what's to stop the .findSpell loop from going past the end of the Magic list and reading gibberish when the spell isn't known?  (and because of the intent of the patch, i.e. operating on everybody's separate Magic list, it's enough for the one character to not know it.)

About #1, the spells being cast by the CaaM are free still indeed if a battle-present party character(s) in battle knows it, yes. For vanilla (and my mod) the CaaM can cast away spells to their hearts content, but not when this patch comes into play. I noticed when scanning a CaaM it shows/loads their HP but not their MP, which we know already I think. But it just seems like with this patch applied it bypasses whatever code there might be to not check for MP and then gives the Need MP flag. It'd be nice to either A) have the CaaM MP be loaded property to be able to cast the spells, or B) have it not check for MP again. But I have no idea what is happening really.


We are born, live, die and then do the same thing over again.
Quote  

#74
Posts: 182
Threads: 1
Thanks Received: 70
Thanks Given: 20
Joined: Oct 2015
Reputation: 18
Status
None
as a followup to #1: what about if the CaaM him/herself knows the spell?  when i hacked Veldt Gau's monster script to cast Ice upon rejoining, he was missing the 5 MP once back in the party.  i suspect this is tied into him already knowing Ice.

also, do your results with and without the patch applied vary at all when the CaaM is ID #0-12 versus 13+ ?

Quote:A) have the CaaM MP be loaded property to be able to cast the spells,

i like this way, but whether a character gets MP in battle hinges on their menu contents, as seibaby got into.  and if it's a guest character, they won't even have the RAM data needed to generate anything besides a non-empty spell menu.  also, because multiple actors can be put into a slot at different times, we wouldn't want the MP consumption for that slot to persist from one to another; iow, the CaaM MP loading for guests would need to just be one-way.

Quote:or B) have it not check for MP again. But I have no idea what is happening really.

as alluded to with #2, i think a bounds check in the patch's .findSpell loop to stop Magic spell searching from running into the Lore list (or Lore spell searching from running into lala-land), and instead return 0 MP Cost once passing list's end, would solve this.  it'd take extra space, though.
Quote  

#75
Posts: 175
Threads: 11
Thanks Received: 78
Thanks Given: 18
Joined: May 2013
Reputation: 13
Status
Well-Fed
I'm not at my desktop with most of my notes, but I checked through my PM history where we were talking about it, and it looks like we did try with a bounds check.

Code:
.findSpell
   LDA ($F2),Y
   CMP $F0
   BEQ .getMPCost
   INC
   BEQ .returnZero
   INY #4
   BRA .findSpell

Which, unless I'm mistaken, should either find the spell in the character's list, OR reach the end of the known list and hit $FF, and therefore exit. Thinking about it, you might even be able to get away without INCing and just do a BMI, since the top bit shouldn't be set for any actual spell value, yes? Only saves a byte, but every byte is precious. ;)

(And the bounds check will be going into a new public version of the code whenever I get around to releasing it... XD )


Current Project: FF6: Tensei | Discord ID: TristanGrayse
  Find
Quote  

#76
Posts: 182
Threads: 1
Thanks Received: 70
Thanks Given: 20
Joined: Oct 2015
Reputation: 18
Status
None
what i had in mind was a bounds check on Y, but that gets a bit bigger and uglier.  what you're doing should work, aside from a hacked situation where (an) out-of-range spell ID(s) inserted in a list causes it to be full.
Quote  

#77
Posts: 2,380
Threads: 93
Thanks Received: 358
Thanks Given: 326
Joined: Aug 2009
Reputation: 44
Status
Nattak\'d
@assassin - You're right about them needing to know the spell in order for it to cost MP, testing here with Gau as well. If he casts Fire which he knows it costs MP, but Fire 3 which he does not no MP was deducted.

From what I've seen thus far it doesn't matter if the CaaM is ID #0-12 versus 13+. I have a CaaM battle where a character 07 is loaded and they can cast spells forever without the patch, or get the 'need MP' with, same as the ID $0F (Kefka) one. Though, this latest bounds check update seems to crash the game for the Kefka battle when I gave him a spell to cast, but the Gau one did not crash the game. So maybe it's something to due to Gau being in the normal character range while Kefka is not, like you said. I'm still not too sure about anything though, it's quite confusing and hard to test. I just know that without the patch there is no issue so I hope it can get back to that lol.


We are born, live, die and then do the same thing over again.
Quote  

#78
Posts: 259
Threads: 3
Thanks Received: 18
Thanks Given: 9
Joined: Jun 2013
Reputation: 6
Status
None
When applying this hack to Brave New World, it results in some weirdness with Gau's Rage list: http://ngplus.net/index.php?/forums/topi...mment=2916

I suspect that this is due to come conflicts with Assassin's alphabetical rage patch and/or DN's hack to condense the rage list.


"You don't have to be a vampire to die like one... b*t*h." -Simon Belmont
Quote  

#79
Posts: 199
Threads: 3
Thanks Received: 24
Thanks Given: 143
Joined: May 2013
Reputation: 0
Status
None
Yes this was discussed in the first pages of this thread, it conflicts with Assassin's alphabetical rage patch. It's only a free space conflict which can easily be remedied by changing freespace lines in the ASM file.

!freespace_C2_0 = $C2A65A
!freespace_C2_1 = $C2FAB0
  Find
Quote  
[-] The following 3 users say Thank You to Warrax for this post:
  • BTB (11-24-2017), GrayShadows (11-24-2017), Robo Jesus (12-24-2017)

#80
Posts: 21
Threads: 1
Thanks Received: 0
Thanks Given: 4
Joined: Oct 2019
Reputation: 0
Status
None
Does anyone have an updated ips patch of this? I've been using condensed spells vers. 1.1 and a vanilla ROM on SNES9x, and it locks up on me every time at the Sealed Gate during the Kefka battle.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite