Saiaku Posted February 9, 2015 Posted February 9, 2015 Hello. I have a shader that periodically appears that a light goes off and on.I would like to tie a light entity to it so that the light entity turns on at the same time the shader transitions. However, as far as I've experimented it seems that timing for shaders and game entities run differently, they become out of sync. So is there any way to directly connect the entity to the shader so that the light acts when the shader changes?
Lazarus Posted February 9, 2015 Posted February 9, 2015 What you could do is script a func_usable to change texture constantly, and tie that with a light entity. In my oppinion that would be more powerfull. You need to add a target_activate and target_deactivate though.
Didz Posted February 9, 2015 Posted February 9, 2015 Yeah this would basically be easier done by scripting the transitions rather than using shader animations. You can toggle a light entity, while toggling the appearance/disappearance of the geometry that should show up based on the state of the light. I think the entity to use for the brushwork is func_wall, but it's been a while.
Saiaku Posted February 10, 2015 Author Posted February 10, 2015 The reason I wanted to use the shader's timing is because I wanted the lights to turn on at the same time my day and night cycle runs.Entities seem to run out of sync from shaders even though they both start at the same time, but I guess an alternative is to drop my idea of automatic on/off and rather have them func_usable with anim stages and button instead.I'll try it out
Didz Posted February 10, 2015 Posted February 10, 2015 Using light styles on light entities should stay in-sync with shaders, but these are limited to the preset styles that the game gives you. (These have a maximum phase of 1.6 seconds) So light styles would be an option if your entire day/night cycle was done in 1.6 seconds
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now