View Single Post
vitorrossi
Senior Member
Join Date: Apr 2012
Location: NY, USA
Old 07-11-2017 , 13:40   Re: [INC] Beam Entities
Reply With Quote #37

I'm trying to use this stock to create a beam and register_touch with player.
It works fine if the beam is created parallel to two axis (i.e. X and Y, X and Z or Y and Z).
However if the beam is only parallel to one or no axis, touch is trigger anywhere within a box between the start and end points and not only along the beam (see image).
P.S. The beam is drawn correctly for all cases.

Spoiler


I've narrowed down to mins maxs and set_size being what causes this, which are called in Beam_RelinkBeam.
I'm guessing Half-Life (Counter-Strike) only creates block entities aligned with the X Y Z axis.
If so I'm not sure if there is a way to fix this, does anyone have any idea?


Edit: Can be fixed by checking with tracelines inside touch function whether the player is intercepting where the beam should be.
However touch hooks are called every frame if player continuously touches beam, not sure how much it would slow the server down.
Still interested in an easier fix if anyone knows how.

Spoiler

Last edited by vitorrossi; 07-11-2017 at 16:59.
vitorrossi is offline