Random and Set Spawn Points possible?

cownaetion

L1: Registered
Feb 24, 2008
32
1
I'm trying to make a duel map for 2v2 and I have four spawn points, two for blue/red respectively. When dueling though the spawn points alternate so you know which point their going to spawn at. Is there anyway to randomize this?

Also if possible, how can I have the players spawn where I want them when they first join the map (or map starts depending on mode) and then after that first spawn let it be random. Any help would be appreciated, thanks!
 

Armadillo of Doom

Group Founder, Lover of Pie
aa
Oct 25, 2007
949
1,228
For the randomness, I think you just need to make the func_respawnroom the same name in each one. And their associated info_player's of course. If you want them to start in Spawn A, then disable the player spawns in B when the map starts. Add an output, after the first spawn, or 5 second, etc. enable the info_player_teamspawn's in B.
 

cownaetion

L1: Registered
Feb 24, 2008
32
1
Hmm, that seems to make sense. Thanks for the info. I'll try it out when I can and let you know how it goes.
 

WarMecha

L2: Junior Member
Feb 10, 2008
64
12
It might be useful for you to note also that the order you create the spawn points in within hammer is the order you spawn in when playing the map, at the last spawn point you then cycle back to the first and so on.
 

trainRiderJ

L5: Dapper Member
Mar 14, 2008
203
31
It might be useful for you to note also that the order you create the spawn points in within hammer is the order you spawn in when playing the map, at the last spawn point you then cycle back to the first and so on.

Do you have a source? Not that I don't trust you, it's just that I could have sworn they were random. I know that each time I compile and test my map I spawn in a random spawnpoint.
 

cownaetion

L1: Registered
Feb 24, 2008
32
1
Yes, the order seems to be how their placed and not random. Is there any entity that can produce a random number? If so I wonder if it'd be possible to input the number into a switch-like statement. If the number is say even, it disables spawn B and enables A and vice versa if it is odd. That possible?
 

WarMecha

L2: Junior Member
Feb 10, 2008
64
12
Unfortunately there isn't a way to generate a random number, however you might want to look at logic_case. You could use this to randomly trigger up to 16 outputs, so you could for instance target a logic_relay which in turn then targets all the spawn points, enabling one and disabling the rest. That would give you scope for 16 spawn points per side, so you could always have 2 logic_case entities for instance meaning 2 spawn points where active at any one time - probably a good thing imo. Or just string the logic_case entities together, but the second logic_case would then have a much lower likely hood of enabling its spawn points.

As for the switch you were describing, you can do this with logic_compare, but you can only cover three cases here. If I remember correctly you can look for equal to, not equal to, greater than and less than, so using equal to, greater than and less than would give you 3 different cases.
 

cownaetion

L1: Registered
Feb 24, 2008
32
1
Lot of output/inputs there but thanks for the info. I'll see what I can come up with and if successful will post back.