Is there a way to make an animated texture start at a specified point via in input?

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
So I'm using an animated texture on a large func_brush that is disabled by default. When it's enabled it of course displays the animated texture on it, but the problem is that it often the texture is half way though the animation.

What I want to know is if there is some way to force it to start at frame 0, so that I can make it start at the same time the func_brush is enabled.?

The only other way I might be able to try is by using a env_toggletexture with a SetTextureIndex input to set it on the starting frame, then sending a IncrementTextureIndex input every 0.05 seconds to animate the texture. I haven't tried this yet as I'd like to know if there is some simple command or other method first.

In case anyone needs is, this is the .vmt for the texture I'm using.
Code:
"LightmappedGeneric"
{
	"$basetexture" "custom/thx1"
	"$selfillum" "1"

	"Proxies"
	{
		"AnimatedTexture"
		{
		"animatedTextureVar" "$basetexture"
		"animatedTextureFrameNumVar" "$frame"
		"animatedTextureFrameRate" "20"
		}
	}
}

And in case anyone asks, I'm trying to make this in map form:
View: https://www.youtube.com/watch?v=nu0R96OZy6w
 

Izotope

Sourcerer
aa
May 13, 2013
698
764
There is also material_modify_control which has a StartAnimSequence input.
I think you can define a "sequence" of frames by numbers in the vmt or in hammer and play it with this input.
Haven't tested this myself though.
 

nickybakes

You should've played Rumbleverse
aa
Jul 28, 2015
911
1,739
Wow, I had the same idea (not THX) of having a "theatre" area for a certain future map. This is great. Fuck tho, the THX theme used to scare me when I was younger.
 

Vel0city

func_fish
aa
Dec 6, 2014
1,947
1,589
Wow, I had the same idea (not THX) of having a "theatre" area for a certain future map. This is great. Fuck tho, the THX theme used to scare me when I was younger.
duuuuuuuuuuuuuuuuuuuuuuuuuUUUUUUUUUUUUUUUUUUUUUUUUUH
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
I'm not sure what's happening with the setup as its not working, but it isn't throwing any errors at me either.

This is the new .vmt file:
Code:
"LightmappedGeneric"
{
   "$basetexture" "custom/thx"
   "$selfillum" "1"

   "Proxies"
   {
     "AnimatedTexture"
     {
     "animatedTextureVar" "$basetexture"
     "animatedTextureFrameNumVar" "$frame"
     "animatedTextureFrameRate" "20"
     }
     "MaterialModifyAnimated"
     {
     }
   }
}
The material_modify_control is set up like so:
  • Name - thx_control
  • Material to modify - custom/thx.vtf
  • Material variable to modify - $basetexture
It's only input is this (via a button ATM):
Code:
OnPressed > thx_control > StartAnimSequence > 1 -1 20 0
I have also tried 0 -1 20 0 and 1 333 20 0 in the parameter override box, but neither works.

I have a feeling the .vmt is set up wrong, but the VDC page for list of Material Proxies indicates that "MaterialModifyAnimated" has no parameters to set.

Anyone got any ideas?
 

Izotope

Sourcerer
aa
May 13, 2013
698
764
Looks like your AnimatedTexture proxy overrides everything the MaterialModifyAnimated proxy does.
Try removing the AnimatedTexture proxy. (back it up first)
 

Izotope

Sourcerer
aa
May 13, 2013
698
764
Well duh, you need to give it the input to start the sequence.
Unless you did that and it still didn't work, in which case, try the other proxy called just MaterialModify and use the input again.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
Well duh, you need to give it the input to start the sequence.
Unless you did that and it still didn't work, in which case, try the other proxy called just MaterialModify and use the input again.
Nope, that didn't work either.

In both cases I'm triggering it manually via ent_fire.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
Well I got it working really well with the env_toggletexture as it syncs up with the sound really well, but I am wondering if the material_modify_control was set up correctly. I did try setting the 'Material variable to modify' to MaterialModify and MaterialModifyAnimated, but neither worked.
 

Izotope

Sourcerer
aa
May 13, 2013
698
764
Oh yeah I remember seeing something important like this in the Counter Prefab Resource by @wiseguy149
Download it and look at the vmf, it might just solve your problem.
 

henke37

aa
Sep 23, 2011
2,075
515
Has anyone tried the video playback entities from portal 2? They do use the same codec in TF2 these days...
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
I think this might be the problem. It's supposed to be modifying the vmt, not the vtf.
That appears to be correct! I looked at the .vmf file provided with @wiseguy149 's counter download, and she has hers set to the .vmt to the .vtf. She also has the 'Material variable to modify' set to $frame.

I might give this method a second shot now that I know this, but as I have it working via the env_texturetoggle method I'm in no rush to test it.
 

Izotope

Sourcerer
aa
May 13, 2013
698
764
Has anyone tried the video playback entities from portal 2? They do use the same codec in TF2 these days...
The entity isn't available in the FGD and is probably not even in the code itself. Why would it be? None of Valve's TF2 maps use it.
However that entity was and still is one of many things I wish Valve would add for the community to play with.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309

Attachments

  • Animated Textures.zip
    4.8 MB · Views: 10
Last edited: