Changes
Jump to navigation
Jump to search
no edit summary
== Fields Scripts ==
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
! style="background:rgb(204,204,204)" | Offset
! style="background:rgb(204,204,204)" | Size
! style="background:rgb(204,204,204)" | Data
|-
| 0
| 1 byte
| Number of door entity
|-
| 1
| 1 byte
| Number of location (walkmesh line) entity
|-
| 2
| 1 byte
| Number of background entity
|-
| 3
| 1 byte
| Number of other entity
|-
| 4
| 2 bytes
| Offset section 1
|-
| 6
| 2 bytes
| Offset script data
|-
| 8
| offsetSection1 - 8 = nbEntity * 2
| [[#Entry point of each entity|Entry point of each entity]]
|-
| offsetSection1
| offsetScriptData - offsetSection1
| [[#Entry point of each script|Entry point of each script]]
|-
| offsetScriptData
| varies
| [[#Script Data|Script Data]]
|}
=== Entry point of each entity ===
Each entry is 2 bytes with:
<pre>
scriptCount = entryPointEntity & 0x7F;
label = entryPoint >> 7;
</pre>
=== Entry point of each script ===
Each entry is 2 bytes with:
<pre>
position = (entryPointScript & 0x7FFF)*4;
flag = entryPointScript >> 15;
</pre>
The position is relative to offsetScriptData. The meaning of the flag is unknown.
=== Script Data ===
Each opcode is 4 bytes.
[[FF8/Field/Script/Opcodes|Opcode List]]
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
! style="background:rgb(204,204,204)" | Offset
! style="background:rgb(204,204,204)" | Size
! style="background:rgb(204,204,204)" | Data
|-
| 0
| 1 byte
| Number of door entity
|-
| 1
| 1 byte
| Number of location (walkmesh line) entity
|-
| 2
| 1 byte
| Number of background entity
|-
| 3
| 1 byte
| Number of other entity
|-
| 4
| 2 bytes
| Offset section 1
|-
| 6
| 2 bytes
| Offset script data
|-
| 8
| offsetSection1 - 8 = nbEntity * 2
| [[#Entry point of each entity|Entry point of each entity]]
|-
| offsetSection1
| offsetScriptData - offsetSection1
| [[#Entry point of each script|Entry point of each script]]
|-
| offsetScriptData
| varies
| [[#Script Data|Script Data]]
|}
=== Entry point of each entity ===
Each entry is 2 bytes with:
<pre>
scriptCount = entryPointEntity & 0x7F;
label = entryPoint >> 7;
</pre>
=== Entry point of each script ===
Each entry is 2 bytes with:
<pre>
position = (entryPointScript & 0x7FFF)*4;
flag = entryPointScript >> 15;
</pre>
The position is relative to offsetScriptData. The meaning of the flag is unknown.
=== Script Data ===
Each opcode is 4 bytes.
[[FF8/Field/Script/Opcodes|Opcode List]]