Sound activated by two seperate triggers


(TNR360) #1

edit:when I say soldier I am not refering to the class just players in general

Say I have an allied soldier at point A and a german soldier at B
both A and B have a trigger targeting a sound
I want to know if it is possible: to have a sound trigger ONLY IF THERE IS AN
ALLIED soldier in A and a AXIS soldier in B if this condition is NOT met the sound does NOT play.


EXAMPLE


SOUND PLAYS—
Allied soldier AXIS SOLDIER
A B

SOund Does not play—
Allied Soldier NOBODY
A B


Possible? how? :?

thanks :smiley:


(89blitz) #2

Go on trigger A and click the spawnflag Allied only :slight_smile:
Go on trigger B and click the spawnflaf Axis only :slight_smile:


(TNR360) #3

yes but would that make it so BOTH triggers are needed?


(kamikazee) #4

yes but would that make it so BOTH triggers are needed?[/quote]No, but you can check that one if you set up some nifty script using bits from the accum values.

Try to draw it on paper to make sure you don’t mess up all those variables. I know it helped me a lot when writing the ET Headshot 2 script.


(Flippy) #5

You would indeed need an ‘allied_only’ trigger(_multiple) in A and an ‘axis_only’ trigger(_multiple) in point B.

Let these triggers target a ‘target_script_trigger’ so you can run a script when someone enters the trigger.

The easiest way to make the script would probably be something like this. I don’t think this is the best way because you are using 2 accums and it might be possible to do with only one…but hey i guess it works so…

Both target_script_triggers should have the same scriptname, but each a different ‘target’.
I don’t know if you are familiar with target_script_triggers, but all they do is run the following script:

<scriptname of target_script_trigger>
{
    <target of target_script_trigger>
    {
        //This gets executed
    }
}

In the ‘target’ block for point A (call it target_A or something like that) you set accum 0 to 1 for example. This means that point A is triggered.

In the ‘target’ block for point B you set accum 1 to 1. This means point B is triggered.

Then, after setting the accum value (in both blocks) you have to check if the other point is also occupied, eg check if the other accum is 1.

Can you work that out yourself?