Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Why is my vehicle's sound so quiet?

Avion Raymaker
Palacio del Emperador!
Join date: 18 Jun 2007
Posts: 980
07-13-2008 13:43
I have an aircraft noise on my zeppelin, sound loop volume set to 1.0, but I can barely hear it unless I zoom the camera in on my seat. How do I make the sound actually audible to the pilot and passengers when the craft is in flight?

On some of the other vehicles I've tested, it's the same way. I have a freebie boat that I can't hear unless I zoom the camera in on the motor. So is something just messed up in my settings?

Thank you,
--Avion
Taeas Stirling
Registered User
Join date: 4 Sep 2004
Posts: 74
07-13-2008 14:47
Sound will only radiate so far from the prim the sound script is operating in. The fix is to add a sound script with the same sound file to a prim closer to where your camera is set, perhaps one of the blimps tail feathers. Que the sound script with linked messages.
Avion Raymaker
Palacio del Emperador!
Join date: 18 Jun 2007
Posts: 980
07-13-2008 15:51
Thanks Taeas,

I understand the concept now, but the send and receive example in the LSL Wiki is just too sketchy for me to understand. I get the send part:

CODE

default
{
touch_start(integer total_number)
{
// Sends the message 0, "Touched.", NULL_KEY to all scripts in this prim,
// that contain a link_message() event handler. That would _this_ script
// if it has one.
llMessageLinked(LINK_THIS, 0, "Touched.", NULL_KEY);
// The 'LINK_THIS' constant makes llMessageLinked ONLY send the message
// to the current prim.
// It's the same as using 'llGetLinkNumber()' to return the current link number.
}
}


So I understand how I can make that send an "on" or an "off" to the other prim that's activated when I fly the blimp, or when I stand up.

But here is the receive:

CODE

default
{
// Waits for another script to send a link message
link_message(integer sender_num, integer num, string str, key id)
{
llSay(0,str);
}
}


Could someone show an example of what the code in the receiving prim would look like in activating and deactivating the sound?

I assume it's going to be an "if .. else" that runs llLoopSound("Sound_file",1.0); or llStopSound(); depending on which signal it receives?

Thank you,
--Avion
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
07-13-2008 16:17
you could use integer num or string str

ie

if (num == 1) play code;
else if (num == 0) stop code;

or

if (str == "play";) play code;
else if (str == "play";) stop code;
Avion Raymaker
Palacio del Emperador!
Join date: 18 Jun 2007
Posts: 980
07-13-2008 17:43
Thank you, Osgeld,

I used that, and got it to compile without errors, but it doesn't do anything when I test it.
Avion Raymaker
Palacio del Emperador!
Join date: 18 Jun 2007
Posts: 980
07-14-2008 11:27
Sorry to bump, but I've exhausted every resource I can find. Does anyone have another example of send/receive scripts for communicating between prims?

Or is there another easy way to get a large vehicle's sound to be audible without zooming the camera onto the seat?

Thanks again,
--Avion
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
07-14-2008 14:47
See if this makes sense for the "receive" part. Obviously the corresponding START_ and STOP_ENG_MSG constants would have to be used in the MessageLinked() call in the sender, presumably corresponding to the CHANGED_LINK event when the driver sits or stands. (These may look familiar. ;) )

CODE

integer START_ENG_MSG = -5500;
integer STOP_ENG_MSG = -5510;

string CAR_START_SOUND = "105672cd-5014-3cd8-e7bd-5101f1ed9312";
string CAR_IDLE_SOUND = "9fae278a-6cbf-438e-8ba1-70228d825b38";
float CAR_START_SOUND_VOLUME = 1.0;
float CAR_IDLE_SOUND_VOLUME = 1.0;

default
{
state_entry()
{
llSetSoundQueueing(TRUE);
}
link_message(integer sender_num, integer num, string str, key id)
{
if (START_ENG_MSG == num)
{
llPlaySound(CAR_START_SOUND, CAR_START_SOUND_VOLUME);
llLoopSound(CAR_IDLE_SOUND, CAR_IDLE_SOUND_VOLUME);
}
else
if (STOP_ENG_MSG == num)
{
llStopSound();
}
}
}
_____________________
Archived for Your Protection
Avion Raymaker
Palacio del Emperador!
Join date: 18 Jun 2007
Posts: 980
07-15-2008 06:05
Thank you Qie, that got the receive prims working.

I was also not realizing that I was sending only to the current prim (even though it says so in the comment). So changing "LINK_THIS" to "LINK_ALL_OTHERS" fixed the send script.

Thanks again everyone.

P.S. Taeas, I got a notification over email that I got something from you in-world, but I can't find it -- I think it got capped.