Frictional Games Forum (read-only)

Full Version: Disable AmbientLight in a specific area?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've just started working on a project and at one point I want the AmbientLight set to 0. AmbientLight is the nightvision kinda thing you get when you're in darkness.

My solution for the moment is to set AmbientLightIntensity = "0.0" in a custom game.cfg and do a full conversion, but that removes the AmbientLight for the whole game. I can work areound this by adding box lights with low intensity to simulate "nightvision".

Is there anyway to fiddle with this without making a full conversion or even better in just that specific area?
Well you can add large-radius point lights with a very dark color (I used around 0.2 for each RGB field) and it will give you a low, ambient lighting feel. But it counts as a light source, so it will prevent sanity drain. Other than that I haven't much suggestions

Good luck
I'm not sure if it would work, but you could use global variables. I have a feeling it wouldn't though.
(03-29-2011, 03:03 AM)MrBigzy Wrote: [ -> ]I'm not sure if it would work, but you could use global variables. I have a feeling it wouldn't though.
Setting AmbientLightIntensity = ambientLight in the game.cfg and then add AddGlobalVarFloat("ambientLight", 0.5); in the script for the first map gives the same result as setting the intensity to 0, no nightvision.

Is that how you meant?

@palistov
Well you can work around the sanity problem by adding a function that slowly drains your sanity when in dark areas.. But that is a lot of extra scripting :/
Really really dark lights still drain sanity...at least they seem to in my map. I have a box light in one area with RGB all around 0.03.
<Player_Darkness

MinLightLevel = "0.15"

That's the point at which you drain sanity. I'm guessing R, G, or B can't be above 0.15.
And yea, I meant you use the variable to change the ambient light, but only in the areas you want it to. Did using it work?
Cool MrBigzy good tip. Smile