Skip to content
‮(gorg) edited this page Jul 10, 2022 · 5 revisions

Blocks

Every block in the blocks array follows the value:

{
    id: "block" | "bracket" // it is the type of block
}

Each type has different values in the object itself

bracket

Brackets are the simplest, so are going first.

Pretty much self-explanatory, their data goes as such:

{
    id:     "bracket",        // cannot be block
    direct: "open" | "close", // Open (as a piston) faces to the right, and close faces left
    type:   "norm" | "repeat" // If the bracket is sticky or not. "norm" isn't and "repeat" is.
}

block

I sort blocks into 4 types: SelectionBlock, SubActionBlock, DataBlock, and Else They all follow the data pattern.

{
    id:    "block", // uhuh
    block: "call_func" | "control" | "else" | "entity_action" | "entity_event" | "event" | "func" | "game_action" | "if_entity" | "if_game" | "if_player" | "if_var" | "player_action" | "process" | "repeat" | "select_obj" | "set_var" | "start_process",
    // All the internal names of block types
}

Any dynamic value which "df doesn't care about" can have any value and will import ignoring what is in the value. They support color codes if using § to prefix the color code (not &). Hex probably wont work

Else

Else is simple, has no dynamic values, and follows data pattern

{
    id:    "block",
    block: "else"
}

Action Blocks

Blocks with actions. They follow the data pattern

{
    id:       "block",
    block:    string, // Only supports options found in the subtypes.
    action:   string, // There are lots and will be too many to list. DF doesn't care about what's on it.
    inverted: "" | "NOT" // If the block is inverted with the NOT arrow. Only IF blocks use this. DF doesn't care about what's on it.
}

SelectionBlock

Perhaps the most common type, which appears to include blocks which don't even use Selections and blocks that don't use Inversion.
They follow the data pattern

{
    id:       "block",
    block:    "event" | "player_action" | "entity_event" | "entity_action" | "set_var" | "game_action" | "repeat" | "control" | "select_obj",
    action:   string,
    target:   "" | "AllPlayers" | "Victim" | "Shooter" | "Damager" | "Killer" | "Default" | "Selection" | "Projectile" | "LastEntity",
    // The selection of the block, not all encompassed by this type use it. DF doesn't care what is in this, again allowing § codes.
    inverted: "" | "NOT" 
}

SubActionBlock

Clone this wiki locally