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

[TF2] Player-Following Annotations Snippet


Post New Thread Reply   
 
Thread Tools Display Modes
Mitchell
~lick~
Join Date: Mar 2010
Old 12-30-2013 , 17:40   Re: [TF2] Player-Following Annotations Snippet
Reply With Quote #11

I dont think it would be 0-based, since adding 0 to any number would still be that number.. Think of it like subneting an ip.
Mitchell is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 12-31-2013 , 09:06   Re: [TF2] Player-Following Annotations Snippet
Reply With Quote #12

The problem with using the bitfield is that...
That one annoation will always be visible to those clients.
It's better to create ONE annotation per client, with it visible to just them, you can then also easily destroy the annoatation on demand, as only that one client will be seeing it. I just set the annotation to follow the viewer with super short lifetime.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 12-31-2013 at 09:08.
friagram is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 12-31-2013 , 09:21   Re: [TF2] Player-Following Annotations Snippet
Reply With Quote #13

Quote:
Originally Posted by friagram View Post
The problem with using the bitfield is that...
That one annoation will always be visible to those clients.
It's better to create ONE annotation per client, with it visible to just them, you can then also easily destroy the annoatation on demand, as only that one client will be seeing it. I just set the annotation to follow the viewer with super short lifetime.
Well basically, my original intent was to create player-following annotations for admins that would function as follows:

1. Would be visible when a player is looking at an admin, and go away when the player stops looking directly at the admin
2. Would disappear if the admin is a Spy and cloaks or disguises, and re-appear upon uncloaking/undisguising

I mean, if it worked like that, then this could potentially be recoded for plugins like VSH/FF2, where the bosses would have annotations that say the boss's name (i.e. "Saxton Hale!")
404UserNotFound is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 12-31-2013 , 09:34   Re: [TF2] Player-Following Annotations Snippet
Reply With Quote #14

Problem with annitations is that they scale /ignore z, and show on the border of the screen when the entity is not visible. You would have to do constant tracerays in a loop to show /hide them, and they annoyingly pop in each time they are spawned/renewed.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 12-31-2013 , 10:33   Re: [TF2] Player-Following Annotations Snippet
Reply With Quote #15

Quote:
Originally Posted by friagram View Post
Problem with annitations is that they scale /ignore z, and show on the border of the screen when the entity is not visible. You would have to do constant tracerays in a loop to show /hide them, and they annoyingly pop in each time they are spawned/renewed.
Oh yeah. I forgot about that. That actually happened to me when I used old code I forgot to update. The annotations were spazzing out on people's screens.
404UserNotFound is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 12-31-2013 , 11:10   Re: [TF2] Player-Following Annotations Snippet
Reply With Quote #16

I can still find a use for them.
Useful for Freezetag too, to point out frozen teammates to only 1 team.

Also for my custom gamemode im currently working on.

Last edited by Mitchell; 12-31-2013 at 11:10.
Mitchell is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 01-01-2014 , 08:31   Re: [TF2] Player-Following Annotations Snippet
Reply With Quote #17

Oh god freezetag, was like first mod I ever wrote, wonder if anyone even use it, lol.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 01-01-2014 , 09:49   Re: [TF2] Player-Following Annotations Snippet
Reply With Quote #18

Quote:
Originally Posted by friagram View Post
Oh god freezetag, was like first mod I ever wrote, wonder if anyone even use it, lol.
Freezetag is awesome!
404UserNotFound is offline
Geit
Senior Member
Join Date: Oct 2009
Location: Home
Old 01-01-2014 , 18:07   Re: [TF2] Player-Following Annotations Snippet
Reply With Quote #19

BuildBitString actually originally comes from this plugin: https://forums.alliedmods.net/showthread.php?t=139902

The way the visibilityBitfield works is much like Powerlord described: You have 32 bits in an integer which you can represent as 1 or 0 (can see or can't see), each bit maps the whether the annotation should be drawn on a given client's screen, for example the 24th bit controls client #24 - Unless I'm mistaken there is actually a bug with BuildBitString in that it'll always be displayed for client #1 (although I have a feeling the 1st bit is the visibility of the annotation to the "world").

It could also be improved massively by doing as Powerlord said and using bit-shifting as opposed to my little hack: "bitfield |= client^2"
Geit is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 01-01-2014 , 18:36   Re: [TF2] Player-Following Annotations Snippet
Reply With Quote #20

Quote:
Originally Posted by Geit View Post
BuildBitString actually originally comes from this plugin: https://forums.alliedmods.net/showthread.php?t=139902

The way the visibilityBitfield works is much like Powerlord described: You have 32 bits in an integer which you can represent as 1 or 0 (can see or can't see), each bit maps the whether the annotation should be drawn on a given client's screen, for example the 24th bit controls client #24 - Unless I'm mistaken there is actually a bug with BuildBitString in that it'll always be displayed for client #1 (although I have a feeling the 1st bit is the visibility of the annotation to the "world").

It could also be improved massively by doing as Powerlord said and using bit-shifting as opposed to my little hack: "bitfield |= client^2"
Well I don't know how to do any of that which is why I put the code out. Hopefully someone more knowledgeable than I can figure out something to use this for.
404UserNotFound is offline
Reply


Thread Tools
Display Modes

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 09:04.


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