[Feature] _switchableshadow equivalent for light entities
SirYodaJedi opened this issue · 5 comments
Like VHLT's light_shadow.
_switchableshadow
only works if the given game/mod supports toggling lightstyles via brush entities, which isn't vanilla behavior for any of the target games. light
entities, however, are coded to be able to toggle lightstyles, so games that support a target
on func_door (ex: HL1, Q2) can target a non-emissive light to toggle their "shadow".
example fgd entry
_switchableshadow_target(target_destination) : "Is toggleable shadow for" : : "Calculate lighting with and without the named entity, which can be toggled by targeting this entity. Implies _nostaticlight."
This sounds fine. Making sure I get it, here's a Q1 example:
{
"classname" "light"
"spawnflags" "1" // start off
"targetname" "hide_wall1_shadow"
"_switchableshadow_target" "wall1"
}
{
"classname" "func_wall"
"targetname" "wall1"
}
Say it's a wall that gets removed: you'd killtarget wall1
and trigger hide_wall1_shadow
at the same time.
Yup, that sounds right.
"spawnflags" "1" // start off
Or, actually, would it make more sense to invert the "on" state here, to be have the shadow enabled when "on" instead of disabled?
The switchable shadow lightstyle contains the light that would shine through when the object is gone.
Without modifying the gamecode, we're stuck with:
"light" entity is off -> style string for the switchable shadow is set to "a" -> the shadow is visually present
"light" entity is on -> style string for the switchable shadow is set to "m" -> the shadow is visually gone
So you can omit the "START_OFF" spawnflag, but that'll just make the shadow "gone" initially
Fair enough.