Conditional Coding based on # of players

Oct 6, 2008
1,949
446
Hi Coding Gurus!

Am asking on behalf of someone else to see it this can be done.

Problem - if the server is slow and not many players...

mapname: Warpath (may this can be applied to other maps)

1. Make center cap KOTH style
2. Have the spawn room near the 2nd / 4th Caps (at the end ot the tunnels for blue or red) spawn the players there when the number of players is low.
3. If the number of players on the server reaches x then the koth stlye is removed and regular warpath style commences.
4. Based on the number of players - perhaps a text message displays 'player number is x- Koth style is now enabled' or 'player number is now x - regular warpath stlye has resumed' so the gameplay transition is fliud (without having to restart the map) and since most of the battle on warpath centers on the bridge.

As far as I can tell, this type of coding can't be done - so I thought I would ask before wasting time on it or have other people waste their time on it. Has anyone tried this type of coding? Can it be done?
 

henke37

aa
Sep 23, 2011
2,075
515
You can count the number of players inside a volume. The other guys are sure to explain how. From then it is a simple matter of executing a server command to switch map.
 

xzzy

aa
Jan 30, 2010
815
531
You can change the victory conditions of a game whenever you want, so technically, yes. I imagine you'd have some kind of trigger_multiple that covered the entire map and fed a system to keep track of how many players are active. I'm sure it's a problem that someone who spends way too much time messing with entities has figured out.

However it'd probably break down on the details.. I don't think you can change the HUD dynamically for example.