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

Discussion in 'Mapping Questions & Discussion' started by Werewolf, May 19, 2016.

  1. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    729
    Positive Ratings:
    205
    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
     
  2. Izotope

    aa Izotope Never releases maps

    Messages:
    606
    Positive Ratings:
    562
    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.
     
  3. Nicky

    aa Nicky Lets try something new!

    Messages:
    912
    Positive Ratings:
    1,698
    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.
     
  4. Vel0city

    aa Vel0city func_fish

    Messages:
    1,902
    Positive Ratings:
    1,516
    duuuuuuuuuuuuuuuuuuuuuuuuuUUUUUUUUUUUUUUUUUUUUUUUUUH
     
    • Funny Funny x 1
  5. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    729
    Positive Ratings:
    205
    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?
     
  6. Izotope

    aa Izotope Never releases maps

    Messages:
    606
    Positive Ratings:
    562
    Looks like your AnimatedTexture proxy overrides everything the MaterialModifyAnimated proxy does.
    Try removing the AnimatedTexture proxy. (back it up first)
     
  7. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    729
    Positive Ratings:
    205
    Nope. That turned it back to a static texture, stuck on the first frame.
     
  8. Izotope

    aa Izotope Never releases maps

    Messages:
    606
    Positive Ratings:
    562
    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.
     
  9. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    729
    Positive Ratings:
    205
    Nope, that didn't work either.

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

    aa Izotope Never releases maps

    Messages:
    606
    Positive Ratings:
    562
    I guess you'll have to use env_toggletexture
     
  11. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    729
    Positive Ratings:
    205
    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.
     
  12. Izotope

    aa Izotope Never releases maps

    Messages:
    606
    Positive Ratings:
    562
    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.
     
  13. henke37

    aa henke37

    Messages:
    1,864
    Positive Ratings:
    432
    Has anyone tried the video playback entities from portal 2? They do use the same codec in TF2 these days...
     
  14. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    729
    Positive Ratings:
    205
    Video playback?
     
  15. Dr. Orange

    Dr. Orange L6: Sharp Member

    Messages:
    361
    Positive Ratings:
    271
    I think this might be the problem. It's supposed to be modifying the vmt, not the vtf.
     
  16. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    729
    Positive Ratings:
    205
    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.
     
  17. Izotope

    aa Izotope Never releases maps

    Messages:
    606
    Positive Ratings:
    562
    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.