Please or Register to create posts and topics.

Can infodecals be stored as handles?

PreviousPage 2 of 2

That's a shame. Thanks for explaining that though.

Got another idea I guess, does anyone know if there is a way to choose which frame an infodecal spawns at?

What you should try doing is create a template infodecal in some room, which has the texture and targetname set. Setup an env_entity_maker and point_template to spawn it, and then you can use the special entity_maker methods to spawn the decal at a position. Since it has a targetname, the entity should stay around until you send the activate input. That means you should be able to do AddOutput to set the targetname.

My stuff:
[spoiler]- BEE2 Addons | (BEE2)
- Hammer Addons
Maps:
- Crushed Gel
- Gel is Not Always Helpful[/spoiler]
TeamSpen210 wrote:
What you should try doing is create a template infodecal in some room, which has the texture and targetname set. Setup an env_entity_maker and point_template to spawn it, and then you can use the special entity_maker methods to spawn the decal at a position. Since it has a targetname, the entity should stay around until you send the activate input. That means you should be able to do AddOutput to set the targetname.

Thank you for your reply. I am already doing everything up untill the last sentence, "That means you should be able to do AddOutput to set the targetname." But I'm not sure why changing the name of the infodecal would help. I was changing the name at first because I wanted to detect decals in a radius, and find te decals within the same radius of each of those, and so on, then I wanted to toggle the texture of each of those. to do that, I would need a name. But the infodecals kill themselves after they sprey, so that doesn't help anymore.

Maybe it would help if I explain what I'm trying to do. I'm trying to create a gel that can be used as a dynamic antiline. You have a button, and a door. You try to find a way to place a line of this gel between the button and the door. You press the button, the gel connecting the button and the door turns from yellow to black, and opens the door. I have a gel bomb with a new gel texture. I have a couple of functions that finds the place of the impact, and use a entity_maker to place an infodecal and a info_target on that spot. The infodecal is the gel in it's black form. When a button is pressed, it calls a function that finds all info_targets with a specific name within a radius, and places the yellow gel splat decal over that, and changes the name of that info_target. Then it has the info_target call the same function, pretty much spreading the output along the gel. In that function, I plan to add a fireuser_1 output to any entity to activate anything. Deactivation shouldn't be too hard after this is working. My problem is that the extra gel splats covering each other are creating a lot of lag, placing the black gel over the yellow doesn't work, as it ends up under the yellow, so the gel won't 'deactivate', and when I start scripting clear gel to work with this, it won't be able to remove the gel.

My current idea for fixing this: I've noticed that when the gel splats are placed in the same spot over and over again under the dropper, lag isn't a problem. Also, when the black gel is placed over the yellow gel, it goes under the yellow gel, possibly as if it's replacing the black gel splat that is already under the yellow texture. I'm guessing that the lowpriority value does remove the texture beneath it and replace it with itself. With that assumption, I think that if that texture does have multiple frames, then if I were to spawn the same texture, but on the yellow frame over the black frame, or the black frame over the yellow frame, or an alpha frame over any of the others, I could change the texture of, or even remove the decal. That's why I'm asking if there is a way to spawn a texture at a specific frame. While writing this out, I've got an idea for how to do that that I'll be trying shortly. I'll post if it works. (I understand that this last method is a huge stretch and probably won't work, but I'm running out of ideas, and I've come so far with this.)

Edit: idea for starting decal on second frame didn't work, tried using the 'skin' value. Still looking for another way to start the decal on another frame.

What I was thinking is to then create an env_texturetoggle and addOutput that to allow you to change the texture frame of the decal. (This is if texturetoggles work on decals). In the script, take the decal/target origin and do something like (x % 64 * 64), which will round it to the nearest 64-unit multiple. Then you could have some logic to ensure only one toggle per "grid" section is created, which would help decrease entity spam.

Alternately, maybe something simpler would be to just not have the "gel" change colours at all. Just spawn in a bunch of particle systems / sprites at the targets, so they blend into each other and show the conduction path. You could also use env_beams.

My stuff:
[spoiler]- BEE2 Addons | (BEE2)
- Hammer Addons
Maps:
- Crushed Gel
- Gel is Not Always Helpful[/spoiler]
Goldenknighttim wrote:
Got another idea I guess, does anyone know if there is a way to choose which frame an infodecal spawns at?
Goldenknighttim wrote:
Edit: idea for starting decal on second frame didn't work, tried using the 'skin' value. Still looking for another way to start the decal on another frame.

Well, there is a parameter for multi-framed textures that actually allows you to choose the first frame your texture will start at:

"$frame" "3" (it would start at the 3rd frame in this example)

I've used it only in those materials where I also added the material proxy "ToogleTexture", but I bet this works in any other texture since the VMT parameters are shader-parameters (not specific for material proxies), and as far as I tested, this param does work at least in UnliGeneric and LightmappedGeneric shaders materials.

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]
TeamSpen210 wrote:
What I was thinking is to then create an env_texturetoggle and addOutput that to allow you to change the texture frame of the decal. (This is if texturetoggles work on decals). In the script, take the decal/target origin and do something like (x % 64 * 64), which will round it to the nearest 64-unit multiple. Then you could have some logic to ensure only one toggle per "grid" section is created, which would help decrease entity spam.

Alternately, maybe something simpler would be to just not have the "gel" change colours at all. Just spawn in a bunch of particle systems / sprites at the targets, so they blend into each other and show the conduction path. You could also use env_beams.

The only way to toggle a decal texture is to have a single overlay with that texture, or several with only one name, and toggle the texture on that. That will toggle every decal with that texture, possibly as a glitch. After I finish this gel, I will want to be able to wash it off. I can only do that by deleating a decal, replacing the decal with alpha, or covering the decal with another that looks exactly like the original brush texture, with the same position and scale. I believe the last is impossible. The first should be possible, but I can't figure out how. The second looks like my best chance at the moment. I've got another idea I'll try tonight when I have the chance. I wonder if all the gel splats are changed with the overlay glitch, then I spawn another splat, it might come out black, and when everything toggles back, it might toggle the one that's black to yellow. It's a bit of a streatch, but if it works, I'll be happy.

Edit: newest idea didn't work. When I toggle the texture, then create a new decal with the same texture, it is also toggles to the same thing. I'm gonna try thinking about this more, but I'm pretty stuck.

PreviousPage 2 of 2