Russell Posted April 27, 2020 Share Posted April 27, 2020 Hello team!! I hope you are ok on these strange days. I'm still working on my minigame for Steam. Today i'm trying to modify ROOT properties of my map with LUA for making one surprise and secret event in the game. And i need disable FOG... With this code: function Script:Oscurecer()--in world:SetFogMode("false") world:SetAmbientLight(0,0,0) world:SetSkybox("Materials/Sky/DarkStormy.mat") end function Script:Aclarar()--in world:SetFogMode("true") world:SetAmbientLight(0.35,0.35,0.35) world:SetSkybox("Materials/Sky/zonesky.mat") end All works OK except FOGMODE... SetFogMode command give me NIL VALUE error. I want Oscurecer() disable FOGMODE and Aclarar() enable it again... After looking in the forum, i'm not be abble to find what is the correct line of LUA for make this. world:SetFogMode("true") or false doesn't work for me... Anyone know what is the sintax of this line??? Thank you!! Quote Link to comment Share on other sites More sharing options...
Marcousik Posted April 27, 2020 Share Posted April 27, 2020 Try the function on the camera. Quote self.camera:SetFogMode(true) self.camera:SetFogMode(false) 1 Quote Link to comment Share on other sites More sharing options...
Russell Posted April 27, 2020 Author Share Posted April 27, 2020 4 hours ago, Marcousik said: Try the function on the camera. Thanks, but doesn't work for me... Nil value error too. This time "attemp to index field 'camera' (a nil value)" If i write Script.MainCamera=""--entity for save this error, appears again SetFogMode command line nil value of the beginning of this thread. I'm trying other things, if i obtain a solution, i will post the code here. :-) Quote Link to comment Share on other sites More sharing options...
Marcousik Posted April 27, 2020 Share Posted April 27, 2020 Did you try on the camera on your player script? After the camera is created, add the function to enable or disable the fog. I can remember I use this on the camera of the FPSplayer.lua and it was OK but well it is a while 1 Quote Link to comment Share on other sites More sharing options...
Russell Posted April 27, 2020 Author Share Posted April 27, 2020 1 hour ago, Marcousik said: Did you try on the camera on your player script? After the camera is created, add the function to enable or disable the fog. I can remember I use this on the camera of the FPSplayer.lua and it was OK but well it is a while Ooohh yeahhh!!! Thank you very much!!! Works marbellous now!! I've got one script with the commands of ROOT properties. But SetFogMode was driving me crazy!! It had not occurred to me use the "player" camera to set the fog mode. Now i'm complete!! Many Thanks!! I'm working on "secret" areas in my map, (achievement hidden areas), and one of those areas needs change global illumination, fogmode (and color) and the skybox... ☺️☺️☺️☺️ 1 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.