An Entity Question

Languid

L5: Dapper Member
Oct 9, 2009
240
256
Ok, this will be a bit rushed because I typed the entire thing and then lost it :O

I have a ctf map where a door will close when either one of the flags is picked up and will only open again if both briefcases are safe in their bases.
to do this I used a math_counter with an initial value of 0, a min value of 0 and a max value of 0. It triggers the lockdown on hitting the max value and opens things up on hitting the min value.
Both briefcases have 3 outputs leading to the counter, which are:

On Pick Up/Add/1
On Return/Subtract/1
On Capture/Subtract/1

It seems to work when testing in single player, but I don't know what it will do in complex situations. Is my logic sound or not? As a final (related) question, what is a good sound to loop for the firing of a rocket engine? I tried using the HL2 sound that steel does, but it gets annoying very fast.
 

Nutomic

L11: Posh Member
Feb 7, 2009
888
177
What if the intel is picked up, then fropped, then picked up again?

You should better use on drop if that exists, as this will fail soon.
 

Languid

L5: Dapper Member
Oct 9, 2009
240
256
The intel being dropped is not meant to open the passageway. It should only open if both briefcases are safe in their bases, which is why I used on return (the timer running out) and on capture as inputs to subtract from the counter.

Of course, this may turn out to be a terrible idea, but this will be a first time release for me, so I'm mainly doing it to try out the whole taking suggestions and implementing them thing.
 

Languid

L5: Dapper Member
Oct 9, 2009
240
256
I guess if no one knows an answer I can slot it in for a gameday and see if my logic works or not. An answer to the sound question would be good, though.
 

Bockagon

L3: Member
Jul 15, 2009
147
72
I had a crazy idea.
Parent a trigger_multiple to the flag. Make the brush the same size as the flag.

what to do

trigger:
set it to a filter that allows only the team that will be picking up the flag
OnStartTouch/<name of trigger>/disable
OnStartTouch/<name of math_counter>/add/1

flag:
OnReturn/<name of trigger>/enable
OnReturn/<name of math_counter>/Subtract/1
OnCapture/<name of trigger>/enable
OnCapture/<name of math_counter/Subtract/1

I have no way to test this (my computer can't run the SDK anymore) but I think it will work. Give it a shot and let me know what happens. My reasoning is that the use of the triggers instead of just the flag will allow you to more directly control when to modify the math_counter.
 

Dr. ROCKZO

L8: Fancy Shmancy Member
Jul 25, 2009
580
159
*Blows conch Shell and waits for A Boojum Snark*

I guess I better turn the Booj light on too..
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,670
Haven't posted because what obso said will work. There are "better" ways to do it without a parented trigger but I didn't think I needed to bother.