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

Question: Beacon Sprite & TF2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Scuzzy
Senior Member
Join Date: Oct 2007
Old 01-22-2008 , 23:48   Question: Beacon Sprite & TF2
Reply With Quote #1

A while back I was looking to change the player model to have a teleporter effect to mimic some "trouble maker" functionality we had in TFC. I've changed direction on that a bit now. I've added a halo above their head that blinks every few seconds to mark them, which works very well:


(btw thanks to turbo for being a guinypig, he's a long term player and not a trouble maker at all)

Anyway, the system tags someone if they've had a temp ban, two or more kicks, or have been manually "tagged" and puts this halo above them.

Obviously though, the problem is that when they move the halo doesn't move with them, it remains where it was drawn (which I did expect). I was curious, is there anyway to tie a sprite to a player model so that it follows the person?

Scuzzy
Scuzzy is offline
KMFrog
Senior Member
Join Date: Oct 2007
Old 01-23-2008 , 08:58   Re: Question: Beacon Sprite & TF2
Reply With Quote #2

what code are you using to create the sprite?
__________________
Was I helpful or not? Rate Me!
KMFrog is offline
Scuzzy
Senior Member
Join Date: Oct 2007
Old 01-23-2008 , 16:39   Re: Question: Beacon Sprite & TF2
Reply With Quote #3

Code:
 new Float:vec[3];
 GetClientAbsOrigin(client, vec);
 vec[2] += 90;
 TE_SetupBeamRingPoint(vec, 10.0, 50.0, g_BeamSprite, g_HaloSprite, 0, 15, 0.5, 5.0, 0.0, greyColor, 10, 0);
 TE_SendToAll();
 
 if (team == 2)
 {
  TE_SetupBeamRingPoint(vec, 10.0, 50.0, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, redColor, 10, 0);
 }
 else if (team == 3)
 {
  TE_SetupBeamRingPoint(vec, 10.0, 50.0, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, blueColor, 10, 0);
 }
 else
 {
  TE_SetupBeamRingPoint(vec, 10.0, 50.0, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, greenColor, 10, 0);
 }
 
 TE_SendToAll();
Scuzzy is offline
KMFrog
Senior Member
Join Date: Oct 2007
Old 01-24-2008 , 11:35   Re: Question: Beacon Sprite & TF2
Reply With Quote #4

check out this, http://developer.valvesoftware.com/wiki/Env_beam

Quote:
  • SetParent <target_destination>
Changes the entity's parent in the movement hierarchy.
  • SetParentAttachment <string>
Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
  • SetParentAttachmentMaintainOffset <vector> [Episode One Update]
Change this entity to attach to a specific attachment point on it's parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment. The entity will maintain it's position relative to the parent at the time it is attached.
I'm guessing if you cant do it with the API your using now, you could try a lower level one and set up the parent & attach..

Ive never done this, so maybe it wont work ;]
__________________
Was I helpful or not? Rate Me!
KMFrog is offline
Scuzzy
Senior Member
Join Date: Oct 2007
Old 01-24-2008 , 20:26   Re: Question: Beacon Sprite & TF2
Reply With Quote #5

Quote:
Originally Posted by KMFrog View Post
check out this, http://developer.valvesoftware.com/wiki/Env_beam

I'm guessing if you cant do it with the API your using now, you could try a lower level one and set up the parent & attach..

Ive never done this, so maybe it wont work ;]
I've been looking at this, but translating the valve wiki into calls is more then likely far beyond my capabilities. I do appreciate it, and will keep at it, thanks.
Scuzzy is offline
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 01-28-2008 , 10:11   Re: Question: Beacon Sprite & TF2
Reply With Quote #6

One of the issues with using the entity SetParent is that it requires a named target entity. By default, player entities do not have target_name's. I'm not sure you can set one, I haven't tried yet.
__________________
I'm a blast from the past!
ferret 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 08:54.


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