I'm trying to adapt a day/night addon to work with a map that doesn't have an env_sun. I have done this so far
[code]
if #ents.FindByClass("env_sun") >= 1 then
SW.Sun = ents.FindByClass("env_sun")[1]
SW.Sun:SetKeyValue( "targetname", "sun" )
SW.Sun:SetKeyValue( "use_angles", "YES" )
SW.Sun:SetKeyValue( "size", 16 )
SW.Sun:SetKeyValue( 'material' , 'sprites/light_glow02_add_noz.vmt' )
SW.Sun:SetKeyValue( 'overlaymaterial' , 'sprites/light_glow02_add_noz.vmt' )
else
SW.Sun = ents.Create("env_sun")
SW.Sun:SetKeyValue( "targetname", "sun" )
SW.Sun:SetKeyValue( "use_angles", "YES" )
SW.Sun:SetKeyValue( "size", 16 )
SW.Sun:SetKeyValue( 'material' , 'sprites/light_glow02_add_noz.vmt' )
SW.Sun:SetKeyValue( 'overlaymaterial' , 'sprites/light_glow02_add_noz.vmt' )
end
[/code]
And the sun appears, but the material doesn't seem to set, it appears as a strobing pink and black. Any solutions?
Spawn()
Activate()
Sorry, you need to Log In to post a reply to this thread.