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

Inside a brush?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 06-06-2011 , 22:37   Inside a brush?
Reply With Quote #1

I'm creating a mod that needs to detect if a player is within the bounding box of a entity brush, lets say for example, a "trigger_hurt" entity.

Has anyone seen a previous plugin, or know a way to detect if a player is inside a brush?

Thanks
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
Nail
BANNED
Join Date: May 2008
Location: PetrovЪ GradЪ
Old 06-07-2011 , 13:34   Re: Inside a brush?
Reply With Quote #2

for trigger_multiple i use
HookSingleEntityOutput(ent, "OnStartTouch", StartTouch, false); - inside
HookSingleEntityOutput(ent, "OnEndTouch", EndTouch, false); - outside
Nail is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 06-07-2011 , 16:06   Re: Inside a brush?
Reply With Quote #3

Yes, you either spawn a trigger_multiple with the same mins and maxs as your trigger_hurt and hook the above outputs or do some pretty cpu intensive calculation each frame or player think to check, if the player's origin is inside the rectangle. I think the Death Zone plugin has such a function.
__________________
Peace-Maker is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 06-07-2011 , 18:30   Re: Inside a brush?
Reply With Quote #4

use sdkhooks touch hook. most trigger type brushes are non solid but still fire touch callbacks.
blodia is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 06-08-2011 , 14:47   Re: Inside a brush?
Reply With Quote #5

I tried the following on the brush trigger_hurt, and they did not work.

1) Tried this after you posted it, good idea, but failed.
Quote:
Originally Posted by Nail View Post
for trigger_multiple i use
HookSingleEntityOutput(ent, "OnStartTouch", StartTouch, false); - inside
HookSingleEntityOutput(ent, "OnEndTouch", EndTouch, false); - outside

2) Tried this before posting on here. Failed.
Quote:
Originally Posted by blodia View Post
use sdkhooks touch hook. most trigger type brushes are non solid but still fire touch callbacks.
Have yet to try peace-maker's suggestion, or to try Nail's suggestion with a trigger_multiple.
------------

Update: The trigger multiple under Nail's example worked. A note to those trying this, make sure when editing the map, the entity's flags are set for clients and bots.
:>
__________________


Last edited by mysticssjgoku4; 06-08-2011 at 15:23.
mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
KawMAN
SourceMod Donor
Join Date: Sep 2007
Location: Cracov
Old 06-09-2011 , 03:38   Re: Inside a brush?
Reply With Quote #6

I think OnStartTouch on trigger_hurt is fired only when it hurt someone
Quote:
OnStartTouch
Fired when an entity starts touching this trigger. The touching entity must pass this trigger's filters to cause this output to fire. (activator is the toucher)
maybe try to use TR_TraceHull*
__________________
KawMAN is offline
Send a message via ICQ to KawMAN Send a message via Skype™ to KawMAN
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 01:46.


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