• Disable fog on gmod
    5 replies, posted
Hi, i have create a script, but it is'nt functionnaly : [CODE]render.FogMode( 0 )[/CODE] Please how to disable fog with a script ? Bye !
I quickly got the file i use to change the players fog based on a statistica. I modified it to fit your problem. That being said you can use it and something like that will come out: HOWEVER if the Fog is MAP dependent it COULD not work! I am not sure! A try is a try though. EDIT: Put in clientsided autorun. Or include it somehow. Your choice. [lua] function SetupWorldFog() render.FogMode( MATERIAL_FOG_LINEAR ) render.FogStart( 0 ) render.FogEnd( 0 ) render.FogMaxDensity( 0 ) render.FogColor( 200, 200, 200 ) end hook.Add( "SetupWorldFog", "SpecialSetupWorldFog", SetupWorldFog ) [/lua] EDIT2: There is also something called a SkyBoxFog. Might include that as well. [lua] function SetupSkyboxFog() render.FogMode( MATERIAL_FOG_LINEAR ) render.FogStart( 0 ) render.FogEnd( 0 ) render.FogMaxDensity( 0 ) render.FogColor( 200, 200, 200 ) end hook.Add( "SetupSkyboxFog", "SpecialSetupSkyboxFog", SetupSkyboxFog ) [/lua]
[QUOTE=Zmeja;51886565]I quickly got the file i use to change the players fog based on a statistica. I modified it to fit your problem. That being said you can use it and something like that will come out: HOWEVER if the Fog is MAP dependent it COULD not work! I am not sure! A try is a try though. EDIT: Put in clientsided autorun. Or include it somehow. Your choice. [lua] function SetupWorldFog() render.FogMode( MATERIAL_FOG_LINEAR ) render.FogStart( 0 ) render.FogEnd( 0 ) render.FogMaxDensity( 0 ) render.FogColor( 200, 200, 200 ) end hook.Add( "SetupWorldFog", "SpecialSetupWorldFog", SetupWorldFog ) [/lua] EDIT2: There is also something called a SkyBoxFog. Might include that as well. [lua] function SetupSkyboxFog() render.FogMode( MATERIAL_FOG_LINEAR ) render.FogStart( 0 ) render.FogEnd( 0 ) render.FogMaxDensity( 0 ) render.FogColor( 200, 200, 200 ) end hook.Add( "SetupSkyboxFog", "SpecialSetupSkyboxFog", SetupSkyboxFog ) [/lua][/QUOTE] Thanks but this is not functionally because the fog is on the map
[QUOTE=SuperMicronde;51886656]Thanks but this is not functionally because the fog is on the map[/QUOTE] Then i guess you can't remove it without editing the map itself ;/
You can find the fog controller entity using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/ents/FindByClass]ents.FindByClass[/url] Then set its fog value using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetKeyValue]Entity:SetKeyValue[/url] Edit: Or you could just remove the controller [code] for k,v in pairs(ents.FindByClass("env_fog_controller")) do v:Remove() end [/code]
Thans it is functionally !
Sorry, you need to Log In to post a reply to this thread.