Raised This Month: $ Target: $400
 0% 

Getting brush entity height


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-25-2013 , 12:38   Getting brush entity height
Reply With Quote #1

Hello Allied Modders!
Im trying to get nonsolid brush entity height but...

Code:
PHP Code:
        pevidpev_origino1 )
        static 
Float:end[3], Float:end2[3], trFloat:dd
        xs_vec_sub
o1Float:{ 0.00.0, -9999.0 }, end )
        
engfuncEngFunc_TraceLineo1endIGNORE_MONSTERS0tr )
        
get_tr2trTR_vecEndPosend )
        
set_peventpev_movetypeMOVETYPE_TOSS )
        
set_peventpev_solidSOLID_BBOX )
        
set_peventpev_originFloat:{ 0.00.00.0 } )
        
        
xs_vec_subendFloat:{ 0.00.09999.0 }, end2 )
        
engfuncEngFunc_TraceLineendend2IGNORE_MONSTERS0tr )
        
get_tr2trTR_vecEndPosend2 )
        
dd end2[2] - o1[2]
        
pn_print1"dist:%f org: %f/%f/%f"ddend[2], end2[2], o1[2] )
        
entity_set_int(entEV_INT_solidSOLID_TRIGGER)
        
entity_set_int(entEV_INT_movetypeMOVETYPE_NOCLIP)
        
set_peventpev_originFloat:{ 0.00.00.0 } ) 
Last traceline go through the entity...
Mayby someone can correct my code and tell me what i did wrong.
And as always, thanks!

Last edited by .Dare Devil.; 05-25-2013 at 12:38.
.Dare Devil. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-25-2013 , 13:01   Re: Getting brush entity height
Reply With Quote #2

Send SetOrigin or SetSize, set pev_origin has no effect.
Anyway, origin is not used with brush entities, so for your start and end trace position, you have to deal with absmin and absmax.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-25-2013 at 13:03.
ConnorMcLeod is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-29-2013 , 17:28   Re: Getting brush entity height
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
Send SetOrigin or SetSize, set pev_origin has no effect.
Anyway, origin is not used with brush entities, so for your start and end trace position, you have to deal with absmin and absmax.
uh, still having problems with that
PHP Code:
        static Float:end[3], Float:end2[3], trFloat:dd
        pev
entpev_absmaxo6 )
        
peventpev_absmin)
        
xs_vec_subo1Float:{ 0.00.0, -9999.0 }, end )
        
engfuncEngFunc_TraceLineo1endIGNORE_MONSTERS0tr )
        
get_tr2trTR_vecEndPosend )
        
set_peventpev_movetypeMOVETYPE_TOSS )
        
set_peventpev_solidSOLID_BBOX )
        
set_peventpev_absmino6 )
        
entity_set_origin(entFloat:{ 0.2,0.2,0.2}) 
        
// entity_set_size(ent, o6, v) // this say that min/max backwards:: it was bacwards, i fix it but still setting size not helping.
        // also, each time when this code run somehow the entity size (absmin&max) get bigger every time, caused by entity_set_size
        
xs_vec_subendFloat:{ 0.00.09999.0 }, end2 )
        
engfuncEngFunc_TraceLineendend2IGNORE_MONSTERS0tr )
        
get_tr2trTR_vecEndPosend2 )
        
dd end2[2] - o1[2]
        
pn_print1"dist:%f org: %f/%f(%f)/%f"ddend[2], end2[2], ps(idps_water_height), o1[2] )
        
// ps(id, ps_water_height) return a value here entity height should be.
        // because brush entity can have many heights i cant use it because i can get ohter heights, only the higher point.
        
entity_set_int(entEV_INT_solidSOLID_TRIGGER)
        
entity_set_int(entEV_INT_movetypeMOVETYPE_NOCLIP)
        
set_peventpev_absmino6 )
        
entity_set_origin(entFloat:{ 0.1,0.1,0.1})
        
// entity_set_size(ent, o6, v) 
Mayby i didint get that what you exacly meant.

Last edited by .Dare Devil.; 05-29-2013 at 17:35.
.Dare Devil. is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-29-2013 , 17:54   Re: Getting brush entity height
Reply With Quote #4

oh right SOLID_BSP not SOLID_BBOX because of flag IGNORE_MONSTERS.
Stupid me...

Oh ConnorMcLeod, what i would do without you. Thank you so much!
.Dare Devil. 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 16:26.


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