Raised This Month: $ Target: $400
 0% 

get water entity index where player is swimming.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-22-2013 , 10:59   get water entity index where player is swimming.
Reply With Quote #1

Hello,

If i register touch and player touch water nothing happen, there is no way what i know to get water id where player/entity is in it.
How can i do it?
Thanks!
.Dare Devil. is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-22-2013 , 11:56   Re: get water entity index where player is swimming.
Reply With Quote #2

In PreThink check pev(index, pev_waterlevel).
Or you can check the entities near you with find_ent_in_sphere (searching for "func_water")

Last edited by didoWEE; 04-22-2013 at 11:59.
didoWEE is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-22-2013 , 12:05   Re: get water entity index where player is swimming.
Reply With Quote #3

Quote:
Originally Posted by didoWEE View Post
In PreThink check pev(index, pev_waterlevel).
Or you can check the entities near you with find_ent_in_sphere (searching for "func_water")
please no find_ent_in_sphere or other find_ent_
they check all entities and check radius/origin all in same time.
when i use this in prethink it will be very horrible.
There must be an ohter way

Last edited by .Dare Devil.; 04-22-2013 at 12:06.
.Dare Devil. is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-22-2013 , 12:10   Re: get water entity index where player is swimming.
Reply With Quote #4

What about
Quote:
Originally Posted by didoWEE View Post
pev(index, pev_waterlevel)
didoWEE is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-22-2013 , 12:12   Re: get water entity index where player is swimming.
Reply With Quote #5

Quote:
Originally Posted by didoWEE View Post
What about
you cant get water entity index with that as long as i know.

Last edited by .Dare Devil.; 04-22-2013 at 12:12.
.Dare Devil. is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-22-2013 , 12:17   Re: get water entity index where player is swimming.
Reply With Quote #6

Try with
pev(index, pev_flags) & FL_INWATER

Last edited by didoWEE; 04-22-2013 at 12:18.
didoWEE is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-22-2013 , 12:21   Re: get water entity index where player is swimming.
Reply With Quote #7

Quote:
Originally Posted by didoWEE View Post
Try with
pev(index, pev_flags) & FL_INWATER
No, do you even know what i mean by water entity index?
Not water level, not " is player or entity in water" but water entity id
so i can get for example water pev( ent, pev_mins, mins ) or maxs or what ever...
.Dare Devil. is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 04-22-2013 , 12:39   Re: get water entity index where player is swimming.
Reply With Quote #8

search for the nearest water entity using find_ent_in_sphere?
Backstabnoob is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-22-2013 , 14:14   Re: get water entity index where player is swimming.
Reply With Quote #9

is there any ohter way to do this?
.Dare Devil. is offline
teh ORiON
Member
Join Date: Sep 2011
Location: Denmark
Old 04-22-2013 , 15:11   Re: get water entity index where player is swimming.
Reply With Quote #10

So the problem is that when a player interacts with func_water it is a bit more complex than just your generic entity ::touch.

The engine calls the PM function PM_CheckWater to check whether or not the player is interacting with water and the depth he is at (and what type of water it is). The func_water entity index is never passed in any way when the player is "touching" the water. It is only concerned about waterlevel and watertype.

Spoiler
teh ORiON is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode