Raised This Month: $ Target: $400
 0% 

[help] entity front


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
katna
Senior Member
Join Date: May 2010
Old 04-05-2011 , 14:25   [help] entity front
Reply With Quote #1

i have 2 entities and i need to detect a third entity touch, from forward only if the third entity touch from background just put a invisible wall to block only the third entity:
view pic.
if E3 touch E1/E2 from back = Block
if E3 touch E1/E2 from front = Print chat message

my question is how can i detect from where did he touch E1/E2. from front or back
katna is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-05-2011 , 17:15   Re: [help] entity front
Reply With Quote #2

Are E1/E2 players?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
katna
Senior Member
Join Date: May 2010
Old 04-06-2011 , 00:45   Re: [help] entity front
Reply With Quote #3

none of them are players
Edit: S1 / S2 are SOLID_TRIGGER. detect touch isn't a problem, the point is how can i detect from where did E3 touch E1 or E2

Last edited by katna; 04-06-2011 at 00:58.
katna is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-06-2011 , 01:03   Re: [help] entity front
Reply With Quote #4

Just do an origin check.
It will require some testing unless you know the directions of the entities.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
katna
Senior Member
Join Date: May 2010
Old 04-06-2011 , 01:13   Re: [help] entity front
Reply With Quote #5

the directions isn't always the same. I tried several times , but i guess another try wont hurt
katna is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-06-2011 , 01:23   Re: [help] entity front
Reply With Quote #6

If the entities can move, you can check their angles to see if it is the front/back.
Otherwise, they would be in the same position/direction all the time so you would just need to check origins.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
katna
Senior Member
Join Date: May 2010
Old 04-06-2011 , 01:41   Re: [help] entity front
Reply With Quote #7

Quote:
Originally Posted by Exolent[jNr] View Post
If the entities can move, you can check their angles to see if it is the front/back.
Otherwise, they would be in the same position/direction all the time so you would just need to check origins.
No, they can't move. i mean the direction is different for every map. Every map has his own origins.
katna is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-06-2011 , 03:01   Re: [help] entity front
Reply With Quote #8

What type of entities are you trying to detect?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
katna
Senior Member
Join Date: May 2010
Old 04-06-2011 , 10:53   Re: [help] entity front
Reply With Quote #9

e1 and e2 are nets.
Code:
ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
	
	if (ent) {
		engfunc(EngFunc_SetOrigin, ent, fCenter)
		
		set_pev(ent, pev_classname, "JailNet")
	
		dllfunc(DLLFunc_Spawn, ent)
	
		set_pev(ent, pev_movetype, MOVETYPE_FLY)
		set_pev(ent, pev_solid, SOLID_TRIGGER)
	
		engfunc(EngFunc_SetSize, ent, fMins, fMaxs)
	}
s3 is the ball SOLID_BBOX and movetype MOVETYPE_BOUNCE
katna is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-06-2011 , 14:53   Re: [help] entity front
Reply With Quote #10

If the map does not already have solid goals (walls/nets around a box to make a soccer (or futbol) goal), then you could create solid entities around the SOLID_TRIGGER entities such that the ball can only touch from one side.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 20:07.


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