Raised This Month: $7 Target: $400
 1% 

[TF2] Sentry Immunity


Post New Thread Reply   
 
Thread Tools Display Modes
Cookies.net
Senior Member
Join Date: Jan 2011
Old 02-24-2011 , 15:50   Re: [TF2] Sentry Immunity
Reply With Quote #11

Quote:
Originally Posted by Tylerst View Post
A fair suggestion, but out of curiousity, why does it matter?

Also, if I do use bitwise operators, shouldn't I use ^ instead of &~ ?

Just curious, If +- are going to cause a problem I'll change it but I'd like to know why it's a problem xD
^ (XOR) toggles the bit(s) e.g. 01101^11011=10110
&~ (NAND) removes the flag if its there, if not then it doesn't do anything e.g. 01101&~11011=00100

+ could be a problem if its used on someone with the flag and
- could be a problem if its used on someone without the flag to my understanding it could interfere with the other flags (correct me if I'm wrong, thats just how i understand it)
Cookies.net is offline
Tylerst
Veteran Member
Join Date: Oct 2010
Old 02-24-2011 , 16:00   Re: [TF2] Sentry Immunity
Reply With Quote #12

Quote:
Originally Posted by Cookies.net View Post
^ (XOR) toggles the bit(s) e.g. 01101^11011=10110
&~ (NAND) removes the flag if its there, if not then it doesn't do anything e.g. 01101&~11011=00100

+ could be a problem if its used on someone with the flag and
- could be a problem if its used on someone without the flag to my understanding it could interfere with the other flags (correct me if I'm wrong, thats just how i understand it)
Well, fair enough, plugin updated.

Just for reference though, in version 0.1.0(unreleased)before I added the current immunity check, and using + or - more than once on the same target seemed to act more as a switch.

IE:
sm_sentryimmunity @me 1 - Made me invisible to sentrys
sm_sentryimmunity @me 1 without turning it off first - Make me visible again.

Same with using 0(-) more than once.

I dunno what's going on underneath to cause that behavior(hence the immunity check), but whatever, I edited in your suggestion so that's that.

Thanks for taking the time to give an explanation.
Tylerst is offline
Matheus28
Senior Member
Join Date: Aug 2009
Old 02-24-2011 , 16:51   Re: [TF2] Sentry Immunity
Reply With Quote #13

Quote:
Originally Posted by Tylerst View Post
Well, fair enough, plugin updated.

Just for reference though, in version 0.1.0(unreleased)before I added the current immunity check, and using + or - more than once on the same target seemed to act more as a switch.

IE:
sm_sentryimmunity @me 1 - Made me invisible to sentrys
sm_sentryimmunity @me 1 without turning it off first - Make me visible again.

Same with using 0(-) more than once.

I dunno what's going on underneath to cause that behavior(hence the immunity check), but whatever, I edited in your suggestion so that's that.

Thanks for taking the time to give an explanation.
But it turns another flag on, which can lead to unexpected behavior
Matheus28 is offline
FoxMulder
Senior Member
Join Date: Jan 2009
Location: Orlando, FL
Old 04-14-2011 , 16:33   Re: [TF2] Sentry Immunity
Reply With Quote #14

This was working fine until recently. Now when a player is given sentry immunity they freeze in place.
__________________
FoxMulder is offline
Tylerst
Veteran Member
Join Date: Oct 2010
Old 04-17-2011 , 03:34   Re: [TF2] Sentry Immunity
Reply With Quote #15

Quote:
Originally Posted by FoxMulder View Post
This was working fine until recently. Now when a player is given sentry immunity they freeze in place.
Still working for me, perhaps another of your plugins is conflicting?
Tylerst is offline
psychonic

BAFFLED
Join Date: May 2008
Old 04-17-2011 , 03:44   Re: [TF2] Sentry Immunity
Reply With Quote #16

Quote:
Originally Posted by Tylerst View Post
Still working for me, perhaps another of your plugins is conflicting?
Quote:
Originally Posted by FoxMulder View Post
This was working fine until recently. Now when a player is given sentry immunity they freeze in place.
The short version is that the plugin needs to be updated to use the FL_NOTARGET define, rather than hardcoding a value of 1<<16.

As of SourceMod 1.3.7, if you're using GetEntityFlags (or the new SetEntityFlags), you need to use the flag defines in entity_prop_stocks.inc, regardless of whether or not their values match the underlying values that the game itself internally uses for them. The new natives (one replacing an existing stock) translate the values on the fly.
psychonic is offline
Tylerst
Veteran Member
Join Date: Oct 2010
Old 04-17-2011 , 04:30   Re: [TF2] Sentry Immunity
Reply With Quote #17

Quote:
Originally Posted by psychonic View Post
The short version is that the plugin needs to be updated to use the FL_NOTARGET define, rather than hardcoding a value of 1<<16.

As of SourceMod 1.3.7, if you're using GetEntityFlags (or the new SetEntityFlags), you need to use the flag defines in entity_prop_stocks.inc, regardless of whether or not their values match the underlying values that the game itself internally uses for them. The new natives (one replacing an existing stock) translate the values on the fly.
Wasn't aware that had been added.

Plugin updated.

Time to go look at the release notes...
Tylerst is offline
FoxMulder
Senior Member
Join Date: Jan 2009
Location: Orlando, FL
Old 04-17-2011 , 08:38   Re: [TF2] Sentry Immunity
Reply With Quote #18

PHP Code:
new flags GetEntityFlags(target_list[i])&~FL_NOTARGET;
SetEntityFlags(target_list[i], flags)

new 
flags GetEntityFlags(target_list[i])|FL_NOTARGET;
SetEntityFlags(target_list[i], flags); 
Thanks, now it works.
__________________
FoxMulder is offline
Pie Flavour
New Member
Join Date: Apr 2011
Old 04-19-2011 , 03:26   Re: [TF2] Sentry Immunity
Reply With Quote #19

I'll test it and give you some screenshots
cuz I have no idea what this is doing
Pie Flavour is offline
clutchh
SourceMod Donor
Join Date: Feb 2008
Old 04-19-2011 , 18:45   Re: [TF2] Sentry Immunity
Reply With Quote #20

Can you add a cvar that lets us leave immunity on for all players at all times?
clutchh 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 06:22.


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