Placing overlays dynamically
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
FindByClassnameNearest
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.)
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.
) 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.