CS Maps that change based on player coun Created 7 years ago2016-11-25 00:10:39 UTC by MistaX88 MistaX88

Created 7 years ago2016-11-25 00:10:39 UTC by MistaX88 MistaX88

Posted 7 years ago2016-11-25 00:10:39 UTC Post #332437
So it came to my attention a while ago that there are a handful of CS 1.6 maps out there that have some changes based on the number of players on the map. I have yet to find any information on how to do this.

I'm currently bouncing an idea around for a type of map with specific weapon pickups to sort of create "classes" (there would be a limited number of subguns, rifles, shotguns, etc) but on a 30 person server this doesn't work if there aren't a ton of people playing. So I want to rig some doors with more guns behind them that only open if x number of players are on the map.

Does anyone know how to do this? Or can anyone at least point me in the right direction to start experimenting with entities that can be triggered round to round based on player count?
Posted 7 years ago2016-11-25 08:36:32 UTC Post #332445
I guess you could do it with a trigger_multiple and a game_counter.
The trigger_multiple activates the game_counter and if it reaches a certain number, the game_counter activates something else.

So if you have, say, a limit of 16 players on 1 team, they need to pass through a "counting center" where they are counted according to that mechanism. If 16 players are counted, something happens.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 7 years ago2016-11-25 08:45:52 UTC Post #332446
Play with multisource entities i'd assume. In conjunction with trigger_multiple(s), multi_manager(s) and maybe some brush entities to cover the trigger setup after activated for the round.
Posted 7 years ago2016-11-25 09:45:12 UTC Post #332448
Since you're also talking about multiple configs for each player amount, you'll probably want to also do some extra work, for example:
  • Level 1 = 8 players (M249s everywhere)
  • Level 2 = 16 players (less M249s and a few barrels)
  • Level 3 = 32 players (way less weapons and much more hazards)
That would require a system which... oh!
I know!

You can also use 1 multi_manager which activates all 3 game_counters. When the 1st one reaches the limit, it's killed/removed, etc. until we're left with the last game_counter.

Each game_counter, as mentioned, locks or unlocks something in the map. Cool, am I right?
Admer456 Admer456If it ain't broken, don't fox it!
Posted 7 years ago2016-11-25 11:45:27 UTC Post #332449
I may have a solution but I need to experiment, I don't know precisely how CS 1.6 "resets" the entities on round start
Posted 7 years ago2016-11-25 12:51:55 UTC Post #332451
CS round restarts reset the following entities:
cycler_sprite
light
func_breakable
func_door
func_water
func_door_rotating
func_tracktrain
func_vehicle
func_train
armoury_entity
ambient_generic
env_sprite
grenade

Players are reset as well.

All item_thighpack entities are removed.

Hostages are resurrected and repositioned to where they should be at the beginning of a round.

C4 is reset as well.

If CS zone entities are found the appropriate flags are set to indicate which game mode is active.
If a func_escapezone has been found and more than 2 rounds have been played with players on the same team, the teams are swapped.
If a VIP zone is found, a new VIP is picked.

game_counter is not reset.

As a workaround, you could add a func_door with a Fire on close to a game_counter_set that resets the counter. That seems like it could work, since func_door closes itself (goes down) when it restarts.
Posted 7 years ago2016-11-25 14:27:58 UTC Post #332452
Thanks for the info Solokiller, this will buy me a lot of time for testing the idea I have in my head.
Posted 7 years ago2016-11-25 20:09:16 UTC Post #332454
Does level change restart aiscripted sequences? :\
Posted 7 years ago2016-11-25 22:10:08 UTC Post #332456
CS doesn't have that entity. It barely has any monster entities to speak of, i can only find monster_mortar, monster_hevsuit_dead and monster_scientist (hostage).
Posted 7 years ago2016-11-26 01:55:41 UTC Post #332459
Thanks for all the responses so far. I'm gonna start experimenting with things myself soon (just finished making the last map I was working on).

Things would be so much easier in CS if entities had a flag to reset after each round (it would be wonderful for trigger_once). But it does make it more rewarding to get something working right when you do find a way. I've already made use of an outside of map func_door for round resets and I figured that would play into resetting other entities. What gets complicated is when you have things that may or may not be used every round (suddenly that "reset" trigger is activating it instead because it was never activated on the previous round).
Posted 7 years ago2016-12-08 04:05:52 UTC Post #332623
Finally got around to testing some entities and the reset method that Solokiller mentioned works perfectly (func_door tied to a game_counter_set to reset the game_counter entities each round). I tested it out just by tying the counter to a light and just killed myself for a few rounds to make sure it would repeat.

Being able to reset the counters this way each round is one cleared hurdle. The other now is how to set up the "counting mechanism".

This might be easy depending on how a map is set up and why the players are being counted, but for the specific thing I'm doing it's gonna be a bit more complicated. Not impossible, but hard to make "look clean" to players.

Basically, what I'm doing is creating a "demolition style" map. A small map with one bombsite like the ones in demolition mode in CSGO. But there's more to that game mode than just small maps. Obviously, recreating the gungame-esque weapon system would be impossible to do without actually making a mod, so I just want to capture some of the spirit of the game, and do do this, I want to lay limited weapon pickups to in effect create "classes" (since typically everyone is at different weapon levels in demo in csgo). Despite the map being designed for smaller player numbers (max of 10 players would be ideal) I would need a contingency in place for the server I play on and other servers with more player slots than that. Can't have a map without enough spawn points in the event more people join up. So I need the map to accommodate up to 30 players (even though it won't play that well) and it gets complicated if you are trying to limit weapon pickups. So basically, the player counters will be in place to open some extra doors with more weapon pickups behind them when more players are on while keeping them sealed off when there actually is a small amount of people on.

The easiest thing would be to drop players from spawn through some trigger multiples and into some water. That way there would be no risk of some random lost player going back into spawn or some afk-er tripping a trigger multiple once it becomes ready to fire again. But this would look really crappy to players. The best way would probably to do that same drop method but in a dark room with a teleport right after the trigger that plops them into the "real" spawn. I'm just worried about having too many entitiy setups and crashing servers. I recommended de_mesa to be added to the rotation on my clan's server a while ago and it would crash the server. However, there are a lot of fancy things going on on that map (which is a shame because I really wanted to see how it played).

EDIT: I forgot I already explained what I wanted to do with my specific map in the first post but, oh well, I explained it in slightly expanded fashion.
Posted 7 years ago2016-12-31 01:39:53 UTC Post #332915
I've finally got this system working. Players spawn in a dark room and immediately fall through their own trigger_multiple which targets a multi_manager which targets the game_counter entities (two of them, one for the 2nd weapon tier and one for the 3rd weapon tier). Players then hit a teleport to go to the "real" spawn. It required finagling with trigger delays and multiple multimanagers (there are 3 multi-managers per team and there are 4 counters in total, two for each team). Entities would get bombarded with too much at once and wouldn't work so things had to be spread out with small delays and basically an "upside down pyramid" of triggers leading into the counters.

Then, even when it was all correct, I still had issues which I tracked down to the door speed. The door wasn't closing fast enough on reset and it would create an inconsistent result. Sometimes the doors would open correctly and sometimes they would not.

There still seems to be a round 1 bug where sometimes both doors will open even if there aren't enough players but I can live with that. It might also just be the way the bots load in (testing with bots in Condition Zero).

I reset the counters with a game_counter_set tied to a func_door but the func_door was actually too slow so I instead blanketed a single trigger_multiple immediately under all of the spawns so that the very first player to spawn would trigger it instantly.

Now that I have this working I need to tackle an weaponstrip issue I'm having, but I have detailed that in another topic.
Posted 7 years ago2016-12-31 02:29:47 UTC Post #332916
Glad you sorted it, that's pretty neat ;)
Captain Terror Captain Terrorwhen a man loves a woman
Posted 7 years ago2016-12-31 20:07:40 UTC Post #332924
Yeah, I'm unfortunately gonna have to scrap the weapon stripping portion due to it stripping the bomb but the counter is working nicely.

I also think I know what might be causing the round 1 bug with more doors opening up than are supposed too. I don't think the counters are being reset between the warmup and first round, so a few players get counted before "Game Commencing" message but then the counters aren't reset before it starts counting the whole team. I could possibly increase the drop height to the triggers and teleports and that would give the a func_door time to reset instead of my trigger_multiple but it might also add more "black screen" time at spawn than I want. Time for more experimenting!

Once I actually have this map tested with real people and I can be sure the system works reliably I'll copy and paste the spawn system over to a sample map and upload it here so others can use it (even if they already know how themselves, creating all those triggers and teleports is tedious).

Edit: After a recompile this wasn't working. Was pulling my hair out trying to understand why because I didn't change any part of the counting system...then I copy and pasted the door that wasn't opening and it worked. So, now I have to make sure once I'm done editing anything else on the map that the counter system still works on final compile and if it doesn't I have to start copy pasting entities in trial and error fashion to find out what suddenly doesn't want to work anymore. Oh, Goldsource!
Posted 7 years ago2017-01-01 02:28:20 UTC Post #332929
The beta is up:

http://twhl.info/vault.php?map=6145

I had more issues with CT spawn working. Moving the counter triggers higher above the trigger_teleport entities under the spawns seemed to do the trick. Weird considering they are still that close together on the terrorist side with no problems. Either way, it was working consistently without issues with bots in CZ so now it's time to see what happens when real people play!
Posted 7 years ago2017-01-03 06:45:40 UTC Post #332955
Here is an .rmf with the trigger system. Feel free to use it for your own map (you might even be able to make it more efficient than I have).

Map vault page includes a long-winded and not very good rundown on the system. I'm not very eloquent when it comes to this kind of explanation. Perhaps when I have more time I'll fix it up with some better writing and actual entity names and make a tutorial out of it.

http://twhl.info/vault.php?map=6147
You must be logged in to post a response.