I noticed that this code only seems to change where the water appears to be, you will still technically be underwater as soon as you step over it (rather than falling into it) as the "WaterSurface" is still set to 0. Hopefully, there is a way to offset the "WaterSurface", I tried myself but it said it did not support offset.Drakkan wrote:actually it is possible...
the problem is curently that if you use this inside dungeon, water surface is black. seems like some problems with shaders... Doridion was investigating it, perhpas he will find yout some solution. As for outdoor areas, its working ok. Hope it helped you a little.Code: Select all
defineObject{ name = "user_water_surface", base_object = "water_surface", components = { { class = "WaterSurface", fogColor = vec(0.021,0.045,0.13,0), fogDensity = 0.2, planeY = -0.4, reflectionColor = vec(0.693,0.81,0.9,0), refractionColor = vec(1,1,1,0), }, { class = "WaterSurfaceMesh", -- There you'll have to modify the Y offset to up/down the water level offset = vec(0,0,0,0), material = "water_surface_calm", underwaterMaterial = "water_surface_underwater", }, }, placement = "floor", editorIcon = 264, }
fill a dungeon dug out with water?
Re: fill a dungeon dug out with water?
Re: fill a dungeon dug out with water?
I think both of you are encountering a similar problem.Mentok wrote:I noticed that this code only seems to change where the water appears to be, you will still technically be underwater as soon as you step over it (rather than falling into it) as the "WaterSurface" is still set to 0. Hopefully, there is a way to offset the "WaterSurface", I tried myself but it said it did not support offset.Drakkan wrote:actually it is possible...
the problem is curently that if you use this inside dungeon, water surface is black. seems like some problems with shaders... Doridion was investigating it, perhpas he will find yout some solution. As for outdoor areas, its working ok. Hope it helped you a little.Code: Select all
defineObject{ name = "user_water_surface", base_object = "water_surface", components = { { class = "WaterSurface", fogColor = vec(0.021,0.045,0.13,0), fogDensity = 0.2, planeY = -0.4, reflectionColor = vec(0.693,0.81,0.9,0), refractionColor = vec(1,1,1,0), }, { class = "WaterSurfaceMesh", -- There you'll have to modify the Y offset to up/down the water level offset = vec(0,0,0,0), material = "water_surface_calm", underwaterMaterial = "water_surface_underwater", }, }, placement = "floor", editorIcon = 264, }
black surface: I believe water reflection/refraction is not updated if no underwater tiles are visible.
"only seems to change where the water appears to be" - that's because handling the appearance of water is all that WaterSurfaceComponent and WaterSurfaceMeshComponent do. I believe that whether the party is underwater does not depend on any of that, it simply depends on whether or not they are in an underwater tile.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: fill a dungeon dug out with water?
In an underwater tile and above elevation 0. I do hope someone figures how to change that. I just went ahead and pulled the water from a couple levels I had. I guess nobody has figured out how to change the elevation you spawn in the level below after falling down a pit either... These two things are really my only two irritations with what is otherwise a fantastic editor. 
Re: fill a dungeon dug out with water?
1st question: i guess is not possible unless we discover which variable tell u'r underwater and where it is ...and obviously can overwrite itMentok wrote:In an underwater tile and above elevation 0. I do hope someone figures how to change that. I just went ahead and pulled the water from a couple levels I had. I guess nobody has figured out how to change the elevation you spawn in the level below after falling down a pit either... These two things are really my only two irritations with what is otherwise a fantastic editor.
2nd question: if i remember well from skugg videos u just need to set height of level where u'r fallinig (top lef window, where level names and positions are)
btw i did some try changing height of water using setWorldPositionY() with no good results, but still results
Re: fill a dungeon dug out with water?
The water surface [model] can be moved easy enough; certainly raised or lowered within the cell... but when the party is below elevation 0, the engine assumes they are below the water level, and the refractions appear on the underside of the surface [looking up]. This happens even if the party is above the [user-altered] water level; from above, the water appears as transparent black with no highlights.Mentok wrote:In an underwater tile and above elevation 0. I do hope someone figures how to change that. I just went ahead and pulled the water from a couple levels I had. I guess nobody has figured out how to change the elevation you spawn in the level below after falling down a pit either... These two things are really my only two irritations with what is otherwise a fantastic editor.
*But for the starting location issue...
Add this to a script object on the initial map where the game starts.
Code: Select all
delayedCall(self.go.id, 0.001, "placeParty")
function placeParty()
party:setPosition(party.x,party.y,party.facing,-7, party.level)
end