• env_sun SetKeyValue
    5 replies, posted
I saw older threads about this, but they didn't really have the answer to my question. I tried to loop through entities and get "env_sun" and then change its keyvalue, but that didn't do anything. So then I tried to change the keyvalue in the InitPostEntity hook, but that didn't do anything either. My question is how would I change keyvalues on "env_sun"?
1) Why would you do so 2) use ents.FindByClass("env_sun") instead of looping through all entities 3) Answer: Call ent:Activate() after you edit keyvalues.
[QUOTE=Robotboy655;40095155]1) Why would you do so[/QUOTE] Because Weathermod for example changes post processing effects..which can make the map dark, sunny, or whatever, but if you want to set it to dark then it makes everything dark(the outside environment and inside). This really doesn't make a good atmosphere. It would look nicer making the map dark, but having bright lights inside houses.
[QUOTE=Gaming_Unlim;40095413]Because Weathermod for example changes post processing effects..which can make the map dark, sunny, or whatever, but if you want to set it to dark then it makes everything dark(the outside environment and inside). This really doesn't make a good atmosphere. It would look nicer making the map dark, but having bright lights inside houses.[/QUOTE] If that's so, env_sun is not what you are looking for.
[QUOTE=Robotboy655;40095469]If that's so, env_sun is not what you are looking for.[/QUOTE] I was using weathermod as an example when you asked why I want to do this...my main goal here is just to change the lighting outside, which would be env_sun( I don't see a light_environment entity on the map ). [B]Edit:[/B] Nevermind just read this on valves page [CODE]The env_sun Entity does not contribute any actual lighting.[/CODE]
light_environment gets deleted when the map loads. If you give it a name before you compile it, it won't get deleted and VRAD will compile additional lightmap data in to the map. Basically you can do a day/night cycle but only if you modify the map to do so. What you probably want to do: - Modify the skybox during night - Modify env_sun to emulate the sun going down and disable shadows during night. - Modify light_envrioment (i think only the Ambient keyvalue can be changed dynamically)
Sorry, you need to Log In to post a reply to this thread.