Team Join Queue mod
codythehun
Join Date: 2013-01-22 Member: 181223Members
in Modding
Hi there NS2 modders,
I've wanted to get into modding for a while now, and NS2 is such an awesome and mod friendly game, I knew the time has come :)
My first mod tackles a very small annoyance I have with the waiting rooms on the maps.
It happens alot when playing with friends that I can't join their team, becuase it has one too many players - makes sense for team balance!
However, I'd still rather join their team sooner or later, so I stay in the join area for a while.
When place becomes available however, some other guy jumps into to join area, and he gets the place! What the hell?
Some people even 'spam' the join area by stepping in and out of it, knowing that the place gets awarded to those who are just stepping into the area (The OnEnter event is handled in the trigger)
This also happens on a map start, when a lot of people prefer a particular team.
To solve these problems, I implemented a queue in these join areas. If you stand in the join area, but there isn't enough room on the team, you can wait for the spot to become available. It's first come first served, and you receive your line number. If you see there are too many people waiting, you can go ahead and join the other team.
The network message is currently only in English, because I have no idea how to use localiasation files in a modular way in mods (didn't want to copy the entire english file), any ideas?
Any comments/feedback is appreciated, I hope it will prove useful to some :)
It's a server side script, so if you are a server operator, please do give it a try.
It's available on steam workshop here: <a href="http://steamcommunity.com/sharedfiles/filedetails/?id=122133691" target="_blank">http://steamcommunity.com/sharedfiles/file...s/?id=122133691</a>
I've wanted to get into modding for a while now, and NS2 is such an awesome and mod friendly game, I knew the time has come :)
My first mod tackles a very small annoyance I have with the waiting rooms on the maps.
It happens alot when playing with friends that I can't join their team, becuase it has one too many players - makes sense for team balance!
However, I'd still rather join their team sooner or later, so I stay in the join area for a while.
When place becomes available however, some other guy jumps into to join area, and he gets the place! What the hell?
Some people even 'spam' the join area by stepping in and out of it, knowing that the place gets awarded to those who are just stepping into the area (The OnEnter event is handled in the trigger)
This also happens on a map start, when a lot of people prefer a particular team.
To solve these problems, I implemented a queue in these join areas. If you stand in the join area, but there isn't enough room on the team, you can wait for the spot to become available. It's first come first served, and you receive your line number. If you see there are too many people waiting, you can go ahead and join the other team.
The network message is currently only in English, because I have no idea how to use localiasation files in a modular way in mods (didn't want to copy the entire english file), any ideas?
Any comments/feedback is appreciated, I hope it will prove useful to some :)
It's a server side script, so if you are a server operator, please do give it a try.
It's available on steam workshop here: <a href="http://steamcommunity.com/sharedfiles/filedetails/?id=122133691" target="_blank">http://steamcommunity.com/sharedfiles/file...s/?id=122133691</a>
Comments
See <a href="https://github.com/AlexHayton/MagnoBoots" target="_blank">https://github.com/AlexHayton/MagnoBoots</a> for an example (look at lua/Locale and feel free to borrow the code there!).
goblin: Not sure what j1/j2 console commands are. The only related console commands I know of is jointeamone and jointeamtwo, so console support would probably need new commands to be introduced, like queueteamone and queueteamtwo.
This might be a nice addition actually, since the queueing mechanism wouldn't have to be tied to the door. So you could queue team two with a console command, then walk to team one. I might try to add this.
MCMLXXXIV: thanks, that's a nice solution to modular localisation, I guess it would work when chaining the resolve function? (when installing your mod and mine at the same time?)