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

Prop static: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
m (Replaced content with "{{EntityTabs|main=source|prop static|source=1|source2=1}} {{quote|''{{autolang|1=Not to be confused with the {{ent|$staticprop}} and <code>allowstatic</code> ({{ent|prop_d...")
Tag: Replaced
Line 1: Line 1:
{{Entitytabs|source2=1|source=1|main=source|prop_static}}
{{EntityTabs|main=source|prop static|source=1|source2=1}}
{{lang|Prop static}}
{{quote|''{{autolang|1=Not to be confused with the {{ent|$staticprop}} and <code>allowstatic</code> ({{ent|prop_data}}) QC commands.|ru=Не путайте с командой QC [[$staticprop]].|zh=''不要混淆 {{ent:zh-cn|$staticprop}} 或者 <code>allowstatic</code> ({{ent:zh-cn|prop_data}}) QC 命令。}}''}}
{{quote|''Not to be confused with the {{ent|$staticprop}} and <code>allowstatic</code> ({{ent|prop_data}}) QC commands.''}}
{{toc-right}}
{{toc-right}}
{{this is a|name=prop_static|e1}} It is used to [[cheap]]ly add a [[model]] to the world. It cannot move, animate, or accept [[input]] (with the limited exception of {{ent|$treesway}}). In fact, it doesn't exist as an entity after the map has been compiled. The vast majority of models in a typical map are <code>prop_static</code>s.
{{this is a|name=prop_static|e1}} {{multipage}}
 
A <code>prop_static</code> ''will'' collide with other objects assuming it has a [[collision mesh]], and, unlike all other model entities, can be lit per-vertex and cast shadows onto [[lightmap]]s.
 
{{note|Models using [[bump maps]] cannot be lit per-vertex, except in {{csgobranch|4}}.}}
{{note|In {{src13mp|4}} and {{gmod|4}}, static props can use lightmaps using the static prop's UVs. They come with the same limitations as per-vertex lit props, and cannot be used on models with bump maps.
{{warning model lightmaps}}
}}
{{modernWarning|In most Source games, a single level is limited to 4096 <code>prop_static</code>s. The limit is 8192 in {{Asbranch|4}} and {{portal2branch|4}} or 16384 in {{csgobranch|4}}. If the limit is reached, [[VBSP]] will fail to compile the map.}}
{{bug|{{code|prop_static}} does not support selectable {{ent|$bodygroup}} submodels (although it does support selectable {{ent|$texturegroup}} skins); only the first one will be used. Despite this, VRAD will generate lightmap shadows from ''all submodels'' present in the MDL! (tested in {{dods}}) {{workaround|Do one of the following:
* Compile a separate model for each desired variation ([[cheap|cheaper]], better lighting)
* Use {{ent|prop_dynamic}} (easier, less file duplication)
}} }}
 
== Consistency ==
In order to enforce consistency of behavior, models with [[prop_data|embedded physics data]] cannot be <code>prop_static</code>. Use the Hammer Model Browser's info tab to check for support.
{{workaround|This is not an engine limitation, but rather an arbitrary restriction imposed by the compile tools, and can be bypassed with a modified [[VBSP]], such as [https://www.sourcemodding.com/resources/tools/level-creation/ VBSP prop_static fix].
}}
 
== Keyvalues ==
{{KV|Collisions|intn=solid|choices|How the prop should interact with other objects.
:* Not solid
:* Use bounding box
:* Use [[VPhysics]] (default) {{note|Using this setting on models without a [[collision mesh]] will cause the engine to throw a warning upon loading the map. If you see such a warning, reset the collision of all props using the noted model to one of the other two choices.}}}}
{{KV|Screen Space Fade|intn=screenspacefade|bool|If enabled, the prop will fade out based on how many screen pixels it covers. The start and end fade distances come to represent the pixels that the prop covers at the start and end of its fade when this is enabled.}}
{{KV|Lighting Origin|intn=lightingorigin|targetname|An {{ent|info_lighting}} from which to sample lighting (instead of the model's origin). Disables per-vertex lighting.}}
{{KV|Disable Vertex lighting|intn=disablevertexlighting|bool|Prop will be lit uniformly with a lighting value sampled from its origin. Enable this if the entity is not shadowed by another object.}}
{{KV|Disable Self-Shadowing with vertex lighting|intn=disableselfshadowing|bool|When vertex lighting is enabled, prevent the geometry from self-shadowing (casting shadows onto itself).}}
{{KV|Ignore surface normal for computing vertex lighting|intn=ignorenormals|bool|When vertex lighting is enabled, ignore the surface normal of faces when calculating the vertex lighting.
: {{tip|Useful for thin, translucent objects such as leaves on foliage props.}}}}
{{KV|Alpha|intn=renderamt|int|Alpha of the fade, where 0 is fully transparent and 255 is fully opaque.|since=L4D}}
{{KV|Render Color (R G B)|intn=rendercolor|color255|Tint the model with this color.|since=L4D}}
{{KV|Generate (and use) lightmaps for this static prop|intn=generatelightmaps|bool|Generate a lightmap for this prop. Requires <code>-StaticPropLighting</code> to be enabled in VRAD. For more information, visit [https://tf2maps.net/threads/guide-prop-lightmaps.24682/ tf2maps.net].
:{{note|Lightmapping can be also faked on static props using the [[Modulate]] shader in all games, although syncing the lighting can be difficult.}}
:{{bug|{{css}} This setting doesn't work on models with multiple skins.}}
:{{warning|Several caveats and limitations; see note and warnings above.}} |only=2013MP|also={{gmod}}}}
{{KV|Lightmap Resolution X|intn=lightmapresolutionx|int|The resolution of the generated lightmap in the X (or U) direction. (Only used if Generate Lightmaps is Yes.)|only=2013MP|also={{gmod}}}}
{{KV|Lightmap Resolution Y|intn=lightmapresolutiony|int|The resolution of the generated lightmap in the Y (or V) direction. (Only used if Generate Lightmaps is Yes.)|only=2013MP|also={{gmod}}}}
{{KV|Enable Bounced Lighting|intn=enablelightbounce|bool|Whether VRAD should create indirect lighting from this prop.|since={{csgobranch}}}}
{{KV|Disable Prop Combine|intn=preventpropcombine|bool|Prevent this static prop from combining with any other static props in vbsp.|since={{csgobranch}}}}
{{KV|Uniform Scaling|intn=uniformscale|float|Evenly scales a given model along the X Y Z axis.
: {{bug|In Hammer, undoing/redoing any changes (whether they are slight unit movements or scale changes) will result in the prop appearing "normal" sized in the 3D Textured Viewport (the model only appears normal sized and the value given is still shown upon reload of the VMF).}}|since={{csgobranch}}}}
{{todo|add scaling kvs from p2ce}}
{{KV|Name|intn=targetname|target_source|The name that {{ent|ship_base_interaction}}{{ship}}/postcompile{{teamspen}} entities refer to this entity by.|only={{ship}}{{teamspen}}}}
{{ScrollBox|
{{KV Studiomodel|static=1|noscroll=1}}
{{KV BaseFadeProp}}
{{KV DXLevelChoice}}
{{KV SystemLevelChoice}}
{{KV Angles}}
}}
 
==Common Mistakes==
Error! prop_static using model "[model]", which must be used on a dynamic entity (i.e. prop_physics). Deleted.
The prop is not compatible to be used as <code>prop_static</code>. You need to use <code>prop_dynamic_override</code> instead, or <code>prop_physics</code> if you want it to have physics.
 
If it's your custom model:
*Either your model is missing {{ent|$staticprop}} or there is no <code>allowstatic 1</code> in the <code>prop_data</code> QC file.
Example: <code>
$KeyValues
{
prop_data
{
"base" "Metal.Medium"
"allowstatic" "1"
}
}
</code>
 
*If for some reason your model located incorrectly, check declared bone name in <code>$definebone</code> of a model; it should be without any slashes. Also check position there, values should be zeroed.
 
== See Also ==
* [[Prop Types Overview]]
** {{ent|prop_dynamic}}
** {{ent|prop_physics}}
** {{ent|prop_detail}}

Revision as of 22:00, 9 December 2023

Template:EntityTabs

Red x.png
This template (and its redirect) is Wikipedia icon Deprecated. Its use is not recommended and its functionality may be compromised.
You can help our editors by replacing or deleting this template on the Pages that use this template. Once no more pages use this template, it should be Marked for deletion.

Additional notes:
Use #switch parser function instead. Example
{{#switch: {{language}}
| #default = English
| ja = 日本語
| zh-tw = 中文(台灣)
‎}}

prop_static is an e1 available in all Source Source games. Template:Multipage