Skip to content

editoritems.txt

Luke18033 edited this page Aug 2, 2016 · 1 revision

editoritems.txt is the config file defining items for the editor. The BEE2 splits this up into seperate files for each item, and style. It is located at Portal 2/portal2_dlc2/scripts/editoritems.txt.

Basic Layout

"ItemData"
	{
	"Item" 
		{ ... }
	"Item" 
		{ ... }
	"Renderables"
		{
		"Item"
			{ ... }
		}
	}		

editoritems.txt is mainly composed of a large number of Items blocks. These are contained within a top-level ItemData block. This must be included in the Style editoritems.txt files, but not in individual items. Renderables defines the model used for the placement-error icon and the connection-heart - this should not need to be altered.

#Item Format

"Item"
	{
	"ItemClass"	"ClassName"
	"Type"	"ITEM_ID_HERE"
	"Editor"
		{
		"SubTypeProperty"	"ButtonType"
		"SubType"
			{
			"Name"	"Subtype Name"
			"Model"
				{
				"ModelName"	"model_filename.3ds"
				"TextureName"	"null.png"
				}
			"Palette"
				{
				"Tooltip"	"PALETTE 1"
				"Image"	"palette/tSpen/icon_1.png"
				"Position"	"4 2 0"
				}
			"Sounds"
				{
				"SOUND_CREATED"	"P2Editor.PlaceOther"
				"SOUND_EDITING_ACTIVATE" "P2Editor.ExpandOther"
				"SOUND_EDITING_DEACTIVATE" "P2Editor.CollapseOther"
				"SOUND_DELETED"	"P2Editor.RemoveOther"
				...
				}
			"Animations"
				{
				"ANIM_IDLE"							"0"
				"ANIM_EDITING_ACTIVATE"				"1"
				"ANIM_EDITING_DEACTIVATE"			"2"
				...
				}
			}
		}
		"MovementHandle"		"HANDLE_NONE"
		"InvalidSurface" 		"WALL FLOOR CEILING"
		"DesiredFacing"			"DESIRES_ANYTHING"
		"CanAnchorOnGoo"		"0"
		"CanAnchorOnBarriers" 	"0"
	}
"Properties"
	{
	"PropertyName"
		{
		"DefaultValue"	"0"
		"Index"	"1"
		}
	...
	}
"Exporting"
	{
	"Instances"
		{
		"0"
			{
			"Name" "instances/p2editor/filename.vmf"
			"EntityCount"	"5"
			"BrushCount"	"5" 
			"BrushSideCount"	"30"
			}
		...
		}
	"TargetName"	"name"
	"Offset"	"64 64 64"
	}
}
  • Type: The ID for this item, which must be unique. Must be present.
  • ItemClass: Set to predefined values. This provides the special behaviours specific to items. The default class is ItemBase, since the parameter is optional.
  • MovementHandle: Sets the type of rotation the item will have. The default is HANDLE_NONE. The -x side of the instance is generally the 'front' of the item.
    • HANDLE_NONE: Does not give a handle. The item can still be rotated in 4 directions by DesiredFacing.
    • HANDLE_4_DIRECTIONS: Gives a quarter-circle handle to allow pointing in 4 directions.
    • HANDLE_5_POSITIONS: Allows center-positioning, and 4 side positions. This is done by rotating the centered item, and switching to a different item when centered/offset. For this reason this type only works with ITEM_LASER_CATCHER, ITEM_LASER_RELAY and ITEM_LASER_EMITTER (_CENTER / _OFFSET).
    • HANDLE_6_POSITIONS: Allows centering in two orientations, and offset on the 4 sides. The instance should be centered, with the sides in the y axis. When offset, the +x side faces toward the center (and won't extend into other voxels).
    • HANDLE_8_POSITIONS: Allows placement on the inner and outer quarter tiles in each direction. Instances should be centered 32 units wide. The -x side is placed flush with the voxel border. *HANDLE_36_DIRECTIONS: Allows rotation on the floor in increments of 10°. This does not function properly on wall- or ceiling-placed items. InvalidSurface should be used.
    • HANDLE_CATAPULT: Special rotation handle used for Faith Plate items and their targets. Likely produces the trajectory and item links.
  • CanAnchorOnGoo: If enabled, the top surface of goo pits will be treated as a surface to attach to.
  • CanAnchorOnBarriers: If enabled, several surfaces will be treated as attchment points: the side of Glass/Grating, tops of 90° Angled/Glass Panels, the top of Track Platforms, and the surface of Piston Platforms. Eligability for placement is defined by the relavant item classes (ItemBarrier, ItemAngledPanel, ItemRailLift and ItemPistonPlatform).
  • InvalidSurface: Allows prohibiting placement of the item on a surface. Defaults to "", but can be set to any combination of WALLS, FLOOR and CEILING to disallow placement on that surface.
  • DesiredFacing: Allows defaulting to a specific orientation on walls:
    • DESIRES_ANYTHING: default, performing no rotation.
    • DESIRES_UP: Rotate so +x is facing upright, and the rotation handle points down.
    • DESIRES_DOWN: Rotate so -x is facing upright, and the rotation handle points up.
    • DESIRES_HORIZONTAL: Rotate so the y axis is vertical. Which side is upright varies depending on which wall it is placed on.
  • Offset: The offset applied to instances. This should always be set to 64 64 64, since all items need to rotate around the centre of the cube.

EmbedFace types: 4x4_checkered, 4x4, 2x2, 2x1, 1x1, Grid_Default Collision: COLLIDE_GRATING, COLLIDE_GLASS, COLLIDE_BRIDGE, COLLIDE_FIZZLER, COLLIDE_PHYSICS, COLLIDE_SOLID, COLLIDE_NOTHING, COLLIDE_EVERYTHING. Connection Types: CONNECTION_TBEAM_POLARITY, CONNECTION_BARRIER_ANCHOR_TO_EXTENT, CONNECTION_HAZARD_BRUSH, CONNECTION_HAZARD_MODEL, CONNECTION_HAZARD, CONNECTION_BOX_DROPPER, CONNECTION_PAINT_DROPPER, CONNECTION_STANDARD.

Animation types:

  • ANIM_REAPPEAR [Cube Dropper]: Played when the dropper is re-enabled. The first frame should start the dropper far above the origin.
  • ANIM_DISAPPEAR [Cube Dropper]: Played when the dropper is disabled or deleted. The last frame should end with the dropper far above the origin.
  • ANIM_GROUND_TO_FALLING_EDITING: Played when the dropper is re-enabled, and the properties menu is open.
  • ANIM_FALLING_TO_GROUND_EDITING: Played when the dropper is disablex, and the properties menu is open.
  • ANIM_GROUND_TO_FALLING: Played when the dropper is enabled, and the properties menu is closed. This only occurs when the item is first placed.
  • ANIM_FALLING_TO_GROUND: Played when the dropper is deleted while the properties menu is closed.
  • ANIM_FALLING_EDITING_DEACTIVATE: Played when the properties menu is closed, and the dropper is enabled.
  • ANIM_FALLING_EDITING_ACTIVATE: Played when the properties menu is opened, and the dropper is enabled.
  • ANIM_FALLING_IDLE: Position for the model when the dropper is enabled.
  • ANIM_EDITING_DEACTIVATE: Played when the properties menu is closed.
  • ANIM_EDITING_ACTIVATEPlayed when the properties menu is opened. If subtypes are used, the new model switches to the last frame of this animation instantly.
  • ANIM_IDLE: Default animation/pose, when the properties menu is closed. For cubes this is the pose without a dropper.

The following are only used on the placement-error icon, and connection heart icon:

  • ANIM_ICON_HEART_HAPPY_IDLE: Animation played when hovering over a choice in the 'remove connection' view.
  • ANIM_ICON_HEART_SUCCESS: Played by itself when a connection is created.
  • ANIM_ICON_HEART_BREAK: Played as the hiding animtion when the antline connection is broken.
  • ANIM_ICON_HIDE: Played to make the icon disappear.
  • ANIM_ICON_IDLE: Played when the icon is visible.
  • ANIM_ICON_SHOW: Played to bring in the icon.

Sound Types:

  • SOUND_DESELECTED: Played when the item is deselected.
  • SOUND_SELECTED: Played when the item is clicked on.
  • SOUND_DELETED: Played when the item is deleted.
  • SOUND_EDITING_DEACTIVATE: Played when the properties menu is closed.
  • SOUND_EDITING_ACTIVATE: Played when the properties window is opened.
  • SOUND_CREATED: Played when the item is first placed on a surface.

TODO:

  • autotrigger
  • buttontype
  • connectioncountpolarity
  • coopdoor
  • painttype
  • portalable
  • startingposition
  • startlocked
  • startopen

Unclassed Properties

These properties are useable in any item class. They generally only have an effect on the $fixup variables passed to an instance.

  • ConnectionCount ($connectioncount): Required for all items accepting an input. The fixup will be set to the number of items connected to the input. This is usually passed to the "Max Value" option in a math_counter.

  • Start...: These properties add a checkbox with the given name. The associated fixup variable will be set to 0 or 1 as appropriate.

    Property Name Editor Text Fixup
    StartActive "Start Active" $start_active
    StartDeployed "Start Deployed" $start_deployed
    StartEnabled "Start Enabled" $start_enabled
    StartLocked "Start Locked" $start_locked
    StartOpen "Start Open" $start_open
    StartReversed "Start Reversed" $start_reversed
    AutoDrop "Enable Cube Auto-Drop On Spawn" $disable_autodrop
    AutoRespawn "Enable Cube Auto-Respawn" $disable_autorespawn

    Note: AutoDrop and AutoRespawn will not be inverted on non-cube items, despite the $fixup name. On droppers, they behave correctly.

  • TimerDelay ($timer_delay): Adds a "Timer Delay" widget which allows selecting numbers from 3-30, and "infinite". When infinite, it will be set to either 0 or 99999999999. 1 or 2 values can be set as the DefaultValue, but cannot be chosen in the editor.

  • TimerSound ($timersound): Set to 0 when the item is infinite, and 1 when finite. Always set to 0 when no output is attached.

Specialised Properties

These few properties are used on certain specific items, which aren't placable by users.

  • IndicatorName: Used on ITEM_INDICATOR_TOGGLE. This adds a $indicator_name fixup, which is populated with the overlay's name.
  • IsTimer: Used on ITEM_INDICATOR_PANEL and ITEM_INDICATOR_PANEL_TIMER. Sets the is_timer fixup based on the item type. This does not function on Pedestal Buttons.
  • HelperRadius ($helper_radius): Used on ITEM_PLACEMENT_HELPER, appears to always be set to 64.
  • UseHelperAngles ($use_helper_angles): Used on ITEM_PLACEMENT_HELPER, appears to always be set to 0.
  • ForcePlacement: Used on ITEM_PLACEMENT_HELPER, appears to always set $force_placement to 0.

Item Classes

ItemAngledPanel

The item class used by both Angled Panel items. This allows use of the Panel Angle property, and for Angled Panels spawns a func_brush with the surface texture. For the glass panel, the white and black models are set to the same model.

Models

  1. White surface, 90°
  2. White surface, 60°
  3. White surface, 45°
  4. White surface, 30°
  5. Black surface, 90°
  6. Black surface, 60°
  7. Black surface, 45°
  8. Black surface, 30°
  9. Undeployed, 90°
  10. Undeployed, 60°
  11. Undeployed, 45°
  12. Undeployed, 30°

Properties:

  • AngledPanelAnimation ($animation): Gives a 30, 45, 60 and 90 degree subtype selection value. The fixup is set to ramp_##_deg_open, with ## matching the set angle.
  • AngledPanelType: Presumably controls whether a surface is spawned for the panel. 1 is used for the Angled Panel, 2 is used for the Glass Panel.

ItemBarrierHazard

Used for Fizzlers and Laserfields. Including the Barrier Type property is required in order to prevent random crashes on placement. Items of this type will mirror themselves to the opposing surface, and can be extended in either direction. A trigger_portal_cleanser or trigger_hurt/func_brush will be generated between the model instances.

Instances:

  • Base: Positioned at the placement position of the item, and given all property values.
  • Model: Placed at each end of every fizzler brush. The $skin fixup is set to 0 for fizzlers, and 2 for laserfields (since skin 1 is a dirty fizzler). The instance is named target123_modelStart123 or fizzler123_modelEnd123. Due to a bug, inputs are sent to target123_modelStart. This is fixed by the BEE2, setting names to fizzler123_modelEnd.

Properties:

  • HazardType: Adds dropdown for choosing between the "Fizzler" and "Laserfield" subtypes. Required to prevent crashes.

ItemBarrier

Used for Glass/Grating items. Custom items will not be generated with any frame instances or brushes. All instances use the same base name, and are passed $fixup values.

Instances:

  • 0: Surface - placed at all occupied points.
  • 1: Left-sided section with corner model at the end
  • 2: Left-sided straight section.
  • 3: Left-sided short section, designed to mesh with corner sections.
  • 4: Left convex corner piece, unused.
  • 5: Right-sided section with corner model at the end
  • 6: Right-sided straight section.
  • 7: Right-sided short section, designed to mesh with corner sections.
  • 8: Right convex corner piece, unused.

Properties:

  • BarrierType: allows choosing between the "Glass" and "Grating" subtypes.

ItemButtonFloor

Used for Floor Buttons. Note that the ButtonType property is optional - if not added, instances 0 and 1 will only be used. This is useful for detecting the colour of the attached surface.

Instances

  • 0: Weighted, White
  • 1: Weighted, Black
  • 2: Cube, White
  • 3: Cube, Black
  • 4: Ball, White
  • 5: Ball, Black

Properties:

  • ButtonType: allows choosing between "Weighted", "Cube", or "Sphere" subtypes.

ItemCatapultTarget

Used for the Faith Plate Target item. When placed, a matching ITEM_CATAPULT is generated.

Properties:

  • VerticalAlignment: Unknown function, appears to be always set to 0.

ItemCatapult

Used for Aerial Faith Plates. Items with this class also place a catapult target, and generate an appropriate trigger_catapult brush. Regardless of handle type, this will force the orientation to point in the direction of the target.

Properties

  • targetname: Present on Valve's item, appears to have no effect.
  • catapultSpeed: Sets the $catapult_speed fixup to the generated speed of the catapult.
  • VerticalAlignment: Unknown function, appears to be always set to 0.

ItemCoopEntranceDoor

Item type used by the Coop Spawn Room. This is linked to a ItemEntranceDoor.

Instances:

  • 0: Spawn Room, placed at the item location.
  • 1: 'White door frame', unused.
  • 2: 'Black door frame', unused.
  • 3: Coop Exit, the disassembly chamber. This is placed at 0 0 0.
  • 4: Arrival and Departure Transition entities, placed at 0 0 0.

ItemCoopExitDoor

Instances:

  • 0 - 3: Exit 1-4
  • 4: White Door Frame
  • 5: Black Door Frame

ItemCubeDropper

Item class used for droppers.

Properties:

  • ItemFallStraightDown ($item_fall_straight_down): Appears non-functional, and always set to 0. In Valve's instance, this will cause the clips in the iris to be killed, so the cube directly sits on the model and interacts with the iris collision sections.

ItemCube

Item class used for Cubes.

Models:

  1. Cube
  2. 'Falling' cube. (This model is unused, but must be set. It is replaced by animations on the normal model.)

Properties: The third item is always set to HANDLE_36_DIRECTIONS, for the Reflection Cube. It also renders with a laser beam visual.

  • DropperEnabled: adds a "Dropper Enabled" checkbox. When enabled the attached dropper will be visible, and will export. When disabled the cube will export.

ItemEntranceDoor

ItemExitDoor

ItemGoo

Item class for Goo. Only model options are available to be chosen, no instances are used for Goo at all. For this reason this class is not suitable for custom items.

ItemLaserEmitter

Item class used for Laser Emitters, to generate the laser preview in the editor.

ItemLightBridge

Item class for Light Bridges. A field preview is generated in the editor. Additionally, items with the CanAnchorOnBarriers setting can be attached to the bridge surface (moving off-grid depending on the exact rotation position).

ItemPaintDropper

Properties:

  • PaintFlowType: Adds a dropdown with the options "Light", "Medium", "Heavy", "Drip" and "Bomb". Bomb-type droppers use their own instance, but the other types use several $fixup variables to configure the paint sprayer:

    Property Light Medium Heavy Drip
    $blobs_per_second 5 10 20 1
    $angled_blobs_per_second 3 3 3 0
    $streak_angle 8 8 8 0
    $ambient_sound 2 2 3 1
    $render_mode 0 0 0 1
  • AllowStreaks: Adds an "Allow Streaks" checkbox, which sets the $streak_time fixup to either 0 or 0.35.

  • PaintExportType: Possibly has to do with the bomb-type instance switching. Does not have visible functionality.

ItemPaintSplat

ItemPanelFlip

Item class used for Flip Panels. When exported, a func_door_rotating brush is generated automatically. The instance recieves a $start_deployed fixup variable, set to 0 for white, and 1 for black. The brush is named instance_name123-flipping_panel , so entities in the instance can refer to it directly.

ItemPedestalButton

This class is used for Pedestal Buttons. It causes the 3-tile wide platform brush to be generated.

ItemPistonPlatform

Class for Piston Platforms. The positions are saved as a number, where 0 is flush with the floor and 4 is fully extended (512 units). OccupiedVoxel is altered based on the maximum position for the platform, taking up the full cube for each piston square and the square in front of the platform. Properties:

  • BottomLevel: Set to a integer between 0 and 3. This encodes the lowest position the platform will move to. It is exported as $bottom_level.
  • TopLevel: Set to an integer between 1 and 4. This encodes the highest position the platform can move to. This is exported as $top_level.
  • StartUp: Set to 0 or 1. If 0, the platform starts at the low position and moves to the high position. If 1, the platform starts high and moves to the low position. It is exported as $start_up.

ItemRailPlatform

All items with this class must use a targetnameof railLift to function correctly. EmbeddedVoxel is ignored for this type - the area below each track segment is always used.

Properties:

  • Oscillate: Adds a checkbox for the operating mode of the platform.
  • TravelDirection ($travel_direction): Set to the direction angles that the platform moves in.
  • TravelDistance ($travel_distance): Set to the distance the platform should move (always multiples of 128).
  • StartingPosition ($starting_position): For oscillating platforms, set to the fraction from the start to the end that it begins at.
  • Speed ($speed): Sets the speed of the platform. Always set to 100.

ItemStairs

ItemTBeam

ItemTurret

Used for turret items. This adds the laser and line of sight overlay.

ItemLightStrip

This is used for the Light Strip item. This class produces the proper collisions for items with the HANDLE_8_POSITIONS rotation type.

#"Extent" Item Classes The item classes ItemRailPlatformExtent, ItemPistonPlatformExtent, ItemBarrierHazardExtent, ItemBarrierExtent are used for the items comprising the additional selection handles. These do not usually need to be modified (since all instance and model settings are set in the original item), unless replacing the grey arrow widgets is desired. Custom items will reuse the original exent objects without any issues.

Clone this wiki locally