Audio Trigger
by Simonas P · in Torque 3D Beginner · 04/04/2014 (9:42 am) · 5 replies
Hey Everybody,
I'm making a demo of an action adventure game. The first level which is an intro is quite big so I really need to have some audio triggers when the player walks through them to play a certain 3d vocal clip.
I set up the ambience sounds no problem with the sound emitter, but its completely different with this vocal trigger area that I'm trying to do.
If I add the sound emitter to the area that I want it to be played at, for some reason it only plays it once and never again, unless I tick one of the options on or off or move the sphere.
The effect that I'm going for is to have the vocals play even after the player has hit the trigger.
Can anyone please help me out with how to write this sort of trigger script?
Thank you very much in advance :)
I'm making a demo of an action adventure game. The first level which is an intro is quite big so I really need to have some audio triggers when the player walks through them to play a certain 3d vocal clip.
I set up the ambience sounds no problem with the sound emitter, but its completely different with this vocal trigger area that I'm trying to do.
If I add the sound emitter to the area that I want it to be played at, for some reason it only plays it once and never again, unless I tick one of the options on or off or move the sphere.
The effect that I'm going for is to have the vocals play even after the player has hit the trigger.
Can anyone please help me out with how to write this sort of trigger script?
Thank you very much in advance :)
#2
datablock SFXProfile(TrentLevel1Vocal1)
{
filename = "art/sound/trentlevel1vocals/1";
description = AudioClosest3d;
preload = true;
};
This is the set up I have for the vocal file in the player.cs file
Although from testing it further, I'm coming to find that the 3d sound might not be the best idea as when I run through the sound emitter area (the one time it works) I have to be dead on in the center or just off center to hear it properly. Plus it stops after I leave the sphere, which is not really what I'm going for as some of the voice acting files a longer than the time it takes to run through the sphere.
Is there any way to create a 2d sound trigger which will play once the player enters it?
Thanks a lot for your response, sorry for my late reply. I'm in the UK so it might be a time difference thing ;)
04/05/2014 (4:56 am)
yeah the looping is on, but once it plays once it just stops after that...datablock SFXProfile(TrentLevel1Vocal1)
{
filename = "art/sound/trentlevel1vocals/1";
description = AudioClosest3d;
preload = true;
};
This is the set up I have for the vocal file in the player.cs file
Although from testing it further, I'm coming to find that the 3d sound might not be the best idea as when I run through the sound emitter area (the one time it works) I have to be dead on in the center or just off center to hear it properly. Plus it stops after I leave the sphere, which is not really what I'm going for as some of the voice acting files a longer than the time it takes to run through the sphere.
Is there any way to create a 2d sound trigger which will play once the player enters it?
Thanks a lot for your response, sorry for my late reply. I'm in the UK so it might be a time difference thing ;)
#3
I add all my sounds to Art/Datablocks/audioprofiles.cs
Then use sfxplayonce(TrentLevel1Vocal1); in the onEnter command and your done :)
04/05/2014 (8:13 pm)
Pretty sure this is how I do it but i'm not at a PCI add all my sounds to Art/Datablocks/audioprofiles.cs
Then use sfxplayonce(TrentLevel1Vocal1); in the onEnter command and your done :)
#4
04/05/2014 (9:04 pm)
Increase the size of the sphere - the falloff is steep and sound will stop when you can no longer hear it to save resources....
#5
04/06/2014 (5:38 pm)
Sweet!!! Thank you guys very much! so far so good. You are life savers :))
Torque Owner Richard Ranft
Roostertail Games