这篇条目有关 Source引擎。如需详情,点击这里。

Zh/Prop ragdoll: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
(Created page with "<!-- When this page is updated to {{langsp}} or {{langsp}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang|Prop r...")
 
No edit summary
Line 1: Line 1:
<!-- When this page is updated to {{langsp}} or {{langsp}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang|Prop ragdoll}}{{seealso|For details on creating a ragdoll, see {{ent|mode=name|$collisionjoints}}.}}
<!-- When this page is updated to {{langsp}} or {{langsp}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang|Prop ragdoll}}{{seealso|有关创建布娃娃的具体细节,详见{{ent|mode=name|$collisionjoints}}.}}
{{CD|CRagdollProp|file1=1}}
{{CD|CRagdollProp|file1=1}}
[[File:prop_ragdoll.jpg|thumb|prop_ragdoll can interact with dynamic objects, unlike death ragdolls.]]
[[File:prop_ragdoll.jpg|thumb|不像NPC死亡时生成的布娃娃,地图制作者放置的布娃娃可以与环境动态的交互]]


{{this is a|point entity|name=prop_ragdoll}} It is a [[VPhysics]] [[Wikipedia:Ragdoll physics|ragdoll]]. Ragdolls are collections of physics objects constrained together to simulate a jointed object like a dead body. They are very [[expensive]] to simulate.
{{this is a|point entity|name=prop_ragdoll}}是一个[[VPhysics|具有物理性质]][[Wikipedia:Ragdoll physics|布娃娃]]。布娃娃是一组约束在一起的物理对象的集合,用于模拟像尸体这样的关节物体,它们的物理模拟有着[[expensive|昂贵的性能开销]].


{{warning|This entity generates server-side ragdolls, which collide with everything but produce very large amounts of network traffic. Network traffic can be significantly reduced by making the ragdoll start asleep, disabling motion and disabling collisions with dynamic objects ({{not in FGD}} add "solid" keyvalue with value of 0) and only enabling motion when necessary.}}
{{warning|该实体生成的是服务端布娃娃,会与任何道具发生碰撞,但这会造成大量网络开销。通过默认休眠(勾选Start asleep Flag),禁用物理运动或禁用与动态道具的碰撞({{not in FGD}}在soild键值中使用0为参数),并仅在需要时启用物理运动,可以显著减少网络开销}}
{{bug|Setting a custom pose via Hammer and making the ragdoll start asleep will make the rendering box fail to update. Making the ragdoll wake for a single frame when spawned and then sleeping it will fix this issue.}}
{{bug|通过Hammer设置自定义动作并勾选<code>Start Asleep</code> Flag会导致渲染框无法更新,在生成时唤醒布娃娃一帧时间后再次休眠即可解决此问题}}
{{bug|{{Portal2|4}} ragdolls cannot pass through portals. This often occurs in {{Portal|4}} as well.}}
{{bug|{{Portal2|4}}中,布娃娃无法穿过传送门,这也在{{Portal|4}}中经常发生}}
{{bug| Ragdolls are ignored in prediction, this causes lots of prediction errors when touching a ragdoll.}}
{{bug|[[Prediction|预测]]时会忽略布娃娃,这会在触摸布娃娃时导致大量的预测错误}}
{{altnames|name1=physics_prop_ragdoll}}
{{altnames|name1=physics_prop_ragdoll}}
{{Expand|title={{bms|4}} specific notices and bugs.|
{{Expand|title={{bms|4}}特定提示和漏洞|
{{note|Original entity version is available as <code>prop_ragdoll_original</code>. The difference is: <code>prop_ragdoll_original</code> can't be gibbed with explosions, crowbar can hit <code>prop_ragdoll_original</code> if <code>[4] Debris</code> spawnflag is unchecked (crowbar's raycast skips <code>prop_ragdoll</code> for some reason), <code>prop_ragdoll_original</code> doesn't bleed or have decals on it, <code>prop_ragdoll_original</code> can't be picked up, <code>prop_ragdoll_original</code> have realistic bullet push.}}
{{note|原始版本仍可作为<code>prop_ragdoll_original</code>使用。区别在于:
* <code>prop_ragdoll_original</code>无法通过爆炸造成碎尸
* 如果没有在Spawnflags勾选<code>[4] Debris</code>,撬棍的攻击可以击中<code>prop_ragdoll_original</code>(由于某些原因,撬棍的攻击判定会跳过<code>prop_ragdoll</code>
* <code>prop_ragdoll_original</code>没有流血效果且不会产生印花
* <code>prop_ragdoll_original</code>无法被拾取
* <code>prop_ragdoll_original</code>有真实的子弹推力效果
}}
{{bug|<br/>
{{bug|<br/>
* server side ragdolls created by NPCs never gib before loading save since the first Steam version, the same for gibs created by gibbed ragdolls.  Use [https://community.lambdageneration.com/black-mesa/post/efesc2f8cyf the workshop addon] if you want to use server side ragdolls in your mod.
* server side ragdolls created by NPCs never gib before loading save since the first Steam version, the same for gibs created by gibbed ragdolls.  Use [https://community.lambdageneration.com/black-mesa/post/efesc2f8cyf the workshop addon] if you want to use server side ragdolls in your mod.

Revision as of 18:54, 6 August 2024

English (en)中文 (zh)Translate (Translate)
参见:  有关创建布娃娃的具体细节,详见$collisionjoints.
C++ 类层级
CRagdollProp
CBaseAnimating
CBaseEntity
C++ physics_prop_ragdoll.cpp
不像NPC死亡时生成的布娃娃,地图制作者放置的布娃娃可以与环境动态的交互

prop_ragdoll是一个点实体(en),可在所有的 起源 起源 游戏中使用。是一个具有物理性质布娃娃。布娃娃是一组约束在一起的物理对象的集合,用于模拟像尸体这样的关节物体,它们的物理模拟有着昂贵的性能开销.

Warning.png警告:该实体生成的是服务端布娃娃,会与任何道具发生碰撞,但这会造成大量网络开销。通过默认休眠(勾选Start asleep Flag),禁用物理运动或禁用与动态道具的碰撞(不存在于FGD!在soild键值中使用0为参数),并仅在需要时启用物理运动,可以显著减少网络开销
Icon-Bug.png错误:通过Hammer设置自定义动作并勾选Start Asleep Flag会导致渲染框无法更新,在生成时唤醒布娃娃一帧时间后再次休眠即可解决此问题  [todo tested in ?]
Icon-Bug.png错误:传送门2 传送门2中,布娃娃无法穿过传送门,这也在传送门 传送门中经常发生  [todo tested in ?]
Icon-Bug.png错误:预测时会忽略布娃娃,这会在触摸布娃娃时导致大量的预测错误  [todo tested in ?]
AltNames.pngAltNames: 此实体也绑定到 physics_prop_ragdoll
黑山 黑山特定提示和漏洞
Note.png注意:原始版本仍可作为prop_ragdoll_original使用。区别在于:
  • prop_ragdoll_original无法通过爆炸造成碎尸
  • 如果没有在Spawnflags勾选[4] Debris,撬棍的攻击可以击中prop_ragdoll_original(由于某些原因,撬棍的攻击判定会跳过prop_ragdoll
  • prop_ragdoll_original没有流血效果且不会产生印花
  • prop_ragdoll_original无法被拾取
  • prop_ragdoll_original有真实的子弹推力效果
Icon-Bug.png错误:
  • server side ragdolls created by NPCs never gib before loading save since the first Steam version, the same for gibs created by gibbed ragdolls. Use the workshop addon if you want to use server side ragdolls in your mod.
  • crowbar's raycast skips/ignores server side ragdolls since the first Steam version.
  • Tripmines do not gib ragddols
  • In multiplayer ragdolls do not create hole decals and blood from bullets if [4] Debris spawnflag is enabled. If this flag is disabled - ragdolls still will not create blood effects and hand blood overlays.  [todo tested in ?]


Death Ragdolls/Ragdoll Transformation

When a NPC/player dies or an entity receives the BecomeRagdoll input, it normally creates a client-side ragdoll and copies most of its animation and visual data to it. Unlike server-side prop_ragdolls, these client-side ragdolls are handled completely on a per-client basis and are much cheaper and simpler than their server-side counterparts, at the expense of being virtually nonexistent on the server, being inconsistent across client perspectives, and only colliding with entities that have physics objects on the client (e.g. worldspawn).

However, a NPC will become a server-side ragdoll while it's under any of the following conditions:

These server-side death ragdolls will collide with physics objects and beyond, like any prop_ragdoll, but they are marked as debris and do not collide with each other. They do not collide with themselves either, unlike client-side ragdolls (fixed in Entropy : Zero 2 Entropy : Zero 2 and 黑山 黑山). This is believed to be intentional behavior to reduce performance/networking costs.

Icon-Bug.png错误:Server side ragdolls don't save blood decals. Fixed in Mapbase Mapbase and 黑山 黑山.  [todo tested in ?]
Note.png注意:Most of this list theoretically applies to players as well, although that hasn't been tested.
Warning.png警告:While most of the relevant animation/visual data is copied to ragdolls, some fields, like fade distances, are not transferred.
Cpp.png代码:This can be modified at CBaseAnimating::CopyAnimationDataFrom() in baseanimating.cpp for server-side ragdolls and C_BaseAnimating::CreateRagdollCopy() in c_baseanimating.cpp for client-side ragdolls.

Keyvalues

Name (目标名称) <target_source>[ Edit ]
这个名称是其他实体通过 输入/输出(en) 或其他 关键值(en)(如 parentnametarget) 来引用该实体时使用的标识符。
该名称也会显示在 Hammer 编辑器的 2D 视图和 实体报告(en) 中。
参见:  所有实体均可使用的 通用键值、输入与输出(en)

Override Animation (angleOverride) <字符串(en)>
Filled in by the engine via hammer_update_entity. Do not edit by hand except to clear.
Non-Valve game specific
Health (health) <整数(en)> (存在于 黑山 之中)
The amount of damage the ragdoll takes before gibbing.
Character Manifest Mimic Name (MimicName) <字符串(en)> (存在于 黑山 之中)
Choose a name or a classname from the character manifest to dress the ragdoll.

GMODSandbox:

Allow Physics Gun (gmod_allowphysgun) <布尔值(en)> (存在于 Garry's Mod 之中)
If set, players cannot use Physics Gun on this entity.
Sandbox Tool Whitelist (gmod_allowtools) <字符串(en)> (存在于 Garry's Mod 之中)
If set, only given tools can be used on this entity. You need to supply the tool class names, the names of the .lua files of those tools. This also includes the context menu properties!

Flags

Debris : [4]
Don't collide with the player or other debris
Use 'Least Recently Used' Retirement [澄清]  : [4096] 不存在于FGD!
Allow Dissolve : [8192]
Motion Disabled : [16384]
Allow stretch : [32768]
Start asleep : [65536]

Inputs

StartRagdollBoogie
Begins ragdoll boogie effect for 5 seconds.
Icon-Bug.png错误:This input is actually supposed to use a parameter for how long the ragdoll should boogie, but it uses the wrong field type in the data description.  [todo tested in ?]
Cpp.png代码修复:In CRagdollProp's data description, find DEFINE_INPUTFUNC( FIELD_VOID, "StartRagdollBoogie", InputStartRadgollBoogie ) and replace FIELD_VOID with FIELD_FLOAT.
EnableMotion / DisableMotion
Enable / disable physics simulation.
FadeAndRemove  (存在于自 半衰期2:第二章 以来)
Fade out then remove (kill) self. Parameter override = duration of fade.
AllowBloodPool  (存在于 黑山 之中) 不存在于FGD!
Сorpse once will create pool of blood (particle effect) if it is placed on brush.
Note.png注意:Not avaible for prop_ragdoll_original and prop_ragdoll_attached.

See Also