• 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/V2.2

From Touhou Wiki
Jump to navigation Jump to search

ECL V2.2 (unofficial name) is the fourth major version of ZUN's ECL format. It is used from Th13 (TD) to Th16 (HSiFS). Compared to ECL V2.1, the enemy system has been expanded, and more opcodes have been added.

Note: This is based on Riri's database.

Syntax Differences (from V2.1)

TBD

Opcode List

300-series (Enemy and ANM)

400-series (Enemy Movement)

500-series (Enemy Misc)

600-series (Bullet Patterns and Special Functions)

These instructions are responsible for the behavior of bullets and bullet-shooting.

ins_600 (etSet)

etSet(int et_id);

Creates a bullet manager and assigns it with ID et_id.

ins_601 (etOn)

etOn(int et_id);

Shoots bullets according the settings on bullet manager et_id.

ins_602 (etSpr)

etSpr(int et_id, int sprite, int frame);

Sets the sprite (and consequentially, the hitbox) for the bullets in bullet manager et_id to sprite with frame frame (which changes their color for non-animated bullets). For curvy lasers, sprite must be set to 0. Note that the values of sprite tend to change with every game.

List of bullet sprites for Th16: HSiFS

ins_603 (etOfs)

etOfs(int et_id, float x, float y);

Sets the offset from which to shoot bullets from for bullet manager et_id. Defaults to (0,0), so the enemy's position.

ins_604 (etR)

etR(int et_id, float ang1, float ang2);

Sets the angle/direction in which bullets are shot at for bullet manager et_id. Normally, ang1 corresponds to the angle offset relative to the default angle and ang2 is an angular difference between bullets or layers of bullets.

ins_605 (etSpd)

etSpd(int et_id, float spd1, float spd2);

Sets the speed in which bullets move at when they're shot for bullet manager et_id. Normally, spd1 is the base speed at which the first cnt2o of bullets moves at, while spd2 is the base minimum speed that determines how slow the remaining cnt2os move at.

ins_606 (etAmt)

etAmt(int et_id, int cnt1, int cnt2);

Sets the amount of bullets that are shot for bullet manager et_id. cnt1 bullets will be shot in cnt2 layers.

ins_607 (etType)

etType(int et_id, int type);

Sets the type of shooting pattern that is used for bullet manager et_id. TBD. 0 = aimed at player; 1 = aimed at angle; 2 = aimed at player, equally distributed; 3 = aimed at angle, equally distributed; 4-7 = same as 0-3 but mirrored?; 8 = random angle and speeds

ins_608 (etSE)

etSE(int et_id, int shot_se, int transform_se);

Sets the sound effects that play when the bullets are shot (shot_se) and when their properties change (transform_se). Not always necessary, since the game has defaults. Use -1 as a sound effect to play no sound.

ins_609 (etEx1)

etEx1(int et_id, int id, int slot, int type, int a, int b, float r, float s);

See table.

ins_610 (etEx2)

etEx2(int et_id, int id, int slot, int type, int a, int b, int c, int d, float r, float s, float m, float n);

See table.

ins_611 (etExi1)

etExi1(int et_id, int slot, int type, int a, int b, float r, float s);

See table.

ins_612 (etExi2)

etExi2(int et_id, int slot, int type, int a, int b, int c, int d, float r, float s, float m, float n);

See table.

ins_613 (etClear_all)

etClear_all();

Clears all bullets. (???)

ins_614 (etCopy)

etCopy(int et_id, int src_id);

Copies all previously-defined settings for bullet manager src_id into et_id.

ins_615 (etClear)

etClear(float r);

Clears all bullets in radius r into the corresponding game-specific item.

ins_616 (etClear_ni)

etClear_ni(float r);

Clears all bullets in radius r but does not convert them into items.

ins_617 (etSetSpeed_r3)

etSetSpeed_r3(int et_id, float spd1_low, float spd1_mid, float spd1_high, float spd2_low, float spd2_mid, float spd2_high);

Sets bullet speed for bullet manager et_id according to in-game rank. Unused.

ins_618 (etSetSpeed_r5)

etSetSpeed_r5(int et_id, float spd1_low, float spd1_midlow, float spd1_mid, float spd1_midhigh, float spd1_high, float spd2_low, float spd2_midlow, float spd2_mid, float spd2_midhigh, float spd2_high);

Sets bullet speed for bullet manager et_id according to in-game rank. Unused.

ins_619 (etSetSpeed_r2)

etSetSpeed_r2(int et_id, float spd1_low, float spd1_high, float spd2_low, float spd2_high);

Sets bullet speed for bullet manager et_id according to in-game rank. Unused.

ins_620 (etSetCount_r3)

etSetCount_r3(int et_id, float cnt1_low, float cnt1_mid, float cnt_high, float cnt2_low, float cnt2_mid, float cnt2_high);

Sets bullet count for bullet manager et_id according to in-game rank. Unused.

ins_621 (etSetCount_r5)

etSetCount_r5(int et_id, float cnt_low, float cnt_midlow, float cnt_mid, float cnt_midhigh, float cnt_high, float cnt2_low, float cnt2_midlow, float cnt2_mid, float cnt2_midhigh, float cnt2_high);

Sets bullet count for bullet manager et_id according to in-game rank. Unused.

ins_622 (etSetCount_r2)

etSetCount_r2(int et_id, float cnt_low, float cnt_high, float cnt2_low, float cnt2_high);

Sets bullet count for bullet manager et_id according to in-game rank. Unused.

ins_623 (getPlayerAngle)

getPlayerAngle(float %A, float x, float y);

Calculates the angle to the player with base point (x,y) and stores it in %A.

ins_624 (etSetSpeed_diff)

etSetSpeed_diff(int et_id, float spd1_e, float spd1_n, float spd1_h, float spd1_l, float spd2_e, float spd2_n, float spd2_h, float spd2_l);

Sets the speed in which bullets move at when they're shot for bullet manager et_id according to difficulty (Easy/Normal/Hard/Lunatic). Higher difficulties than Lunatic may cause overflow problems.

ins_625 (etSetCount_diff)

etSetCount_diff(int et_id, float cnt_e, float cnt_n, float cnt_h, float cnt_l, float cnt2_e, float cnt2_n, float cnt2_h, float cnt2_l);

Sets the amount of bullets that are shot for bullet manager et_id according to difficulty (Easy/Normal/Hard/Lunatic). Higher difficulties than Lunatic may cause overflow problems.

ins_626 (etSetOffset_r)

etSetOffset_r(int et_id, float a, float r);

Sets the offset from which bullets for bullet manager et_id are shot from to (cos(a) * r,sin(a) * r). Does not override ins_603.

ins_627 (etSetDistance)

etSetDistance(int et_id, float dist);

Sets the distance from the final shooting offset from which the bullets for bullet manager et_id are shot from to dist pixels.

ins_628 (etSetOffset_abs)

etSetOffset_abs(int et_id, float x, float y);

Sets the offset from which bullets for bullet manager et_id are shot from, in absolute coordinates. May override ins_603.

ins_629 (setBossFog)

setBossFog(float r, int color);

Sets the radius r for the boss's surrounding fog with color color. Calling this again will make the fog play its spawn animation again.

ins_630 (callSTD)

callSTD(int id);

Calls script id from the stage STD file.

ins_631 (hideLife)

hifeLife(int time);

Hides the boss lifebar and timer for time frames. Yuugi post-midboss in SA stage 3.

ins_632

ins_632(int id);

TBD.

ins_633

ins_633(int);

Used in TD, unknown.

ins_634

ins_634(int);

Unknown.

ins_635

ins_635(float);

Unknown.

ins_636

ins_636(float);

Unknown.

ins_637

ins_637(int id);

TBD.

ins_638

ins_638 (int);

Unknown.

ins_639

ins_639 (int);

Unknown.

ins_640

ins_640(int et_id, int a, char* sub);

TBD.

ins_641

ins_641(int et_id);

Unknown.

700-series (Lasers)

Laser-related instructions. Note: Lasers function similarly to bullets. As such, etCreate, etSetSprite, etSetSpeed, etSetAngle, etSetSE and etSetExtra are essential and still affect the laser.

ins_700 (laserSetSize)

laserSetSize(int et_id, float start_length, float length, float start_width, float width);

Sets laser sizes for the bullet manager et_id. start_length and start_width correspond to the size of the laser when it is spawned/disabled. length and width correspond to the laser's maximum length and width. Curvy lasers only require width to be properly set and their length is defined in laserSetTime.

ins_701 (laserSetTime)

laserSetTime(int et_id, int start, int trans1, int duration, int trans2, int end);

Sets the timing for the lasers (in frames) for the bullet manager et_id.

  • start is the amount of time the laser stays disabled when it is spawned.
  • trans1 is the time the laser takes to go from its starting width to final width defined in laserSetSize (note: the laser is dangerous at this point).
  • duration is the time the laser stays enabled, after which it stops being dangerous. trans2 is the time between the laser going from its maximum width to its starting width.
  • end is unknown, although it is related to laser collision.

Curvy lasers only require start to be properly set, and it determines the time the laser takes to fully spawn (and consequentially its length).

ins_702 (laserShoot)

laserShoot(int et_id);

Shoots a straight laser using the properties defined for the bullet manager et_id.

ins_703 (laserShootStatic)

laserShootStatic(int et_id, int laser_id);

Shoots a static straight laser using the properties defined for the bullet manager et_id and assigns it ID laser_id (NOT the bullet manager ID) which can be used for later transformations. Think Clownpiece.

ins_704 (laserSetOffset)

laserSetOffset(int laser_id, float x, float y);

Sets the start offset of laser laser_id to x and y.

ins_705 (laserSetTrajectory)

laserSetTrajectory(int laser_id, float r, float s);

Gives the laser laser_id a trajectory with angle r and speed s.

ins_706 (laserSetLength)

laserSetLength(int laser_id, float length);

Changes the maximum length of laser laser_id to length.

ins_707 (laserSetWidth)

laserSetWidth(int laser_id, float width);

Changes the maximum width of laser laser_id to width.

ins_708 (laserSetAngle)

laserSetAngle(int laser_id, float ang);

Changes the direction of laser laser_id to ang.

ins_709 (laserSetRotSpeed)

laserSetRotSpeed(int laser_id, float a);

Makes the laser laser_id rotate by a every frame.

ins_710 (laserBreak)

laserBreak(int laser_id);

Instantly cancels out the specified laser.

ins_711 (laserCurvyShoot)

laserCurvyShoot(int et_id);

Shoots a curvy laser using the properties defined for the bullet manager et_id.

800-series (Specific-Enemy)

ins_800 (sendCall)

sendCall(int enemy_id, char* sub);

Immediately sends an instruction to the specified enemy (enemy_id) that calls sub.

ins_801 (getEnemyPos)

getEnemyPos(float %A, float %B, int enemy_id);

Gets the X- and Y-positions of the specified enemy (enemy_id) and stores them in %A and %B respectively.

ins_802

ins_802(int);

Unknown. Boss-related.

900-series (Debug)

These are debug functions that do not actually function in the final release of the games. As such, they're the least known functions.

ins_900

ins_900();

Unknown.

ins_901

ins_901();

Unknown. Used in default.ecl in the DebugSkipFunc function.

ins_902

ins_902();

Unknown. Used in default.ecl in the DebugSkipStopFunc function.

1000-series (Game-specific Misc)

Extra Bullet Attributes