-
Notifications
You must be signed in to change notification settings - Fork 119
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
Enable a button to allow players to change teams #872
base: main
Are you sure you want to change the base?
Conversation
@F1F7Y This one is specially for you due to your Server Utilities :D |
There was a problem hiding this 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
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. |
There was a problem hiding this 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.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
Outdated
Show resolved
Hide resolved
{ | ||
"Name": "ns_allow_team_change", | ||
"DefaultValue": "1", | ||
"Flags": "REPLICATED" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know spoon wanted this ( and I agree with it ) but would be great to know version compat of this change before release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be up to @GeckoEidechse when he does a release with this change right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have the capacity to test that atm. If someone could take care of that, that would great.
It can be tested without making a release.
Basically testing should cover
- New server <-> Old Client
- Old server <-> New Client
And on that note
- New server with old client not working is a non-issue as we can just version gate
- Old server with new client would suck as servers don't update that fast. We could still do it though, just need to ping server hosts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New Clients to Old Servers won't change anything, the server will recieve the command from the button but ignore it.
New Servers to Old Clients will also not change anything substantial besides old clients having to type "changeteam" in console in order to swap.
There was a problem hiding this 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
I agree information should be transmitted to player somehow. |
There was a problem hiding this 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
It's actually not really necessary, but talking with @ASpoonPlaysGames on Discord VC, we agreed that having that threading is good because then Clients updates realtime in case server enables/disables the ability to change teams. |
I fully agree the button should be up to date, I'm just questioning whether a while true loop is the best way to do it. |
I'd say that if we can get a convar change callback to handle it then that would be ideal but I dont think we expose that sort of thing to squirrel? |
There's callbacks for when networked variables changes in Squirrel, but there's none for convars afaik. |
Changing team should kill player and Auto-Titan in playing state. |
Why? |
For example, you can just switch team and kill old teammates/steal flag/cap points nearby. |
Valve games don't have Squirrel callbacks for changing teams, so it's easier to just kill the player to fix those potential issues. FSU existed for a long time now and nobody ever complained about its method of switching teams without killing players, for CTF i can just add a team change callback to force flag drop in case player is carrying it. |
Fairly certain there is already a callback for changing teams it just never gets called? I remember seeing the killfeed code has stuff for team change notifications and somewhere up the callstack for that it comes from a callback? |
That's what i mean, adding that callback for special logic in such case since it is already used to notify players when someone changes teams which you are probably remembering from #789 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, team change is now possible in-game; it's impossible to spam team change more than once every 5 seconds.
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. |
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. |
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.