prop_weighted_cube

From Source Entities
Jump to navigation Jump to search
Prop weighted cube.png

Code classes:

prop_weighted_cube is a point entity present in P2.pngPortal 2. This entity is used for all varieties of weighted storage cubes, including spheres and reflector cubes, but not frankenturrets.

Bug: If a reflector cube is touching a laser and comes to rest, it will ignore gravity until something bumps it. This can be used to make cubes float in midair!

Fix: Use the ExitDisabledState input to tell the cube to come out of rest. If you don't have a surefire way of detecting when a cube should drop to the ground (this bug can also happen by stacking two cubes) you should send this input via a logic_timer.

Keyvalues[edit | edit source]

Cube Type (CubeType) <choices>
Which kind of cube this one is.
  • 0: Standard
  • 1: Companion
  • 2: Reflective
  • 3: Sphere
  • 4: Antique
  • 6: Custom model (Not in FGD)
World Model (Not in FGD) (model) <studio>
If Cube Type is set to 6, a custom model to use. Bug: The custom model may not bounce and slide as if it were covered in gel.
Fix: Make a logic_auto and send the following input to the cube ('X' should be the cube type most closely matching your model):
My OutputTarget EntityTarget InputParameterDelayOnly Once
OnMapSpawnprop_weighted_cubeAddOutputCubeType X0.00No
Skin Type (SkinType) <choices>
Whether the cube is clean or rusted. Only standard and reflector cubes have a rusted skin.
  • 0: Clean
  • 1: Rusted
Use new skins (NewSkins) <boolean>
Makes the cube use Cube Type instead of Skin (OLD) for its cube type. Cube Type is objectively better. This should always be set to true.
Paint Power (PaintPower) <choices>
Covers the cube in gel when the map starts.
  • 0: Bounce
  • 1: Stick - No effect.
  • 2: Speed
  • 3: Portal - No effect.
  • 4: None
Skin (OLD) (skin) <choices>
Old appearance settings. Use Cube Type instead and make sure to set Use new skins to Yes.

Inputs[edit | edit source]

Dissolve
Fizzles the cube.
SilentDissolve
Removes the cube and fires the OnFizzled output.
PreDissolveJoke
If the map is mp_coop_multifling_1, makes Glados (generic_actor named @glados with Entity Scripts (vscripts) set to choreo/glados_coop.nut) give a sarcastic remark.
ExitDisabledState
Tells the cube to check if it can fall. Does not apply if the cube was told to stay in place by other inputs or settings.
SetPaint (Not in FGD) <integer>
Sets Paint Power.
EnablePortalFunnel
Sets Allow Portal Funneling (allowfunnel) to Yes.
DisablePortalFunnel
Sets Allow Portal Funneling (allowfunnel) to No.
EnablePickup (Not in FGD)
Allows the cube to be picked up. Functions separately from the Prevent pickup flag. (Allowed by default.)
DisablePickup (Not in FGD)
Disallows the cube from being picked up.

Outputs[edit | edit source]

OnFizzled
Fires when the cube is fizzled.
OnBluePickUp
Fires when ATLAS picks up the cube.
OnOrangePickUp
Fires when P-Body picks up the cube.
OnPainted
Fires when the cube is covered in gel.