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

View Poll Results: What should the new native (assuming it gets accepted) be called?
TF2_SetClientTeam 3 25.00%
TF2_ChangeClientTeam 9 75.00%
Voters: 12. You may not vote on this poll

[CLOSED] Adding a new native to Sourcemod, would like some naming feedback


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wliu
Veteran Member
Join Date: Apr 2013
Old 02-21-2015 , 21:02   [CLOSED] Adding a new native to Sourcemod, would like some naming feedback
Reply With Quote #1

So I recently submitted a pull request to try to get a new native added.

I was initially going to call it TF2_SetClientTeam (which wraps around ChangeClientTeam and provides symmetry for TF2_GetClientTeam) but psychonic has suggested that it might be better named as TF2_ChangeClientTeam.

So basically I just want to see what everyone else thinks about the naming.
__________________
~Wliu

Last edited by Wliu; 02-24-2015 at 15:15. Reason: Merged.
Wliu is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 02-21-2015 , 23:10   Re: Adding a new native to Sourcemod, would like some naming feedback
Reply With Quote #2

I dunno, seems pretty pointless to me as all it is is a function to throw that ugly enum tag on it.
__________________
Chdata is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 02-22-2015 , 11:19   Re: Adding a new native to Sourcemod, would like some naming feedback
Reply With Quote #3

Quote:
Originally Posted by Chdata View Post
I dunno, seems pretty pointless to me as all it is is a function to throw that ugly enum tag on it.
I'd enjoy not having to coerce stuff from TFTeam to ints and back to TFTeam again repeatedly just because of ChangeClientTeam ;P.
__________________
~Wliu
Wliu is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-22-2015 , 17:51   Re: Adding a new native to Sourcemod, would like some naming feedback
Reply With Quote #4

If you're creating a TF2-specific change team, why wouldn't you just call the newer ChangeTeam that SM doesn't implement?

That is, TF2's CTFPlayer::ChangeTeam( int iTeamNum, bool bAutoTeam, bool bSilent );, which is in CTFPlayer's vtable (420 on Linux).
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 02-22-2015 , 19:08   Re: Adding a new native to Sourcemod, would like some naming feedback
Reply With Quote #5

Quote:
Originally Posted by Powerlord View Post
If you're creating a TF2-specific change team, why wouldn't you just call the newer ChangeTeam that SM doesn't implement?

That is, TF2's CTFPlayer::ChangeTeam( int iTeamNum, bool bAutoTeam, bool bSilent );, which is in CTFPlayer's vtable (420 on Linux).
That bSilent looks *really* appealing right now ;P. Perhaps someone could implement that?
__________________
~Wliu
Wliu is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 02-24-2015 , 09:51   Re: Adding a new native to Sourcemod, would like some naming feedback
Reply With Quote #6

Setting team is more like dynamic thing Like for mannhattan anti crash.

Changing team sounds like the normal changeteam.
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
psychonic

BAFFLED
Join Date: May 2008
Old 02-24-2015 , 10:17   Re: Adding a new native to Sourcemod, would like some naming feedback
Reply With Quote #7

Quote:
Originally Posted by Powerlord View Post
If you're creating a TF2-specific change team, why wouldn't you just call the newer ChangeTeam that SM doesn't implement?

That is, TF2's CTFPlayer::ChangeTeam( int iTeamNum, bool bAutoTeam, bool bSilent );, which is in CTFPlayer's vtable (420 on Linux).
I addressed this in a comment on Wliu's PR before seeing the source here.
Quote:
Originally Posted by psychonic
Quote:
Originally Posted by Wliu View Post
In addition, Powerlord pointed out that there's a new CTFPlayer::ChangeTeam( int iTeamNum, bool bAutoTeam, bool bSilent );
If by new, you mean eight years old ;). It's existed since the Orangebox engine debuted.
The beauty of the one we're using now is that it is on a fairly stable interface. The other one would require gamedata as it would occasionally break. Additionally, automatically selecting a team and blocking the player_team event can be done manually without much hassle.
psychonic is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-24-2015 , 11:00   Re: Adding a new native to Sourcemod, would like some naming feedback
Reply With Quote #8

My mistake, I was thinking of CTFPlayer::ForceChangeTeam(int, bool) which is the one called by CTFGameRules when it swaps players for autobalancing and team switches between rounds.

As I recall, there was a conversation before about what the bool was and it controls whether dominations are cleared.

However, that's still going to have gamedata issues as it would require a signature.

This particular function has all sorts of extra logic for things like duel minigames, dropping flags, etc... that aren't necessarily covered by the normal ChangeTeam.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 02-24-2015 , 14:36   Re: Adding a new native to Sourcemod, would like some naming feedback
Reply With Quote #9

I would vote for TF2_SwitchTeam(int client, int team) since cstrike CS_SwitchTeam(int client, int team) just to keep a standard for the API (is that even something that might go official?)
Mathias. is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 02-24-2015 , 15:14   Re: Adding a new native to Sourcemod, would like some naming feedback
Reply With Quote #10

It was merged in as TF2_ChangeClientTeam to a) provide consistency for the underlying command and b) better represent what it's actually doing.
__________________
~Wliu
Wliu 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 05:08.


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