øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=948.0;prev_next=nexte:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexf2db.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=948.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexf2db.html.zxð…g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ …­m™OKtext/htmlISO-8859-1gzip8:Öm™ÿÿÿÿÿÿÿÿTue, 10 Mar 2020 12:36:23 GMT0ó°° ®0®P®€§²ð®ð…g^m™ FF2 Battle Script That's Different Than FF4

Author Topic: FF2 Battle Script That's Different Than FF4  (Read 9693 times)

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Re: FF2 Battle Script That's Different Than FF4
« Reply #30 on: January 21, 2009, 11:00:22 PM »
Let me see if I can help clear it up. I renamed that little section at the top "Conditions Encoded Data", because it's the actual data that determines the conditions.

The Attack Sequence Groups are in two byte sets, like you said; for example, "If charmed, do such-and-such." The "if charmed" part is condition 01 -- that actual data that determines that is in the Conditions Encoded Data section.

The conditions are encoded in four bytes. Condition 00 is just FF FF FF FF (i.e. "nothing"). Condition 01 (the "if charmed" one) is 00 17 01 08. According to the guide I patched together, that means, "If 17's status byte 01 is status 08...". Since the character/enemy 17 is above 16, the value is 17 -1 = 16. 16 corresponds to "self", as seen in the Enemy Attack Sequences document. Status byte 01 is:
Code: [Select]
Byte Bit Text Notes
---- --- ---- -----
01: 7   Curse
6   Float
5   Paralyze
4   Sleep
3   Charm
2   Berserk
1   Petrify 2/3 petrified
0   D 1/3 petrified

Status 08 of this byte, when done in binary (08 = 00001000) corresponds to Charm. So, the translation is, "If self is charmed..." If you changed that 08 to 10 (in binary: 00010000), then the status would correspond to Sleep, and the condition would be, "If self is sleeping..."

Does all that make sense? Is that what you were asking?

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: FF2 Battle Script That's Different Than FF4
« Reply #31 on: January 21, 2009, 11:14:01 PM »
Let me see if I can help clear it up. I renamed that little section at the top "Conditions Encoded Data", because it's the actual data that determines the conditions.

The Attack Sequence Groups are in two byte sets, like you said; for example, "If charmed, do such-and-such." The "if charmed" part is condition 01 -- that actual data that determines that is in the Conditions Encoded Data section.

The conditions are encoded in four bytes. Condition 00 is just FF FF FF FF (i.e. "nothing"). Condition 01 (the "if charmed" one) is 00 17 01 08. According to the guide I patched together, that means, "If 17's status byte 01 is status 08...". Since the character/enemy 17 is above 16, the value is 17 -1 = 16. 16 corresponds to "self", as seen in the Enemy Attack Sequences document. Status byte 01 is:
Code: [Select]
Byte Bit Text Notes
---- --- ---- -----
01: 7   Curse
6   Float
5   Paralyze
4   Sleep
3   Charm
2   Berserk
1   Petrify 2/3 petrified
0   D 1/3 petrified

Status 08 of this byte, when done in binary (08 = 00001000) corresponds to Charm. So, the translation is, "If self is charmed..." If you changed that 08 to 10 (in binary: 00010000), then the status would correspond to Sleep, and the condition would be, "If self is sleeping..."

Does all that make sense? Is that what you were asking?

Yes. I'm not entirely able to make head or tails of a number of these, but it would be of great help if the conditions and the internal settings follow each other in the docs, so I can visualize something more creative for them. It's much easier to decypher with examples.. although I don't think I'll use this information in the immediate future...

Although, I wonder if scripts that test sleep/paralysis status will follow its script.. because that opens a huge can of worms... addtionally that would explain a number of the phenomenom on the GBA port (in other words, the original code was already set up for FF4A's Zeromus EG specialized status scripts).
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: FF2 Battle Script That's Different Than FF4
« Reply #32 on: January 27, 2009, 11:48:54 PM »
Code: [Select]
07 if magically attacked by a character
08 if hit by a character fire-elemental spell
09 if hit by a character ice-elemental spell
0A if hit by a character lightning-elemental spell
0B if magically attacked by a character?
0C if hit by a character fire-elemental spell?
0D if hit by a character ice-elemental spell?
0E if hit by a character lightning-elemental spell?
0F if hit by a character holy-elemental spell

I believe I think I know the difference.

In testing this... I set the Waterbug to switch its reaction counter from magic attacks to lightning attacks (0A)... what that produced was a counter reaction to single targeted Lightning attacks. I tested 0E, and found the monster to react to both single and multitargeted Lightning attacks... so there is an actual difference.

 :edit:

I didn't get a chance to post this earlier, but here's what I understand..

07-0A are used as counters...

08-0A has specific behavior.

1) The monster doesn't react to a multitargeted elemental attack if other units accompany them. For instance, using Ice on the group with only the Ballon monster left will cause one of them to Explode, but if it is accompanied by a Grudger for instance, they don't react.

2) The monster will always react to a single targeted elemental attack.

0B-0F is used in non-counter scripts.

0C-0F has specific behavior.

The Spirit series of monsters follow the "do nothing when ice is used" script ONLY if they are single targeted. I never really knew that was possible.. so you can "freeze" these monsters into doing nothing. It won't be doable if you use the IceRod and attack every unit... you have to use a single target the Ice1 spell.

When 0C-0F is used as a counter script, monsters will react regardless of accompanying units.

08-0A behaves like 0C-0F for non-counter scripts.

Note: These properties used in non-counter scripts seem to hold for the rest of the battle... overriding the Always condition (although, this could change with more than one condition)

Also, 07 and 0B react regardless of the targeting used for the magic attack.

 :edit:

Hmm.. under different formations, the 08-0A doesn't cause the same counter script to work... oh well.
« Last Edit: January 28, 2009, 04:39:37 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: FF2 Battle Script That's Different Than FF4
« Reply #33 on: February 04, 2009, 11:30:36 AM »
Ok, I think I now understand it better, but your doc needs to be improved.

All info assumes a headered ROM.

0x76900 is where the condition data lies.. which is fine. However, it's really just the "building blocks" to the complex conditions. These 2-byte sets make up a condition.

0x76800 is where the complex conditions are built. Multiple conditions can be combined here. FF terminates the complex condition. That is where you build off that condition list which has been documented in detail.

It's actually unfortunate that there isn't a lot of space to add onto existing conditions.. rather, space has to be made. Plenty of space can be had if say some of the lamer conditions get removed (pretty much Rubicant's fire-reviving counter script is a good start).  I should be able to improve on stuff based on this knowledge.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3