Page 1 of 1
Nade...
Posted: Mon Jan 24, 2005 3:02 pm
by SupaNixke
hey
i want a script for my "training map"
this is what i have:
- brush : texture = trigger; targetname = trigger_1 and its a trigger_multiple
- light: color = red; targetname = light_1
what i want:
i want that the light becomes green when a nade passes the trigger (brush)
greetz
Posted: Mon Jan 24, 2005 3:16 pm
by Master-Of-Fungus-Foo-D
you cannot change the color of an actual light entity... you must make a script_object and hit n. give it the key/value of model/fx/dummy.tik then ype in light/0.00 9.00 0.00. To make it brighter green just make the middle number biger(it goes R-0.00 g-9.00 b-0.00)
Posted: Mon Jan 24, 2005 3:49 pm
by lizardkid
dont make too many of these though, dynamic lighting hurts FPS on your map.
you'll need to script the thing to get it to work though, here's an example of what you'll need t do.
1. open Radiant
2. find your trigger and give it a key/value of setthread/testLight
3. close Rad, open Notepad
4. put these lines in there.
Code: Select all
main:
level waittill prespawn
level waittill spawn
// this is the fx model, i'll assume you replaced the light_1 with this instead.
$light_1 hide
end
testLight:
$light_1 show
wait 5
$light_1.light 0.00 9.00 0.00
wait .5
$light_1.light 0.00 8.00 0.00
wait .5
$light_1.light 0.00 7.00 0.00
wait .5
$light_1.light 0.00 6.00 0.00
wait .5
$light_1.light 0.00 5.00 0.00
wait .5
$light_1.light 0.00 4.00 0.00
wait .5
$light_1.light 0.00 2.00 0.00
wait .5
$light_1.light 0.00 1.00 0.00
wait .5
$light_1.light 0.00 0.00 0.00
end
5. save your map and script as the same name, for instance if your map is MyMap.map, save this script as MyMap.scr.
6. compile and try it out.
SIDENOTE: i tried to do it with a loop but couldnt figure out how to leave the other values be and just decrease the green. :S
Posted: Mon Jan 24, 2005 5:16 pm
by Master-Of-Fungus-Foo-D
might want to put
after
and make it triggerable again at the end so you dont have some1 screwing around and throwing one nade after another into while the light is dimming... wouldnt that crash it?
Posted: Mon Jan 24, 2005 6:21 pm
by lizardkid
no it'd make it dim and brighten very fast and possible cause seisures

Posted: Mon Jan 24, 2005 6:27 pm
by Master-Of-Fungus-Foo-D