Jump to content

Waterplane Hidden True/False


Paul Thomas
 Share

Recommended Posts

Not sure if anyone else had a problem but I couldn't hide the waterplane. I tend to set the waterplane first and then paint terrain. Extremely difficult to do with the underwater effect once I had finished painting around the water.

 

I fixed this by changing a few things in the environment_waterplane.lua file:

 

Remove "fw.renderer:SetWater(1)" from the object:Refresh() portion and place the "fw.renderer:SetWater(1)" under "object.model:SetKey("wavespeed","1.0") (or anywhere, just out of object:Refresh() but you can't remove it completely).

 

Within object:SetKey(key,value) add this before "else":

 

	elseif key == "hidden" then
		if value == "1" then
			fw.renderer:SetWater(0)
		elseif value == "0" then
			fw.renderer:SetWater(1)
		end

 

Hope this helps anyone.

 

At the moment I'm unsure if the property grid changes the text to lowercase, else you may have to change it to "Hidden." I had changed my default property grid so I don't exactly remember how it was before.

 

My default property grid for "Hidden" is:

 

group:AddProperty("hidden", PROPERTY_BOOL, "", "Hide")

 

I have to refresh the editor after changing the default property grid or it doesn't show up after saving. Not sure if it's just me or not.

Link to comment
Share on other sites

If your fw.renderer.DrawShadowText() isn't exposed to Lua (remove {hidden} for lugi.generator) and you want to use this function just add this (a fairly simple copy):

 

function DrawShadowText(text, x, y)
 SetColor(Vec4(0, 0, 0, 1))
 DrawText(text, x+1, y+1)
 SetColor(Vec4(1, 1, 1, 1))
 DrawText(text, x, y)
 SetColor(Vec4(1, 1, 1, 1))
end

 

I also added these lines within "constants/engine_const.lua"

 

--Blending
BLEND_NONE=0
BLEND_ALPHA=1
BLEND_LIGHT=2
BLEND_SHADE=3
BLEND_MOD2X=4

 

Didn't see it in any other Lua file.

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