Is it poosible to...

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
Patroclus
Corporal
Posts: 33
Joined: Tue Jun 22, 2004 3:33 pm
Location: Somewhere in the Northeast

Is it poosible to...

Post by Patroclus »

Is it possible to create a light which ca be switch on and off?

What I rigged up is a switch that opens a door in the ceiling with light in the cavity behind the door, but is tere an easier, better looking way?

Thanks
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

Yeah, it's possible. Just keep in mind that this light will "go through" walls, so don't put it too close to walls, ceilings, etc...

Create a script model and give the key/values:

key:targetname
value:mylight

key:model
value:fx/dummy.tik

put a switch in your map and give:

key:targetname
value:myswitch

and put a trigger use around the switch:

key: setthread
value:switchthread

Now, in your script file, put this above level waittill spawn:

//light off
$mylight light(1 1 1)
$mylight lightRadius 150
$mylight notsolid
level.lightswitch1=0
$mylight lightoff

and this, at the bottom:

//light thread
switchthread:
$myswitch anim turn
$myswitch anim waittill animdone
$myswitch anim on
$myswitch playsound click
$myswitch anim waittill animdone
if (level.lightswitch1==0 )
{
$mylight lighton
level.lightswitch1=1
}
else
{
$mylight lightoff
level.lightswitch1=0
}
wait .5
$myswitch anim off
end
Image
Patroclus
Corporal
Posts: 33
Joined: Tue Jun 22, 2004 3:33 pm
Location: Somewhere in the Northeast

Post by Patroclus »

Thanks, now, how do i get a switch that looks like a light switch? All I can find is that little round silver thing tht would be used in elevators and stuff...
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

The other one I know it's the static/equipment/alarmswitch...mohaa don't have nice switches...
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

switch

Post by tltrude »

You can make a script_object switch out of brushes. The little arm can then be made to rotate up and down in the script--kind of like a floor or ceiling hatch.
Tom Trude,

Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

or jsut make the brushes around it and have a rotatingdoor for the switch without sound and a setthtread value....
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Post Reply