Changing a texture ingame (Texture_Toggle?)
Quote from The_Butler on September 25, 2012, 7:32 amTime for a good oll' obvious question.
I am trying to get a countdown timer on a wall, and I want to use the "effects/countdown_timer_num_0n"
textures that come with Portal2. I thought a good start would be to see how normal indicator lights change their texture, but the tutorial is not making that overly clear. I then stumbled upon the Texture_Toggle function https://developer.valvesoftware.com/wiki/Env_texturetoggle but I am now even more confused... it is going on about VTF files - and that you must have a VTF file in order to use texture toggle...so a few beginner's questions, when I go to textures, and I browse.. that is what I get isn't it - just textures, little drawn up pictures that have no logic or features attached?
To solve this, surely I need to create some sort of object that has all 11 states / frames that my number can have (NULL,0,1,2...9) and by firing a number at the object it will display on the wall?
how come the blue indicator lights just work, when I browse for them I can't see the Yellow variant anywhere, just the blue strip - how could I find out without tutorials that these lights can turn "on"?
I'm also using a math counter and a logic timer to get my counter going - is this the correct way of ding things of should I consider using a script instead?
many thanks for your patience gents, I'll get there one of these days
Time for a good oll' obvious question.
I am trying to get a countdown timer on a wall, and I want to use the "effects/countdown_timer_num_0n"
textures that come with Portal2. I thought a good start would be to see how normal indicator lights change their texture, but the tutorial is not making that overly clear. I then stumbled upon the Texture_Toggle function https://developer.valvesoftware.com/wiki/Env_texturetoggle but I am now even more confused... it is going on about VTF files - and that you must have a VTF file in order to use texture toggle...
so a few beginner's questions, when I go to textures, and I browse.. that is what I get isn't it - just textures, little drawn up pictures that have no logic or features attached?
To solve this, surely I need to create some sort of object that has all 11 states / frames that my number can have (NULL,0,1,2...9) and by firing a number at the object it will display on the wall?
how come the blue indicator lights just work, when I browse for them I can't see the Yellow variant anywhere, just the blue strip - how could I find out without tutorials that these lights can turn "on"?
I'm also using a math counter and a logic timer to get my counter going - is this the correct way of ding things of should I consider using a script instead?
many thanks for your patience gents, I'll get there one of these days
Quote from Lpfreaky90 on September 25, 2012, 8:03 amWhat you see in the texture browser is all the materials portal 2 has.
A material is a vmt file that has information, like
$basetexture, which is the .vtf file, the actual image itself.If you go to the indicator light textures, you will notice that the vtf has multiple frames with textures in one file. The env_texturetoggle allows the game to switch to the specified frame, basically changing the entire image.
The numbers however, are not all in one vtf, so switching between them is a hell. Chickenmobile made a nice timer a long time ago, look for it in the other section of portal 2
What you see in the texture browser is all the materials portal 2 has.
A material is a vmt file that has information, like
$basetexture, which is the .vtf file, the actual image itself.
If you go to the indicator light textures, you will notice that the vtf has multiple frames with textures in one file. The env_texturetoggle allows the game to switch to the specified frame, basically changing the entire image.
The numbers however, are not all in one vtf, so switching between them is a hell. Chickenmobile made a nice timer a long time ago, look for it in the other section of portal 2 ![]()
Quote from ChickenMobile on September 25, 2012, 8:24 amI say!
Just toggle brushes on and off with your desired textures.
That's what I did for this: Underground Timer
I say!
Just toggle brushes on and off with your desired textures.
That's what I did for this: Underground Timer
Quote from The_Butler on September 25, 2012, 8:48 amThanks for the info Lpfreaky90, that makes it a bit clearer for me!
RoboChicken, wow nice one. I will delve into that one tonight when I get home.
Thanks for the info Lpfreaky90, that makes it a bit clearer for me!
RoboChicken, wow nice one. I will delve into that one tonight when I get home.
Quote from The_Butler on September 25, 2012, 1:53 pmI have the timer happily ticking away in my level, forgive me if I am being thick though, but I don't understand the interaction with logic relays... I have two relays that will enable / disable a light wall; how do I reference to these via your button stand and timer panel? I tried following your tutorial....
lets say my relays are called "LR_Wall_On" and "LR_Wall_Off"
both button and wall panel are called "Timer_01" (Entity name fixup)
....
never mind, writing down what I have got in Hammer made me see my mistake, the logic relays are called "fixup" - "logic relay name" whohooo
right, back to making my map... I promise one day I will publish one... soon
I have the timer happily ticking away in my level, forgive me if I am being thick though, but I don't understand the interaction with logic relays... I have two relays that will enable / disable a light wall; how do I reference to these via your button stand and timer panel? I tried following your tutorial....
lets say my relays are called "LR_Wall_On" and "LR_Wall_Off"
both button and wall panel are called "Timer_01" (Entity name fixup)
....
never mind, writing down what I have got in Hammer made me see my mistake, the logic relays are called "fixup" - "logic relay name" whohooo
right, back to making my map... I promise one day I will publish one... soon
Quote from ChickenMobile on September 25, 2012, 6:39 pmYou could also use an '@' symbol so then you don't need the prefix name things like I said: but I think it helps people understand it a little as well.
You could also use an '@' symbol so then you don't need the prefix name things like I said: but I think it helps people understand it a little as well.
Quote from josepezdj on September 27, 2012, 11:13 amYou can also make a custom timer with your own number textures. I'm doing myself one for the mod using our numbers and typo. You can make your own .vtf file with the 10 numbers as frames into the same file, always bearing in mind the limitations that a vtf file could have (for some games that's 512kb max. / 256x256px... dunno for Portal2 though).
The rest is relatively easy using logic_timers and env_texturetoggles (and whatever outputs to activate the count... There an interesting output applicable to the env_texturetoggle called "IncrementTextureIndex" that could be fired every second to change to the next texture/number)
A second option would be to make directly an animated spray. You have an awesome tutorial for that HERE; 2 methods are explained indeed...
You can also make a custom timer with your own number textures. I'm doing myself one for the mod using our numbers and typo. You can make your own .vtf file with the 10 numbers as frames into the same file, always bearing in mind the limitations that a vtf file could have (for some games that's 512kb max. / 256x256px... dunno for Portal2 though).
The rest is relatively easy using logic_timers and env_texturetoggles (and whatever outputs to activate the count... There an interesting output applicable to the env_texturetoggle called "IncrementTextureIndex" that could be fired every second to change to the next texture/number)
A second option would be to make directly an animated spray. You have an awesome tutorial for that HERE; 2 methods are explained indeed...
Quote from The_Butler on September 27, 2012, 1:41 pm[quote="josepezdj"]
There an interesting output applicable to the env_texturetoggle called "IncrementTextureIndex" that could be fired every second to change to the next texture/number)
That was exactly the option I was looking at; it looks elegant and well, just the proper way to do it. Although very greatfull for Chicken mobile's counter I am not happy with the fact that I have not "learned" something new with all this - so maybe I might have a go and try your way... but first, first i will finish at least one map, even if it kills me....
[quote="josepezdj"]
There an interesting output applicable to the env_texturetoggle called "IncrementTextureIndex" that could be fired every second to change to the next texture/number)
That was exactly the option I was looking at; it looks elegant and well, just the proper way to do it. Although very greatfull for Chicken mobile's counter I am not happy with the fact that I have not "learned" something new with all this - so maybe I might have a go and try your way... but first, first i will finish at least one map, even if it kills me....
Quote from josepezdj on September 28, 2012, 5:03 amThe_Butler wrote:Although very greatfull for Chicken mobile's counter I am not happy with the fact that I have not "learned" something new with all thisI guess working with instances, and to know what's happening inside them, is a bit more for advanced mappers. However, even thought I haven't checked Chicken's underground timer, I know it is an awesome tool very well configured, intuitive and useful. Working with instances allows you to have it all already set up and vary only certain general values from time to time you use the instance... like in this case the amount in seconds to count up or down and the event you want to happen after the time has come.
I also like to know what happens, to know it by myself, and to make it happen myself. That's why I like hammer this lot
I'll try to take some of my little free time to make an example mini map with a working timer in it but the way I said above, no instances, just the entities and the multi-framed texture files, in order to make a more didactic thingy where you can see what is happening between each entity clearly.
I guess working with instances, and to know what's happening inside them, is a bit more for advanced mappers. However, even thought I haven't checked Chicken's underground timer, I know it is an awesome tool very well configured, intuitive and useful. Working with instances allows you to have it all already set up and vary only certain general values from time to time you use the instance... like in this case the amount in seconds to count up or down and the event you want to happen after the time has come.
I also like to know what happens, to know it by myself, and to make it happen myself. That's why I like hammer this lot ![]()
I'll try to take some of my little free time to make an example mini map with a working timer in it but the way I said above, no instances, just the entities and the multi-framed texture files, in order to make a more didactic thingy where you can see what is happening between each entity clearly.
Quote from ChickenMobile on September 28, 2012, 8:05 amHey if you have any questions related to the timer, just ask. Not hard
Hey if you have any questions related to the timer, just ask. Not hard ![]()











