Changing Light Colour

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Bilko
Colour Sergeant
Posts: 91
Joined: Sat May 24, 2003 3:06 pm
Location: UK
Contact:

Changing Light Colour

Post by Bilko »

Right, I've made a script/model as my light and it works fine, however, I've discovered that it shines through walls. Is there a way to change the colour of a normal light when a switch is triggered? Ive tried "$real_lights.color 1 0 0" and "$real_lights color 1 0 0" but with no success. Any ideas?

Bilko.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Try

$real_lights lightRed (value 0 to 1)
$real_lights lightGreen (value 0 to 1)
$real_lights lightBlue (value 0 to 1)
Image
Bilko
Colour Sergeant
Posts: 91
Joined: Sat May 24, 2003 3:06 pm
Location: UK
Contact:

Post by Bilko »

no, no luck. I read somewhere that lights aren't entities, could it be that you can't assign a light a targetname?

Bilko.
Serph
Major
Posts: 278
Joined: Wed Jun 11, 2003 5:23 pm
Location: Barrie, Ontario Canada
Contact:

Post by Serph »

are you saying that the light goes through your walls?

if I'm right can't you just use sunblock?
Image
~serph~
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

You can't change the color of a point light (the one you place in Radiant) dynamically. This is because lightmaps are precompiled :(.

I thought you were talking about dynamic lights ;)
Image
Bilko
Colour Sergeant
Posts: 91
Joined: Sat May 24, 2003 3:06 pm
Location: UK
Contact:

Post by Bilko »

Ahh, ok. Different way of looking at the problem. Is there a way to stop dynamic lights shining through walls or are we back to 'the wall doesn't know it's a light' etc?

Bilko.

ps. can u at least hide them, or not?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

A dynamic light can be 'hidden' with the lightOff command.

Example:
$light lightOff
Image
Bilko
Colour Sergeant
Posts: 91
Joined: Sat May 24, 2003 3:06 pm
Location: UK
Contact:

Post by Bilko »

Sorry, I meant normal lights then, shoulda said. Anyway, seems impossible so I'll give up.
Thanks for your help JV.

Bilko.
SlasherZ
Colonel
Posts: 433
Joined: Fri Jul 11, 2003 12:55 pm
Contact:

Post by SlasherZ »

normal light color can be changed by key: color
Bilko
Colour Sergeant
Posts: 91
Joined: Sat May 24, 2003 3:06 pm
Location: UK
Contact:

Post by Bilko »

I mean in-game.

Bilko.
Post Reply