Raised This Month: $51 Target: $400
 12% 

Check for two entities


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FEELiFE
Member
Join Date: Jul 2010
Old 07-19-2010 , 11:46   Check for two entities
Reply With Quote #1

How can I check that entity is in other entity?
I'm trying to make a plugin that blocks moving block on the barriere (base builder mod). I tried some things and i realized that I can't use touch. I tried with hamsandwitch and origins but it went mess. I save the door (zone) coordinates of the specified map in ini file.

Can someone make the plugin or tell me how to use tracehull. How it works and in which case i can use it?

Thanks..
FEELiFE is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 07-19-2010 , 15:58   Re: Check for two entities
Reply With Quote #2

If the base has a roof (as it should), you can do:

PHP Code:
static Float:fpOrigin[3]
entity_get_vector(iEntEV_VEC_originfpOrigin)

while (
point_contents(fpOrigin) == CONTENTS_EMPTY)
    
fpOrigin[2] += 5.0

// Check for sky and everything else you think you should check for 
Spunky is offline
Send a message via AIM to Spunky
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 07-19-2010 , 16:26   Re: Check for two entities
Reply With Quote #3

can it help to get distance to over head entity[roof] ?
AngeIII is offline
Send a message via Skype™ to AngeIII
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 07-19-2010 , 16:37   Re: Check for two entities
Reply With Quote #4

Yes.

PHP Code:
static Float:fpOrigin[3]
entity_get_vector(iEntEV_VEC_originfpOrigin)

static 
Float:fpSkyOrigin[3]
fpSkyOrigin[0] = fpOrigin[0]
fpSkyOrigin[1] = fpOrigin[1]
fpSkyOrigin[2] = fpOrigin[2]

new 
Float:fpDistance

while (point_contents(fpSkyOrigin) == CONTENTS_EMPTY)
    
fpSkyOrigin[2] += 5.0

fpDistance 
vector_distance(fpOriginfpSkyOrigin
Remove the check to see if it's sky, sorry.

Last edited by Spunky; 07-19-2010 at 18:36.
Spunky is offline
Send a message via AIM to Spunky
FEELiFE
Member
Join Date: Jul 2010
Old 07-20-2010 , 06:18   Re: Check for two entities
Reply With Quote #5

What is point_contents? Where is that function from and what it does?
FEELiFE is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 07-20-2010 , 06:25   Re: Check for two entities
Reply With Quote #6

thanks Spunky you realy help me ;)

FEELiFE -> this function check what "content" at a origins what you writen in.

engine:
PHP Code:
point_contents(origins
fakemeta:
PHP Code:
#define fm_point_contents(%1) engfunc(EngFunc_PointContents, %1) 
return this values:
PHP Code:
hlsdk_const.inc
// engfunc(EngFunc_PointContents, Float:origin) return values
#define    CONTENTS_EMPTY                  -1
#define    CONTENTS_SOLID                  -2
#define    CONTENTS_WATER                  -3
#define    CONTENTS_SLIME                  -4
#define    CONTENTS_LAVA                   -5
#define    CONTENTS_SKY                    -6
#define    CONTENTS_ORIGIN                 -7          // Removed at csg time
#define    CONTENTS_CLIP                   -8          // Changed to contents_solid
#define    CONTENTS_CURRENT_0              -9
#define    CONTENTS_CURRENT_90             -10
#define    CONTENTS_CURRENT_180            -11
#define    CONTENTS_CURRENT_270            -12
#define    CONTENTS_CURRENT_UP             -13
#define    CONTENTS_CURRENT_DOWN           -14
#define CONTENTS_TRANSLUCENT            -15
#define    CONTENTS_LADDER                 -16
#define    CONTENT_FLYFIELD                -17
#define    CONTENT_GRAVITY_FLYFIELD        -18
#define    CONTENT_FOG                     -19 
AngeIII is offline
Send a message via Skype™ to AngeIII
FEELiFE
Member
Join Date: Jul 2010
Old 07-20-2010 , 08:31   Re: Check for two entities
Reply With Quote #7

It won't work either.
Is there any other method that doesn't use origins?
FEELiFE is offline
FEELiFE
Member
Join Date: Jul 2010
Old 07-24-2010 , 03:55   Re: Check for two entities
Reply With Quote #8

Ideas?
FEELiFE 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 23:25.


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