Author Topic: Attack of the SwordRats  (Read 7013 times)

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Attack of the SwordRats
« on: March 07, 2008, 05:51:04 PM »
I was trying to create a call spell that would actually "call" a monster (like the enemy attacks Call or Alert). Unfortunately, some of the called monsters turned out to be invincible, and this is what I ended up with . . .

(It says there's only 3, but actually I killed some of them and it looped around to 13. They really just wouldn't stop coming.  :laugh:)

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Attack of the SwordRats
« Reply #1 on: March 07, 2008, 06:04:17 PM »
 :tongue:

Have you tried directly modifying an existing Call spell instead? It would be a safe place to start...
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Re: Attack of the SwordRats
« Reply #2 on: March 07, 2008, 06:32:42 PM »
The problem is that the battle doesn't seem to have any way to deal with calling extra monsters. I've both created my own Call spell and used the enemy attack Call, and they work the same (which they should since I just copied the data for it). I've tried killing the monsters off then calling them again, and while it seems to work for up to the number of monsters there originally was, it's still buggy (missing graphics, miscounted enemies, etc.). Only ones called beyond the original number are invincible. I think the "Alert" or "Call" enemy attacks only work in the specific battles that they're used in. Or at least, there's only certain situations when that spell/attack works correctly.

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Attack of the SwordRats
« Reply #3 on: March 07, 2008, 06:52:34 PM »
I've tried killing the monsters off then calling them again, and while it seems to work for up to the number of monsters there originally was, it's still buggy (missing graphics, miscounted enemies, etc.). Only ones called beyond the original number are invincible. I think the "Alert" or "Call" enemy attacks only work in the specific battles that they're used in. Or at least, there's only certain situations when that spell/attack works correctly.

AFAIK, there is a particular behavior that normal enemy summons require. They have a special designated slot (usually Group 3) to be summoned to, even though there is 0 of that monsters slotted in that group. Consider any Searcher grouping and that explains half the deal. Since you do not have an actual group, the creation of the monster becomes unpredictable, slotting them to something that's not defined. Also, you shouldn't be able to summon more monsters than there is slotted, given how the attack scripts for all summoning monsters have them set up. A more complex setup (not sure if it is doable in the game's battle scripting) is to check the number of monsters in "summon group" and continue to summon the monster until it is "full".

Anyways, I'm not entirely surprised at the results.

It sounds more like you are doing the "enemy version" of summoning, which is specific to the enemies involved + monster slottage + number + formuation.. that's what you seem to be tapping in your modification.

Do you know what I mean?
« Last Edit: March 07, 2008, 07:10:10 PM by Deathlike2 »
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Re: Attack of the SwordRats
« Reply #4 on: March 07, 2008, 07:03:19 PM »
I was doing the enemy version of summoning, sorry if that wasn't clear before.

The designated slot for summoned monsters makes sense, and I can see why it doesn't work in most battles. Oh well, it would have been a neat effect, but I won't waste any more time on it.

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Attack of the SwordRats
« Reply #5 on: March 07, 2008, 07:11:17 PM »
Well, if you were able to do make the unused slot to something more usable (and the summoned monster not be invincible) , it would be the next best thing to have a summon you could harvest EXP and particularly items from (think of the possibilities).
« Last Edit: March 07, 2008, 07:40:02 PM by Deathlike2 »
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Re: Attack of the SwordRats
« Reply #6 on: March 07, 2008, 07:36:09 PM »
That was my original idea. I wanted to decrease encounter rates on all maps, and have the optional call spell. That way if you needed experience you wouldn't have to wander around and around looking for monsters. Unfortunately, doesn't seem like it's going to happen . . . but anyone that figures out a solution gets a  :cookie:

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Attack of the SwordRats
« Reply #7 on: March 07, 2008, 07:44:17 PM »
I honestly can't tell how you fix the invinciblity.. but in theory as part of the summoning, you would have to set the last group's formation (for those that have one active showing group like solo Alerts+Searchers, you probably want to set group 2 to be safe) to the monster in question with 1 spot. You will have to set its positioning coordinates as well.  You may want to do checks to see if that spot is currently filled (with at one monster) to cause the spell to fail. Once you do that, the summon should work as intended w/o the invinciblity.

The only issue with this is that you will most likely override the enemy's monster summon (assuming they are in group 3), but that might be accounted for though if you modify the battle engine... which is far more complicated.

I wouldn't know the complexity of the issue, but you would need to do some real romhacking to make it happen.
« Last Edit: March 07, 2008, 07:50:29 PM by Deathlike2 »
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Attack of the SwordRats
« Reply #8 on: March 07, 2008, 08:18:03 PM »
Actually, I made a slight error on summon behavior.

According to the game data, group 2 is primarily used for the summoned monster. Whatever is slotted there appears to start with 0 monsters even though
internally 1 monster is declared for that slot.

So, whatever you summon automatically goes to that slot, and it only works properly if nothing is there to begin with. A monster also has to be declared for that slot for it to work.

You know what you could do that might be easier is to leave slot 2 with one monster at all time (it won't show up initially) as I described and have a "universal monster summon" as part of the command or spell list. This requires far less romhacking and sounds very doable. You would have to do with/for every enemy formation and limit some of your options, but that's very doable.

Edit: The enemy formation must have some bit defining that that this group has enemy summons (and perhaps is group definable).
« Last Edit: March 07, 2008, 09:05:30 PM by Deathlike2 »
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Re: Attack of the SwordRats
« Reply #9 on: March 09, 2008, 06:27:41 AM »
That does sound possible, but as you say it would be quite a lot of work. And it still wouldn't solve the problem of if you use the command more than once. Definitely workable, though.

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Attack of the SwordRats
« Reply #10 on: March 09, 2008, 06:34:36 AM »
That does sound possible, but as you say it would be quite a lot of work.

Well, as a start, you could probably use the "Rydia's Restored Summon" hack as a base to start reworking the command to the enemy summon command.

The other part is to find what bit controls the battle's "enemy summon slot".

Quote
And it still wouldn't solve the problem of if you use the command more than once. Definitely workable, though.

That's your job to add the extra checks.. or perhaps increase the number slotted in that spot (this will require testing for sure).
If you are able to summon more in the same position (see 3 Red Dragons formation) and not create any extra bugs, it just might work.
(You will have to document the bug, but at least you won't have to worry as much due to user idiocy or accidents.)
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Re: Attack of the SwordRats
« Reply #11 on: March 09, 2008, 06:54:23 AM »
Yeah, I'm using the Restored Power hack right now to try and create a Drain command, but it's a bit harder than I thought it would be with my limited ASM skills. I can't seem to find the subroutine that would change it to the Vampire's Fang item rather than the Grimoire item.

In regards to the enemy call command, the way I was doing it (a spell that costs 0 MP) seems a bit easier, that way it wouldn't require any ASM hacking, but it would have the multiple use bug. Like you said, it would have to be documented and avoided by users (that's what I meant when I said "workable"). Anyway, it's far down on my list of priorities right now, but when I get back to it I'll let you know how it goes.

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Re: Attack of the SwordRats
« Reply #12 on: April 20, 2008, 02:28:32 AM »
I eventually came back to this idea, and I believe I found a solution. I've learned a lot about ASM since I first tried it, and I now know how to write code to check whether all monster slots are full/alive. However, since the Call/Alert spell effects summon a monster to slot 2, it doesn't work for all the enemy sets that only have one kind of monster. I could change the subroutine for these effects (so that they summon to slot 1), but they're a little complicated, so instead I came up with the idea to do a full revive on a monster that has died. Normally you can't target those enemies (except if you target them right before they die, as FF4 experience-harvesters know), but I know enough ASM to target a full-revive spell (e.g. spell AC, Remedy) at a slot for an enemy that has already died. I plan on incorporating this into my hack, and I'll post here when I write the subroutine and test it fully.

To quote myself:

Quote
. . . but anyone that figures out a solution gets a  :cookie:

Don't mind if I do
:cookie:

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Attack of the SwordRats
« Reply #13 on: April 20, 2008, 09:10:27 AM »
I eventually came back to this idea, and I believe I found a solution. I've learned a lot about ASM since I first tried it, and I now know how to write code to check whether all monster slots are full/alive. However, since the Call/Alert spell effects summon a monster to slot 2, it doesn't work for all the enemy sets that only have one kind of monster. I could change the subroutine for these effects (so that they summon to slot 1), but they're a little complicated, so instead I came up with the idea to do a full revive on a monster that has died. Normally you can't target those enemies (except if you target them right before they die, as FF4 experience-harvesters know), but I know enough ASM to target a full-revive spell (e.g. spell AC, Remedy) at a slot for an enemy that has already died. I plan on incorporating this into my hack, and I'll post here when I write the subroutine and test it fully.

To quote myself:

Quote
. . . but anyone that figures out a solution gets a  :cookie:

Don't mind if I do
:cookie:

AFAIK, The the revive (Recover in FF2US) spell (spell 171) that monsters use has to change its targeting to target every group and the other monsters revive.

This occurs with the following bosses: Magus Sisters, CPU+Defender+Attacker, Baigan+Arms

This spell always succeeds, even when the defined hit rate is 0 (skips that check most likely) and revives those that are dead in said slots. I'm not entirely sure if all groups have to be filled with something though.

Note that the revived monster is considered a new monster, and that will factor into the EXP.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Re: Attack of the SwordRats
« Reply #14 on: April 20, 2008, 05:10:23 PM »
Quote
Note that the revived monster is considered a new monster, and that will factor into the EXP.

This is why I'm adding this in, so that leveling up doesn't take so long. And besides, I think it's fun.