Page 2 of 2
Re: fill a dungeon dug out with water?
Posted: Sat Dec 27, 2014 6:54 am
by Mentok
Drakkan wrote:actually it is possible...
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,
}
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.
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.

Re: fill a dungeon dug out with water?
Posted: Sat Dec 27, 2014 7:39 am
by minmay
Mentok wrote:Drakkan wrote:actually it is possible...
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,
}
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.
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.

I think both of you are encountering a similar problem.
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.
Re: fill a dungeon dug out with water?
Posted: Sun Dec 28, 2014 9:20 am
by Mentok
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?
Posted: Mon Jan 26, 2015 11:28 pm
by Granamir
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.

1st question: i guess is not possible unless we discover which variable tell u'r underwater and where it is ...and obviously can overwrite it
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?
Posted: Tue Jan 27, 2015 4:28 am
by Isaac
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.

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.
*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
Note: Setting the elevation below floor level is handled by the engine, but setting it above the ceiling can spawn the party in the void.