Team Join Queue mod

codythehuncodythehun Join Date: 2013-01-22 Member: 181223Members
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>

Comments

  • lwflwf Join Date: 2006-11-03 Member: 58311Members, Constellation
    If you change your mind and run over to the other door, what happens if there's a free slot when you're halfway there? That is, will players exit the queue when they leave the door they were trying to join through first?
  • goblingoblin Join Date: 2004-09-05 Member: 31412Members
    does it work with j1/j2 console commands?
  • MCMLXXXIVMCMLXXXIV Join Date: 2010-04-14 Member: 71400Members
    Re: the localisation, I've worked out a way to add new localisation messages while preserving the default ones by hooking into the Locale.ResolveString function.

    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!).
  • codythehuncodythehun Join Date: 2013-01-22 Member: 181223Members
    lwf: Once you leave the door, you leave the queue. The queue is implemented in the TeamJoin trigger, which is placed by each door.

    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?)
  • MCMLXXXIVMCMLXXXIV Join Date: 2010-04-14 Member: 71400Members
    I hope so, they should chain together fine. However, I think there are problems with loading multiple mods that use game_setup.xml at the moment.
  • codythehuncodythehun Join Date: 2013-01-22 Member: 181223Members
    I was wondering how that would work. I assume if multiple mods are enabled, each mod's client or server lua file is loaded specified in their game.xml. If multiple mod's client.lua includes the original client.lua file, I guess it would be loaded only once. Can anyone verify that?
Sign In or Register to comment.