Changing Spawn Points based on Payload Location

Oct 6, 2008
1,947
445
Ok, believe it or not, I have never made a map where I needed to changed spawn points now I do.

I’ve searched the forums and googled it but all I can find is how to make spawn rooms/points etc. I’ve tried the associated spawn points thing but am not getting the expected results.

Here’s what I’m doing – perhaps you can clarify what I’m doing wrong

The game starts

For Control Points(Cp) 1,2,3 - a pretty simple set up

Bluespawn1(same for all 3 points) Assoc. Cp cp_01
Redspawn1(same for all 3 points) Assoc. Cp cp_03 < since this is the last cap on my payload route

On Blue cap of cp_03

Blue needs to spawn in the same room as Red so I have it set up as

On pass cp_03(the path track coding)
- disable or kill Redspawn1 (and the player entities) – have tried both
- enable Redspawn2(starts as disabled) Associated Cp cp_04
- enable Redspawn2a(starts as disabled) Associated Cp cp_04
- Disable Bluespawn1 - haven’t tried to kill it
- enable Bluespawn2 Associated CP cp_03 (the closest cp to the spawn room)

Issues:
Blue keeps spawning original location even though disabled
Red spawns at all other spawn points except the new location – the others (example cp_05, cp_06) are disabled.

What am I doing wrong or how do you code the spawns so that you get the teams spawning at the points you want them to spawn at - at the time you want them to spawn at?
 

Fruity Snacks

Creator of blackholes & memes. Destroyer of forums
aa
Sep 5, 2010
6,394
5,571
Assoc. control points don't work. You need to name the spawns (so like, if you have a forward spawn, name all of the blu_forward_spawn or something)... and have them start disabled.


Then just go to the path track where you want to spawns to change, and have it disable the primary spawns, and enable the new forward spawn (with the Onpass command)
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
Changing spawn points in a single stage payload map is actually pretty confusing and it took me a while to figure it out too since you actually need to designate your spawns with rounds (even though there aren't any).

Rather than explain it in detail you can see for yourself by opening the badwater basin vmf provided with the SDK in your sdk_content tf maps folder. You might have to ungroup some stuff/entities before you can look at the I/O's etc.
 
Oct 6, 2008
1,947
445
Thanks guys - as always you're a great help!

I've been sitting here racking my brains out trying to figure out why the asscociated control points were't working! My head was starting to hurt the wall I hit it so many times - LOL.

Looking at code - that should be working and ISN'T, is the fun part of mapping I guess - LOL
 
Oct 6, 2008
1,947
445

tyler

aa
Sep 11, 2013
5,102
4,621
On the right side you should see three buttons that say "Groups", "Objects" and something else. You may have to turn it on in the window menu or screen elements menu, I can't remember. Anyway, Groups means that when you have grouped objects you select them all by clicking one of them. Object mode allows you to select one thing in a group and still see the properties and I/Os without ungrouping. This is pretty useful if you need to edit a prefab or connect path_tracks in Booj's prefabs etc.

Sorry if that is unclear, I'm on my phone
 
Oct 6, 2008
1,947
445
ok just recoded everything based on the bad water set up - issue now is bothe teams seem to be advancing one spawn on death - even though that spawn is disabled:cursing:
 
Oct 6, 2008
1,947
445
Spawn point setup

game rules - n/a
team control point master - n/a and has no name

logic_auto
- global state - none
- output
---OnMapSpawn
---- mspl_gamrules<usual stuff
---- bluespawn1 (blue's starting place) >enable
---- redspawn1_2_3(red's starting place) >enable
---- all other spawnpoints/spawnrooms/info_player_teamspawn>disabled
none of the info_player_teamspawn's have the associated control point aded

for reference purposes I have


1-func_respawnroom
1-info_player_teamspawn

both of these will have the same name for each of the points below

i.e. -func_respawnroom (bluespawn1), -info_player_teamspawn(bluespawn1)

team_round timer - n/a
team_train_watcher
-linkedPathTrack - cp_01_relay
-Linked CP - cp_01

Ok here we go with my set up:

At the start-
Red/Blue kep the same spawn rooms for CP's 01,02, 03
func_respawnroom - bluespawn1
func_respawnroom - redspawn1_2_3
none of the info_player_teamspawn's have the associated control point aded
they start active.

Cart Captures point 3
func_respawnroom - bluespawn1>Disable
func_respawnroom - bluespawn2>Enable
func_respawnroom - redspawn1_2_3>Disable
func_respawnroom - redlakegate>Enable

I have some dynamic stuff happening in the map so a couple of these may seem out of place but they're not:wow:

pathtrack-lakecavegate
pushzone-disabled
(mini CTF game starts)
gate captured - pushzone enabled
cart proceeds to point 4

Capture Point 4
func_respawnroom - redlakegate>Disable
func_respawnroom - reduwfb>Enabled

UpperWaterfallBridge
on pass - pushzone disabled
func_respawnroom - reduwfb>Disabled
func_respawnroom - redSpawnTop>Enabled
func_respawnroom - redpoint5>Enabled
func_respawnroom - bluespawn2>Disabled
func_respawnroom - bluespawnuwfb>enabled
(mini CTF game starts up)
GateCaptured - puzhzone>enabled

Capture Point 5
func_respawnroom - redpoint5>disabled
func_respawnroom - redSpawnTop>stays enabled
func_respawnroom - bluespawnuwfb>stays enabled
func_respawnroom - bluespoint5>enabled

cart continues

Clifftop Pathtrack
func_respawnroom - bluespawnuwfb>Disabled
func_respawnroom - bluespawnfinal>Enabled

CP6,7,8 no changes
func_respawnroom - redSpawnTop>stays enabled
func_respawnroom - bluespawnfinal>stays Enabled.


Ok that's the way I have it set up - in my mind I think I have it laid out pretty well in terms of functionality - where am I going wrong because I'm still spawning all over the map.
 

tyler

aa
Sep 11, 2013
5,102
4,621
I'm not even going to read most of that and tell you two things.

One, having your spawn room and spawn points named identically could be screwing everything up.

Two, this is what I do in every map I have ever made with moving spawns, and it always works. Obviously you can use whatever names you want, but you get the idea.

I name the first spawn room for each team accordingly, ie blu_spawn_1, red_spawn_1, whatever.

I name the first spawn points for each team accordingly, ie, all info_player_teamspawns in blu_spawn_1 are named blu_player_spawn_1 and the same for red. I always use separate spawn triggers and points even when both teams might share a respawn room just for simplicity.

Any secondary or tertiary rooms/points are named blu_spawn_2 and blu_player_spawn_2, etc, and they all start disabled.

When a team captures a point that should change the spawn points, I send these outputs. You can put them on the capture trigger (for a/d CP) or on the path_track (payload).
OnCapTeam2 > blu_player_spawn_1 > Disable
OnCapTeam2 > blu_player_spawn_2 > Enable
If you're doing it on a path_track, use the output OnPass instead. I never use a delay.

I'm not sure if this is the simplest way, the best way, or the easiest way, but it's what I have always done and it works. All you really need to do is change what points are disabled. The rest is not necessary.
 
Oct 6, 2008
1,947
445
Thanks yyler I'll check it out when I get home from work!

I knew I was probably doing something wrong somewhere I just couldn't find any definitive info on it online until your answer along with Grazr's.
 
Oct 6, 2008
1,947
445
yyler thanks for this - after 6 hours I finally got it done right and working - took me that long cause I have 10 points where spawns moved.
 

English Mobster

L6: Sharp Member
Jul 10, 2011
355
299
Question, a bit unrelated, but still: Why do your spawns move at 10 points in a map? Even entity-heavy TC maps don't have it change that much. For a typical map, they'll move perhaps 3 times AT MOST. The only explanation for having 10 different spawn rooms is if you have a spawn room at each end of a point in a 5CP match, which isn't good gameplay as you effectively have 5 KOTH points.
That many respawn rooms will only confuse the player, and I'm willing to bet probably half of them aren't needed. If an extra respawn room doesn't sever 20-25 seconds of walk time MINIMUM, you probably don't need it. It's disorienting and uses a lot more entities and therefore server processing power (even though it isn't terribly much, if a map is big enough to need 10 respawn rooms the server will probably be having processing issues).
Also, you don't need to set the disable/enable commands in your logic_auto. Hammer will handle it by itself; load a game with ent_messages 1 in the console and you'll see it all happen without a logic_auto handling it.
 
Oct 6, 2008
1,947
445
Question, a bit unrelated, but still: Why do your spawns move at 10 points in a map? Even entity-heavy TC maps don't have it change that much. For a typical map, they'll move perhaps 3 times AT MOST. The only explanation for having 10 different spawn rooms is if you have a spawn room at each end of a point in a 5CP match, which isn't good gameplay as you effectively have 5 KOTH points.
That many respawn rooms will only confuse the player, and I'm willing to bet probably half of them aren't needed. If an extra respawn room doesn't sever 20-25 seconds of walk time MINIMUM, you probably don't need it. It's disorienting and uses a lot more entities and therefore server processing power (even though it isn't terribly much, if a map is big enough to need 10 respawn rooms the server will probably be having processing issues).
Also, you don't need to set the disable/enable commands in your logic_auto. Hammer will handle it by itself; load a game with ent_messages 1 in the console and you'll see it all happen without a logic_auto handling it.


Thanks for the tip on logic auto!

I have
1 blue spawn - this covers caps 1-2-3 (1st)
1 red spawn - covers 1-2-3 (2nd)

on cap 3

blue moves to red (3rd) original
Red mover to gate room (4th)

on Cap 4

red moves to upper waterfall room (5th)

OnPass lower waterfall bridge blue moves to gate room (6th)
On Open gate Red moves to cave room (7th)

on Cap 5

Red moves to final cap (8th)
Blue moves to cave room(9th)

On cliff pass Blue moves to shack(10th)

On Cap 6

Blue moves to Final Spawn (11th)

So - lol - looks like I have 11 not 10!

The reason the spots move around so much is because my map is huge(not sure but it might hold the record for being the biggest map out there - about 460 nodes just for the payload route) and has a lot of verticle lift in it. Although I am open to suggestions if you have any as to where I should put them.

I'm also having issues with the spawnroom visualizers and I think it's along the same issue - even though I have them set to start disabled the opposing team can't run through them - they're still solid.
 
Last edited:
Oct 6, 2008
1,947
445
Ok having an issue with last blue spawn point - on start of round they are spawning there instead of the starting point of the map even thought I have the room and the spawn oints disabled. Any ideas?
 
Oct 6, 2008
1,947
445
no - it's weird

I spawn the right location during waiting for players and then when it evneters the set up time - I change locations.

I deleted the offending parties (spawns) where it was happening and now it sends me to another one of my spawns in the map (also disabled)

Only happens on set up

edit: looks like everythings working right now -

Issue 1 - had a duplicate entry in the auto logic

but this is the main issue any why I couldn't easily identify the problem

Check your filters

filter_(red/blue)_team - so that the filter reads it properly - I had my entities coded as filter_team_(red/blue) and that was the cause of the problem.
 
Last edited: