Control an unnamed light_environment with lua?

What I heard from my friends who uses Source SDK is that light_environment is hidden to lua if there is no targetname and inputs issued to it.

Is there a way to control it still (Setting a name to it before it hides, etc.)? Without editing the map that is.

Probably not…


Like I said, it will be hidden without a targetname even to that command

gm_flatgrass has a light_environment, try running “PrintTable(ents.FindByClass(“light_environment”))”… It’ll return nothing.


if string.lower(game.GetMap()) == "rp_evocity_v2d" then
	function CheckLightEnvs( ent )
		if ValidEntity(ent) and ent:GetClass() == 'light_environment' then
			ent:SetKeyValue("targetname", "lightenv")
			ServerLog("Found light environment " .. ent:EntIndex())
	hook.Add("OnEntityCreated", "CheckLightEnvs", CheckLightEnvs)

Used that script above to set a name…

Now my map is opposite of fullbright… The props around are still fullbright though.

the think is the hl2 light_enviroment is static, you cant just change its brightness

Somehow, it ain’t. There is a day/night addon that modifys the light a light_environment got, however, it requires map modification.

thats cool, any link?


and i did Ent:Changekeyvalue(“Brightness”, 0,0,0,0)