Most of the sequences are used when an action is executed. They define what your actions actually do. A sequence is a list of commands to execute, one by one, in order. The commands vary from altering sprites to dealing damage.

Call A Sequence

You can attach a sequence to skills, items and weapons using the tag sequence: id, where id is the identifier of the sequence. The specified sequence will be played once the object is used in battle.
When a sequence isn’t defined, a default one is used.

Default Sequences

Here are the predefined sequences. They are in the configuration file:

  • battle_start : Called when the battle start. This sequence is empty by default.
  • turn_start : Called when the turn starts.
  • victory : Called when the party is victorious of a battle.
  • dead : Called when an entity dies.
  • revived : Called when an entity is revived.
  • damaged : Called when an entity is damaged.
  • evaded : Called when an entity evaded. This sequence is empty by default.
  • atk : The default sequence used for weapons.
  • cast(loop) : A template sequence used by other sequences. Plays the cast animation.
  • pre-skill : A template sequence used before the skill sequence.
  • post-skill : A template sequence used after the skill sequence.
  • skill : The default sequence used by skills.
  • map_skill : Same a skill but the animation is played on each cell in the AoE instead of battlers.
  • item : The default sequence used by items.
  • bow : An example of a sequence for bows.
  • counter : Called when a counter attack occurs.
  • summon : A template sequence called for summoning an entity.

Overloading Sequences

(To Update)

Creating A Sequence

There are two ways to create a sequence, using a tag, or inside the configuration file.

1- Using a tag:

<letbs_Sequence>
command1: parameter1, parameter2, ...
command2: parameter1, parameter2, ...
...
</letbs_Sequence>

Using this method, the tag sequence: id is useless. The defined sequence will be used so there is no use of that tag.

2- Inside the configuration file:

Insert the following template in the Lecode.S_TBS.Config.Sequences section.

"ID": [
    "command1: parameter1, parameter2, ...",
    "command2: parameter1, parameter2, ...",
    "...",
],

Template Sequences

(To Update)

Building The Sequence

A sequence is defined by a list of commands, and each command has parameters. Use the commands listed bellow properly to get the desired effects.
For instance, here's the content of the atk sequence:

"atk": [
    "play_pose: user, atk",
    "wait: 10",
    "effects: {aoe}_battlers, current_obj, obj_anim",
    "wait: 60"
],

That sequence does the following actions in this order:

  • Calls the pose atk on the user.
  • Waits 10 frames.
  • Triggers the effects of the object on all battlers in the selected AoE, playing that object's animation.
  • Waits 60 frames.

Selecting Entities And Cells

Most of the commands use cells or designated entities as a parameter. For example the command play_pose make the designated entities play a pose. Selecting entities and cells is done by using a key word as a parameter. In the command play_pose: user, atk, user is a key word who targets the entity executing the sequence.

Entities Key Words :

  • {aoe}_battlers : Selects all battlers in the AoE.
  • {aoe}_allies : Selects all allies in the AoE.
  • {aoe}_enemies : Selects all enemies in the AoE.
  • cursor_battler : Selects the entity on the cursor cell.
  • cursor_ally : Selects the ally on the cursor cell.
  • cursor_enemy : Selects the enemy on the cursor cell.
  • x_battlers_in_{aoe} : Selects x random battlers in the AoE.
  • x_allies_in_{aoe} : Selects x random allies in the AoE.
  • x_enemies_in_{aoe} : Selects x random enemies in the AoE.
  • {aoe}_dead_battlers : Selects all battlers in the AoE.
  • {aoe}_dead_allies : Selects all actors in the AoE.
  • {aoe}_dead_enemies : Selects all enemies in the AoE.
  • cursor_dead_battler : Selects the entity on the cursor cell if he's dead.
  • cursor_dead_ally : Selects the ally on the cursor cell if he's dead.
  • cursor_dead_enemy : Selects the enemy on the cursor cell if he's dead.
  • x_dead_battlers_in_{aoe} : Selects x random ded battlers in the AoE.
  • x_dead_allies_in_{aoe} : Selects x random ded allies in the AoE.
  • x_dead_enemies_in_{aoe} : Selects x random dead enemies in the AoE.
  • battler_toward_user : Select the battler toward the user.
  • user : Select the user.
  • all : Selects all entities on the map.
  • allies : Selects all allies on the map.
  • enemies : Selects all enemies on the map.
  • last_targets : Use the last selected targets.
  • saved : Use saved targets.

Cells Key Words :

  • {aoe} : Selects all cells in the AoE.
  • cursor_cell : Selects the cursor cell.
  • user_cell : Selects the user cell.
  • x_cells_in_{aoe} : Selects x random cells in the AoE.
  • {aoe}_ally_cells : Selects all ally cells in the AoE.
  • {aoe}_enemy_cells : Selects all ally cells in the AoE.
  • battler_cells : Selects all cells on the map containing a battler.
  • ally_cells : Selects all ally cells on the map.
  • enemy_cells : Selects all enemy cells on the map.
  • last_targets : Use the last selected cells.
  • saved : Use saved cells.

Notes

{aoe} refers to the current action AoE. The key word aoe can be replaced by cursor or any of the scope data, such as circle, square, or custom, ect.
Example: {circle(2,4)}_allies.
The center of these AoEs is always the cursor cell.

It's possible to exclude some targets from the selection, by adding - followed by a key at the end of the main key words. Examples:

  • {aoe}_battlers -user: Select all battlers in the action AoE except the user.
  • 3_battlers_in_{aoe} -{circle(2)}_battlers: Select 3 random battlers in the aoe expcept those in the scope circle(2).
  • battler_cells -user_cell: Select each battler's cell on the map except the one of the user.

Sequence Commands

Sprite Commands

  • play_pose: entities, pose_name, [wait]
    Selected entities play the designated pose. If the third parameter is true, the sequence will wait for the end of the pose animation.
  • play_pose: entities, pose_name, after_pose
    after_pose will be played right away after the end of the animation. To perform a loop, set after_pose the same as pose_name.
  • set_frame: entities, pose_name, frame_index
    Set a fixed frame for the selected entities. The pose will not be played but stuck on the defined frame.
  • set_speed: entities, reset
    Reset the speed of the selected entities.
  • set_speed: entities, +x
    Increase the speed of the selected entities by x.
  • set_speed: entities, -x
    Decrease the speed of the selected entities by x.
  • set_speed: entities, x
    Set x as the speed of the selected entities.
  • set_frame_delay: entities, reset
    Reset the frame delay of the selected entities.
  • set_frame_delay: entities, +x
    Increase the frame delay of the selected entities by x.
  • set_frame_delay: entities, -x
    Decrease the frame delay of the selected entities by x.
  • set_frame_delay: entities, x
    Set x as the frame delay of the selected entities.
  • sprite_shake: entities, power, duration, [wait]
    Make the selected entities shake. If wait is true, the sequence will wait for the end of the duration.

Damage Commands

  • effects: entities, obj, hit_animation, animation_delay, [wait]
    Triggers the effects on each selected entity.
    • obj can be:
      • current_obj : The current used skill/item/attack effects are triggered.
      • skill_ID : The designated skill's effects will be applied.
      • item_ID : The designated item's effects will be applied.
      • f: string : Evaluate the string to deal damage.
        Examples: f: 80, f: b.hp * 0.2
    • hit_animation can be:
      • obj_anim : The animation of the current object.
      • ID : The animation with the designated ID will be used.
  • map_effects: cells, obj, hit_animation, animation_delay, [wait]
    Triggers the effects on the selected cells. Entities on these cells will be damaged and the animation is played on each cell.
  • perform_collapse: entities
    This instruction is used on the default dead sequence. It’s used to properly state that the battler is dead.

Animation Commands

  • anim: entities, animation, animation_delay, [wait]
    Play an animation on each selected entity.
    • animation can be:
      • obj_anim : The animation of the current object.
      • collapse_anim : The collapse animation will be used.
      • ID : The animation with the designated ID will be used.
  • map_anim: cells, animation, animation_delay, [wait]
    Play an animation on each selected cells.
    • animation can be:
      • obj_anim : The animation of the current object.
      • ID : The animation with the designated ID will be used.
  • directional_anim: entities, reference_entity, down, left, right, up
    The selected entities play an animation based on the direction of reference_entity. down, left, right and up must be animation IDs.

Motions Commands

  • look_at: entities, cell
    Selected entities will face the designated cell.
  • look_away: entities, cell
    Selected entities will give the back to the designated cell.
  • move_to_cell: entity, cell, [is_instant]
    The selected entity will move to the designated cell. If is_instant is true, the entity will be teleported. If not, the sequence will wait until the end of the move.
  • jump_to_cell: entity, cell, [height]
    The selected entity will jump to the designated cell. The default height is 120.
  • move_straight: entity, x
    The selected entity will move in his faced direction by x cells.
  • push: entities, source_cell, x, [damage?]
    Selected targets will be pushed by x cells based on the source cell. If damage? is true, they will take damage in case of collision.
  • pull: entities, source_cell, x, [damage?]
    Selected targets will be pulled by x cells based on the source cell. If damage? is true, they will take damage in case of collision.
  • reach_target: user, entity, type, end_if_imposible
    Teleport the user near the entity. if end_if_imposible is true, the sequence is ended if the caster can’t reach the target.
    • type can be:
      • back : The user will be teleported at the back of the target
      • front : The user will be teleported toward the target
      • side : The user will be teleported at one the sides of the target
      • random : The user will be teleported randomly at the back, side or front
  • switch_cell: entity_a, entity_b
    entity_a will switch his position with entity_b.

Summoning Commands

  • projectile: ID, start_cell, end_cell
    Create a projectile based on its identification. It’ll travel from start_cell to end_cell. Take a look at the projectiles section. Selected cells can be entities.
  • mark: ID, cells
    (Requires the mark add-on)
    Create a mark based on its identification on each cell.
  • summon: ID, cells
    (Requires the summoning add-on)
    Summon entities on each cell.

Call Commands

  • call: sequence_ID, x
    Call a sequence x times. The current sequence will wait until the end of the called sequences.
  • call_for_every_cell: sequence_ID, cells, sort_type
    Call a sequence one time for every selected cell. The cursor cell will be updated for every cell.
    • sort_type can be:
      • close->far : The selected cells are sorted from closest to farthest from the user.
      • far->close : The selected cells are sorted from farthest to closest from the user.
      • random : The selected cells are sorted randomly.
  • call_for_every_entity: sequence_ID, entities, sort_type
    Call a sequence one time for every selected entity. The cursor cell is updated for every entity.
  • delegate_call: sequence_ID, entity
    A sequence will be called but the designated entity will be considered as the user of that sequence. So, user in the called sequence will refer to entity.
  • end_delegate_call: -
    Ends the delegated call. Must be used to stop the reference to the fake user.
  • ask_sequence: sequence_ID, entities
    Make selected entities play a sequence. The current sequence doesn't stop.
  • use_skill: entities, skill_id
    The selected entities will use the designated skill. The AoE of that skill will be based on the cursor cell. ask_sequence is indirectly called there.

The difference between delegate_call and ask_sequence is that in the case of a delegated sequence, the one who’s delegating the sequence plays it, making the former sequence to wait. In the case of ask_sequence, it’s not the current user who plays it. Hence, there’ll be no wait. Use ask_sequence for synchronous actions.

Misc. Commands

  • wait: x
    The sequence will wait x frames.
  • save_cells: id, cells, option
    Save the selected cells as targets. They can be referenced later by an ID with saved(id). If option is shift, only the first cell from the selected ones is saved. But it is removed from them beforehand. This means that cell becomes unique and can’t be selected again. For example: “save_cells: test, aoe, shift” will select the first cell from aoe, save it with the ID test and remove it from the main aoe. This option is then useful to loop through an aoe. The command call_for_every_cell uses it.
  • save_entities: id, entities, option
    Save the selected entities as targets. They can be referenced later by an ID with saved(id).
  • script: code
    Evaluate the code.