Linedef executor

From SRB2 Wiki
Jump to: navigation, search

Linedef executors are a linedef-based scripting system, used to set up triggered special events in a level, from switches and doors, to on-screen messages, to changing sky and weather. Linedef executors are made up of two parts, a trigger and commands. The trigger sector activates the trigger linedef, which in turn runs all linedef executors in its sector. The trigger sector is always a sector type, because the game cannot detect linedef collision properly. The trigger linedefs and commands are linedef types.


The trigger is what sets off the linedef executor. This will be what causes the action to happen. There are many sector types and linedef types, and all of them have different purposes. The sector types determine what action will trigger the linedef executor, and the linedef type determines how to run the commands. Also, the executor sector should share the sector tag as the trigger linedef. Alternatively, instead of a trigger sector, an Object calling the action A_LinedefExecute or the Lua function P_LinedefExecute can be used to run the trigger linedef.

Sector types

Linedef types

Additional effects

If the Repeat Midtexture flag of any trigger linedef in a control sector with several linedef actions is checked, the game goes through the actions in order of their linedef numbers when the linedef is triggered. Otherwise, a specific order is taken: the game goes through every linedef in a cyclic fashion, starting from one of the adjacent to the trigger linedef, and visiting the rest until it performs a full loop around the control sector. When you want several actions to be executed in a given order, set the correspondent effects on the linedefs following the trigger one and around the control sector (if your control sector was built clockwise, the actions will be executed by going clockwise around the sector, otherwise, by going counter-clockwise).

The default scenario usually results in poorer performance, so when the order of which the linedef actions are executed doesn't matter, it's a good idea to check the Repeat Midtexture flag to improve efficiency.


The linedef executor commands are what the trigger linedef will make happen. When the linedef executor is triggered, all the commands in the control sector where the trigger linedef is will be executed. Note that many of the linedef executor commands are very specific about details, so make sure that the linedef is facing the proper direction if it needs to have data from another sector, and that any values you're giving it make sense. If it doesn't work, check the pages below to make sure that all the details are correct.

Command list

Additional effects

If the Upper Unpegged flag (8) of any linedef executor command is checked, the linedef executor will run after an amount of time specified by the sum of the floor and ceiling height of the linedef's back sector. For more information, see the Timed linedef executor/Upper Unpegged tutorial.

See also