Env texturetoggle: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
 
 Tip:You can fire
Tip:You can fire 
		
	
|  (Added a useful tip) |  (Added example VMT with the ToggleTexture proxy.) | ||
| Line 3: | Line 3: | ||
| In order for <code>env_texturetoggle</code> to work properly, your overlay or at least one face of your brush must use a [[VMT]] material with the <code>[[List Of Material Proxies#Texture manipulation|ToggleTexture</code> proxy]] defined and pointing to an animated [[VTF]] file with at least two frames. | In order for <code>env_texturetoggle</code> to work properly, your overlay or at least one face of your brush must use a [[VMT]] material with the <code>[[List Of Material Proxies#Texture manipulation|ToggleTexture</code> proxy]] defined and pointing to an animated [[VTF]] file with at least two frames. | ||
| Such a VMT file could look like this: | |||
| <source lang=php> | |||
| LightmappedGeneric | |||
| { | |||
|   $basetexture "path/to/a/VTF/file/with/multiple/frames" | |||
|   Proxies | |||
|   { | |||
|     ToggleTexture | |||
|     { | |||
|       ToggleTextureVar         $basetexture | |||
|       ToggleTextureFrameNumVar $frame | |||
|     } | |||
|   } | |||
| } | |||
| </source> | |||
| {{code class|CTextureToggle|env_texturetoggle.cpp}} | {{code class|CTextureToggle|env_texturetoggle.cpp}} | ||
| {{tip|You can fire [[AddOutput]]  | {{tip|You can fire <code>[[AddOutput]] texframeindex #</code> which will change the texture's frame index without needing this entity.}} | ||
| ==Keyvalues== | ==Keyvalues== | ||
Revision as of 11:42, 16 March 2021

Template:Base point It allows you to change the textures on brush entities or overlays.
In order for env_texturetoggle to work properly, your overlay or at least one face of your brush must use a VMT material with the ToggleTexture proxy defined and pointing to an animated VTF file with at least two frames.
Such a VMT file could look like this:
LightmappedGeneric
{
  $basetexture "path/to/a/VTF/file/with/multiple/frames"
  Proxies
  {
    ToggleTexture
    {
      ToggleTextureVar         $basetexture
      ToggleTextureFrameNumVar $frame
    }
  }
}
 Tip:You can fire
Tip:You can fire AddOutput texframeindex # which will change the texture's frame index without needing this entity.Keyvalues
- Target Brush(es) (target) ([todo internal name (i)]) <targetname>
- Name of the brushes or info_overlays. All ToggleTexturematerials on all entities (including sprites) matching the targetname will be affected.
Inputs
- IncrementTextureIndex
- Increments target brush's current texture frame by one.
- SetTextureIndex <integer>
- Sets target brush's texture frame to the specified index.


























