This article's documentation is for anything that uses the Source engine. Click here for more information.

Phys ragdollmagnet: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Add internal names of keyvalue keys)
No edit summary
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{base point|phys_ragdollmagnet}} It acts like a magnet for ragdolls. Useful for crafting exaggerated ragdoll behavior (i.e. guys falling over rails on death). If the Bar Magnet spawnflag is set, the magnet works like it was a cylindrical magnet i.e. it attracts ragdolls to the nearest point on a line.
{{CD|CRagdollMagnet|file1=CRagdollMagnet.cpp}}
{{this is a|point entity|name=phys_ragdollmagnet}} It acts like a magnet for ragdolls. Useful for crafting exaggerated ragdoll behavior (i.e. guys falling over rails on death). If the Bar Magnet spawnflag is set, the magnet works like it was a cylindrical magnet i.e. it attracts ragdolls to the nearest point on a line.
{{official vmf example|sdk_phys_ragdollmagnet.vmf}}


== Keyvalues ==
== Keyvalues ==
{{KV Targetname}}
{{KV|Bar Magnet Axis|intn=axis|vecline|Axis of the bar magnet, if the spawnflag is active.}}
{{KV|Bar Magnet Axis|intn=axis|vecline|Axis of the bar magnet, if the spawnflag is active.}}
{{KV|Effective Radius|intn=radius|float|Radius in which ragdolls are affected around this entity's origin.}}
{{KV|Effective Radius|intn=radius|float|Radius in which ragdolls are affected around this entity's origin.}}
{{KV|Force|intn=force|float|Magnetic force to apply to ragdolls within the radius. Expressed as kilograms per inch per second. So a force of 1000 will add 10 inches/second to a 100kg man. It will add 100 inches per second to a 10kg headcrab. {{tip|Using a negative value will propel ragdolls away from the magnet.}}}}
{{KV|Force|intn=force|float|Magnetic force to apply to ragdolls within the radius. Expressed as kilograms per inch per second. So a force of 1000 will add 10 inches/second to a 100kg man. It will add 100 inches per second to a 10kg headcrab. {{tip|Using a negative value will propel ragdolls away from the magnet.}}}}
{{KV|Entity to affect|intn=target|string|If specified, the phys_ragdollmagnet will only affect the target entity.}}
{{KV|Entity to affect|intn=target|string|If specified, the phys_ragdollmagnet will only affect the target entity.}}
{{KV Targetname}}
{{KV EnableDisable}}
{{KV EnableDisable}}
{{KV Parentname}}
{{KV Angles}}


== Flags ==
== Flags ==
* 2 : Bar Magnet (use axis helper)
{{fl|2|Bar Magnet (use axis helper)}}


== Inputs ==
== Inputs ==
{{I Targetname}}
{{I EnableDisable}}
{{I EnableDisable}}
{{I Parentname}}
== Outputs ==
{{O Targetname}}


[[Category:Forces]]
[[Category:Forces]]

Latest revision as of 06:57, 29 April 2025

C++ Class hierarchy
CRagdollMagnet
CPointEntity
CBaseEntity
C++ CRagdollMagnet.cpp

phys_ragdollmagnet is a point entity available in all Source Source games. It acts like a magnet for ragdolls. Useful for crafting exaggerated ragdoll behavior (i.e. guys falling over rails on death). If the Bar Magnet spawnflag is set, the magnet works like it was a cylindrical magnet i.e. it attracts ragdolls to the nearest point on a line.

PlacementTip.pngExample:See steamapps/common/sourcesdk_content/hl2/mapsrc/sdk_phys_ragdollmagnet.vmf for example use (comes with Source SDK installation [confirm])

Keyvalues

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

Bar Magnet Axis (axis) <vector>
Axis of the bar magnet, if the spawnflag is active.
Effective Radius (radius) <float>
Radius in which ragdolls are affected around this entity's origin.
Force (force) <float>
Magnetic force to apply to ragdolls within the radius. Expressed as kilograms per inch per second. So a force of 1000 will add 10 inches/second to a 100kg man. It will add 100 inches per second to a 10kg headcrab.
Tip.pngTip:Using a negative value will propel ragdolls away from the magnet.
Entity to affect (target) <string>
If specified, the phys_ragdollmagnet will only affect the target entity.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).

Flags

Bar Magnet (use axis helper) : [2]

Inputs

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.