Raised This Month: $ Target: $400
 0% 

right above water


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 05-25-2010 , 01:12   right above water
Reply With Quote #1

I have an "info_target" point entity in the func_water brush entity and I want to discover a point in the Z axis that is right above the boundaries of func_water entity the "info_target" entity is in. So the X and Y coords for this point would be the same as "info_target" and Z coords would've been right above the water model - not the water origin point, but the whole water model. Hope you did understand.


[IMG]http://img192.**************/img192/862/lolz1y.png[/IMG]

My first thought would be getting the index and then origin of the func_water the info_target is in, then getting the entity size and adding "entity z size /2" to the z coord of func_water.
__________________

Last edited by Voi; 05-25-2010 at 01:22.
Voi is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-25-2010 , 17:39   Re: right above water
Reply With Quote #2

Why don't you try what you thought of?

Code:
// iEntity = func_water entity new Float:vecAbsMin[ 3 ], Float:vecAbsMax[ 3 ]; entity_get_vector( iEntity, EV_VEC_absmin, vecAbsMin ); entity_get_vector( iEntity, EV_VEC_absmax, vecAbsMax ); // origin = ( absmin + absmax ) / 2 new Float:vecOrigin[ 3 ]; xs_vec_add( vecAbsMin, vecAbsMax, vecOrigin ); xs_vec_div_scalar( vecOrigin, 2.0, vecOrigin ); // keep the maximum height vecOrigin[ 2 ] = vecAbsMax[ 2 ];
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 05-25-2010 , 18:48   Re: right above water
Reply With Quote #3

Yeah but i don't know how to get the index of func_water the info_target would be in.
__________________
Voi is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 05-25-2010 , 19:24   Re: right above water
Reply With Quote #4

use find_ent_by_class(iIndex, const szClass[]) with "func_water" and compare the info_target's origin to the mins/maxs of the func_water to see if it is corresponding func_water entity.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 05-26-2010 , 00:10   Re: right above water
Reply With Quote #5

Quote:
Originally Posted by Emp` View Post
use find_ent_by_class(iIndex, const szClass[]) with "func_water" and compare the info_target's origin to the mins/maxs of the func_water to see if it is corresponding func_water entity.
This isn't working when you have func_water based on multiple brushes(for example de_aztec). I would rather need to check touch at one frame only. I would register touch, but i don't need to check touch every frame, so it would be a waste of resources. I would need something like:

Code:
get_entity_touching(ent, classname)
__________________

Last edited by Voi; 05-26-2010 at 00:27.
Voi 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 05:17.


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