[SOLVED] Prop fading in/out

Avatar
KyloX
62 Posts
Posted Jan 14, 2015
The idea I have is this:
I have a prop which I want it to fade out or in after certain action ( like activating a trigger), not dependable on what distance is between the player and the prop. There isn't an output for props to change "Start / End Fade Dist", so that's a bummer.

So any ideas on how to execute this or should I scrap this one?

Advertisement
Registered users don't see ads! Register now!
Avatar
TeamSpen210
608 Posts
Posted Jan 14, 2015
Replied 1 hour later
You can do this, it involves a little bit of work though. On the prop_dynamic, change Render Mode to Constant Glow. This will make the Render FX value usable, which actually is transparency. You can send Alpha inputs with a parameter of 0-255 to set the amount.

You'll need a sequence of logic entities to create a fading effect - logic_timer > math_counter > math_remap > prop_dynamic.
- For the timer, set the Refire Time to 0.1s. You'll need two, one to fade in and the other to fade out. They should OnTimer Add or Subtract 1 from the math_counter, respectively. They both should start disabled.
- The math_counter should have a maximum limit set to the fading transition time * 10 (50 for 5 seconds). The OutValue output should feed into the math_remap's InValue input.
- In the math_remap, the input maximum should be set to the same as the counter, and the output maximum set to 255. Both minimums should be 0. The OutValue output should feed into the prop_dynamic's Alpha input.
- Create two logic_relays named "fade_in_rl" and "fade_out_rl". Outputs:
Fade_in_rl:
- Fade_out_rl > CancelPending
- Fade_in_timer > Enable
- Fade_out_timer > Disable
- Fade_in_timer > Disable (after transition time)

Fade_out_rl:
- Fade_in_rl > CancelPending
- Fade_out_timer > Enable
- Fade_in_timer > Disable
- Fade_out_timer > Disable (after transition time)
These should correctly handle being triggered rapidly.

Avatar
KyloX
62 Posts
Posted Jan 14, 2015
Replied 52 minutes later
Awesome, works like a charm. Thanks senpai.

The thing I am working on is a cube, more or less. Rather than fizzle away, it fades away and appears in the spawn. Now I only need to do some parenting with the original cube and it's done, hopefully...

Avatar
TeamSpen210
608 Posts
Posted Jan 14, 2015
Replied 6 hours later
In that case, I suggest you set the prop_dynamic to Start Disabled, which will make it invisible. When you want it to dissolve, send a DisableDraw input to the real cube, and an Enable input to the prop_dynamic, plus possibly a DisableMotion input to the cube to make it freeze and not able to be picked up. When the cube respawns, you'll want to SetValue the math_counter back to 0.
Avatar
KyloX
62 Posts
Posted Jan 14, 2015
Replied 37 minutes later
Found a better solution, use prop_physics_paintable. Works like prop_physics_override and has render FX parameters.
I though at first to use parents, but prop_dynamic doesn't really accept prop_physics_override as a parent.

This is what I am working on, Hex complex:

Advertisement
Registered users don't see ads! Register now!
Avatar
josepezdj
2,386 Posts
Posted Jan 14, 2015
Replied 1 hour later
Man, that looks awesome! Very interesting aesthetics