Divide team in two subteams

  • If you're asking a question make sure to set the thread type to be a question!

zaratustra

L2: Junior Member
Feb 1, 2009
52
1
Is there a way to divide both teams in two groups that spawn in different places, and keep the number of players balanced on each side?
 
Feb 14, 2008
1,051
931
You can have two spawns, but there would be no way of controlling where they respawn when they die (or maybe there is... with some trickery)
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
...there would be no way of controlling where they respawn... ...(or maybe there is... with some trickery)...

Helpful post is helpful!
 

Dracky

L1: Registered
Aug 29, 2009
32
2
You could very easily set up the two spawn rooms, however the same player wont always spawn in the same room, but its very easy, just set up two groups of player starts
 

Ravidge

Grand Vizier
aa
May 14, 2008
1,544
2,818
actually.. from what I've seen, the first player to enter the map spawns at the (teams) spawnpoint with the lowest ID (placed first in hammer). And then it continues like that...

can be noticed on 2fort if you've ever done 1 on 1 sniper duels, you will always spawn in the courtyard spawnroom until you've died enough to start spawning in that other spawn.

So, if you want even amount of people spawning in different rooms, try putting down the spawnpoints 1 by 1 in an alternating fashion.

This may just be bullshit from my part though, but it's the closest thing I can think of at this time.
 

Firest0rm

L4: Comfortable Member
Sep 27, 2009
171
33
for keeping the spawns even, you could probably have a special brush that detects kills around the whole map (theres a tutorial for something like that somewhere), and have it alternate between turning on and off spawn points in spawn room. i would go into more detail, but i have to go
 

Blue552

L3: Member
Sep 16, 2009
137
18
This would be achievable but pretty tricky.

Here is my example:

Lets say you wanted 10 people to respawn in each area. Have a trigger_multiple at the door with an output -> on start touch -> [math_counter] -> add 1

When the counter hits it max disable the spawns and enable the other ones. Do the some thing with the other spawn.



I have no idea how you would keep individual players at each spawn - that is gonna be harder [but still possible] just get used to using the !activator entity in your output.
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
actually.. from what I've seen, the first player to enter the map spawns at the (teams) spawnpoint with the lowest ID (placed first in hammer). And then it continues like that...

This.

It's entirely possible (but maybe not worth it) to write a script which would...
  • Find all spawn points owned by a team
  • Cluster them by 3D location.
  • Swap their hammer IDs so that IDs ascend evenly through each cluster.

You could run such a script against your VMF (or even on the compiled BSP!) to ensure that--on average--people would spawn in even groups across all open spawn points.

_______________________

Y'know, I could probably make something to do that for the BSP scenario--VMFs are trickier--if I had a good algorithm for breaking the "cloud" of spawn points into groups. (You can't go by the owning func_respawnroom entities, since there
may may be multiple ones in the same oddly-shaped physical room.)
 
Last edited:

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Why would you even need such a script... Who jumps between spawn rooms alternating the points they make? More likely than not they already ARE grouped. Additionally, hammerID isn't in the VMF, VBSP adds it when you compile.
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
Why would you even need such a script... Who jumps between spawn rooms alternating the points they make?
Exactly: Nobody. The script emulates the behavior for you. You can lay out your spawns in a line, copy-paste a new copy to multiple places, and still accomplish a "continuous spread" spawning situation instead of having waves that rotate positions.

Additionally, hammerID isn't in the VMF, VBSP adds it when you compile.
:p Then my compiling over here must be win-the-jackpot lucky when it comes to random numbers, because it appears every single ID for a teamspawn in the VMF... matches a HammerID in the BSP.

Ex:


VMF:
Code:
entity
{
	"id" "[B]23783[/B]"
	"classname" "info_player_teamspawn"
	"angles" "0 0 0"
	"StartDisabled" "0"
	"TeamNum" "3"
	"origin" "-2240 -2240 148.924"	
}

BSP:
Code:
{
"origin" "-2240 -2240 148.924"
"TeamNum" "3"
"StartDisabled" "0"
"angles" "0 0 0"
"classname" "info_player_teamspawn"
"hammerid" "[B]23783[/B]"
}
 

Blue552

L3: Member
Sep 16, 2009
137
18
Do triggers keep memory of the activator?

For instance to you could make the first 10 people to join only spawn in one respawn room.

[In reality they all spawn in the same room but are instantly teleported to their allocated spawn room depending on how late they joined.]

a.k.a first 10 activators teleport to your first spawn room, the rest there after go to the other one.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
I shouldn't rush my posts when I'm tired. What I was trying to say is the hammerID isn't relevant to the spawn order, it's just something the compiler uses for error reports. Spawn order (or other entity priorities) is first-in-file (thus, first added) priority, which is unrelated to hammerID.
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
I shouldn't rush my posts when I'm tired.
A chance to offer an entity correction to Boojum: Best Birthday Present Evar. :p

Spawn order (or other entity priorities) is first-in-file (thus, first added) priority, which is unrelated to hammerID.
OK, so instead of swapping IDs within a valid pool, all it has to do is reorder them in the file... Perfectly doable with the support code I have in there now... Assuming bspzip will allow me to overwrite mapname.ent...