Math Counter and npc_turret_ground

So I’m working on a HL2E2 level and I’m trying to get this puzzle to work. In sum, the player can blast their way into a Combine outpost by overloading a gas main and taking out the outpost’s defense turret to cause a reaction. The entity logic is set up like so:

math counter 1, max value of 3. Gas valve 1, 2, and 3 each Add 1 to the value of this counter. When maxed, a light flips on to signify the gas is overloaded enough.

[attach=5155,none,1916][/attach]

math counter 2, designed after the ground turrets in the Overwatch Nexus during “Follow Freeman!” The counter is based around a check to see if the player has tripped a sensor recently to force a check from the turret. If the player trips a sensor, the trigger subtracts 1 to turn off the lasers and enable the turret, as well as opening it’s func_door casing. If the area is clear, it adds 1 from the counter to re-enable the laser grid and shut the floor hatch, disabling the weapon.

[attach=5156,none,1928][/attach]

2 major problems with my entity setup-

  1. The light on the third button isn’t turning on, which means possibly the counter is not receiving all possible additions.

  2. The turret refuses to shoot at me. I’ve tried everything- changing the casing, the logic for tripping the sensor, I even squadded in an enemyfinder in case the turret was having issues seeing the player. Nothing works.

I’ve been slaving away at this logic for several days and it’s getting quite annoying. Is there a way to check my entity logic to ensure all additions are being calculated properly? I saw one bug in the console that I fixed, but it didn’t help the overall issue. Map available on request.


If you pop the VMF my way I can take a quick look for you, if you like.

Alternatively, try running the game with developer 2 enabled. This makes all entities output their entity logic to the console, and you can then go over the console log and debug.

I PMed you about it. Thanks very much!

Small useless note:
If you double click (or drag) the manifest window on your right, you can kill it with the x button on it. Gives you a little bit more of screen space.

You can also use ent_messages_draw 1 to visually see the entity outputs that are being sent. Very useful entity debug tool.

Ooo! I’ll have to try that cvar!

Founded in 2004, Leakfree.org became one of the first online communities dedicated to Valve’s Source engine development. It is more famously known for the formation of Black Mesa: Source under the 'Leakfree Modification Team' handle in September 2004.