Func clip vphysics: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Clarifying something I went to the trouble of making a test map to be sure of.)
(updates)
Line 1: Line 1:
{{base brush|func_clip_vphysics}}  
{{lang|Func clip vphysics}}
{{base brush|func_clip_vphysics}} It is considered solid to [[VPhysics]] objects (such as a {{ent|prop_physics}}). [[QPhysics]] objects (such as {{ent|player}}s) can pass freely.


==Entity description==
{{bug|'''Start Disabled''' is not present in code. Use a {{ent|logic_auto}} to <code>Disable</code> it. A code fix is available below.}}
It is considered solid to [[VPhysics|vphysics]]; in layman's terms, an invisible wall. It is not solid to players.
{{bug|"Start Disabled" is not functional. It must be disabled by another entity. A fix is available below.}}


In code it is represented by class CFuncVPhysicsClip, defined in bmodels.cpp.
{{code class|CFuncVPhysicsClip|bmodels.cpp}}


== Keyvalues ==
==Keyvalues==
{{KV|Filter Name|filterclass|Filter to use to see if activator collides with me. See filter_activator_name for more explanation. Allow means 'Allow to Block' for this entity.}}
{{KV|Filter Name (filtername)|filterclass|[[Filter]] to use to see if activator collides with this entity.}}
{{KV Targetname}}
{{KV EnableDisable}}
{{KV EnableDisable}}
{{KV BaseEntity}}


== Inputs ==
==Inputs==
{{I Targetname}}
{{I EnableDisable}}
{{I EnableDisable}}
{{I BaseEntity}}


== Outputs ==
==Outputs==
{{O Targetname}}
{{O BaseEntity|l4d=1}}


==Fixing Start Disabled Behavior==
==Adding StartDisabled==
By default, start disabled is unsupported by this entity, but this can be easily corrected in code.
By default, StartDisabled is unsupported by this entity, but this can be easily corrected in code.
To start, edit line 1355 of bmodels.cpp to read:
<source lang=cpp>DEFINE_KEYFIELD( m_bDisabled, FIELD_BOOLEAN, "startdisabled" ),</source>


Then, simply add the new keyfield to func_clip_vphysics's definition in your mod's base FGD.<br>
Find this line in the [[DataDesc]], in bmodels.cpp. It should be at line 1358:
<code>
<source lang=cpp>DEFINE_FIELD( m_bDisabled, FIELD_BOOLEAN ),</source>
startdisabled(choices) : "Start Disabled" : 0 : "The entitiy's default state" =
Change <code>DEFINE_FIELD</code> to <code>DEFINE_KEYFIELD</code>, and add <code>"StartDisabled"</code> as the last parameter.
[
<source lang=cpp>DEFINE_KEYFIELD( m_bDisabled, FIELD_BOOLEAN, "StartDisabled" ),</source>
0 : "No"
1 : "Yes"
]
</code>


[[Category:Physics]]
[[Category:Physics]]

Revision as of 05:12, 6 October 2018

English (en)Translate (Translate)

Template:Base brush It is considered solid to VPhysics objects (such as a prop_physics). QPhysics objects (such as players) can pass freely.

Icon-Bug.pngBug:Start Disabled is not present in code. Use a logic_auto to Disable it. A code fix is available below.  [todo tested in ?]
C++ In code, it is represented by theCFuncVPhysicsClipclass, defined in thebmodels.cppfile.

Keyvalues

Filter Name (filtername) ([todo internal name (i)]) <filter>
Filter to use to see if activator collides with this entity.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).


Inputs

EnableDisable:

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


Outputs

Adding StartDisabled

By default, StartDisabled is unsupported by this entity, but this can be easily corrected in code.

Find this line in the DataDesc, in bmodels.cpp. It should be at line 1358:

DEFINE_FIELD( m_bDisabled, FIELD_BOOLEAN ),

Change DEFINE_FIELD to DEFINE_KEYFIELD, and add "StartDisabled" as the last parameter.

DEFINE_KEYFIELD( m_bDisabled, FIELD_BOOLEAN, "StartDisabled" ),