Field File Section 8: Triggers - niemasd/PyFF7 GitHub Wiki

The Triggers section contains information about triggers. This wiki is a useful reference for the Triggers section.

4 bytes: Section Length

  • This is a 4-byte unsigned integer denoting the total length (in bytes) of this section

9 bytes: Field Name

  • The first 8 bytes are a "left-aligned" string: strings shorter than 8 characters are right-padded with <NULL> (i.e., 0x0)
  • The 9th byte is <NULL> (i.e., 0x0)

1 byte: Control Direction

  • This is a 1-byte integer
  • It's not clear if this is signed or unsigned (but given that it's a "direction," perhaps signed?)

2 bytes: Camera Focus Height

  • This is a 2-byte signed integer
    • Height = 0 implies normal focus
    • Height > 0 implies focus above
    • Height < 0 implies focus below

8 bytes: Camera Range

  • The first 2 bytes designate a signed integer representing "left"
  • The second 2 bytes designate a signed integer representing "bottom"
  • The third 2 bytes designate a signed integer representing "right"
  • The fourth 2 bytes designate a signed integer representing "top"
  • "Bottom" and "top" might be flipped; it's not known for sure
    • Regardless, the 1st and 2nd 2-byte chunks are negative, the 3rd and 4th are positive, and 1st == negative 3rd and 2nd == negative 4th

4 bytes: Unknowns Related to Background Layers 3 and 4

  • The first 2 bytes designate an integer representing some unknown about Layer 3 (maybe)
  • The last 2 bytes designate an integer representing some unknown about Layer 4 (maybe)
  • It's not clear if they're signed or unsigned, but they seem to always be either 0, 1, or 256

4 bytes: Background Layer 3 Animation Dimensions

  • The first 2 bytes designate a signed integer representing the animation width
  • The first 2 bytes designate a signed integer representing the animation width
  • These values seem to always be 1,024

4 bytes: Background Layer 4 Animation Dimensions

  • The first 2 bytes designate a signed integer representing the animation width
  • The first 2 bytes designate a signed integer representing the animation width
  • These values seem to always be 1,024

24 bytes: Unknowns Related to Background Layers 3 and 4

  • The first 12 bytes seem to be for Layer 3 (maybe)
  • The last 12 bytes seem to be for Layer 4 (maybe)
  • No clue what they mean, but there's lots of <NULL> (i.e., 0x0)

Gateways

There are 12 gateways, and each is a total of 24 bytes. For each gateway:

6 bytes: Vertex 1 of Exit Line

  • The first 2 bytes are a signed integer designating the x-coordinate
  • The next 2 bytes are a signed integer designating the z-coordinate
  • The last 2 bytes are a signed integer designating the y-coordinate

6 bytes: Vertex 2 of Exit Line

  • The first 2 bytes are a signed integer designating the x-coordinate
  • The next 2 bytes are a signed integer designating the z-coordinate
  • The last 2 bytes are a signed integer designating the y-coordinate

6 bytes: Destination Vertex

  • The first 2 bytes are a signed integer designating the x-coordinate
  • The next 2 bytes are a signed integer designating the z-coordinate
  • The last 2 bytes are a signed integer designating the y-coordinate

2 bytes: Field ID

  • This is a 2-byte unsigned(?) integer designating the Field ID
  • Sometimes it's 0x7FFF (32,767), probably designating something important

4 bytes: Unknown

  • These are 4 bytes that are all equal in a given gateway (but they vary between gateways)

Triggers

There are 12 triggers, and each is a total of 16 bytes. For each trigger:

6 bytes: Vertex of Corner 1

  • The first 2 bytes are a signed integer designating the x-coordinate
  • The next 2 bytes are a signed integer designating the z-coordinate
  • The last 2 bytes are a signed integer designating the y-coordinate

6 bytes: Vertex of Corner 2

  • The first 2 bytes are a signed integer designating the x-coordinate
  • The next 2 bytes are a signed integer designating the z-coordinate
  • The last 2 bytes are a signed integer designating the y-coordinate

1 byte: Background Group ID (Parameter)

  • This is a 1-byte signed integer
  • This seems to always be either 1 or -1

1 byte: Background Frame ID (State)

  • This is a 1-byte unsigned integer

1 byte: Behavior

  • This is a 1-byte unsigned integer that can have a value between 0 and 5:
    • 0 - OnTrigger - ON
    • 1 - OnTrigger - OFF
    • 2 - OnTrigger - ON, AwayFromTrigger - OFF
    • 3 - OnTrigger - OFF, AwayFromTrigger - ON
    • 4 - OnTrigger - ON, AwayFromTriggerOnPlusSide - OFF
    • 5 - OnTrigger - OFF, AwayFromTriggerOnPlusSide - ON

12 bytes: Shown Arrows

These are shown arrows on gateway lines, and they are not present in the Japanese version of the game. For each of the 12 gateways you can show an arrow. If shown arrow = 1, a red arrow is displayed in the middle of the corresponding gateway line.

Arrows:

There are 12 arrows that are each 16 bytes total, each defined with the following items:

4 bytes: Position X

  • This is a 4-byte signed integer

4 bytes: Position Z

  • This is a 4-byte signed integer

4 bytes: Position Y

  • This is a 4-byte signed integer

4 bytes: Type

  • This is a 4-byte unsigned integer
  • 0 = disabled, 1 = red, 2 = green
⚠️ **GitHub.com Fallback** ⚠️