Toggling a brush's visibility?

Avatar
Tigger
100 Posts
Posted Jan 27, 2008
I have a brush with an animating texture I only want visible when the player is touching it.

Haven't figured out how yet after looking here and on the SDK site. Any suggestions on how to set this up?

Thanks.

Advertisement
Registered users don't see ads! Register now!
Avatar
Interitus
145 Posts
Posted Jan 28, 2008
Replied 2 hours later
make a trigger around it , just a little bigger than you want sticking out where the player will touch it. Make it a trigger_multiple and add the outputs. The first output should be OnStartTouch -> enable visibility, the second OnEndTouch -> disable visibility
Avatar
Tigger
100 Posts
Posted Jan 28, 2008
Replied 10 minutes later
Thanks for the answer, but I'm afraid I'm not seeing the Enable Visibility or Disable Visibility options in the triggers.

Also I don't know how to start a brush with visibility disabled initially.

Avatar
NykO18
183 Posts
Posted Jan 28, 2008
Replied 2 hours later
Use a func_brush for your block and set the "Start disabled" option on "Yes".
Then, you can do what Interitus said, put a trigger_multiple around it, with a one unit shift, check its "client" flag (and only this one) and put some outputs in it :

OnStartTouchAll > func_brush > Enable
OnEndTouchAll > func_brush > Disable

It will make the brush appear when the player touches the wall.

Avatar
Duffers
474 Posts
Posted Jan 28, 2008
Replied 4 hours later
Sigh Using func_brush go into render FX (I believe, I don't have hammer in front of me) and there should be an option like "fade when close" or something. I'll confirm it later.
Avatar
Interitus
145 Posts
Posted Jan 28, 2008
Replied 25 minutes later

Tigger wrote:
Thanks for the answer, but I'm afraid I'm not seeing the Enable Visibility or Disable Visibility options in the triggers.

Erm, yeah, I didnt have hammer open so I just pulled those terms out of thin air. Its just enabled/disabled like Nyk018 said, and what Duffedwaffe said might work to help give it a fading effect rather than just disappearing.

Avatar
Hurricaaane
189 Posts
Posted Jan 28, 2008
Replied 9 minutes later
I would suggest a material proxy, like the combine force field that fades in when close.
Avatar
NykO18
183 Posts
Posted Jan 28, 2008
Replied 35 minutes later
And if you need another solution, the func_areaportalwindow makes a brush disappear depending on the distance.
Avatar
msleeper
4,095 Posts
Member
Posted Jan 28, 2008
Replied 8 hours later

Holy shit people.

For one, DO NOT USE A FUNC_AREAPORTALWINDOW FOR THIS EFFECT! You will get SERIOUS errors since the engine is trying to render a totally useless and retardidly placed func_areportalwindow, which exists for a very specific reason and has very specific setup requirements.

Secondly, using a material proxy is over complicating the process a bit I think. You can do it this way, but it's not necessary.

Doing the Trigger is probably your best bet. Setup your Outputs for the trigger like this:

  • OnStartTouch -> (func_brush name) -> RenderAmt -> 255- OnEndTouchAll -> (func_brush name) -> RenderAmt -> 0
    The RenderAmt Input controls the transparancy of a func_brush, where 255 is totally visible and 0 is totally invisible.
Avatar
NykO18
183 Posts
Posted Jan 28, 2008
Replied 6 minutes later

msleeper wrote:
For one, DO NOT USE A FUNC_AREAPORTALWINDOW FOR THIS EFFECT!

Depends on how the wall is built
I did it a bunch of times in my maps without any problems.

Avatar
msleeper
4,095 Posts
Member
Posted Jan 28, 2008
Replied 10 minutes later
The map might compile and load up, but that doesn't change the fact that is NOT how the func_areaportalwindow should be used and, when used in a map with proper func_areaportalwindow's, could cause some big problems.
Avatar
NykO18
183 Posts
Posted Jan 28, 2008
Replied 38 minutes later
No problem here :
http://hl.logout.fr/images/tuto_opti/areaportalwindow0.jpg
http://hl.logout.fr/images/tuto_opti/areaportalwindow1.jpg
http://hl.logout.fr/images/tuto_opti/areaportalwindow2.jpg
It's used for what it's supposed to be used, and it acts like a ghost wall.
But well, ok. I agree that it should not fall in inexperimented hands.
Avatar
msleeper
4,095 Posts
Member
Posted Jan 28, 2008
Replied 15 minutes later
Actually that is a totally legitimate use of areaportalwindow. Granted you are exploiting the fade on it to do stuff besides what it was intended, but that's not what I meant. If you make a free floating brush - one that is not sealed on all sides by world brushes - and make it a func_areaportalwindow, you will get problems.

Neat trick by the way.

Avatar
Tigger
100 Posts
Posted Jan 28, 2008
Replied 4 hours later
Enabling then disabling the brush does the trick perfectly. Thank you all for the help.
Advertisement
Registered users don't see ads! Register now!
Avatar
NykO18
183 Posts
Posted Jan 29, 2008
Replied 5 hours later

msleeper wrote:
If you make a free floating brush - one that is not sealed on all sides by world brushes - and make it a func_areaportalwindow, you will get problems.

Yeah, lol, of course.
I thought it was obvious, but I forgot that it's not for everyone.
Sorry