Forcing Teamplay Mode for Just One Map - By Raeven0 |
|
This tutorial was submited on Feb 1, 2005.
Note: HL2DM maps will crash if you run them in deathmatch (i.e., non-teamplay) mode with only teamplay spawn points. Buckle up Include both for safety!
Entities used (placement doesn't matter except in trigger_multiple):
logic_auto
- Global State to Read - set_teamplay_off (note that you will have to type this in, not choose it)
- output OnMapSpawn target servercommand input Command override mp_teamplay 0
env_global
- Name - setteamplay0
- Global State to Set - set_teamplay_off
- Initial State - Off
filter_activator_team
- Name - unassignedfilter
- Filter Mode - Allow
- Filter Team - 0 (Unassigned)
point_servercommand
- Name - servercommand
trigger_multiple
- Should be either one large trigger_multiple, large enough to cover the entire map, or several small trigger_multiples, one covering each spawn point
- Filter Name - unassignedfilter
- Delay Before Reset - 3
- output OnTrigger target servercommand input Command override mp_teamplay 1
- output OnTrigger target set_teamplay_off input TurnOn override <none> delay 0.5
- output OnTrigger target servercommand input Command override changelevel map_name delay 1
That's the entity setup:
DOWNLOAD EXAMPLE MAP
It works by using the trigger_multiple and the filter_activator_team to check whether a spawning player is on the "Unassigned" team. In teamplay mode, no one can be on the Unassigned team; however, in deathmatch mode, everyone is on that team. If someone is on the Unassigned team (meaning the server is in deathmatch mode), then the trigger_multiple will fire its outputs. And when it does--
The point_servercommand entity will set the server to teamplay mode; the env_global entity will set a variable set_teamplay_off that will be used later; and the point_servercommand entity will reset the map. Easy. However, many players will be angry that your map takes five more seconds to load (because it has to be reloaded). Be ready for their complaining and try not to kill any of them.
When the map starts again, the logic_auto will check the variable set_teamplay_off. If the variable is set (meaning the trigger_multiple was triggered properly in the last map), then the logic_auto will unset teamplay. This means that if a player activated the trigger_multiple, which is only possible in deathmatch, then the logic_auto will set teamplay back to 0 when the map begins again, allowing the server to go back to deathmatch gameplay on the next map. Changes to mp_teamplay (the teamplay CVar) won't take effect unless the map is reloaded, after all.
This setup could also be used to force a teamplay server into deathmatch mode, by incorporating another filter_activator_team (one for Rebels, one for Combine) as well as a filter_multi to check both of them (so that either team can activate the trigger_multiple).
Still need help? Ask your questions in one of our HELP FORUMS
|
|
|
| Comments |
| gtamike_TSGK - Apr 20, 2008 |
| Thanks |
|
|
|