mat_phong 0

L1: Registered
Jul 10, 2017
24
9
I am planning in making a map but I cannot make players have only melee. How can I make that possible?
I'd also like to know how to make the player able to pick up weapons around the map and how to spawn the weapon that can be picked up.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
Create a big, map wide 'trigger_add_tf_player_condition' brush (can be one big brush or lots of brushes tied to the same entity) and set it to Condition 41 - "Cannot Switch from Melee", and set the duration to -1.

You then need to have add a named point_clientcommand entity somewhere in the map. (I typically name mine 'ClientCommand', but you can pick your own name.) Go back to the 'trigger_add_tf_player_condition' brush and select it's 'Outputs' tab. Create a new output with this setup:
Code:
OnStartTouch | ClientCommand | command | slot3 | 0.00
Also make sure the 'Clients' flag is enabled in the 'Flags' tab.

Now whenever someone walks into the brush, it will force them to swap to their melee and prevent them from changing until they leave that zone.

While you may want the zone for most of your map, don't include the spawn rooms. You'll want to design those so players walk into the melee-zone as they leave spawn. Spawning player directly in the melee-zone can occasionally cause them not the trigger the 'OnStartTouch' and so those players may have their normal weapons.
 
Last edited:

henke37

aa
Sep 23, 2011
2,075
515
Really, what you want to do requires a custom serverside plugin.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
Really, what you want to do requires a custom serverside plugin.
Literally 2 methods for it to work without plugins above your post.

this one is easier, but has control than werewovle's
Medieval mode also allows some non-melee weapons and forces the medieval text in chat. And er, "but has control than"? I think you missed an "more" or "less" in there.
 

henke37

aa
Sep 23, 2011
2,075
515
You guys are focusing on the obvious part of his description. What he actually wants is for players to start without non melee weapons and then find them laying around in the level to be picked up.
 

YOYOYO

47 crashes and counting
aa
Jul 10, 2017
620
556
Medieval mode also allows some non-melee weapons and forces the medieval text in chat. And er, "but has control than"? I think you missed an "more" or "less" in there.
that's what I meant by more control
 

mat_phong 0

L1: Registered
Jul 10, 2017
24
9
You guys are focusing on the obvious part of his description. What he actually wants is for players to start without non melee weapons and then find them laying around in the level to be picked up.
I could do it but I don't know any way to make the player have a gun without giving ammo to other guns too. If it's not possible, it's fine, I'll find a way around
Create a big, map wide 'trigger_add_tf_player_condition' brush (can be one big brush or lots of brushes tied to the same entity) and set it to Condition 41 - "Cannot Switch from Melee", and set the duration to -1.

You then need to have add a named point_clientcommand entity somewhere in the map. I typically name mine 'ClientCommand', but you can pick your own name Go back to the trigger_add_tf_player_condition brush and select it's 'Outputs' tab. Create a new output with this setup:
Code:
OnStartTouch | ClientCommand | command | slot3 | 0.00
Also make sure the 'Clients' flag is enabled in the 'Flags' tab.

Now whenever someone walks into the brush, it will force them to swap to their melee and prevent them from changing until they leave that zone.

While you may want the zone for most of your map, don't include the spawn rooms. You'll want to design those so players walk into the melee-zone as they leave spawn. Spawning player directly in the melee-zone can occasionally cause them not the trigger the 'OnStartTouch' and so those players may have their normal weapons.
thanks! that is really useful!
use the tf_logic_medieval entity to do melee only. I don't think you can spawn pickupable weapons.
I don't want people to complain about the chat nor do I want my map to be medieval, but can also work as plan B.