Phys convert: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Cleaned up Input notes/bugs)
(Cleanup)
Line 1: Line 1:
{{base point|phys_convert}} It turns an arbitrary entity into a physically simulated entity. i.e. brush entities will behave like [[simple_physics_brush]], model entities behave like [[simple_physics_prop]]. {{note|[[simple_physics_brush]] and [[simple_physics_prop]] are very limited physics entities separate from [[func_physbox]] and [[prop_physics]]. See their respective pages for details.}}
{{base point|phys_convert}} It turns an arbitrary entity into a physically simulated entity. Brush entities will turn into [[simple_physics_brush]] and model entities will turn into [[simple_physics_prop]]. Both are very limited compared to [[func_physbox]] and [[prop_physics]]. See their respective pages for details.
{{note|phys_convert cannot be used in reverse. (cannot turn physically simulated entities into arbitrary entities)}}


== Keyvalues ==
== Keyvalues ==
{{KV|Entity to convert|target_destination|Name of the entity that will be converted to a physics object when the <code>ConvertTarget</code> input is fired.}}
{{KV|Entity to convert|target_destination|Name of the entity that will be converted to a physics object when the <code>ConvertTarget</code> input is fired.}}
{{KV|Model Swap Entity|string|If specified, this entity's model will replace the model of the target object during conversion. {{tip|Use this when the converted object has a separate model used for physics props.}}}}
{{KV|Model Swap Entity|string|If specified, the model of the entity specified here will replace the model of the target object when it is converted. {{tip|Use this when the converted object has a separate model used for physics props. (e.g. converting "coolthing001a" when "coolthing001a_physics" exists)}}}}
{{KV|Mass Override|float|Sets the mass when the object(s) are converted (0 means auto-calculate)}}
{{KV|Mass Override|float|Sets the mass when the object(s) are converted (0 means auto-calculate)}}
{{KV Targetname}}
{{KV Targetname}}
Line 13: Line 14:
== Inputs ==
== Inputs ==
{{IO|ConvertTarget|Converts this entity's target to a physically simulated object.}}
{{IO|ConvertTarget|Converts this entity's target to a physically simulated object.}}
{{note|The converted object will have its velocity transferred.}}
{{note|Only name, model, and velocity are retained after conversion. No keyvalues, e.g. skin and color, are kept. [[AddOutput]] could be used as a workaround depending on the circumstances.}}
{{bug|All keyvalues other than the name and model are not converted, such as skin or color. [[AddOutput]] can be used to solve this by firing it immediately after converting.}}
{{I Targetname}}
{{I Targetname}}



Revision as of 12:14, 19 June 2018

Template:Base point It turns an arbitrary entity into a physically simulated entity. Brush entities will turn into simple_physics_brush and model entities will turn into simple_physics_prop. Both are very limited compared to func_physbox and prop_physics. See their respective pages for details.

Note.pngNote:phys_convert cannot be used in reverse. (cannot turn physically simulated entities into arbitrary entities)

Keyvalues

Entity to convert ([todo internal name (i)]) <targetname>
Name of the entity that will be converted to a physics object when the ConvertTarget input is fired.
Model Swap Entity ([todo internal name (i)]) <string>
If specified, the model of the entity specified here will replace the model of the target object when it is converted.
Tip.pngTip:Use this when the converted object has a separate model used for physics props. (e.g. converting "coolthing001a" when "coolthing001a_physics" exists)
Mass Override ([todo internal name (i)]) <float>
Sets the mass when the object(s) are converted (0 means auto-calculate)
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Flags

  • 1 : Convert Asleep
  • 2 : Convert As Debris

Inputs

ConvertTarget
Converts this entity's target to a physically simulated object.
Note.pngNote:Only name, model, and velocity are retained after conversion. No keyvalues, e.g. skin and color, are kept. AddOutput could be used as a workaround depending on the circumstances.


Outputs

OnConvert
Fires after the conversion has taken place.


See also