-
Notifications
You must be signed in to change notification settings - Fork 0
editoritems.txt
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
.
"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 isItemBase
, since the parameter is optional. -
MovementHandle
: Sets the type of rotation the item will have. The default isHANDLE_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 byDesiredFacing
. -
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 withITEM_LASER_CATCHER
,ITEM_LASER_RELAY
andITEM_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 they
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
andItemPistonPlatform
). -
InvalidSurface
: Allows prohibiting placement of the item on a surface. Defaults to "", but can be set to any combination ofWALLS
,FLOOR
andCEILING
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 they
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 to64 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_ACTIVATE
Played 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.
autotrigger
buttontype
connectioncountpolarity
coopdoor
painttype
portalable
startingposition
startlocked
startopen
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 amath_counter
. -
Start...
: These properties add a checkbox with the given name. The associated fixup variable will be set to0
or1
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
andAutoRespawn
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 from3
-30
, and "infinite". When infinite, it will be set to either0
or99999999999
.1
or2
values can be set as theDefaultValue
, but cannot be chosen in the editor. -
TimerSound
($timersound
): Set to0
when the item is infinite, and1
when finite. Always set to0
when no output is attached.
These few properties are used on certain specific items, which aren't placable by users.
-
IndicatorName
: Used onITEM_INDICATOR_TOGGLE
. This adds a$indicator_name
fixup, which is populated with the overlay's name. -
IsTimer
: Used onITEM_INDICATOR_PANEL
andITEM_INDICATOR_PANEL_TIMER
. Sets theis_timer
fixup based on the item type. This does not function on Pedestal Buttons. -
HelperRadius
($helper_radius
): Used onITEM_PLACEMENT_HELPER
, appears to always be set to64
. -
UseHelperAngles
($use_helper_angles
): Used onITEM_PLACEMENT_HELPER
, appears to always be set to0
. -
ForcePlacement
: Used onITEM_PLACEMENT_HELPER
, appears to always set$force_placement
to0
.
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
- White surface, 90°
- White surface, 60°
- White surface, 45°
- White surface, 30°
- Black surface, 90°
- Black surface, 60°
- Black surface, 45°
- Black surface, 30°
- Undeployed, 90°
- Undeployed, 60°
- Undeployed, 45°
- Undeployed, 30°
Properties:
-
AngledPanelAnimation
($animation
): Gives a 30, 45, 60 and 90 degree subtype selection value. The fixup is set toramp_##_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.
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 to0
for fizzlers, and2
for laserfields (since skin1
is a dirty fizzler). The instance is namedtarget123_modelStart123
orfizzler123_modelEnd123
. Due to a bug, inputs are sent totarget123_modelStart
. This is fixed by the BEE2, setting names tofizzler123_modelEnd
.
Properties:
-
HazardType
: Adds dropdown for choosing between the "Fizzler" and "Laserfield" subtypes. Required to prevent crashes.
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.
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.
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.
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.
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 at0 0 0
. -
4
: Arrival and Departure Transition entities, placed at0 0 0
.
Instances:
-
0
-3
: Exit 1-4 -
4
: White Door Frame -
5
: Black Door Frame
Item class used for droppers.
Properties:
-
ItemFallStraightDown
($item_fall_straight_down
): Appears non-functional, and always set to0
. 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.
Item class used for Cubes.
Models:
- Cube
- '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.
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.
Item class used for Laser Emitters, to generate the laser preview in the editor.
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).
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 either0
or0.35
. -
PaintExportType
: Possibly has to do with the bomb-type instance switching. Does not have visible functionality.
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.
This class is used for Pedestal Buttons. It causes the 3-tile wide platform brush to be generated.
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
.
All items with this class must use a targetname
of 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 to100
.
Used for turret items. This adds the laser and line of sight overlay.
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.