Corridors - BEEmod/BEE2-items GitHub Wiki

Corridors

BEEmod adds a new system for customising which corridors are used at the beginning and end of a map. Corridors consist of the entry/exit door and the worldportal connecting to the elevator instance, which remains controlled by the style. Additionally, the new capability to create upward and downward facing corridors is added.

There are a total of 12 different kinds of corridor that can be specified (the order of each word does not matter):

  • sp_entry_horizontal
  • sp_entry_floor
  • sp_entry_ceiling
  • sp_exit_horizontal
  • sp_exit_floor
  • sp_exit_ceiling
  • coop_entry_horizontal
  • coop_entry_floor
  • coop_entry_celing
  • coop_exit_horizontal
  • coop_exit_floor
  • coop_exit_ceiling

For convenience, corridors override the orientation of the instance so that they are always upright. For horizontal doors, the chamber door should be on the right of the top view (east, +x).

An additional legacy syntax is available: orientation can also be specified as up and down. This indicates the direction of travel through the corridor - entry_up is on the floor, exit_up is on the ceiling.

Configuration

Corridors are specified as a group in info.txt as shown below. Groups can be repeated in multiple packages, and are merged together.

"CorridorGroup"
	{
	"ID" "<group_id>"
	"inherit" "<group_id>"
	"Options"
		{
		...
		}
	"<kind>"
		{
		"instance" "instances/BEE2/style/corridor_blah.vmf"
		"config" "path/to/config.cfg"
		"name" "Corridor Name"
		"authors" "Author 1, Author 2"

		"image" "PACKAGE:path/to/img1.jpg"
		"image" "PACKAGE:path/to/img2.vtf"
		"image" "PACKAGE:path/to/img3.png"
		"icon" "PACKAGE:path/to/icon.png"

		"DefaultIndex" "1"
		"Legacy" "0"
		"Option" "SOME_OPTION"
		"Fixups"
			{
			"$var1" "value1"
			"$var2" "value2"
			...
			}
		}
	"<kind>"
		{
		...
		}
	...
	}
  • ID: This identifies the group of corridors. Usually this will match the ID of a style, to associate this group with that style. Otherwise, the group will not be directly visible - another group needs to use Inherit to make the defintions usable. This could be used to share some common corridors among styles.
  • Inherit: This specifies the ID of another corridor group, whose corridors will be copied to this one. Multiple can be specified.
  • <kind>: Each block defines one corridor and its type, in any order. If the orientation is omitted it defaults to horizontal, the direction (entry/exit) and game mode (sp/coop) must be supplied.
  • Options: Defines one or more options available for the corridors to use. See below for details.

The following options are available for each corridor:

  • instance: This specifies the instance used for this corridor. It must be unique, this is used to identify the corridor.
  • config: This specifies a configuration file in items/ containing configuration for VBSP (such as Conditions).
  • name: The name to display for this corridor.
  • authors: Comma-separated list of authors for the corridor.
  • image: Path for screenshots to display for the corridor. Any number can be shown. They should be 4:3 in size and at least 256x192.
  • icon: Path for the icon to display in the corridor selector. This should ideally be 144x96. If not specified, the first screenshot is used.
  • Disabled: If set, this corridor requires the user to select it in the options pane before it will be used. This should be used for corridors which have unusual shapes or other special behaviour, to ensure puzzles don't break.
  • Legacy: Should not be used in new corridors. This disables the automatic orientation correction, so existing corridor instances can still be used.
  • Fixups: Each fixup variable specified here is set on the corridor instance. This can be used to indicate how to configure the corridor. In the standard styles, common features like doors or fizzlers are defined in the item configs, then enabled by setting fixups.
  • Option: Specifies the ID for options that apply to this corridor. Can be specified multiple times.

Options

To allow further variation in corridors, each group can define various options. Each option is enabled only for corridors which it is relevant for - either specific corridors, or based on the type of corridor.

If applicable, each option sets an associated fixup value to one of several values. Each option can also be set to a 'random' mode, where the option is randomised for each level.

Configuration is like so:

"Options"
	{
	"<option_id>"
		{
		"name" "Poster Design"
		"var"  "$poster_mat"
		"Description" "Selects which poster to display."
		"global" "sp_entry"
		"default" "<RANDOM>"
		"values"
			{
			"DOLLARS"  "60 Dollars!"
			"PARADOX"  "Paradoxes"
			"FLOODING" "Flood Risk"
			}
		}
	... 
	}
  • <option_id>: Each option must have a unique ID.
  • name: The display name used in the UI.
  • var: The fixup variable this will set.
  • description: Description of the option and how each value behaves. Can be a block with multiple lines and supports Markdown.
  • global: If provided, this option is applicable to all corridors of this type. Valid values are one or both of sp/coop and entry/exit. Can be specified multiple times to include different combinations.
  • default: Specifies the option to initially set. Must either be one of the value IDs, or <RANDOM>.
  • values: Defines the valid values for the option, in order. Each key is the ID representing this value, which is ultimately assigned to the fixup value. The value is displayed to the user.

Value IDs should not be set to raw configurations (like light colours, model names etc). Doing so would cause saved configurations to be lost if the exact value needs to change in the future, and doesn't work if one corridor needs a slight value tweak. Instead, use conditions like MapInstVar or Switch to translate the IDs to the specific values each corridor needs.

For example, clean corridors use this config to select light strips:

"Condition"
	{
	"instance" "[spEntryCorr]"
	"Switch"
		{
		"test" "instvar"
		"$temperature COOL"
			{
			"SetInstVar" "$strip_skin 0"
			"SetInstVar" "$strip_mat lights/light_panel_cool"
			}
		"$temperature COLD"
			{
			"SetInstVar" "$strip_skin 0"
			"SetInstVar" "$strip_mat lights/light_panel_cool"
			}
		"$temperature NEUTRAL"
			{
			"SetInstVar" "$strip_skin 2"
			"SetInstVar" "$strip_mat lights/light_panel_neutral"
			}
		"$temperature WARM"
			{
			"SetInstVar" "$strip_skin 1"
			"SetInstVar" "$strip_mat lights/light_panel_warm"
			}
		}
	}
⚠️ **GitHub.com Fallback** ⚠️