Difference between revisions of "User:Mddass/Touhou File Format Specification/ECL/V1.0"

From Touhou Wiki
Jump to navigation Jump to search
(ins_87 (laser_store): Rename and fix doc)
 
Line 58: Line 58:
 
|}
 
|}
  
==Function Opcodes==
+
<!--==Function Opcodes==
 
'''''NOTE:''' These names are unofficial, although some of them take into account known opcode names.''
 
'''''NOTE:''' These names are unofficial, although some of them take into account known opcode names.''
  
Line 765: Line 765:
 
If <code>a & 1</code>, toggles whether the spellcard can be captured through timeout or not. Also determines if the bonus decreases over time or not.
 
If <code>a & 1</code>, toggles whether the spellcard can be captured through timeout or not. Also determines if the bonus decreases over time or not.
  
'''''NOTE:''''' Opcodes higher than 135 also fallback to this function.
+
'''''NOTE:''''' Opcodes higher than 135 also fallback to this function.-->
  
 
== Timeline Opcodes ==
 
== Timeline Opcodes ==

Latest revision as of 16:02, 18 April 2019

This is the first ever version of ZUN's ECL format, and is used in EoSD.

Format[edit]

Main Structure[edit]

Type Description
Int32 Function count.
Int32 Offset to main timeline.
Int32 Unknown. Always 0.
Int32 Unknown. Always 0.
Int32 x Function Count Offset to function.
Function x Function Count List of functions.
Timeline Timeline.

Function[edit]

Functions are simply a list of ECL instructions, and always have a footer of 0xFFFFFFFF (which should never be reached and is there for safety).

Offset Type Description
0x00 Int32 Frame in which the instruction should be executed.
0x04 Int16 Opcode.
0x06 Int16 Size of this instruction. Should never be less than 12 (0xC).
0x08 Int16 Rank mask. Determines in which ranks the instruction should execute.
0x0A Int16 Param mask. Determines which parameters are variables or not. Unused in this game (always 0xFF).
0x0C Byte x (Size - 12) Parameters. Length varies.

Timeline[edit]

EoSD has a timeline system for stage timing. This timeline is a list of timeline functions and is responsible for spawning enemies, starting dialogue, etc. Parsing ends when the 0xFFFF footer is reached.

Offset Type Description
0x00 Int16 Frame in which the instruction should be executed.
0x02 Int16 Parameter (param_ex).
0x04 Int16 Opcode.
0x06 Int16 Size of this instruction. Should never be less than 8 (0x8).
0x08 Byte x (Size - 8) Parameters. Length varies.


Timeline Opcodes[edit]

NOTE: These names are unofficial, although some of them take into account known opcode names.

ins_0 (enemy_create)[edit]

enemy_create(float x, float y, float z, short life, short item, int score);

Spawns in an enemy.

  • param_ex: Function to execute.
  • x: X-coordinate to spawn in.
  • y: Y-coordinate to spawn in.
  • z: Z-coordinate to spawn in.
  • life: Enemy HP.
  • item: Item to spawn on death. -2 means nothing, -1 means random(ish) item.
  • score: Score reward on death.

ins_2 (enemy_create_mirror)[edit]

enemy_create_mirror(float x, float y, float z, short life, short item, int score);

Spawns in an enemy with its rotation mirrored along the vertical axis.

  • param_ex: Function to execute.
  • x: X-coordinate to spawn in.
  • y: Y-coordinate to spawn in.
  • z: Z-coordinate to spawn in.
  • life: Enemy HP.
  • item: Item to spawn on death. -2 means nothing, -1 means random(ish) item.
  • score: Score reward on death.

ins_4 (enemy_create_rand)[edit]

enemy_create_rand(float x, float y, float z, short life, short item, int score);

Spawns in an enemy.

  • param_ex: Function to execute.
  • x: X-coordinate to spawn in. Random value between 0.0 and 392.0 if -999.0.
  • y: Y-coordinate to spawn in.
  • z: Z-coordinate to spawn in.
  • life: Enemy HP.
  • item: Item to spawn on death. -2 means nothing, -1 means random(ish) item.
  • score: Score reward on death.

ins_6 (enemy_create_mirror_rand)[edit]

enemy_create_mirror_rand(float x, float y, float z, short life, short item, int score);

Spawns in an enemy with its rotation mirrored along the vertical axis.

  • param_ex: Function to execute.
  • x: X-coordinate to spawn in. Random value between 0.0 and 392.0 if -999.0.
  • y: Y-coordinate to spawn in.
  • z: Z-coordinate to spawn in.
  • life: Enemy HP.
  • item: Item to spawn on death. -2 means nothing, -1 means random(ish) item.
  • score: Score reward on death.

ins_8 (start_msg)[edit]

start_msg();

Starts dialogue with ID param_ex.

ins_9 (wait_msg)[edit]

wait_msg();

Freezes the timeline timer until there is a pause in the current dialogue.

ins_10 (run_event)[edit]

run_event(int unk1, int unk2);

Runs a hardcoded global event.

ins_12 (wait_enemy)[edit]

wait_enemy();

Freezes the timeline timer as long as there are killable enemies present.