Waterblock error
by Daniel Neilsen · in Torque Game Engine · 10/05/2002 (11:56 pm) · 5 replies
I have found an issue with waterblocks in my game
In one map I have two water blocks. Lets say the following applys:
Waterblock A - position x0-10 y0-10 z4-5
Waterblock B - position x0-10 y10-20 z1-2
This looks fine in game and plays fine except for one thing. If the player is at point 5,15,4.5 the engine think sthe player is in a waterblock even though the player is obviously not in the water.
In my game this causes problems as poeple are "drowning in the attic" heh
In one map I have two water blocks. Lets say the following applys:
Waterblock A - position x0-10 y0-10 z4-5
Waterblock B - position x0-10 y10-20 z1-2
This looks fine in game and plays fine except for one thing. If the player is at point 5,15,4.5 the engine think sthe player is in a waterblock even though the player is obviously not in the water.
In my game this causes problems as poeple are "drowning in the attic" heh
About the author
#2
10/06/2002 (12:46 am)
Even with the scale fo the waterblocks set to "128 128 1" this would make my water disappear. Anyone else have a solution?
#3
Now as I know very little C++ this is quite difficult for me so, if anyone has some pointers or can point me to some similiar pieces of code in the engine this would be most appreciated.
Just for clarification. I need to detect if the player is IN the actual waterblock.
10/10/2002 (5:10 pm)
What it looks like I am going to have to do is alter the engine code so that it determines the player colission with the waterblock correctly.Now as I know very little C++ this is quite difficult for me so, if anyone has some pointers or can point me to some similiar pieces of code in the engine this would be most appreciated.
Just for clarification. I need to detect if the player is IN the actual waterblock.
#4
I may not have read your initial entry correctly, but I think the problem is coming from setting the third value (what I think of as Z) to something other than 1.0. Have you tried setting it to 1.0 and seeing if you get this problem. The wet edges thing is true too. I've encountered a similar problem to yours (If I read it right). Unfortunately, when I set the Z value to 1.0 and I walk in the water, AND if I look at a certain angle, the water fog disapears. This is on my own list of things to figure out.
Best of luck,
Ed
10/10/2002 (5:30 pm)
Daniel,I may not have read your initial entry correctly, but I think the problem is coming from setting the third value (what I think of as Z) to something other than 1.0. Have you tried setting it to 1.0 and seeing if you get this problem. The wet edges thing is true too. I've encountered a similar problem to yours (If I read it right). Unfortunately, when I set the Z value to 1.0 and I walk in the water, AND if I look at a certain angle, the water fog disapears. This is on my own list of things to figure out.
Best of luck,
Ed
#5
What the problem is is this.
The engine detects if the players x,y coordinates is in line with a waterblock, which in this case is true (the player is OVER the lowest waterblock)
It then checks to see if a player is within the height of a water block. This is also true because my players is in the height of the highest waterblock and, even though the player is not in the x and y position of this waterblock, he will drown.
10/10/2002 (5:40 pm)
No,What the problem is is this.
The engine detects if the players x,y coordinates is in line with a waterblock, which in this case is true (the player is OVER the lowest waterblock)
It then checks to see if a player is within the height of a water block. This is also true because my players is in the height of the highest waterblock and, even though the player is not in the x and y position of this waterblock, he will drown.
Torque Owner D Player
Also, make sure that the water isn't scaled (128 128 1 is normal, as in demo missions).