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

Extension\Plugin that draws invisible entities (And bounds if applicable)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Thraka
AlliedModders Donor
Join Date: Aug 2005
Old 08-14-2009 , 14:47   Extension\Plugin that draws invisible entities (And bounds if applicable)
Reply With Quote #1

In L4D (others maybe too) there is an entity named env_player_blocker. This entity is a point entity, and thus invisible. it also has these two properties that set the bounds of the entity (which blocks players from entering those bounds)
Code:
"origin" "6664 3918 608"
"mins" "-4 -90 -70"
"maxs" "4 80 80"
"initialstate" "1"
"BlockType" "0"
"classname" "env_player_blocker"
The mins and maxs set the bounds, creating a box of some sort. This is hard to create in the game as you can image, since you cannot visually see the bounds of the entity.

Can someone create a visualizer that would paint the bounds of this entity?

Some other handy things would be
1) Set entity position to where I'm pointing
2) Adjust entity XYZ position by VALUE
3) Set mins\max
4) set BlockType to 0,1,2
5) dump data out to text file of the current pointed-at entity
Thraka is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 08-14-2009 , 15:00   Re: Extension\Plugin that draws invisible entities (And bounds if applicable)
Reply With Quote #2

I don't think it's possible to create a brush entity from a plugin.

The closest a plugin can get is to check player position and teleport them out of the box. I have done that before.
__________________
Greyscale is offline
Thraka
AlliedModders Donor
Join Date: Aug 2005
Old 08-14-2009 , 17:15   Re: Extension\Plugin that draws invisible entities (And bounds if applicable)
Reply With Quote #3

Not create a brush entity, draw something on the screen. cant you draw lasers from one point to the other some how?
Thraka is offline
FrozenHaxor
Senior Member
Join Date: Jun 2009
Location: Poland
Old 08-17-2009 , 00:02   Re: Extension\Plugin that draws invisible entities (And bounds if applicable)
Reply With Quote #4

I think he need it to Stripper.
FrozenHaxor is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 08-17-2009 , 08:30   Re: Extension\Plugin that draws invisible entities (And bounds if applicable)
Reply With Quote #5

Quote:
Originally Posted by Thraka View Post
Not create a brush entity, draw something on the screen. cant you draw lasers from one point to the other some how?
Im not sure if there already is a way of drawing the entity box by just supplying its entity index, possibly with a command or whatnot. Anyhow, you surely can draw it yourself line by line. See TE_SetupBeamPoints (dont forget to send it after the set up... such a common mistake ).

Threw in a function that should help you get the absolute bounds of the entity to be drawn. Have fun working out the math how to draw each line, its not that hard but may take some time if you suck at maths like I do.

PHP Code:
//returns false if entity has no bounding box
bool:GetAbsBoundingBox(ent,Float:mins[3],Float:maxs[3]) {
    if(!
GetEntSendPropVector(ent,"m_vecMins",mins)) {
        return 
false
    
}

    
decl Float:origin[3]

    
GetEntPropVector(ent,Prop_Data,"m_vecAbsOrigin",origin)
    
GetEntPropVector(ent,Prop_Send,"m_vecMaxs",maxs)

    
mins[0] += origin[0]
    
mins[1] += origin[1]
    
mins[2] += origin[2]

    
maxs[0] += origin[0]
    
maxs[1] += origin[1]
    
maxs[2] += origin[2]

    return 
true
}

bool:GetEntSendPropVector(ent,const String:prop[],Float:vec[3]) {
    
decl String:class[32], offsPropFieldType:type

    
if(GetEntityNetClass(ent,class,sizeof class) && (offs FindSendPropInfo(class,prop,type)) != -&& type == PropField_Vector) {
        
GetEntDataVector(ent,offs,vec)
        return 
true
    
}

    return 
false

In case you dont feel like looking for a sprite to use with TE_SetupBeamPoints yourself, heres one Ive been using: "materials/sprites/bluelaser1.vmt".
__________________
plop
p3tsin 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 17:49.


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