AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Question: Beacon Sprite & TF2 (https://forums.alliedmods.net/showthread.php?t=66067)

Scuzzy 01-22-2008 23:48

Question: Beacon Sprite & TF2
 
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:

http://www.oldtimersclan.com/post_img/player_tagged.jpg
(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

KMFrog 01-23-2008 08:58

Re: Question: Beacon Sprite & TF2
 
what code are you using to create the sprite?

Scuzzy 01-23-2008 16:39

Re: Question: Beacon Sprite & TF2
 
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();


KMFrog 01-24-2008 11:35

Re: Question: Beacon Sprite & TF2
 
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 ;]

Scuzzy 01-24-2008 20:26

Re: Question: Beacon Sprite & TF2
 
Quote:

Originally Posted by KMFrog (Post 577902)
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.

ferret 01-28-2008 10:11

Re: Question: Beacon Sprite & TF2
 
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.


All times are GMT -4. The time now is 05:26.

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