Door closing after capturing two points?

cornontheCoD

L420: High Member
Mar 25, 2008
437
70
I want a door to close after the attacking team captures A and B (gravelpit style).

I am having a hard time doing this. I tried using logic_compare with the input starting at 0 and the compare value at 2. Hypothetically, I could make capping A add 1 and capping B add 1. The problem is that on the hammer wiki it says that the addoutput command (I would use the addoutput command from the cap points, sending it to the logic_compare) is potentially dangerous to use and to use it with care

any ideas?
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Wrong entity to use. Use a math_counter with it's max value set to 2, and starts at 0. Each capture adds 1 to it and use OnHitMax to close the door.

As a side note, addoutput has nothing to do with mathematical adding, it literally adds an output to an entity. They label it as dangerous because it is entirely possible to do things with it that will cause crashes if not handled with care.
 
Jan 31, 2008
555
1,482
Make three relays.

relay_cap_a (Start disabled)
relay_cap_b (Start disabled)
relay_cappedboth

relay_cap_a:: OnTrigger -> relay_cap_b -> Trigger
relay_cap_b:: OnTrigger -> relay_cappedboth -> Trigger
controlpoint_a:: OnCapTeam2 -> relay_cap_a -> Trigger
controlpoint_b:: OnCapTeam2 -> relay_cap_a -> Trigger
relay_cappedboth:: OnTrigger -> door -> Open

Or do it the easy way that boojum said :D