Author Topic: FF7: Imprisoned problems  (Read 3861 times)

Karifean

  • Cool newbie
  • *
  • Posts: 60
  • Karma: 8
    • View Profile
FF7: Imprisoned problems
« on: 2013-09-10 18:11:40 »
So I'm making a mod with direct battle transitions, Hojo-style. One major problem that arises is the Imprisoned status. Some enemies in the gauntlet - in this case Reno - are capable of inflicting this status effect on party members. Problem is, if it is not remedied until the enemy is defeated, it will never go away. The character will remain inactive forever.

Obviously, I have the un-imprison routine (sets Flag:Enabled to 1 and Status:Imprisoned to 0) in Reno's Death Counter script and even in the following enemy's (Sample:H0512's) Pre-Battle script. Doesn't matter, the characters remain Imprisoned. I have no idea why the status refuses to be remedied. Making the Pyramids use their Vanish skill also doesn't work.

I even tried making Reno's (Report) ability target all party members and remove the Imprisoned status. It ended in a Game Over, don't ask me why.

Sega Chief

  • No life
  • *
  • Posts: 3228
  • Karma: 186
  • These guys is sick
    • View Profile
Re: FF7: Imprisoned problems
« Reply #1 on: 2013-09-10 19:05:14 »
Isn't Imprisoned in the Reno fight (and the Bottomswell one, maybe) linked to the additional enemy that they 'summon'? How about putting an extra enemy in those formations (there should be space for a third enemy), an invisible one that doesn't do anything except run a script to kill Pyramids/Waterpolos when Reno/Bottomswell are dead. That way the fight doesn't end when Reno/Bottomswell are killed and the invisible enemy can 'clean up' the imprisoned characters before killing itself. That would end the battle with everyone 'free' and hopefully without any issues in continuing the boss-rush.

Couple of issues might be with Reno's Report move locking up the fight but if that happens then you could maybe look at Gongaga Reno's AI (he doesn't end or lock the fight there) or try giving him a different animation for his Report move (maybe Idle, which is nearly always 00). Another might be some kind of AI in their death counters that end the fight (they'd need to be removed if possible). Might be other obstacles, but those are what I can think of off the top of my head.

NFITC1

  • No life
  • *
  • Posts: 2906
  • Karma: 72
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: FF7: Imprisoned problems
« Reply #2 on: 2013-09-10 20:36:00 »
Obviously, I have the un-imprison routine (sets Flag:Enabled to 1 and Status:Imprisoned to 0) in Reno's Death Counter script and even in the following enemy's (Sample:H0512's) Pre-Battle script. Doesn't matter, the characters remain Imprisoned. I have no idea why the status refuses to be remedied. Making the Pyramids use their Vanish skill also doesn't work.

Vanish is basically a placeholder action that forces them to use their disappearing animation. It doesn't do anything for the imprisoned character. From what I can tell, it will take an action to actually remove Imprisoned from an actor. There's some kind of handler specifically for the Imprisoned status. There is a "Pyramid Release" action that Reno has access to, but never does. If you set those to remove the inflicted Imprisoned status at the end of that battle it might cure them of it.

I even tried making Reno's (Report) ability target all party members and remove the Imprisoned status. It ended in a Game Over, don't ask me why.

That's awesome. :D

Don't forget the formation's AI:

Code: [Select]
Unknown(2180) <- 0
While ( (Unknown(2180) < 3) )
{
TargetMask <- FlagBit(Unknown(2180))
TargetMask <-  (TargetMask.Status:Imprisoned == 1)
If (TargetMask)
{
TargetMask.Flag:Enabled? <- 0
}
Unknown(2180) <- Unknown(2180) + 1
} LOOP
SCRIPT END

That's in the General Counter. If a character has the Imprisoned status before ANY action is taken they will be Disabled, but this won't enable them either. So the order should be this:

  • Enable
  • Remove Imprisoned
  • Perform ANY Action

If you've set Reno to just die without performing his report then it will likely not work. The AI does appear to be flushed at the end of every chained battle so it shouldn't carry over to the next one.

Karifean

  • Cool newbie
  • *
  • Posts: 60
  • Karma: 8
    • View Profile
Re: FF7: Imprisoned problems
« Reply #3 on: 2013-09-10 22:44:08 »
Unfortunately, that was not it. I did indeed still have Reno use (Report) because the Turks' fleeing animation is one of the few unique death animations that don't cause infinite Wait Mode and will thus work fine. I even moved the Pyramids' use of Vanish just after the Remove Imprisoned line, so it should be EXACTLY as if you'd kill a Pyramid (except for the flags on the Pyramids themselves).

No dice, it does not work. Since the Pyramids do vanish in an IF query that checks for Imprisoned characters, the game obviously still recognizes them as Imprisoned characters, but removing it simply seems to not work.

A bit on the subject, how do you use AI scripting to force an enemy's death exactly as if they'd died regularly?

This is Reno's Death Counter, btw:

Code: [Select]
Death Counter:
0x000 11 0000
0x003 60 00
0x005 90
0x006 12 2070
0x009 02 0020
0x00C 02 4060
0x00F 80
0x010 01 0000
0x013 40
0x014 90
0x015 12 2070
0x018 10 4023
0x01B 80
0x01C 60 00
0x01E 90
0x01F 12 2070
0x022 10 4024
0x025 80
0x026 60 00
0x028 90
0x029 01 0000
0x02C 87
0x02D 00 401F
0x030 80
0x031 60 01
0x033 40
0x034 70 0068
0x037 11 0000
0x03A 87
0x03B 10 4023
0x03E 80
0x03F 60 01
0x041 90
0x042 11 0000
0x045 87
0x046 10 401F
0x049 80
0x04A 60 00
0x04C 90
0x04D 12 0040
0x050 02 2060
0x053 90
0x054 12 2060
0x057 02 2070
0x05A 90
0x05B 60 20
0x05D 61 014E
0x060 92
0x061 12 2060
0x064 02 0040
0x067 90
0x068 11 0000
0x06B 01 0000
0x06E 60 01
0x070 30
0x071 90
0x072 01 0000
0x075 60 03
0x077 42
0x078 70 0006
0x07B 12 2060
0x07E 10 4008
0x081 80
0x082 60 00
0x084 90
0x085 12 2060
0x088 10 400F
0x08B 80
0x08C 60 00
0x08E 90
0x08F 93 Reno “Hmph. I'll be back.”
0x0AA FF
0x0AB 12 2060
0x0AE 10 402C
0x0B1 80
0x0B2 60 01
0x0B4 90
0x0B5 12 2070
0x0B8 02 20A0
0x0BB 90
0x0BC 60 20
0x0BE 61 0164
0x0C1 92
0x0C2 73

And the "Disassembled" version:

Code: [Select]
0x000LocalVar:0000 <- 0
0x006TargetMask <-  (LocalVar:0020.FormationNumber == LocalVar:0000)
0x015TargetMask.Flag:Enabled? <- 0
0x01FTargetMask.Flag:MainScriptActive <- 0
0x029 If ( (FlagBit(LocalVar:0000).Status:Imprisoned == 1) )
0x029 {
0x037 FlagBit(LocalVar:0000).Flag:Enabled? <- 1
0x042 FlagBit(LocalVar:0000).Status:Imprisoned <- 0
0x04D LocalVar:0040 <- Self
0x054 Self <- TargetMask
0x05B Perform("Vanish"[014E], EnemyAttack)
0x061 Self <- LocalVar:0040
0x068LocalVar:0000 <- LocalVar:0000 + 1
0x072 If ( (LocalVar:0000 >= 3) ) //Note: The else goes back to the second line, 0x006.
0x072 {
0x07B Self.Status:Haste <- 0
0x085 Self.Status:Regen <- 0
0x08F Display String: "Reno “Hmph. I'll be back.”"
0x0AB Self.Flag:Unknown(00001000) <- 1
0x0B5 TargetMask <- Self
0x0BC Perform("(Report)"[0164], EnemyAttack)
0x0C2 SCRIPT END

LocalVar:0020 refers to all Pyramids.

NFITC1

  • No life
  • *
  • Posts: 2906
  • Karma: 72
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: FF7: Imprisoned problems
« Reply #4 on: 2013-09-11 04:35:13 »
Have you tried setting their HP to 0 in Reno's death script? That should cause the pyramids to activate their death counter scripts.

Sega Chief

  • No life
  • *
  • Posts: 3228
  • Karma: 186
  • These guys is sick
    • View Profile
Re: FF7: Imprisoned problems
« Reply #5 on: 2013-09-11 13:36:06 »
Alright, I got the fight working. When Reno dies he does his Report, the Pyramids are cleared up, the fight transitions properly, and all characters that were disabled by a pyramid become active again. I put an 'invisible' new move at the top of Reno's Death Counter to hit all pyramids on the field with a no damage attack that has an element that the Pyramids had death weakness to (but I think NF1TC's suggestion of simply making their HP = 0 would be a much neater way to do it). However, after that I found that I had to delete the three instances of 'LocalVar:00##.Flag:MainScriptActive <- 0' from Reno's Death Script.

When those lines were gone from Reno's death script, characters caught in a pyramid were able to resume action when the next fight started. I think they maybe disabled the character somehow instead of the Pyramid. Just speculation, I don't know what any of this stuff does just that this seems to work for some reason.

Edit: Also, I'd initially deleted the chunk of script that handles the Pyramids in Reno's Death Counter and added these lines in again later (they appeared in the middle of Reno's status ailment clean-up so they weren't at the top of the Death Script anymore). Just mentioning this in case it affects the way the AI functions but it shouldn't make a difference.

I recorded the fight too. If you replaced the 'clean-up' move with NF1TC's suggestion for HP = 0 scripts then it should be fairly seamless: http://www.youtube.com/watch?v=OCzW23fNyZM&feature=youtu.be
« Last Edit: 2013-09-11 14:11:44 by Sega Chief »

NFITC1

  • No life
  • *
  • Posts: 2906
  • Karma: 72
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: FF7: Imprisoned problems
« Reply #6 on: 2013-09-11 14:33:10 »
I recorded the fight too. If you replaced the 'clean-up' move with NF1TC's suggestion for HP = 0 scripts then it should be fairly seamless: http://www.youtube.com/watch?v=OCzW23fNyZM&feature=youtu.be


This video is private.

Sega Chief

  • No life
  • *
  • Posts: 3228
  • Karma: 186
  • These guys is sick
    • View Profile
Re: FF7: Imprisoned problems
« Reply #7 on: 2013-09-11 14:39:14 »
I changed it to unlisted; I always get those two options mixed up.

Karifean

  • Cool newbie
  • *
  • Posts: 60
  • Karma: 8
    • View Profile
Re: FF7: Imprisoned problems
« Reply #8 on: 2013-09-11 20:03:02 »
For some reason, I'm unable to reproduce it. I don't know why, it just won't work.

The Death Counter script now looks like this:

Code: [Select]
0x000Self.Status:Haste <- 0
0x00ASelf.Status:Regen <- 0
0x014LocalVar:0000 <- 0
0x01A If ( (FlagBit(LocalVar:0000).Status:Imprisoned == 1) )
0x01A {
0x028 Display String: "imprisoned enemy"
0x03A TargetMask <-  (LocalVar:0020.FormationNumber == LocalVar:0000)
0x049 Perform("Delete Pyramids"[0197], EnemyAttack)
0x04F TargetMask.Flag:Enabled? <- 0
0x059LocalVar:0000 <- LocalVar:0000 + 1
0x063 If ( (LocalVar:0000 >= 3) ) // Else goes to 0x01A
0x063 {
0x06C TargetMask <- Self
0x073 Perform("(Report)"[0164], EnemyAttack)
0x079 SCRIPT END

What's strange is that the test message "imprisoned enemy" is displayed correctly, but Reno shows no signs of using his ability at all. The If query also works as the message is not displayed if no character is trapped when Reno dies. The ability also seems to work since I had him use it on himself in the Pre-Battle script and he did show his hurt animation - which he doesn't do in the Death Counter. It's as if for some odd reason he just doesn't use the ability at all. And as a result of that the battle doesn't end. (It does if there's no imprisoned enemy). Actually, since the Pyramid becomes untargetable, he might even be using the ability, but he neither visibly does his hurt animation, nor does the battle end. Then again, that is probably just because of the Enabled=0 line. I don't get it.

The ability itself has Attack Damage Type 40h (also tried 42h, doesn't seem to matter) and is Shout-elemental but besides also being targetable is a clone of the (Report) move. I also tested giving Reno a Shout Death Weakness and he DID die when using it on himself so yeah, no problem there.

And simply setting HP to 0 didn't work either. In fact, the Pyramid stayed targetable and would refuse to die (Sephi's Yummy Mummy A comes to mind), so I quickly abandoned the idea.

And before someone assumes it's because of the LocalVar0020:FormationNumber == LocalVar0000 targeting, I have the same targeting system in my Use Pyramid routine and it works fine there (I use a different variable because 0000 is my turn counter):

Code: [Select]
0x01A LocalVar:0040 <- Random MOD 3
0x022 LocalVar:0040 <- LocalVar:0040 + 1 MOD 3
0x02F TargetMask <- FlagBit(LocalVar:0040)
0x037 If ( ( (TargetMask.Status:Death == 0)  And  (TargetMask.Status:Imprisoned == 0) ) )
0x037 {
0x04F LocalVar:0060 <-  (LocalVar:0020.FormationNumber == LocalVar:0040)
0x05E LocalVar:0060.Flag:Enabled? <- 1
0x068 LocalVar:0060.Flag:MainScriptActive <- 1
0x072 LocalVar:0060.Status:Death <- 0
0x07C LocalVar:0060.HP <- LocalVar:0060.MHP
0x08B Perform(349 + LocalVar:0040, EnemyAttack)

I'm kind of stumped.

Sega Chief

  • No life
  • *
  • Posts: 3228
  • Karma: 186
  • These guys is sick
    • View Profile
Re: FF7: Imprisoned problems
« Reply #9 on: 2013-09-11 23:52:25 »
I'll write down the AI code and post it here tomorrow when I get home. It's largely unaltered from the original death script, it was just that clean up move added to the start with those flags deleted. It might be the move's targeting that's done the trick. I set it to Enable Selection, Multiple, and All Rows (with 0X 100% Physical - No Damage set).

Edit: Here's the code for the Death Counter Script and other info. Note that 61 0170 is the clean-up move I added. The data for the clean-up move is:

Reno's Animation: 01 (hurt)

Attack%: 255
Impact Anim: FF
Target Anim: FF00
Anim ID: FF
Impact Sound: FFFF
Attack Str: 255
Attack Damage: 0X Physical, 100% hit chara - 0X No damage

Attack Target (following are ticked)
Enable Selection
Start as Multiple
All Rows

Attack Element: Gravity (or whatever the Pyramids have a death weakness to).

And the code itself for the death counter is:

Code: [Select]
12 2070
02 20E0
90
60 20
61 0170
92
12 2060
10 4002
80
60 00
90
12 2060
10 4003
80
60 00
90
12 2060
10 4007
80
60 00
90
12 2060
10 4008
80
60 00
90
12 2060
10 4009
80
60 00
90
12 2060
10 400F
80
60 00
90
12 0020
10 4024
80
60 00
90
12 0040
10 4024
80
60 00
90
12 0060
10 4024
80
60 00
90
12 2060
10 4015
80
60 00
90
12 2060
10 4017
80
60 00
90
12 2060
10 4016
80
60 00
90
93 Reno "It's time."
12 2060
10 402C
80
60 01
90
12 2070
02 2060
90
60 20
61 0164
92
73

I tested it again today with more than one character in a Pyramid and it worked okay. Remember that any other changes you've made to the Pyramid Death Counter AI or Reno's Pyramid move might affect how this works.
« Last Edit: 2013-09-12 13:59:08 by Sega Chief »

Karifean

  • Cool newbie
  • *
  • Posts: 60
  • Karma: 8
    • View Profile
Re: FF7: Imprisoned problems
« Reply #10 on: 2013-09-12 22:45:09 »
Just noticed what may have been the problem. In your code, you set the address 4024 of all the Pyramids to 0. That adress is the "MainScriptActive" flag. I on the other hand have been setting address 4023, the "Enabled" flag, to 0.

I'll try it and see if it's the crucial point.

Edit: Indeed it was. This is the final Death Counter script I used:

Code: [Select]
0x000Self.Status:Haste <- 0
0x00ASelf.Status:Regen <- 0
0x014TargetMask <-  (LocalVar:0020.FormationNumber == 0)
0x022TargetMask.Flag:MainScriptActive <- 0
0x02CTargetMask <-  (LocalVar:0020.FormationNumber == 1)
0x03ATargetMask.Flag:MainScriptActive <- 0
0x044TargetMask <-  (LocalVar:0020.FormationNumber == 2)
0x052TargetMask.Flag:MainScriptActive <- 0
0x05CTargetMask <- LocalVar:0020
0x063Perform("Delete Pyramids"[0197], EnemyAttack)
0x069SCRIPT END

Delete Pyramids is now simply (Report), but with the target selection Sega posted and the Shout element. That way, the only way the player can put the Death weakness to use is with Blade Beam. Could've also done it with a Death weakness to a status effect, but it's fine.
« Last Edit: 2013-09-12 23:04:15 by Karifean »