PDA

View Full Version : "Dynamic" lights with dx7



pollo
13th October 2014, 21:58
https://www.youtube.com/watch?v=njIYN4OJRRc

A friend (Radio-xf: walkingcodradio) told me that there was a way to make dynamic lights without using DirectX 9 + dynamic light effects. I tested it and it seems to work fine. Players will have those annoying light bugs (bright/dark models) though, but doesn't matter ^^. Also use this with a few script_brushmodels since there's a max of it (256 iirc)

How to do it?

1- Make a script_brushmodel with no lights. Give it a targetname, for example: "lights_off".
2- Make another script_brushmodel, in a different position of the first one. Light the script_brushmodel at your own, and give it another targetname, for example: "lights_on".
4- Make sure you align the textures in both of the script_brushmodels, otherwise it would look weird.
5- Make a trigger to activate them and give it a targetname, for example: "trig_lights".
6- Copy this script:


lights()
{
off = getent("lights_off","targetname");
on = getent("lights_on","targetname");
trig = getent("trig_lights","targetname");
wait .1;

on movez(-392,0.01); //change this to move the "lights_on" brushmodel to the exact position the "lights_off" is.
on hide();

while(1)
{
trig sethintstring("Press [USE] to turn ^2ON ^7the lights");
trig waittill("trigger");
wait .5;
on show();
off hide();
trig sethintstring("^1Wait :p");
wait 3;
trig sethintstring("Press [USE] to turn ^1OFF ^7the lights");
trig waittill("trigger");
wait .5;
off show();
on hide();
trig sethintstring("^1Wait :p");
wait 3;
}
}