Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add button to allow players to change teams #872

Merged
merged 25 commits into from
Nov 22, 2024

Conversation

Zanieon
Copy link
Contributor

@Zanieon Zanieon commented Sep 7, 2024

This a feature not related to vanilla behavior but rather QoL in regards to the very nature of the Northstar servers, as the only way of changing teams is using mods that gives these functionalities to the server, when it actually should be bundled in Northstar itself already, imo.

ns_allow_team_change

image

@Zanieon Zanieon added the needs testing Changes from the PR still need to be tested label Sep 7, 2024
@github-actions github-actions bot added the needs code review Changes from PR still need to be reviewed in code label Sep 7, 2024
@Zanieon
Copy link
Contributor Author

Zanieon commented Sep 7, 2024

@F1F7Y This one is specially for you due to your Server Utilities :D

Copy link
Contributor

@ASpoonPlaysGames ASpoonPlaysGames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you made the convar replicated, you could enable and disable the UI button based on if the server has the convar enabled. I think we should try to avoid using SendHudMessage for most things if possible

@Zanieon
Copy link
Contributor Author

Zanieon commented Sep 7, 2024

If you made the convar replicated, you could enable and disable the UI button based on if the server has the convar enabled. I think we should try to avoid using SendHudMessage for most things if possible

Alright, convar replicated and button visibility bound to it, now in regards to SendHudMessage, those i'll have to probably localize them eventually because would be quite frustrating to players trying to click the button and no info will ever pop in for those two specific cases they could appear.

Copy link
Member

@F1F7Y F1F7Y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Train WiFi review

Northstar.Client/mod/scripts/vscripts/ui/menu_ingame.nut Outdated Show resolved Hide resolved
Northstar.Client/mod/scripts/vscripts/ui/menu_ingame.nut Outdated Show resolved Hide resolved
Northstar.CustomServers/mod.json Show resolved Hide resolved
Copy link
Contributor

@ASpoonPlaysGames ASpoonPlaysGames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good as far as I'm concerned

@Alystrasz
Copy link
Contributor

In regards to SendHudMessage, those i'll have to probably localize them eventually because would be quite frustrating to players trying to click the button and no info will ever pop in for those two specific cases they could appear.

I agree information should be transmitted to player somehow.
A less invasive way could be to print warning message in chat (using another colour than white).

Copy link
Member

@F1F7Y F1F7Y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate the thread thing but if it works it works

@Alystrasz Alystrasz removed the needs testing Changes from the PR still need to be tested label Nov 2, 2024
@Zanieon Zanieon added READY TO MERGE This mergeable right now and removed almost ready to merge Apart from any small remaining other issues addressed by other labels, this would be ready to merge labels Nov 3, 2024
@Bobbyperson
Copy link
Contributor

Might I suggest that this convar be set to zero automatically in some cases? This would mess with infection and the hidden pretty badly.

@Zanieon
Copy link
Contributor Author

Zanieon commented Nov 5, 2024

Might I suggest that this convar be set to zero automatically in some cases? This would mess with infection and the hidden pretty badly.

If the server is fixed at those gamemodes then all you need to do is just add the convar to the launch arguments, disabling it, the other method is make the gamemode initialization function disable it as well.

@Bobbyperson
Copy link
Contributor

True, some people might not be running dedicated servers though so it might be worthwhile adding it to those functions like you said.

@Zanieon
Copy link
Contributor Author

Zanieon commented Nov 5, 2024

True, some people might not be running dedicated servers though so it might be worthwhile adding it to those functions like you said.

Alright i'll probably make a proper toggle function instead of fiddling with the convar for gamemodes that does custom team switching.

@Zanieon Zanieon added waiting on changes by author Waiting on PR author to implement the suggested changes almost ready to merge Apart from any small remaining other issues addressed by other labels, this would be ready to merge and removed READY TO MERGE This mergeable right now labels Nov 5, 2024
@Zanieon
Copy link
Contributor Author

Zanieon commented Nov 10, 2024

@Bobbyperson See if this is okay for you now.

@Zanieon Zanieon removed the waiting on changes by author Waiting on PR author to implement the suggested changes label Nov 10, 2024
@Bobbyperson
Copy link
Contributor

Looks great, only other changes I might suggest is to also disable it on competitive gamemodes like Fastball and Live fire, since changing teams in those gamemodes could cause big problems.

It might also be worth adding a convar like ns_max_team_imbalance (default 1) that would stop specific players (trolls) from switching to prevent teams from having too many/too few players. For example, setting it to 2 would allow a 2 player difference between the teams.

@GeckoEidechse
Copy link
Member

@Zanieon what's blocking this PR atm? Just the changes @Bobbyperson suggested?

@Zanieon
Copy link
Contributor Author

Zanieon commented Nov 18, 2024

@Zanieon what's blocking this PR atm? Just the changes @Bobbyperson suggested?

Nothing really, just pondered a bit if i should implement Bobbyperson suggestion in regards to balance of teams or not, but at that point, trolls should be punishable with either a kick or warn for doing such thing, the intention of the button is not to handle all cases of all types of players.

Fine for me to merge as is, if these cases of people joining one team way too much then it might be worth doing another PR specifically for said case.

@Zanieon Zanieon added READY TO MERGE This mergeable right now and removed almost ready to merge Apart from any small remaining other issues addressed by other labels, this would be ready to merge labels Nov 18, 2024
@Bobbyperson
Copy link
Contributor

AFAIK, most Northstar servers do not have active moderators. In my opinion, if we add a feature like this we should make it as troll proof as possible as to not add an extra burden for server owners/moderators to manage.

If you don't wanna do it I can make a PR for this later after merge.

@Zanieon
Copy link
Contributor Author

Zanieon commented Nov 18, 2024

AFAIK, most Northstar servers do not have active moderators. In my opinion, if we add a feature like this we should make it as troll proof as possible as to not add an extra burden for server owners/moderators to manage.

If you don't wanna do it I can make a PR for this later after merge.

I'd prefer to see how this will test itself out first without it, so far all servers that allows team switching with FSU never had much issues with that, this button will also probably not bypass the decision made by the Better Team Balance mod (which is another thing that should eventually be integrated into northstar as an option).

@Bobbyperson
Copy link
Contributor

Fair point, sounds good.

@GeckoEidechse
Copy link
Member

Aight, I'll stick it in the next minor release together with a bunch of other features soon™ o7

@GeckoEidechse GeckoEidechse changed the title Enable a button to allow players to change teams Add button to allow players to change teams Nov 22, 2024
@GeckoEidechse GeckoEidechse merged commit 13211e9 into R2Northstar:main Nov 22, 2024
3 checks passed
@Zanieon Zanieon deleted the TeamSwitchBtn branch November 22, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
READY TO MERGE This mergeable right now
Projects
Status: No status
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants