Skip to content

Static Props

Nak edited this page Sep 18, 2022 · 11 revisions

Static Props are models baked into the map. These objects can't move, animate or be edited by other means.

Returns Functions Description
StaticProp? BSPObject:GetStaticProp( Number index ) Returns the Static Prop with said index.
Table BSPObject:GetStaticProps() Returns a list of all Static Props.
Table BSPObject:GetStaticPropModels() Returns a list of all Static Props models used by the map.
Table BSPObject:FindStaticByModel( String model ) Returns a list of all Static Props matching the model.
Table BSPObject:FindStaticInBox( Vector boxMins, Vector boxMaxs ) Returns a list of all Static Props, within the specified box.
Table BSPObject:FindStaticInSphere( Vector origin, Number radius ) Returns a list of all Static Props, within the specified sphere.

Note: A lot of Static Prop variables can only be used in certain versions. Therefore some of these variables will always be the default. See: https://developer.valvesoftware.com/wiki/Source_BSP_File_Format#Static_props for more info.


Returns Functions Description
Number StaticProp:GetVersion() Returns the version of the StaticProp.
Number StaticProp:GetIndex() Returns the index.
Vector StaticProp:GetPos() Returns the position.
Angle StaticProp:GetAngles() Returns the angles.
String StaticProp:GetModel() Returns the model.
Number StaticProp:GetSkin() Returns the model-skin.
Color StaticProp:GetColor() Returns the color.
Number StaticProp:GetScale() Returns the model-scale.
Number StaticProp:GetSolid() Returns the solid enum. See: https://wiki.facepunch.com/gmod/Enums/SOLID
Vector StaticProp:GetLightingOrigin() Returns the lighting origion.
Number StaticProp:GetFlags() Returns the flags.
Boolean StaticProp:HasFlag(Number flag) Returns true if it has the flag.
Boolean StaticProp:GetDisableX360() Returns true if the Static Prop is disabled on X360.
Vector, Vector StaticProp:GetModelBounds() Returns the min/max model bounds. This will be scaled with :GetScale()
Vector, Vector StaticProp:GetRenderBounds() Returns the min/max model bounds. This will be scaled with :GetScale()
Vector, Vector StaticProp:GetModelRenderBounds() Returns the min/max model bounds. This will be scaled with :GetScale()
Number StaticProp:GetFadeMinDist() The distance the Static Prop will start fading away.
Number StaticProp:GetFadeMaxDist() The distance the Static Prop will stop fading and stop drawing entirely.
Number StaticProp:GetForceFadeScale() In some cases while or running in a low DXLevel, the engine will ignore FadeMax/FadeMin variables and forcibly fade the Static Prop. This variable is used to somewhat control the forced-fade-scale.
Number, Number StaticProp:GetDXLevel() Returns the min/max DXLevel to render the Static Prop.
Boolean StaticProp:HasDXLevel() Returns true if the client can render the Static Prop. ( CLIENT ONLY! )
Number, Number StaticProp:GetCPULevel() Returns the min/max CPULevelto to render the Static Prop.
Number, Number StaticProp:GetGPULevel() Returns the min/max GPULevelto to render the Static Prop.
Number, Number StaticProp:GetLightMapResolution() Returns the lightmapResolutionX and lightmapResolutionY. See: https://tf2maps.net/threads/guide-lightmap-optimization.33113/ for more info
Number StaticProp:GetFlagExs() Returns the "further" bitflags.
Boolean StaticProp:HasFlagEx(Number flag) Returns true if the Static Prop has the the "further" bitflag.

Nik Naks Wiki


Features:

Clone this wiki locally