- Welcome to Touhou Wiki!
- Registering is temporarily disabled. Check in our Discord server to request an account and for assistance of any kind.
User:Mddass/Touhou File Format Specification/ECL/V1.0: Difference between revisions
No edit summary |
No edit summary |
||
Line 294: | Line 294: | ||
==== ins_67 (et_set_aimed) ==== | ==== ins_67 (et_set_aimed) ==== | ||
et_set_aimed(short spr, short | et_set_aimed(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags); | ||
Sets the bullet attributes of an enemy to type 0 (aimed at player). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | Sets the bullet attributes of an enemy to type 0 (aimed at player). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | ||
* <code>spr</code>: bullet sprite (and hitbox). | * <code>spr</code>: bullet sprite (and hitbox). | ||
* <code> | * <code>col</code>: sprite index (i.e. color). | ||
* <code>num1</code>: amount of bullets per layer. | * <code>num1</code>: amount of bullets per layer. | ||
* <code>num2</code>: number of layers. | * <code>num2</code>: number of layers. | ||
Line 307: | Line 307: | ||
==== ins_68 (et_set) ==== | ==== ins_68 (et_set) ==== | ||
et_set(short spr, short | et_set(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags); | ||
Sets the bullet attributes of an enemy to type 1 (specified aim). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | Sets the bullet attributes of an enemy to type 1 (specified aim). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | ||
* <code>spr</code>: bullet sprite (and hitbox). | * <code>spr</code>: bullet sprite (and hitbox). | ||
* <code> | * <code>col</code>: sprite index (i.e. color). | ||
* <code>num1</code>: amount of bullets per layer. | * <code>num1</code>: amount of bullets per layer. | ||
* <code>num2</code>: number of layers. | * <code>num2</code>: number of layers. | ||
Line 320: | Line 320: | ||
==== ins_69 (et_set_aimed_eqdistr) ==== | ==== ins_69 (et_set_aimed_eqdistr) ==== | ||
et_set_aimed_eqdistr(short spr, short | et_set_aimed_eqdistr(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags); | ||
Sets the bullet attributes of an enemy to type 2 (aimed at player, equally distributed). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | Sets the bullet attributes of an enemy to type 2 (aimed at player, equally distributed). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | ||
* <code>spr</code>: bullet sprite (and hitbox). | * <code>spr</code>: bullet sprite (and hitbox). | ||
* <code> | * <code>col</code>: sprite index (i.e. color). | ||
* <code>num1</code>: amount of bullets per layer. | * <code>num1</code>: amount of bullets per layer. | ||
* <code>num2</code>: number of layers. | * <code>num2</code>: number of layers. | ||
Line 333: | Line 333: | ||
==== ins_70 (et_set_eqdistr) ==== | ==== ins_70 (et_set_eqdistr) ==== | ||
et_set_eqdistr(short spr, short | et_set_eqdistr(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags); | ||
Sets the bullet attributes of an enemy to type 3 (specified aim, equally distributed). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | Sets the bullet attributes of an enemy to type 3 (specified aim, equally distributed). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | ||
* <code>spr</code>: bullet sprite (and hitbox). | * <code>spr</code>: bullet sprite (and hitbox). | ||
* <code> | * <code>col</code>: sprite index (i.e. color). | ||
* <code>num1</code>: amount of bullets per layer. | * <code>num1</code>: amount of bullets per layer. | ||
* <code>num2</code>: number of layers. | * <code>num2</code>: number of layers. | ||
Line 346: | Line 346: | ||
==== ins_71 (et_set_aimed_eqdistr_away) ==== | ==== ins_71 (et_set_aimed_eqdistr_away) ==== | ||
et_set_aimed_eqdistr_away(short spr, short | et_set_aimed_eqdistr_away(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags); | ||
Sets the bullet attributes of an enemy to type 4 (aimed away from player, equally distributed). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | Sets the bullet attributes of an enemy to type 4 (aimed away from player, equally distributed). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | ||
* <code>spr</code>: bullet sprite (and hitbox). | * <code>spr</code>: bullet sprite (and hitbox). | ||
* <code> | * <code>col</code>: sprite index (i.e. color). | ||
* <code>num1</code>: amount of bullets per layer. | * <code>num1</code>: amount of bullets per layer. | ||
* <code>num2</code>: number of layers. | * <code>num2</code>: number of layers. | ||
Line 359: | Line 359: | ||
==== ins_72 (et_set_eqdistr_away) ==== | ==== ins_72 (et_set_eqdistr_away) ==== | ||
et_set_eqdistr_away(short spr, short | et_set_eqdistr_away(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags); | ||
Sets the bullet attributes of an enemy to type 5 (specified aim away, equally distributed). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | Sets the bullet attributes of an enemy to type 5 (specified aim away, equally distributed). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | ||
* <code>spr</code>: bullet sprite (and hitbox). | * <code>spr</code>: bullet sprite (and hitbox). | ||
* <code> | * <code>col</code>: sprite index (i.e. color). | ||
* <code>num1</code>: amount of bullets per layer. | * <code>num1</code>: amount of bullets per layer. | ||
* <code>num2</code>: number of layers. | * <code>num2</code>: number of layers. | ||
Line 372: | Line 372: | ||
==== ins_73 (et_set_rand_ang) ==== | ==== ins_73 (et_set_rand_ang) ==== | ||
et_set_rand_spd(short spr, short | et_set_rand_spd(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags); | ||
Sets the bullet attributes of an enemy to type 6 (random angle). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | Sets the bullet attributes of an enemy to type 6 (random angle). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | ||
* <code>spr</code>: bullet sprite (and hitbox). | * <code>spr</code>: bullet sprite (and hitbox). | ||
* <code> | * <code>col</code>: sprite index (i.e. color). | ||
* <code>num1</code>: amount of bullets per layer. | * <code>num1</code>: amount of bullets per layer. | ||
* <code>num2</code>: number of layers. | * <code>num2</code>: number of layers. | ||
Line 386: | Line 386: | ||
==== ins_74 (et_set_rand_spd) ==== | ==== ins_74 (et_set_rand_spd) ==== | ||
et_set_rand_spd(short spr, short | et_set_rand_spd(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags); | ||
Sets the bullet attributes of an enemy to type 7 (random speed). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | Sets the bullet attributes of an enemy to type 7 (random speed). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | ||
* <code>spr</code>: bullet sprite (and hitbox). | * <code>spr</code>: bullet sprite (and hitbox). | ||
* <code> | * <code>col</code>: sprite index (i.e. color). | ||
* <code>num1</code>: amount of bullets per layer. | * <code>num1</code>: amount of bullets per layer. | ||
* <code>num2</code>: number of layers. | * <code>num2</code>: number of layers. | ||
Line 400: | Line 400: | ||
==== ins_75 (et_set_rand_ang_spd) ==== | ==== ins_75 (et_set_rand_ang_spd) ==== | ||
et_set_rand_ang_spd(short spr, short | et_set_rand_ang_spd(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags); | ||
Sets the bullet attributes of an enemy to type 8 (random angle and speed). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | Sets the bullet attributes of an enemy to type 8 (random angle and speed). If [[User:{{PAGENAME}}#ins_78 (et_delay)|<code>et_delay</code>]] is not called before this, also shoots immediately. Also sets the following parameters: | ||
* <code>spr</code>: bullet sprite (and hitbox). | * <code>spr</code>: bullet sprite (and hitbox). | ||
* <code> | * <code>col</code>: sprite index (i.e. color). | ||
* <code>num1</code>: amount of bullets per layer. | * <code>num1</code>: amount of bullets per layer. | ||
* <code>num2</code>: number of layers. | * <code>num2</code>: number of layers. |
Revision as of 18:38, 2 February 2019
This is the first ever version of ZUN's ECL format, and is used in EoSD.
Format
Main Structure
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
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
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. |
Function Opcodes
NOTE: These names are unofficial, although some of them take into account known opcode names.
ins_0 (nop)
nop();
No operation.
ins_1 (delete)
delete(int a);
Deletes self if a == 0.
ins_2 (jump)
jump(int time, int cp);
Unconditionally sets current time to time
and changes the current seek in the func by cp
.
ins_3 (jump_ex)
jump_ex(int time, int cp, int $VAR);
Sets current time to time
, changes the current seek position in the function by cp
and decreases $VAR
by 1 if it is not 0. Used as for loops.
ins_4 (set)
set(int $A, int a);
Sets $A
to a
.
ins_5 (setf)
setf(float %A, float a);
Sets %A
to a
.
ins_6 (set_rand)
set_rand(int $A, int a);
Sets $A
to a random value between 0 and a
exclusive.
ins_7 (set_rand2)
set_rand2(int $A, int min, int a);
Sets $A
to a random value between 0 and a
exclusive and adds min
.
ins_8 (set_randf)
set_randf(float %A, float a);
Sets %A
to a random value between 0 and a
.
ins_9 (set_randf2)
set_randf2(float %A, float min, float a);
Sets %A
to a random value between 0 and a
and adds min
.
ins_10 (get_x)
get_x(float %A);
Gets the current X-position of the enemy and stores it in %A
. Similar to setf(%A, [-10015.0f]);
.
ins_11 (get_y)
get_y(float %A);
Gets the current Y-position of the enemy and stores it in %A
. Similar to setf(%A, [-10016.0f]);
.
ins_12 (get_z)
get_z(float %A);
Gets the current Z-position of the enemy and stores it in %A
. Similar to setf(%A, [-10017.0f]);
.
ins_13 (add)
add(int $A, int a, int b);
Addition operation: $A = a + b
.
ins_14 (sub)
sub(int $A, int a, int b);
Subtraction operation: $A = a - b
.
ins_15 (mult)
mult(int $A, int a, int b);
Multiplication operation: $A = a * b
.
ins_16 (div)
div(int $A, int a, int b);
Division operation: $A = a / b
.
ins_17 (mod)
mod(int $A, int a, int b);
Modulo operation: $A = a % b
.
ins_18 (inc)
inc(int $A);
Increment operation: $A++
.
ins_19 (dec)
dec(int $A);
Decrement operation: $A--
.
ins_20 (addf)
addf(float %A, float a, float b);
Addition operation for floats: %A = a + b
.
ins_21 (subf)
subf(float %A, float a, float b);
Subtraction operation for floats: %A = a - b
.
ins_22 (multf)
multf(float %A, float a, float b);
Multiplication operation for floats: %A = a * b
.
ins_23 (divf)
divf(float %A, float a, float b);
Division operation for floats: %A = a / b
.
ins_25 (atan2)
atan2(float %A, float ox, float oy, float tx, float ty);
Gets the arc-tangent between 2 points and stores the resulting angle in %A
. Equivalent to atan2((ty) - (oy), (tx) - (ox))
.
ins_26 (norm_rad)
norm_rad(float %A);
Normalizes %A
to be a valid value in the [-pi, pi] interval.
ins_27 (test)
test(int a, int b);
Compares a
and b
and stores the result (-1 if a
< b
; 0 is a
== b
; 1 if a
> b
) in the "comparison register."
ins_28 (testf)
testf(float a, float b);
Compares a
and b
and stores the result (-1 if a
< b
; 0 is a
== b
; 1 if a
> b
) in the "comparison register."
ins_29 (jump_l)
jump_l(int time, int cp);
Sets current time to time
and changes the current seek in the func by cp
if the comparison register is -1.
ins_30 (jump_leq)
jump_leq(int time, int cp);
Sets current time to time
and changes the current seek in the func by cp
if the comparison register is -1 or 0.
ins_31 (jump_eq)
jump_eq(int time, int cp);
Sets current time to time
and changes the current seek in the func by cp
if the comparison register is 0.
ins_32 (jump_g)
jump_g(int time, int cp);
Sets current time to time
and changes the current seek in the func by cp
if the comparison register is 1.
ins_33 (jump_geq)
jump_geq(int time, int cp);
Sets current time to time
and changes the current seek in the func by cp
if the comparison register is 1 or 0.
ins_34 (jump_neq)
jump_neq(int time, int cp);
Sets current time to time
and changes the current seek in the func by cp
if the comparison register is -1 or 1.
ins_35 (call)
call(int func, int arg1, float arg2);
Calls function func
and sets [-10001] to arg1
and [-10005.0f] to arg2
. Variables [-10001] to [-10012] are also copied onto backup registers.
ins_36 (return)
return();
Returns to the previous function from being called, also loads variables [-10001] to [-10012] from the backup registers. Game crash if no parent function.
ins_37 (call_l)
call_l(int func, int arg1, float arg2, int a, int b);
Calls function func
and sets [-10001] to arg1
and [-10005.0f] to arg2
if a
< b
. Variables [-10001] to [-10012] are also copied onto backup registers.
ins_38 (call_leq)
call_l(int func, int arg1, float arg2, int a, int b);
Calls function func
and sets [-10001] to arg1
and [-10005.0f] to arg2
if a
<= b
. Variables [-10001] to [-10012] are also copied onto backup registers.
ins_39 (call_eq)
call_l(int func, int arg1, float arg2, int a, int b);
Calls function func
and sets [-10001] to arg1
and [-10005.0f] to arg2
if a
== b
. Variables [-10001] to [-10012] are also copied onto backup registers.
ins_40 (call_g)
call_l(int func, int arg1, float arg2, int a, int b);
Calls function func
and sets [-10001] to arg1
and [-10005.0f] to arg2
if a
> b
. Variables [-10001] to [-10012] are also copied onto backup registers.
ins_41 (call_geq)
call_l(int func, int arg1, float arg2, int a, int b);
Calls function func
and sets [-10001] to arg1
and [-10005.0f] to arg2
if a
>= b
. Variables [-10001] to [-10012] are also copied onto backup registers.
ins_42 (call_neq)
call_l(int func, int arg1, float arg2, int a, int b);
Calls function func
and sets [-10001] to arg1
and [-10005.0f] to arg2
if a
!= b
. Variables [-10001] to [-10012] are also copied onto backup registers.
ins_43 (set_pos)
set_pos(float x, float y, float z);
Set the position of the enemy to (x
,y
,z
).
ins_45 (set_trajectory)
set_trajectory(float r, float s);
Set the trajectory of the enemy to angle r
with speed s
.
ins_46 (set_rot_speed)
set_rot_speed(float r);
Sets the angle rotation speed of the enemy to r
radian per frame.
ins_47 (set_speed)
set_speed(float s);
Sets the movement speed of the enemy to s
pixels per frame.
ins_48 (set_accel)
set_accel(float a);
Sets the movement acceleration of the enemy to a
pixels per frame2.
ins_49 (set_angle_rand)
set_angle_rand(float min, float range);
Sets the angle of the enemy to a random value between 0 and range
and adds min
.
ins_50 (set_angle_rand_ex)
set_angle_rand_ex(float min, float max);
Sets the angle of the enemy to a random value between min
and max
while taking into account the movement area of the enemy.
ins_51 (set_speed_to_player)
set_speed_to_player(int a, float s);
Sets the angle of the enemy towards the player and speed to s
. a
is seemingly ignored?
ins_52 (move_decel)
move_decel(int time, float r, float s);
Moves in a deceleration fashion (TBD) for time
frames with angle r
and speed s
.
ins_56 (move_linear_point)
move_linear_point(int time, float x, float y, float z);
Moves to the point (x
,y
,z
) in time
frames using the function f(x)=x
.
ins_57 (move_decel_point)
move_decel_point(int time, float x, float y, float z);
Moves to the point (x
,y
,z
) in time
frames using the function f(x)=2x-x2
.
ins_59 (move_accel_point)
move_accel_point(int time, float x, float y, float z);
Moves to the point (x
,y
,z
) in time
frames using the function f(x)=x2
.
ins_61 (move_decel_time)
move_decel_time(int time);
Moves with deceleration while keeping the current speed and angle and stops in time
frames.
ins_63 (move_accel_time)
move_accel_time(int time);
Moves with acceleration while keeping the current speed and angle and stops in time
frames.
ins_65 (set_move_area)
set_move_area(float x1, float y1, float x2, float y2);
Confines the movement of the enemy to the defined rectangle.
ins_66 (unset_move_area)
unset_move_area();
Removes the movement boundaries set by set_move_area
.
ins_67 (et_set_aimed)
et_set_aimed(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags);
Sets the bullet attributes of an enemy to type 0 (aimed at player). If et_delay
is not called before this, also shoots immediately. Also sets the following parameters:
spr
: bullet sprite (and hitbox).col
: sprite index (i.e. color).num1
: amount of bullets per layer.num2
: number of layers.spd1
: speed of the first bullet layer.spd2
: "minimum" speed of the bullet layers. The slowest layer has speed of(spd1 - spd2) / num2
.ang1
: offset of the aim. 0 = at player.ang2
: angular space between each bullet on each layer.flags
: flags for extra bullet behaviors.
ins_68 (et_set)
et_set(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags);
Sets the bullet attributes of an enemy to type 1 (specified aim). If et_delay
is not called before this, also shoots immediately. Also sets the following parameters:
spr
: bullet sprite (and hitbox).col
: sprite index (i.e. color).num1
: amount of bullets per layer.num2
: number of layers.spd1
: speed of the first bullet layer.spd2
: "minimum" speed of the bullet layers. The slowest layer has speed of(spd1 - spd2) / num2
.ang1
: offset of the aim. 0 = right.ang2
: angular space between each bullet on each layer.flags
: flags for extra bullet behaviors.
ins_69 (et_set_aimed_eqdistr)
et_set_aimed_eqdistr(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags);
Sets the bullet attributes of an enemy to type 2 (aimed at player, equally distributed). If et_delay
is not called before this, also shoots immediately. Also sets the following parameters:
spr
: bullet sprite (and hitbox).col
: sprite index (i.e. color).num1
: amount of bullets per layer.num2
: number of layers.spd1
: speed of the first bullet layer.spd2
: "minimum" speed of the bullet layers. The slowest layer has speed of(spd1 - spd2) / num2
.ang1
: offset of the aim. 0 = at player.ang2
: angular space between each layer of bullets.flags
: flags for extra bullet behaviors.
ins_70 (et_set_eqdistr)
et_set_eqdistr(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags);
Sets the bullet attributes of an enemy to type 3 (specified aim, equally distributed). If et_delay
is not called before this, also shoots immediately. Also sets the following parameters:
spr
: bullet sprite (and hitbox).col
: sprite index (i.e. color).num1
: amount of bullets per layer.num2
: number of layers.spd1
: speed of the first bullet layer.spd2
: "minimum" speed of the bullet layers. The slowest layer has speed of(spd1 - spd2) / num2
.ang1
: offset of the aim. 0 = right.ang2
: angular space between each layer of bullets.flags
: flags for extra bullet behaviors.
ins_71 (et_set_aimed_eqdistr_away)
et_set_aimed_eqdistr_away(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags);
Sets the bullet attributes of an enemy to type 4 (aimed away from player, equally distributed). If et_delay
is not called before this, also shoots immediately. Also sets the following parameters:
spr
: bullet sprite (and hitbox).col
: sprite index (i.e. color).num1
: amount of bullets per layer.num2
: number of layers.spd1
: speed of the first bullet layer.spd2
: "minimum" speed of the bullet layers. The slowest layer has speed of(spd1 - spd2) / num2
.ang1
: offset of the aim. 0 = away from player.ang2
: angular space between each layer of bullets.flags
: flags for extra bullet behaviors.
ins_72 (et_set_eqdistr_away)
et_set_eqdistr_away(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags);
Sets the bullet attributes of an enemy to type 5 (specified aim away, equally distributed). If et_delay
is not called before this, also shoots immediately. Also sets the following parameters:
spr
: bullet sprite (and hitbox).col
: sprite index (i.e. color).num1
: amount of bullets per layer.num2
: number of layers.spd1
: speed of the first bullet layer.spd2
: "minimum" speed of the bullet layers. The slowest layer has speed of(spd1 - spd2) / num2
.ang1
: offset of the aim. 0 = away from right.ang2
: angular space between each layer of bullets.flags
: flags for extra bullet behaviors.
ins_73 (et_set_rand_ang)
et_set_rand_spd(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags);
Sets the bullet attributes of an enemy to type 6 (random angle). If et_delay
is not called before this, also shoots immediately. Also sets the following parameters:
spr
: bullet sprite (and hitbox).col
: sprite index (i.e. color).num1
: amount of bullets per layer.num2
: number of layers.spd1
: speed of the first bullet layer.spd2
: "minimum" speed of the bullet layers. The slowest layer has speed of(spd1 - spd2) / num2
.ang1
: maximum angle that bullets will be shot at. 0 = right.ang2
: minimum angle that bullets will be shot at. 0 = right.flags
: flags for extra bullet behaviors.
NOTE: ang1
and ang1
are normalized into the [-pi, pi] range.
ins_74 (et_set_rand_spd)
et_set_rand_spd(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags);
Sets the bullet attributes of an enemy to type 7 (random speed). If et_delay
is not called before this, also shoots immediately. Also sets the following parameters:
spr
: bullet sprite (and hitbox).col
: sprite index (i.e. color).num1
: amount of bullets per layer.num2
: number of layers.spd1
: maximum speed that bullets will be shot at.spd2
: minimum speed that bullets will be shot at.ang1
: offset of the aim. 0 = right.ang2
: angular space between each layer of bullets.flags
: flags for extra bullet behaviors.
NOTE: ang1
and ang1
are normalized into the [-pi, pi] range.
ins_75 (et_set_rand_ang_spd)
et_set_rand_ang_spd(short spr, short col, int num1, int num2, float spd1, float spd2, float ang1, float ang2, int flags);
Sets the bullet attributes of an enemy to type 8 (random angle and speed). If et_delay
is not called before this, also shoots immediately. Also sets the following parameters:
spr
: bullet sprite (and hitbox).col
: sprite index (i.e. color).num1
: amount of bullets per layer.num2
: number of layers.spd1
: maximum speed that bullets will be shot at.spd2
: minimum speed that bullets will be shot at.ang1
: maximum angle that bullets will be shot at. 0 = right.ang2
: minimum angle that bullets will be shot at. 0 = right.flags
: flags for extra bullet behaviors.
NOTE: ang1
and ang1
are normalized into the [-pi, pi] range.
ins_76 (et_auto)
et_auto(int time);
Sets the interval in frames between each shot. Zero means no automatic shooting.
From Shuusou Gyoku ECL.H
:
#define ECL_TAUTO 0x41 // 弾発射間隔をセットする(0:自動発射しない)
ins_77 (et_auto_delay)
et_auto_delay(int time);
Delays the first shot by a random amount of time ranging from 0 to time
exclusive and set shooting interval to time
. Zero means no automatic shooting.
From Shuusou Gyoku ECL.H
:
#define ECL_TAUTO 0x41 // 弾発射間隔をセットする(0:自動発射しない)
ins_78 (et_delay)
et_delay();
Delays shooting so that setting the attributes doesn't shoot immediately.
ins_79 (et_on)
et_on();
Sets the shoot flag for this frame. Sort of?
From Shuusou Gyoku ECL.H
:
#define ECL_TAMA 0x40 // 弾発射
ins_81 (et_ofs)
et_ofs(float x, float y, float z);
Sets the offset from which to shoot the bullets relative to enemy. Defaults to (0,0,0).
From Shuusou Gyoku ECL.H
:
#define ECL_TXYR 0x42 // 弾発射位置の相対ずらし
ins_82 (et_extra)
et_extra(int a, int b, int c, int d, float r, float s, float m, float n);
Sets the extra attributes for the enemy bullets. Effects depend on the flags of the bullet:
1
: Quick deceleration effect. Uses no parameters.2
: Spawn effect 1. Uses no parameters.4
: Spawn effect 2. Uses no parameters.8
: Spawn effect 3. Uses no parameters.16
: Add an acceleration towardss
with speedr
fora
frames.32
: Change bullet angle bys
and speed byr
fora
framesb
times.64
: Decelerate the bullet fora
frames, then change angle byr
and set speed tos
. Do thisb
times.128
: Decelerate the bullet fora
frames, then aim it by the player, change angle byr
and set speed tos
. Do thisb
times.256
: Decelerate the bullet fora
frames, then set angle tor
and set speed tos
. Do thisb
times.512
: Play sound when shot (possibly determined by ins_84). Uses no parameters.1024
: Allow the bullet to "bounce" on all walls in the gamea
times. Speed is set tor
on contact.2048
: Allow the bullet to "bounce" on all walls in the game but the bottom onea
times. Speed is set tor
on contact.
ins_83 (et_break)
et_break();
Cancels all bullets, transforming them into star items.
ins_84 (et_sfx)
et_sfx(int sfx);
Sets the bullet SFX which plays whenever the enemy shoots. Set to -1 to not play anything. Flag 512 (0x200) must be set for it to play.
ins_85 (laser_on)
laser_on(short sprite, short frame, float angle, float speed, float start_off, float end_off, float start_length, float width, int start_duration, int duration, int stop_duration, int graze_delay, int graze_tolerance, int unk);
ins_86 (laser_on_aimed)
laser_on_aimed(short sprite, short frame, float angle, float speed, float start_off, float end_off, float start_length, float width, int start_duration, int duration, int stop_duration, int graze_delay, int graze_tolerance, int unk);
ins_87 (laser_store)
laser_store(int id);
Applies an ID to the next laser that gets spawned, to allow later modifications.
ins_88 (laser_rotate)
laser_rotate(int id, float delta);
Changes the angle of laser id
by delta
.
ins_90 (laser_move)
laser_move(int id, float x, float y, float z);
Move laser id
by (x
,y
,z
).
ins_92 (laser_break)
laser_break(int id);
Instantly cancels out the specified laser.
ins_93 (set_spellcard)
set_spellcard(short face, short spell_id, char* name);
Starts a spellcard. Displays name
as the spellcard name, changes background, shows portrait face
, sets damage reduction to 8x and clears all bullets.
ins_94 (end_spellcard)
end_spellcard();
Ends current spellcard. Removes its name from the screen, restores background, restores damage reduction and clears all bullets.
ins_95 (enemy_create)
enemy_create(int func_id, float x, float y, float z, unsigned short life, short item, int score);
Spawns an enemy at position (x
,y
,z
), assigns it the function func_id
, sets its life, item reward on death and score reward on death to life
, item
and score
respectively.
ins_96 (enemy_break_all)
enemy_break_all();
Kills all on-screen enemies instantly. Does not kill untouchable enemies or bosses.
ins_97 (set_anm)
set_anm(int id);
Sets enemy graphic to ANM script id
, based on current ANM files loaded.
ins_98 (set_default_anm)
set_default_anm(short default, short far_left, short far_right, short left, short right, short padding);
Set the default graphics for movement accordingly, based on current ANM files loaded.
ins_99 (set_aux_anm)
set_aux_anm(int slot, int id);
Sets an auxiliary graphic to the slot slot
with ANM script id
, based on current ANM files loaded.
ins_100 (set_death_anm)
set_death_anm(int id);
Set the ANM script to play on death.
ins_101 (set_boss_mode)
set_boss_mode(int boss_id);
Sets boss mode, and gives the enemy the boss ID boss_id
. As long as there's an enemy with boss ID not set to -1, boss mode will be active and stage enemies won't spawn.
ins_102 (create_card)
create_card(int id, float x_rot, float y_rot, float z_rot, float dist);
Creates a card graphic that spins around the boss accordingly.
ins_103 (set_hitbox)
set_hitbox(float width, float height, float depth);
Sets the enemy hitbox.
ins_104 (set_collideable)
set_collideable(int b);
Toggles player collision.
ins_105 (set_damageable)
set_damageable(int b);
Toggles player damage.
ins_106 (play_sound)
play_sound(int se);
Plays a sound effect. List is TBD.
ins_107 (set_death_flags)
set_death_flags(int flags);
Sets death flags to flags
, which determine events on death. Must be in the [0-7] interval.
- 0: Normal.
- 1: Call specified death function.
- 2: Do not get deleted immediately.
- 3: Do not get deleted immediately, call specified death function.
- 4-7: Unused, unknown.
ins_108 (set_death_callback)
set_death_callback(int func_id);
Set the function to be called when the enemy is killed to func_id
. Death flag 1 must be set.
ins_109 (mem_write_int32)
mem_write_int32(int val, int index);
Writes val
into the enemy's personal memory pool at index index
. There is space for 8 values, and larger values will overflow to other enemy variables (x-position, y-position, z-position, hitbox width, etc.). Used to start bosses after dialogue.
ins_111 (set_life)
set_life(int life);
Sets enemy life to life
.
ins_112 (set_time)
set_time(int time);
Sets current timeout time to time
. Note that this time starts at 0 and goes up until it reaches the timeout time.
ins_113 (set_life_threshold)
set_life_threshold(int life);
Sets life threshold to life
, preventing the enemy's life from going any lower than that.
ins_114 (set_life_callback)
set_life_callback(int func_id);
Sets the function callback to when the life threshold is reached to func_id
.
ins_115 (set_timeout)
set_timeout(int time);
Sets time when a timeout occurs to time
.
ins_116 (set_timeout_callback)
set_timeout_callback(int func_id);
Sets the function callback to when a timeout occurs to func_id
.
ins_117 (set_targetable)
set_targetable(int b);
Toggles targetable. If disabled, the enemy cannot be killed by clear_enemies
, player shots won't affect it and ReimuA's homing amulets will not even try to target it.
ins_118 (spawn_particle)
spawn_particle(int script, int number, int color);
Spawns a particle effect.
ins_119 (drop_bonus)
drop_bonus(int count);
Drop count
items around the enemy. Drop power items if not at max power, else drop point items.
ins_120 (set_graphic_rotate)
set_graphic_rotate(int b);
Toggles enemy graphics rotation towards the enemy's angle.
ins_121 (game_func_call)
game_func_call(int id, int param);
Calls hardcoded game function id
with a parameter param
. See ins_122
for the list of functions.
ins_122 (game_func_toggle)
game_func_toggle(int id);
Turns on a hardcoded game function (which also doesn't need a paremeter) with ID id
(to turn it off, use id
as -1).
List of functions:
ID | Param? | Description |
---|---|---|
-1 | No | Stop all functions. |
0 | Yes | If param is 0: Freeze all bullets in place and change their subframe to 15.If param is 1: Accelerate bullets towards a random angle for 0.01f speed for 220 frames, and set subframe to 15. Acceleration effect can be replicated with et_set_complex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f); assuming bullet flag 16 is set.
|
1 | Yes | Casts param to float, sets bullet offset to a random point in a param xparam area around the enemy and then shoots.
|
2 | No | Example |
3 | Yes (Unused?) | Sets a value to [-10002] , [-10003] and [-10004] respectively:- [0, 3, 1] if ReimuA. - [2, 3, 4] if ReimuB. - [1, 4, 0] if MarisaA. - [4, 2, 3] if MarisaB. |
4 | Example | Example |
5 | Example | Example |
6 | Example | Example |
7 | Example | Example |
8 | Example | Example |
9 | Example | Example |
10 | Example | Example |
11 | Example | Example |
12 | Example | Example |
13 | Example | Example |
14 | Example | Example |
15 | Example | Example |
16 | Example | Example |
ins_123 (change_time)
change_time(int time);
Change the current function time by time
.
ins_124 (drop_bonus2)
drop_bonus2(int id);
Drops a single item from the enemy's position. Item is determined by id
:
- 0: Power
- 1: Point
- 2: Big Power
- 3: Bomb
- 4: Full Power
- 5: 1-up
- 6: Star
ins_125
ins_125();
Unknown.
ins_126 (set_boss_lives)
set_boss_lives(int lives);
Sets the amount of lives a boss has to lives
. Doesn't change automatically, so it must be called every time a life bar is depleted.
ins_127
ins_127(int);
Removed operation.
ins_128 (end_anm)
end_anm(int a);
If a & 1
then the current enemy graphic is terminated.
ins_129 (end_aux)
end_aux(int slot, int a);
If a & 1
then the graphic at slot slot
is interrupted.
ins_130
ins_130(int);
Unknown.
ins_131 (set_difficulty_influence)
set_difficulty_influence(float speed_low, float speed_high, int density_low, int density_high, int firerate_low, int firerate_high);
Sets the influence of difficulty in the enemy shots (10 being "low" and 32 being "high" probably changes with difficulty, though?). By default, speed_low
is set to -0.5
and speed_high
is set to 0.5
while the rest is 0
. Not really, fire rate seems to be some other value.
ins_132 (set_invisible)
set_visible(int b);
Toggles enemy invisibility.
ins_133
ins_133(int);
Unknown.
ins_134
ins_134(int);
Unknown.
ins_135 (set_timeout_card)
set_timeout_card(int b);
Toggles whether the spellcard can be captured through timeout or not. Also determines if the bonus decreases over time or not.
Timeline Opcodes
NOTE: These names are unofficial, although some of them take into account known opcode names.
ins_0 (enemy_create)
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)
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)
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 between0.0
and392.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)
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 between0.0
and392.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)
start_msg();
Starts dialogue with ID param_ex
.
ins_9 (wait_msg)
wait_msg();
Freezes the timeline timer until there is a pause in the current dialogue.
ins_10 (wait_boss)
wait_boss(int unk1, int unk2);
Freezes the timeline timer as long as there is a boss onscreen. Which boss?
ins_12 (wait_enemy)
wait_enemy();
Freezes the timeline timer as long as there are killable enemies present.