prop_weighted_cube
prop_weighted_cube
is a point entity available in Portal 2. It represents the various kinds of Weighted storage cubes, including the Discouragement Redirection Cube that redirects Thermal Discouragement Beams. It can be painted with gel.


Keyvalues
- Cube Type
<choices>
- Cube model type.
- 0 : Standard
- 1 : Companion
- 2 : Reflective
- 3 : Sphere
- 4 : Antique
- 5 : Schrödinger's Cube (only in
)
- 6 : Custom model (!FGD)
- Skin Type
<choices>
- Which skin variant to use. Only Standard and Reflection cubes have rusted skins.
- 0 : Clean
- 1 : Rusted
- model
<string>
!FGD - If Cube Type is set to 6, this is the model to use. Swap to a normal type OnMapSpawn using AddOutput to ensure gel skins behave correctly.
- Paint Power
<choices>
- The cube's starting paint type.
- 0 : Bounce
- 2 : Speed
- 3 : Portal
- 4 : None
- Skin (OLD)
<choices>
- Cube skin, old method. Deprecated; use Cube Type instead. This appears to just set specific Cube Types on spawn.
- 0 : Standard
- 1 : Companion
- 2 : Standard Activated
Bug: Non-functional. Produces a companion cube.
- 3 : Reflective
- 4 : Sphere
- 5 : Antique
- Use new skins
<boolean>
- Use the values in the Cube Type and Skin Type fields instead of the Skin(OLD) field.
- Allow Portal Funneling
<boolean>
- Whether or not this object should auto-funnel into a portal.
Targetname:
- Name
(targetname)
<string>
- The targetname that other entities refer to this entity by.
- Entity Scripts
(vscripts)
<scriptlist>
(in all games since)
- Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
- Script think function
(thinkfunction)
<string>
(in all games since)
- Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call.
Note: Try to avoid expensive operations in this function, as it may cause performance problems.
Angles:
- Pitch Yaw Roll (Y Z X)
(angles)
<angle>
- This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Reflection:
- Render in Fast Reflections (drawinfastreflection)
<boolean>
(in all games since)
- If enabled, this entity will render in fast water reflections (i.e. when a water material specifies
$reflectonlymarkedentities
) and in the world impostor pass.
Inputs
EnablePortalFunnel
- Enable portal funneling behavior.
DisablePortalFunnel
- Disable portal funneling behavior.
Dissolve
- Dissolves the cube.
SilentDissolve
- Kills the cube and fires its OnFizzled output.
PreDissolveJoke
- Calls the VScript function
CoopCubeFizzle()
on@glados
. Used inmp_coop_multifling_1
when the cubes fall in the goo. Seemingly useless, as this could have been done by using FireUser inputs or just directly calling the function from the trigger. ExitDisabledState
- Exits the disabled state of a reflective cube.
EmitLaser
(only in)
- Turn laser on or off. Pass <boolean> 0 or 1 as parameter.
Targetname:
Kill
- Removes this entity from the world.
KillHierarchy
- Removes this entity and its children from the world.
Note: Entities already remove orphaned children upon being removed, but this input removes all children on the same frame, being marginally faster than
Kill
. AddOutput
<string>
- Adds a keyvalue/output to this entity. It can be potentially very dangerous, use with care.
KV Format:<key> <value>
I/O Format:<output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1
toFireUser4
- Fire the
OnUser
outputs; see User Inputs and Outputs. Use
!FGD- Same as a player invoking +use; may not do anything depending on the entity. Can also be invoked by firing an output that does not specify an input.
RunScriptFile
<script>
(in all games since)
- Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode
<string>
(in all games since)
- Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
Bug: In
, the code is executed in the script scope of the entity that fires the output, not the one receiving the input.
Warning: Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.
CallScriptFunction
<string>
(in all games since) !FGD
- Execute a VScript function in the scope of the receiving entity.
SetLocalOrigin
<coordinates>
(in all games since) !FGD
- Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
SetLocalAngles
<angles>
(in all games since) !FGD
- Set this entity's angles.
Reflection:
DisableDrawInFastReflection
(in all games since)
- Turns off rendering of this entity in reflections when using
$reflectonlymarkedentities
in water material. EnableDrawInFastReflection
(in all games since)
- Turn on rendering of this entity in reflections when using
$reflectonlymarkedentities
in water material.
Outputs
OnFizzled
- Fired when a cube is fizzled.
OnOrangePickUp
- Orange picked up the cube.
OnBluePickUp
- Blue picked up the cube.
OnPlayerPickup
- Player picked up the cube.
OnPhysGunDrop
- Player dropped the cube.
OnPainted
- Fired when the cube is painted with gel.
OnPowered
(only in)
- Fired when the cube is powered by a laser.
OnUnpowered
(only in)
- Fired when the cube is no longer powered by a laser.
Targetname:
OnUser1
toOnUser4
- These outputs each fire in response to the firing of the like-numbered
FireUser1
toFireUser4
Input; see User Inputs and Outputs. OnKilled
(only in)
- This output fires when the entity is killed and removed from the game.