Please or Register to create posts and topics.

Placing overlays dynamically

Hello,
I've run into some dead ends with working with decals because I have no control over them. I want to be able to place down an overlay wherever my script calculates it should be, but overlays want me to specify which brushes they can attach to. Is there a way to tell what number brush I want to automatically assign, or is there a way to get around this inconvenience?
Thanks

What about using this function to locate the nearest brush around a given point:

FindByClassnameNearest

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]

My script uses the traceline function, which only seems to detect world brushes, and and func_details. FindByClassnameNearest looks for Origins, and neither of those types of brushes have an origin. I'll test the concept when I get the chance later today just in case though.

I'm afraid this may not be possible with overlays. Once the map is compiled, the overlay entity is just a proxy; the actual graphic is part of the (static) map geometry and, as far as I know, can't be changed except from setting a different texture index. (Try killing an env_overlay entity in-game and see what happens.)

If you can figure out some way of getting the surface normal of the wall / floor / whatever, then maybe you can try placing non-solid func_brushes that have only one side textured, and rotating them so they appear just like overlays.

(Side note: TraceLine also works for func_physbox entities, so if you have any brush entities that need to support this, you could turn them into func_physboxes with motion disabled.)

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic

Killing an overlay seems to crash the game. That's unfortunate. I have considered placing a brush, like you said, but If I were to place a portal over it, or if it would be placed really close to an edge, the texture would seem to float over the portal or edge, and that would look aweful. Is there a way to avoid that by using the brush method?https://drive.google.com/file/d/0B9wOk5iIMMN_YThwQzhZaXFxUWc/view?usp=sharing

Goldenknighttim wrote:
Killing an overlay seems to crash the game. That's unfortunate. I have considered placing a brush, like you said, but If I were to place a portal over it, or if it would be placed really close to an edge, the texture would seem to float over the portal or edge, and that would look aweful. Is there a way to avoid that by using the brush method?

Well, you can slip a really thin brush under a portal (like, 0.25 units off the surface) and have it render correctly in most cases, but if they can protrude over an edge, then that's a problem.

Assuming that this is the antline gel you're working on, (Google doesn't want to show me that image you linked to, so I'm guessing) maybe it would be better to think of some other way to get that puzzle mechanic. Like, for example, construct the paintable surfaces out of func_brushes that can toggle between plain, painted-inactive and painted-active, and have them react to the paint bombs. To make portals work, you would need to make them non-solid and add an invisible, solid surface for the portals.

Just an idea, but maybe it helps. If I think of anything else, I'll let you know.

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic

Yeah,it's the gel. I am hoping to create an instance that can be used in any level, but maybe I can use that if all other options don't work. I'm hoping to find a way to get the texture to toggle, but I'm willing to drop that idea if it turns out to be completely impossible. If I were to use the stick gel splats by leaving paint in map on, I could use particles instead to symbolize the gel becoming powered. The other problem with this is that lasers would bounce off of the antiline gel. (Also calling it linking-yellow gel wouldn't work anymore. :P) Only part I don't know how to do is recoloring the gel splats. I've already recolored the gel it'self, so it should work similarly. If you have any ideas for how to use a decal-type-wall-texture with full control, let me know, cause I would much prefer to use a solution like that. But short of splitting a brush into about 100 pieces and tracelining underneath each one to see if they are on a brush and deleting them if the report a '1'(I'd expect to see massive lag, but I might try it anyway just to see what happens), I'm out of ideas.

Goldenknighttim wrote:
Only part I don't know how to do is recoloring the gel splats.

If you decide to use Gel 1 for this, the convar portal_paint_color recolors the paint itself (as when it's splattered on a brush). I think I used 128 0 255 255 for Adhesion Gel. Note that this variable only takes effect after a map transition.

Falsi sumus crusto!