Directional Lights

I’m working on improving the Combine Light addon by Robinkooli for NutScript HL2RP.

After initially fixing it to be spawnable, I now want to modify it to emit a directional light (similar to the one you can spawn with the tool gun) but the way the GMod STool does it seems pretty complicated and flat out too much for a entity that’s supposed to just emit a light… Does anybody know a quick and good way to do that? The light doesn’t need to be toggle-able.

I assume you mean env_projectedtexture. Fill’s out what you’re asking, heres a

link.https://developer.valvesoftware.com/wiki/Env_projectedtexture

It’s pretty simple actually, spawn the entity, parent to something else, set all the required key values, done. You can find code example in that very tool.

Thanks for the replies, I figured it out.

For further reference,



	self.dlight = ents.Create( "env_projectedtexture" )

		self.dlight:SetParent( self.Entity )
		self.dlight:SetLocalPos( Vector( -8, 0, 0 ) )
		self.dlight:SetLocalAngles( Angle( 0, 180, 0 ) )

		self.dlight:SetKeyValue( "enableshadows", 1 )
		self.dlight:SetKeyValue( "shadowquality", 1 )
		self.dlight:SetKeyValue( "farz", 500 )
		self.dlight:SetKeyValue( "nearz", 12)
		self.dlight:SetKeyValue( "lightfov", 155)
		self.dlight:SetKeyValue( "lightcolor", "125 200 255 600")
		self.dlight:Spawn()
		self.dlight:Input( "SpotlightTexture", NULL, NULL, "effects/flashlight/hard.vtf" )