I wanted to know this a while back and someone said to me that there was a rtcw map that has it, so I mailed the mapper and this was his reply:
The setup itself is a bit complicated, but the idea is simple. It will be easiest if i just run through how to build it. Start with your room, and any surfaces that will be affected by any of the lights you wish to turn on/off. Copy all of that geometry and move it directly above, under, right or left of the origional, or as close as possible without obscuring any other geometry. Make the selected brushes a script_mover. Create an origin for it and two path_corners, one where the origin is, the other aligned so the script_mover is in perfect alignment of the origional room. Now you must apply the same texture as in the origional room, but using a special shader for them.
This is a shader i built for the script_mover, using an existing texture in the game.
textures/silo_wall/concrete_c07bcmp_offset
{
qer_editorimage textures/miltary_wall/concrete_c07bcmp.tga
surfaceparm nonsolid
surfaceparm nomarks
polygonoffset
{
map $lightmap
rgbGen identity
}
{
map textures/miltary_wall/concrete_c07bcmp.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
}
Notice i used the polygonoffset parameter, this is the most important one of all them. Also surfaceparm nonsolid, nomarks are necessary.
Now once you have all these aligned properly, go ahead and setup your script_mover. For the scripting here is what i have.
//LightSwap Trigger
lightswitch
{
spawn
{
}
trigger toggle
{
trigger lightmap toggle
}
}
//LightSwap Lightmaps
lightmap
{
spawn
{
accum 1 set 0
wait 500
alertentity lightbulbs //fixing bug...
wait 500
alertentity sparks
alertentity lightbulbs
gotomarker on 9000
}
trigger toggle
{
//halt
trigger lightmap off
wait 5
trigger lightmap on
}
trigger off
{
accum 1 abort_if_not_equal 0
resetscript
accum 1 set 1
alertentity lightbulbs
alertentity corona
alertentity sparks
gotomarker off 9000
}
trigger on
{
accum 1 abort_if_not_equal 1
resetscript
accum 1 set 0
alertentity lightbulbs
alertentity corona
gotomarker on 9000
alertentity sparks
}
}
This works so the light can be toggled on or off and stay that way until the mover is triggered again. some of the other things ive used are corona’s and light models, as well as sparks for a broken light.
If you still have any questions feel free to drop by my forums whitch are dead and ask a question or just email me back. Hope it works out!
I tried it and it worked, but the light will still be there, so any player models will still light up, you just won’t see the lightspots on the floor and walls if you know what I mean.