About Store Forum Documentation Contact
Donations:
327$/mo



Post Reply 
how to detect wheatern character under water or not
Author Message
Ceryni Offline
Member

Post: #1
how to detect wheatern character under water or not
hi,

i want to check weather the character is under a lake/river or not to set him on top to let him swim.

How can i do that cause water is no Game::obj and lakes and rivers arents detected with World.underWater(pos,depth)

and another question how du i acces the water area of a lake to set the depth
12-25-2011 06:53 PM
Find all posts by this user Quote this message in a reply
dragonfly3 Offline
Member

Post: #2
RE: how to detect wheatern character under water or not
Ctrl+Alt+RMB will allow you to set the depth of the water for lakes and rivers (you can find this and other helpful controls for settings bodies of water in the wiki)

I'm not familiar with the coding aspect for swimming in water but I thought I saw something on the forum at one time about this. I can't find it now but perhaps these threads concerning gravity and up/down movement will help start you in the right direction?
http://www.esenthel.com/community/showth...y+settings

http://www.esenthel.com/community/showth...y+settings
12-25-2011 08:40 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Ceryni Offline
Member

Post: #3
RE: how to detect wheatern character under water or not
thx for the links very interesting also for further development.

but the most important thing is how i can detect the collision between the char and the water surface

anybody else some idea?
12-25-2011 08:57 PM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #4
RE: how to detect wheatern character under water or not
Try:

Code:
if(Game::World.waterUnder(pos())!=NULL) {...}

www.thinkplaystudios.com
12-25-2011 09:25 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Ceryni Offline
Member

Post: #5
RE: how to detect wheatern character under water or not
Quote:How can i do that cause water is no Game::obj and lakes and rivers arents detected with World.underWater(pos,depth)

it seems like i doesnt work with lakes and rivers created in WE cause they have difrent levels
12-25-2011 10:36 PM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #6
RE: how to detect wheatern character under water or not
The issue might be somewhere else. I have this implemented where I have both lakes and rivers at higher elevation than the ocean, and you can take your chr and swim in any of them.

www.thinkplaystudios.com
12-26-2011 12:47 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Ceryni Offline
Member

Post: #7
RE: how to detect wheatern character under water or not
thx, it works my fold.

wanted to set watr depth later but my characters fell through the water and the force is already set so also turning off gravity didnt stop him.

it works fine now
12-26-2011 09:57 AM
Find all posts by this user Quote this message in a reply
Post Reply