Jump to content
Restless Swords

Can sound play only in OWNERS viewer (not everyones)?

Recommended Posts

Say I want to ring a bell, or whatever sound, in the viewer of the owner of the object -- but NOT annoy everyone around me

- llPlaySound etc is heard by everyone.

- best I can tell, there is no way to play a sound only to myself ??

 

Share this post


Link to post
Share on other sites

If it's in a HUD, only the wearer can hear it.

 

EDIT: Another hack / workaround would be to play the sound at a very low volume and position the sounding object as close to the agent's camera as possible, although that requires you know where their camera is, which you'll need permissions for.

Edited by AlduousMcBurlington

Share this post


Link to post
Share on other sites

Certainly, play it in a HUD.  llPlaySound will only be heard by the person wearing the HUD.  llTriggerSound in a HUD will be heard by everyone.  Your HUD script doesn't need anything more complicated than a listen event that responds to a trigger from whatever is managing your system.  So, you have a script in some object on the ground that says:
 

default

{

    collision_start(integer num)

    {

        llRegionSayTo(llDetectedKey(0),-12345,"DING");

    }

}

And you have a HUD that listens:
 

default

{

    state_entry()

    {

        llListen(-12345,"","","");

    }

    listen (integer channel, string name, key id, string message)

    {

        if (message == "DING")

        {

            llPlaySound("Ding",0.5);  //"Ding" is a sound in the HUD's inventory

        }

    }

}

You bump into the object and you hear the sound.  Anyone not wearing the HUD hears nothing.

   

 

  • Like 1

Share this post


Link to post
Share on other sites

and as a side note. if you don't want to give the sound to the user. you can use UUIDs. You can hard code them into the hud script, or as in rolig's example, pass the uuid via chat instead of the sound name

(that's assuming you have full perms of the sound. I get annoyed with creators that sell things "full perm" but then actually make them no mod so you can't change the name, like an animation or sound)

Edited by Ruthven Willenov

Share this post


Link to post
Share on other sites

I tried to do as the example script above for a ranged weapon, so.....the arrow sends the llRegionSayTo to the weapon and then the weapon plays the sound. Problem is....the weapon is not a HUD so the sound goes to everyone not only the OWNER.

My question is if there's another way in order to work without a HUD. I ask because there are weapons that have this feature and also don't have a HUD.

Thank you for your attention....i am anxiously waiting for yout answer......

Share this post


Link to post
Share on other sites

No, although you can always restrict the range of a sound by setting it to lower volume.  Intensity drops off as the square root of distance, so a soft sound will only be heard if you are very close to the emitter.

Share this post


Link to post
Share on other sites

thank you Rolig. I see yur post everywhere....you help a LOT!!! 

I guess i'llhave to put it on a HUD then..... = ).

Edited by Nimus Firehawk

Share this post


Link to post
Share on other sites

i'll check that...i assume you mean using the llPlaySound......and weapon as a HUD but rigged to your hand for example, right?

Respect to llSetSoundRadius there¡s a bug reported many times in SL it doesn't work at all......

 

Edited by Nimus Firehawk

Share this post


Link to post
Share on other sites
28 minutes ago, Nimus Firehawk said:

i'll check that...i assume you mean using the llPlaySound......and weapon as a HUD but rigged to your hand for example, right?

Respect to llSetSoundRadius there¡s a bug reported many times in SL it doesn't work at all......

 

Sorry, I linked the wrong one.

http://wiki.secondlife.com/wiki/LlTriggerSoundLimited

And yes, sounds played by a HUD attachment via Play/TriggerSound are only heard by the wearer. The fact that some links are rigged to other bones does not change that behavior as far as I know. 

Share this post


Link to post
Share on other sites

how can I set llTriggerSoundLimited to the owner only? the coordinates i never really understood....could you help me on that? I'm affraid doing a rig for the weapon will not result in the sthetics i look for...the weapon will always be in an unmobile position an woun't accept user adjustmens...and so would behave with different animations (it would result strange positions)....

 

Share this post


Link to post
Share on other sites
4 hours ago, Nimus Firehawk said:

how can I set llTriggerSoundLimited to the owner only? the coordinates i never really understood....could you help me on that? I'm affraid doing a rig for the weapon will not result in the sthetics i look for...the weapon will always be in an unmobile position an woun't accept user adjustmens...and so would behave with different animations (it would result strange positions)....

The sound created by that function is only heard by avatars that are inside of the box defined by the two positions at the time the sound starts.

If you use "llTriggerSoundLimited(sound, volume, llGetPos(), llGetPos());" only the wearer can possibly be within that area. Anyone else -- even if they're bumping right against the wearer -- can't get close enough to be inside of the same position aside from a few very specific cases (like if both avatars are sitting on objects and are placed in the exact same position that way).

The only downside there is that it's TriggerSound, not PlaySound, so the sound will "fall behind" a moving avatar instead of staying attached to them no matter where they go.

Edited by Wulfie Reanimator

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...