Jump to content

One-way Field


Go to solution Solved by Artemis,

Recommended Posts

Posted

Hey guys, sorry to drop in here again. 

I'm trying to build a hangar bay that has a one-way force field. I want to be able to leave the bay but not come back in. Essentially, I need it to be solid on the outside, but not solid on the inside. 

I imagined I could do this with shaders, but I'm having no luck. I put nodraw on all sides except the side I wanted the texture on, which didn't work. Then I used nodraw_solid on the sides of the brush but regular nodraw on the hangar-facing side. And that just made the whole brush solid. 

I'm sure I can do this with shaders, but maybe I'm just missing something? I'd appreciate any help you guys could offer here. 

Thanks.

Posted

You could try using a patch, since the backside of it is nonsolid.  It should let you only run through it one way.

Oh my god I'm an idiot. I can't believe I didn't think of that. 

 

So I could use the patch and as long as the texture is "cull twosided" then I'm fine. 

 

So I could then set it to func_usable and switch it with a regular brush covered painted with nodraw_solid if I wanted to make a locking switch. 

 

Okay, I'll try this. Thanks. God I feel like an idiot. 

Droidy365 likes this
Posted

Turns out I don't need to switch it with another brush. I just set the "unlocked" field's shader to "surfaceparm nonsolid" and set the "locked" field to solid. 

Then they could switch against a trigger and I can just use two meshes. Ugh. This mapping thing is driving me nuts but it's so much fun.

Droidy365 and Artemis like this
  • 3 weeks later...
Posted

Another alternative that might be a bit easier to deal with - you can use a nonsolid brush for the visuals, and use physics_clip on a patch mesh facing the outside to prevent entry from that direction.

 

If you want the physics_clip to be switchable, you can attach it to a func_wall entity, and target a trigger_multiple at it. (Make sure somewhere nearby there is a brush, ideally a tiny one covered with caulk, as part of the func_wall entity or you'll get "sv_setBrushModel: null" on startup.) Every time the func_wall is fired, the wall will toggle in and out of existence. But because the visuals are attached to a nonsolid brush, they are always present. Sounds like that's what you're looking for, I think?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...