• 0
monkeybrain

Creating a activation trigger

Question

I was playing around with triggers in editor and wanted to see if it worked on exile so i put this into the SQM in exile.
 

class Entities
    {
    items=1;

class Item0
        {
            dataType="Trigger";
            position[]={9070.1221,130.87619,16045.862};
            class Attributes
            {
                onActivation="playsound""song"";";
                sizeA=100;
                sizeB=100;
                repeatable=1;
                activationBy="ANY";
                isRectangle=1;
            };
            id=252;
            type="EmptyDetectorAreaR50";
            atlOffset=0.40499878;
            };
            };

Works in editor, how would I get it to work in exile? Is it even possible? :P

Thanks

Share this post


Link to post
Share on other sites

22 answers to this question

  • 0

Hello Monkey,

I too had this issue.  I forget, but you need to set the 'side' to the player.  Otherwise everything and its brother will set this off over and over.

 

BUT, there is another bigger issue.  Triggers are ok, but they put a 'drain' on the system.  Many eons ago, the exile loot spawning was handled by triggers.  Too much work, so they switch to using 'math' to determine location.

I would recommend you use this method as it requires much less 'work' on the machines to detect when to 'fire off' this alarm.

Use you use this 'math' in a script which is run by all players, such as being launched via the mission PBO.

The math by the way, is trig, to help point you in the right direction!

:)

 

Share this post


Link to post
Share on other sites
  • 0

Hey, when you say side, do you mean who it's activated by ( say independant)? When i walk into the trigger in game, the sound doesn't trigger at all.

Do you have a example for the second method, i'm new to all of this. Do I put the trigger in a script and execute it in the init?

 

Share this post


Link to post
Share on other sites
Advertisement
  • 0

Hello,

Well, there is a lot of code examples that you can follow for this.

 

You also can get my short/simple 'No Kill Zones' script and it shows it in there:

:)

 

 

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

Well, it is not my 'saying'.  I did not think it was a big deal myself, till I saw the exile devs say so and remove the triggers from exile.  I am not a 'script god' and I strive to learn from others who are better than me.

Since that time, I have seen others come out and say the same thing.

The good thing is with a script such as mine, you can define all sorts of things.  With a trigger, well, you would have to have multiple triggers.

In my script for example, I could have it activate for men on the ground at 200m and for vehicles at 100m all in one script.  For triggers, I would have to have two; one for the 100m and one for the 200m.

 

Is it actually faster?  I heard it is, but I have never tested/timed it.

 

Oh well, you got it going...that's all that matters!  ;)

 

Good luck to ya!

:)

 

Share this post


Link to post
Share on other sites
  • 0

Sorry to bump an older post... but I am stuck with getting this to work... was thinking maybe it's the filesize at 192kb.. I cannot shrink sound file anymore.

And is there a way to get the sound to play from a further distance.. and grow louder at approach to sound source? Not just quietly play at centre of trigger location.

ANY help would be so appreciated!

In description.ext I've added #include "soundcall.cpp"

In soundcall.cpp file

Spoiler

class CfgSFX
{
    sounds[] = {"prayer2"};

    class sfxsound14
    {
        name = "prayer2";
        sounds[]={sfxsound};
        sfxsound[]={"sound\prayer2.ogg",15,1,24,1,1,1,0};
        empty[]= {"",0,0,0,0,0,0,0};
    };

};

Current mission.sqm

Spoiler

        class Item53 
        {
            dataType="Trigger";
            position[]={16719.416,3.2958221,10335.763};
            class Attributes
            {
                condition="call{this}";
                onActivation="call{playsound prayer2}";
                sizeA=250;
                sizeB=250;
                repeatable=1;
                activationBy="ANYPLAYER";
                effectSoundTrigger="sfxsound14";
            };
            id=306;
            type="EmptyDetectorAreaR250";
        };

 

Edited by Numbat177

Share this post


Link to post
Share on other sites
  • 0

One way that MIGHT work and it is a silly trick, but in most things, it would do.

Try this - If the max volume of the file is '5', increase it to '10' and resave it.  Increase it's 'amplitude'.  This way, when it starts to play, it will be at a higher volume level that it was before..

Of course, this also might be a program limitation put in place by Bohemia too, which would be fun to try to get around...

;)

 

Share this post


Link to post
Share on other sites
  • 0
On 03/11/2017 at 4:27 AM, Z80CPU said:

Try this - If the max volume of the file is '5', increase it to '10' and resave it.  Increase it's 'amplitude'.  This way, when it starts to play, it will be at a higher volume level that it was before..

I am so sorry... I didn't receive an alert that someone replied to this post, or I plain missed it lol ... thank you for your reply... I'm not sure which setting is 'amplitude' or 'volume' for that matter.

The trigger and sound work great when playing game via Eden editor .. but when running on the server it's a no go.

Share this post


Link to post
Share on other sites
  • 0
30 minutes ago, Z80CPU said:

Look at this post for guidance...it should point you in the correct direction...

 

Z80CPU, if you were meaning your earlier post with link to NKZ, I had already looked at all that before posting here... I'm not understanding how to use or alter the NKZ script to create a sound trigger/marker with that. Thankyou anyway though. ;)

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.