Nade...

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
SupaNixke
Private
Posts: 5
Joined: Sun Jan 16, 2005 2:32 pm

Nade...

Post 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
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post 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)
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

might want to put

Code: Select all

$trigger_1 nottriggerable
after

Code: Select all

$light_1 show
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?
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

no it'd make it dim and brighten very fast and possible cause seisures :twisted:
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

:P
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Post Reply