foolproofing doors

BigBangTheory

L1: Registered
Apr 3, 2012
22
0
Seeking help with spycrab room doors.
In my map (trade_server map), I have a red and blue team spycrab room. The thinking is to have an isolated room that x number of people can go into and shut the door and lock out the rest. I have it such that the door closes and the room lights come on and then opens and switches lights out when the button is hit the next time (toggle)
func_button w/ 2 toggle outputs (door and room lights)
func_door w / 2 inputs (OnPressed toggle from button and OnEndTouch from trigger_multiple open)
The trigger_multiple is a room size trigger that is from floor to mid way up that opens the door OnEndTouch and turns off lights OnEndTouch. The thinking is to prevent someone from locking the room and disconnecting from server, and thus locking the room empty.
Problem that exists is the door open / close can be glitched via demo's sticky nades on or near button and folks still can get locked out. Any advanced door resources available that might help with fool-proofing the rooms?
 
Last edited:

Freyja

aa
Jul 31, 2009
2,994
5,813
OnTouch, rather than OnTouchAll triggers each time someone enters the trigger area.

Likewise, OnEndTouch rather than OnEndTouchAll triggers each time someone leaves the trigger area, regardless of who is in it. This includes when someone dies or disconnects.

With this, hooked up to a math_counter, you could theoretically have an active count of how many people are in the room (if you filter the trigger to only players).

If you set up a logic_compare, you could enable/disable the button that controlls the lights/doors only when the count of players within the room is greater than 1.

Put a failsafe in that triggers when the count = 0 with another logic_compare, which toggles the doors to open, thus if no one is in the room, the doors are always open.

I hope that helps!
 

sivartz

L1: Registered
Aug 27, 2012
4
0
could you elaborate just a bit more on your explaination. Ive tried to comprehend the math_counter and the logic_compare.But I think im missing something in translation. This is a great idea if I could get it to work.