[GUIDE + PREFAB] Direct Variable re-spawns

Tango

Sauce Copter Enthusiast
Jul 10, 2017
198
241
Spawn Rooms? Who needs those?

These prefabs easily allows you implement a multitude of unique ways to directly spawn into you map.

What's inside?
  • Five direct spawning prefabs
  • Readme entities giving an explanation on each of the presets
  • Handy user visgroups for easy manipulation

dmprefab.png

How does it work?
The general concept is to detect which team is in the area and change depending on the circumstance.
This is done so that players do not spawn directly in front or behind members of the opposite team. However with my time working on pd_shipment, I've realised that there is not a one size fits all solution to fix this issue. I made five presets for the most (Debatable) useful and common ways to make sure everyone spawns in the map as intended.

A notable thing you should keep in mind though, if a red / blue spawn is active players will always spawn to that point instead of the anyteam spawn points. Only if there are none of the respective team spawn points are active, a player will then spawn at the anyteam spawn points.​

What are each of the presets good for?
Each of the five presets are intended to fix common issues you may encounter; and a good combination of them will provide the greatest results. They are as follows:​
  • AnyTempTeam,
    • The spawn points will be deactivated until a member of your team is inside the zone. This is good for areas with moderate to high amounts of player combat, as teammates will only spawn if you already have members of your team inside the zone.
  • CaptureTeam,
    • The zone will start off disabled but when a player enters it, the zone turns into the players team and will remain that way until a member of the opposite team enters it and then it becomes that players zone. Think of it as planting a flag in the soil and claiming it as your own; until someone else replaces it. These kind of zones are good for areas you want predominantly controlled by one team or the other, as a player does not have to actively be in the zone to claim it.
  • CaptureTeamPre,
    • Same as above but at the start it is either red or blue. This is good if you want teams to start in one or more areas but if captured will spawn somewhere else.
  • TempTeamSwap,
    • Similar to an anyTempTeam in regards to it behaviour, however if players are absent it defaults to either red / blue. Use this type of zone for areas you want either team to have a permanent foothold in this area.
  • AltTeamSpawn,
    • Similar to a TempTeamSwap as it used for the same kind of concept, however when the opposing team enters an alternate 'backup' spawn is enabled. This is implemented if you want do't players to spawn in any team zones if all of the zones are occupied by members of the opposing team.
If you are still unsure of what to do consult the handy flowchart I've setup. This applied to most cases but don't be afraid to use your own judgement sometimes.
flowchart.png
How do I properly copy and set it all up?
First off, find the preset you wish to use and use the user set filters to copy what you want. Only the filters, triggers and spawn points need to be copied for it it properly function.
step1.png
Secondly, once you have everything copied; paste it into your map.

step2.png
You will then want to change the name of your filter and your spawn points.
This step is very important to execute correctly. Make sure that the spawn points, trigger and filter all are happy with each other and use the correct ones.
step3.png
lastly edit the zone to fit your map's needs.
step4.png
And you are done! Congratulations! Hopefully everything works!​


Troubleshooting:

When you are implementing variable spawns like this, being able to see the spawns and how they react to you presence is much much easier then going through everything for the eighth time because something does not feel correct. Not only that it will easy to visually point out errors that should be addressed.
Code:
sv_cheats 1

developer 2

ent_text info_player_teamspawn

Inserting these commands into the developer console in that order doing this should look like this:
ref.jpg

If not make sure that the waiting for players countdown
didn't disable it, and retry once its over. (Or by prematurely ending it with mp_waitingforplayers_cancel 1.)

Last quick notes:
  • The any Team is 0, While Red is 2, and blue is 3.
  • The method I use has a filter set to red, if the filter is set to any other colour it will work incorrectly. Additionally a filter is required for each zone.
  • Make sure if you are copying a prefab to rename the spawnpoints are make sure they are grouped. you can add or subtract any amount of spawnpoints if they are all grouped and named the same.


I hope you find good use of this asset and wish you a great rest of your day.

Best regards,
-Neon Tango
 

Attachments

  • aaa_direct_variable_respawns_prefab.vmf
    122.8 KB · Views: 202