Divide team in two subteams

Discussion in 'Mapping Questions & Discussion' started by zaratustra, Nov 3, 2009.

  1. zaratustra

    zaratustra L2: Junior Member

    Messages:
    52
    Positive Ratings:
    0
    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?
     
  2. Randdalf

    aa Randdalf

    Messages:
    1,054
    Positive Ratings:
    462
    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)
     
  3. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,561
    Helpful post is helpful!
     
  4. Dracky

    Dracky L1: Registered

    Messages:
    32
    Positive Ratings:
    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
     
  5. Ravidge

    aa Ravidge Grand Vizier

    Messages:
    1,544
    Positive Ratings:
    2,492
    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.
     
    • Thanks Thanks x 1
  6. Firest0rm

    Firest0rm L4: Comfortable Member

    Messages:
    171
    Positive Ratings:
    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
     
  7. Blue552

    Blue552 L3: Member

    Messages:
    137
    Positive Ratings:
    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.
     
  8. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    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: Nov 3, 2009
  9. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,527
    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.
     
  10. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    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.

    :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]"
    }
     
  11. Blue552

    Blue552 L3: Member

    Messages:
    137
    Positive Ratings:
    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.
     
  12. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,527
    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.
     
  13. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    A chance to offer an entity correction to Boojum: Best Birthday Present Evar. :p

    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...
     
  14. FaTony

    FaTony Banned

    Messages:
    902
    Positive Ratings:
    160
    It's <100 lines in SourceMod. (2 team, not hammerid stuff).