Raised This Month: $32 Target: $400
 8% 

TE_SetupBeamFollow - appears in front of face?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Remy Lebeau
Senior Member
Join Date: Dec 2009
Location: Sydney, Australia
Old 03-12-2015 , 20:35   TE_SetupBeamFollow - appears in front of face?
Reply With Quote #1

So I've been playing around a little bit with TE_SetupBeamFollow (in CounterStrike:Source).

It's great fun. The only downside is that the beam start point is right in front of the players face, meaning that it gets in the way of players actually being able to see!

Does anyone have a suggestion for how I could either spawn the TE slightly behind the player, or an alternate that does something similar?

Thanks!

EDIT: Further experiments suggest this is only the case for the T models, not the CT! I guess the attachment point must be different

Last edited by Remy Lebeau; 03-12-2015 at 20:44.
Remy Lebeau is offline
xf117
Senior Member
Join Date: Mar 2010
Location: Russia
Old 03-13-2015 , 10:00   Re: TE_SetupBeamFollow - appears in front of face?
Reply With Quote #2

You can attach it to the client's weapon.

Also you can create an entity and position it anywhere you want relatively to player. Then mark the player as parent for that entity(this will force entity's position move with the player). After that use TE on the entity.
xf117 is offline
Send a message via ICQ to xf117
Remy Lebeau
Senior Member
Join Date: Dec 2009
Location: Sydney, Australia
Old 03-25-2015 , 18:47   Re: TE_SetupBeamFollow - appears in front of face?
Reply With Quote #3

Thanks for the idea.

How would I go about finding the correct entity? Say for example I wanted to attach it to a player's knife, how do I work that out?
Remy Lebeau is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-25-2015 , 19:15   Re: TE_SetupBeamFollow - appears in front of face?
Reply With Quote #4

Quote:
Originally Posted by xf117 View Post
Also you can create an entity and position it anywhere you want relatively to player. Then mark the player as parent for that entity(this will force entity's position move with the player). After that use TE on the entity.
That's alot of work, you're better off just making a env_spritetrail at that point.
Mitchell is offline
Remy Lebeau
Senior Member
Join Date: Dec 2009
Location: Sydney, Australia
Old 03-26-2015 , 04:06   Re: TE_SetupBeamFollow - appears in front of face?
Reply With Quote #5

Quote:
Originally Posted by Mitchell View Post
That's alot of work, you're better off just making a env_spritetrail at that point.
The problem isn't creating the trail, the problem is what to attach it to ... Surely if I make an env_spritetrail I still have to attach it to something right?

I'm after guidance as to how I can attach this to a player in a way that isn't directly to the head...
Remy Lebeau is offline
Remy Lebeau
Senior Member
Join Date: Dec 2009
Location: Sydney, Australia
Old 03-26-2015 , 04:09   Re: TE_SetupBeamFollow - appears in front of face?
Reply With Quote #6

Ah, found an example:

Quote:
new entityToFollow = GetPlayerWeaponSlot(client, 2);
if (entityToFollow == -1)
entityToFollow = client;

new color[4];
Array_Copy(g_trails[client][TrailColor], color, sizeof(color));

TE_SetupBeamFollow(entityToFollow,
g_trails[trail][TrailModelIndex],
0,
g_trails[trail][TrailLifetime],
g_trails[trail][TrailWidth],
g_trails[trail][TrailEndWidth],
g_trails[trail][TrailFadeLength],
color);
TE_SendToAll();

return true;
Remy Lebeau is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-26-2015 , 09:15   Re: TE_SetupBeamFollow - appears in front of face?
Reply With Quote #7

Quote:
Originally Posted by Remy Lebeau View Post
The problem isn't creating the trail, the problem is what to attach it to ... Surely if I make an env_spritetrail I still have to attach it to something right?

I'm after guidance as to how I can attach this to a player in a way that isn't directly to the head...
If you attach an env_spritetrail you can attach it to any attachment point of the player, or his origin. The attaching is the least of your problems with env_spritetrail. The TE_ way you cannot tell the temp entity where to attach it to, I figured it was obvious when i posted that. Temp Ents will only last a handful of seconds before they are deleted again.

Last edited by Mitchell; 03-26-2015 at 09:16.
Mitchell is offline
Remy Lebeau
Senior Member
Join Date: Dec 2009
Location: Sydney, Australia
Old 03-26-2015 , 18:14   Re: TE_SetupBeamFollow - appears in front of face?
Reply With Quote #8

Quote:
Originally Posted by Mitchell View Post
If you attach an env_spritetrail you can attach it to any attachment point of the player, or his origin. The attaching is the least of your problems with env_spritetrail. The TE_ way you cannot tell the temp entity where to attach it to, I figured it was obvious when i posted that. Temp Ents will only last a handful of seconds before they are deleted again.
I haven't done any work at all with env_spritetrails, sorry, and have only gotten as far as attaching TempEnts directly to entities without specifying attachment point! I really appreciate your help in learning this, and it looks like (from your comments) than an env_spritetrail could be a better solution for what I'm after.

Can you point me in the direction of the functions I need to become familiar with to use env_spritetrail, and also work out attachment points?

Thanks!
Remy Lebeau 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 18:42.


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