Filtering for engineers

Amarnaman

L1: Registered
Jan 22, 2008
1
0
Hi,

I'm trying to see if its possible to have a trigger only fire if an engineer walks through it. I know I can put a filter into the trigger properties but in the filter (filter_activator_class), what do I put for the class name??? I've tried using GFCScrape and in the engineer_red.res file, there are possibilities (Engineer_red, classinfo_engineer, TF_Engineer) but none of them seem to work. Does, anybody know what the class/sub-class name of an engineer is or will this not currently work in TF2/Hammer???
 

Jive Turkey

L3: Member
Jan 22, 2008
120
32
Nope. I've played around with this. I wanted to make map specific buildings that were created by whacking them with the Engi's wrench. No dice. From what I can see from some debugging in the console, all players have the same entity classname. Their "class" as in character class is just a field that is part of this entity, and it is a field which is inaccessible to any of the filter entities. They just see "player" regardless of which character they're actually playing as.

This really sucks and I wish Valve would include some way to determine a player's character class as it would open up a lot of new ideas on map specific objectives.
 

werny

L1: Registered
Jan 20, 2008
11
0
I was wondering is there anyway to take out metal from an engy? so I could create something and it would take 30 metal?, or is that not possible
 
F

felipebp

I am also trying to filter engineer/demoman but without success yet.
 

Milktoast

L1: Registered
Jan 8, 2008
26
0
I ran into the same problem. Everyone is "player." However, from the debugging console, you can see their "playerclass" (which does show what class they are) and even an attribute that shows what weapon they're holding... but there's no way to get at that information from the filter.
 
Oct 25, 2007
219
690
Everyone is "player."

This is the root of the problem. The filter_activator_class filters specific entity classes, not player classes. When a player spawns, no matter what type of TF2 character they chose, they all come from a info_player_teamspawn entity, all players use (and are) the same entity.

If you were making a HL2 map, and you wanted a small room which zombies can't enter, you would filter out npc_zombie since that is the entity that creates zombies. You can't filter specific zombie models however.

In brief, the filter_activator_class examines too broadly for your requirements. Hope that helps.
 

Jive Turkey

L3: Member
Jan 22, 2008
120
32
I really think we should formally petition Valve for this sort of filter entity. It would be dirt simple to implement but it would open a lot of doors for custom map objectives for specific classes.

This is from a post I made on another forum:
the general idea is to have structures that the engineer has to build in order to complete the map. So instead of capping points, you're supporting your engis to build something. Say a power station or a large weapon or maybe a bridge, the something is really just a mcguffin, just someing more interesting than just standing on a cap point. There are other uses too, like route access control. Think of doors that team A can destroy, cutting off one of team B's access routes until an engi can get over there and rebuild it. Or maybe an elevator's motor is destroyed, disabling it until and engi can go and repair it. Maybe an engi can repair the electrical system in a dark warehouse, bringing the lights back on.

There are tons of things an engi could do, but the other classes can have their own goals as well. Perhaps a door has an access code that only a spy's sapper can crack, a code that can be changed again by a spy on the door's own team. Maybe there's a long rail that is a great way to gain access to a certain area, but only a scout is nimble enough to cross it. Other classes get rejected and pushed off by a trigger_push. Maybe a demoman, with his explosives knowledge, can rig a large machine on the opposing team to detonate, killing them or capping an area (maybe their engis then have to rebuild it). Maybe the Medic has to get to an area and poison the water supply of the opposing team, who knows what chemicals he brings around with him. Maybe the soldier has to get to a radio and call in an airstrike on the opposing team's base or use his shovel to dig a trench. Maybe the pyro has to burn down a building or boil some water for whatever purpose (maybe for a turbine, maybe an assassination attempt on the opposing team's pond of expensive tropical fish).

I'd really like to see this sort of capability.
 
F

felipebp

I also agree.
Should do a petition to create a valve body of the filter damage and filter class for tf2.
 

ryodoan

Resident Bum
Nov 2, 2007
409
117
Isn't there anyway to add "real code" to a map? Like some sort of plugin?
I can imagine that hammer can't figure out player classes, but can't we just add it? (or am I now talking 'modding'?)

I doubt it, because it would open up the door for some serious exploits.
 
Oct 25, 2007
219
690
but can't we just add it? (or am I now talking 'modding'?)

Bingo! Modding. You'd actually have to create 9 new enitities. When you create a new map, instead of using info_player_teamspawn you'd use info_player_medic, info_player_soldier, info_player_spy, info_player_pyro and all the rest. This way, the different player classes come from different entity classes.
 

YM

LVL100 YM
aa
Dec 5, 2007
7,158
6,079
oooh thats a nice idea, then you could have different classes spawn in different areas, add some interesting game types
 

MacNetron

L5: Dapper Member
Dec 12, 2007
203
47
Sounds interesting indeed, but can we add that easily in a map. So that it still can be in a map-rotation of a server?
Or do we "break" TF2 by that to have the need start a modded TF2? This last case would be unfortunate.
 
Oct 25, 2007
219
690
Sounds interesting indeed, but can we add that easily in a map. So that it still can be in a map-rotation of a server?
Or do we "break" TF2 by that to have the need start a modded TF2? This last case would be unfortunate.

If someone were to implement what I had said (different entities for different player classes), then it wouldn't be TF2 anymore, it would be a mod. You could make it compatible with 'official' TF2 maps, but the server and clients would still have to run the mod instead of TF2.