Cleanup is going to take awhile, so the site is back up but editing has been disabled.

Func physbox

From HalfLife 2 Knowledge Base

Jump to: navigation, search

Contents

func_physbox

Source(core) Solid Entity


description

A brush entity that's physically simulated.


properties

  • Prop Data propdata(choices) - default: Set to the best approximation of the size and material of this entity's brushes. If set, it will override this entity's health and damage taken from various weapons. See the prodata.txt file in the scripts directory of your mod to get a detailed list of what each propdata entry specifies.
    • 0 - None
    • 1 - Wooden.Tiny
    • 2 - Wooden.Small
    • 3 - Wooden.Medium
    • 4 - Wooden.Large
    • 5 - Wooden.Huge
    • 6 - Metal.Small
    • 7 - Metal.Medium
    • 8 - Metal.Large
    • 9 - Cardboard.Small
    • 10 - Cardboard.Medium
    • 11 - Cardboard.Large
    • 12 - Stone.Small
    • 13 - Stone.Medium
    • 14 - Stone.Large
    • 15 - Stone.Huge
    • 16 - Glass.Small
    • 17 - Plastic.Small
    • 18 - Plastic.Medium
    • 19 - Plastic.Large
    • 20 - Pottery.Small
    • 21 - Pottery.Medium
    • 22 - Pottery.Large
    • 23 - Pottery.Huge
    • 24 - Glass.Window
  • Strength health(integer) - default: 1
    Number of points of damage to take before breaking. 0 means don't break.
  • Material Type material(choices) - default: Set to the material type of the brush. Used to decide what sounds to make when damaged, and what gibs to produce when broken.
    • 0 - Glass
    • 1 - Wood
    • 2 - Metal
    • 3 - Flesh
    • 4 - CinderBlock
    • 5 - Ceiling Tile
    • 6 - Computer
    • 7 - Unbreakable Glass
    • 8 - Rocks
  • Gibs Direction explosion(choices) - default: Used to decide which direction to throw gibs when broken.
    • 0 - Random
    • 1 - Relative to Attack
    • 2 - Use Precise Gib Dir
  • Precise Gib Direction gibdir(angle) - default: 0 0 0
    Specifies the direction to throw gibs when this breakable breaks. Be sure to select Use Precise Gib Dir in the Gibs Direction field!
  • Damaging it Doesn't Push It nodamageforces(choices) - default: Used to determine whether or not damage should cause the brush to move.
    • 0 - No
    • 1 - Yes
  • Gib Model gibmodel(string)
    Used by HL1Port to specify a custom gib model to break into, overriding the 'Material Type'.
  • Spawn On Break spawnobject(choices) - default: When broken, an entity of the selected type will be created.
    • 1 - item_battery
    • 2 - item_healthkit
    • 3 - item_ammo_pistol
    • 4 - item_ammo_pistol_large
    • 5 - item_ammo_smg1
    • 6 - item_ammo_smg1_large
    • 7 - item_ammo_ar2
    • 8 - item_ammo_ar2_large
    • 9 - item_box_buckshot
    • 10 - item_flare_round
    • 11 - item_box_flare_rounds
    • 12 - item_ml_grenade
    • 13 - item_smg1_grenade
    • 14 - item_box_sniper_rounds
    • 15 - unused1
    • 16 - weapon_stunstick
    • 17 - weapon_ar1
    • 18 - weapon_ar2
    • 19 - unused2
    • 20 - weapon_ml
    • 21 - weapon_smg1
    • 22 - weapon_smg2
    • 23 - weapon_slam
    • 24 - weapon_shotgun
    • 25 - weapon_molotov
    • 26 - item_dynamic_resupply
  • Explode Magnitude explodemagnitude(integer) - default: 0
    If non-zero, when this entity breaks it will create an explosion that causes the specified amount of damage.
  • Pressure Delay pressuredelay(float) - default: 0
    Delay, in seconds, after 'broken' by pressure before breaking apart (allows for sound to play before breaking apart).
  • Name targetname(target_source)
    The name that other entities refer to this entity by.
  • Origin (X Y Z) origin(origin)
    The position of this entity's center in the world. Rotating entities typically rotate around their origin.
  • Render Mode rendermode(choices) - default: Used to set a non-standard rendering mode on this entity. See also 'FX Amount' and 'FX Color'.
    • 0 - Normal
    • 1 - Color
    • 2 - Texture
    • 3 - Glow
    • 4 - Solid
    • 5 - Additive
    • 7 - Additive Fractional Frame
    • 9 - World Space Glow
    • 10 - Dont Render
  • FX Amount (0 - 255) renderamt(integer) - default: 255
    The FX amount is used by the selected Render Mode.
  • FX Color (R G B) rendercolor(color255) - default: 255 255 255
    The FX color is used by the selected Render Mode.
  • Disable Receiving Shadows disablereceiveshadows(choices)
    • 0 - No
    • 1 - Yes
  • Disable shadows disableshadows(choices)
    • 0 - No
    • 1 - Yes
  • Minimum Light Level _minlight(string)
    The minimum level of ambient light that hits this brush.
  • Impact Damage Type Damagetype(choices)
    • 0 - Blunt
    • 1 - Sharp
  • Mass Scale massScale(float) - default: 0
    A scale multiplier for the object's mass.
  • Override Parameters overridescript(string)
    A list of physics key/value pairs that are usually in a physics prop .qc file. Format is 'key,value,key,value,etc'.
  • Health Level to Override Motion damagetoenablemotion(integer) - default: 0
    If specified, this object will start motion disabled. Once it's health has dropped below this specified amount, it will enable motion.
  • Physics Impact Force to Override Motion forcetoenablemotion(float) - default: 0
    If specified, this object will start motion disabled. Any impact that imparts a force greater than this value on the physbox will enable motion.
  • Strength health(integer) - default: 0
    Number of points of damage to take before breaking. 0 means don't break.
  • Preferred Player-carry Angles preferredcarryangles(vector) - default: 0 0 0
    If the 'Use Preferred Carry Angles' spawnflag is set, this angle is the angle which the object should orient to when the player picks it up, with the physgun or +USE.
  • Not solid to world notsolid(choices)
    • 0 - Solid to World
    • 1 - Passes through World


spawn flags

  • 1: Only Break on Trigger - default: OFF
  • 2: Break on Touch - default: OFF
  • 4: Break on Pressure - default: OFF
  • 512: Break immediately on Physics - default: OFF
  • 1024: Don't take physics damage - default: OFF
  • 4096: Start Asleep - default: OFF
  • 8192: Ignore +USE for Pickup - default: OFF
  • 16384: Debris - Don't collide with the player or other debris - default: OFF
  • 32768: Motion Disabled - default: OFF
  • 65536: Use Preferred Carry Angles - default: OFF
  • 131072: Enable motion on Physcannon grab - default: OFF
  • 262144: Not affected by rotor wash - default: OFF
  • 524288: Generate output on +USE - default: ON


inputs

  • Kill(void)
    Removes this entity from the world.
  • KillHierarchy(void)
    Removes this entity and all its children from the world.
  • AddOutput(string)
    Adds an entity I/O connection to this entity. Format
  • FireUser1(void)
    Causes this entity's OnUser1 output to be fired.
  • FireUser2(void)
    Causes this entity's OnUser2 output to be fired.
  • FireUser3(void)
    Causes this entity's OnUser3 output to be fired.
  • FireUser4(void)
    Causes this entity's OnUser4 output to be fired.
  • SetParent(string)
    Changes the entity's parent in the movement hierarchy.
  • SetParentAttachment(string)
    Change this entity to attach to a specific attachment point on it's parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
  • ClearParent(void)
    Removes this entity from the the movement hierarchy, leaving it free to move independently.
  • SetDamageFilter(string)
    Sets the entity to use as damage filter. Pass in an empty string to clear the damage filter.
  • DisableShadow(void)
    Turn shadow off.
  • EnableShadow(void)
    Turn shadow on.
  • Break Breaks(void)
    the breakable.
  • SetHealth(integer)
    Sets a new value for the breakable's health. If the breakable's health reaches zero it will break.
  • AddHealth(integer)
    Adds health to the breakable. If the breakable's health reaches zero it will break.
  • RemoveHealth(integer)
    Removes health from the breakable. If the breakable's health reaches zero it will break.
  • EnablePhyscannonPickup(void)
    Makes the breakable able to picked up by the physcannon.
  • DisablePhyscannonPickup(void)
    Makes the breakable not able to picked up by the physcannon.
  • EnableDamageForces(void)
    Damaging the entity applies physics forces to it.
  • DisableDamageForces(void)
    Damaging the entity does *not* apply physics forces to it.
  • DisableShadow(void)
    Turn shadow off.
  • EnableShadow(void)
    Turn shadow on.
  • Wake(void)
    Wake up this physics object, if it is sleeping.
  • Sleep(void)
    Put this physics object to sleep. It will wake if given the Wake input, or if force is applied to it. Note that physics objects go to sleep automatically after coming to rest for a while, so you don't really need to use this.
  • EnableMotion(void)
    Enable physics motion/collision response.
  • DisableMotion(void)
    Disable physics motion/collision response.
  • ForceDrop(void)
    If this object is being carried by a player, with the physgun or +USE, force it to be dropped.

outputs

  • OnUser1(void)
    Fired in response to FireUser1 input.
  • OnUser2(void)
    Fired in response to FireUser2 input.
  • OnUser3(void)
    Fired in response to FireUser3 input.
  • OnUser4(void)
    Fired in response to FireUser4 input.
  • OnBreak(void)
    Fired when this breakable breaks.
  • OnHealthChanged(float)
    Fired when the health of this breakable changes, passing the new value of health as a percentage of max health, from [0..1].
  • OnPhysCannonDetach(void)
    Fired when the physcannon has ripped this breakable off of the wall. Only fired if ACT_PHYSCANNON_DETACH is defined in the model this breakable is using.
  • OnDamaged(void)
    Fired when this entity is damaged.
  • OnAwakened(void)
    Fired when this entity becomes awake (collision/force is applied).
  • OnMotionEnabled(void)
    Fired when motion is enabled due to damage/physcannon/force.
  • OnPhysGunPickup(void)
    Fired when a player picks this object up, either with the physgun or +USE.
  • OnPhysGunDrop(void)
    Fired when a player drops this object.
  • OnPlayerUse(void)
    Fired when the player tries to +USE the physbox. This output will fire only if the Generate output on +USE spawnflag is set.

related tutorials

Submit your tutorial for func_physbox

Personal tools