Jump to content

SetFogMode true or false with LUA line??


Russell
 Share

Recommended Posts

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!!

Link to comment
Share on other sites

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. :-)

Link to comment
Share on other sites

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...

☺️☺️☺️☺️

 

  • Like 1
  • Haha 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...