llTriggerSoundLimited(string sound, float volume, vector tne, vector bsw)
Plays a transient sound
NOT attached to an object
with its audible range limited by the axis
--aligned bounding box
defined by tne
(top-north-east) and bsw
(bottom-south-west). The sound plays from a stationary position
located at the center of the object at the time of the trigger. There is no limit to the number of triggered sounds which can be generated by an object, and calling llTriggerSound
does not affect the attached sounds created by llPlaySound
. This is very useful for things like collision
noises, explosions, etc. There is no way to stop or alter the volume
of a sound triggered by this function.
It is polite to use this function where ever possible, especially to prevent your sounds spilling over on to your neighbor's land
. Alternately, use the normal non-limited sound functions and exceedingly small volume
settings, like 0.05
, so that the sound is highly localized, though this is probably less useful for explosions, etc.
The values for tne
are in region local coordinates
. So, the points tne
describe a box in the world
. This box is unrelated to the scripted object's position
. An avatar
standing in this box will be able to hear the triggered sound (if they could hear it if it was played with just llTriggerSound
. That is, they are not too far from the object triggering the sound and it is not too quiet). An avatar standing outside
the box will not hear the sound.
Note: avatars walking into the box after the sound is triggered (no matter the length of the sound) will not hear the sound.
To get the values
, you can use the following method:
- Create a cube that is the bounding box you want (you can make it phantom and semi-transparent to make things easier).
- Create a small sphere (doesn't matter what it is, except for the purposes of this description) centered on one corner of your cube. Take note of its position from the edit window (call this vector1).
- Create another small sphere centered on the diagonally opposite corner of your cube. Take note of its position from the edit window (call this vector2).
- We now have two vectors, vector1 and vector2, for each of x, y, and z. Put the larger value in the vector tne, and the smaller value in bsw.
For example, if vector1
would be <100,75,60>
would be <10,50,20>
If you just want your scripted object's sounds not to spread too far, use this method:
This makes it so that people will only hear the sound if they're within around 10 meters, give or take some. Objects like slot machines would greatly benefit from this.
Q: Is there a way to have sound played so that only a specific agent can hear it?
A: llPlaySound() will also do this in a hud attachment, and it'll be nondirectional.
A: llTriggerSoundLimited(sound, volume, llGetPos(), llGetPos()) in an HUD attachment will do the trick.
You can also target a specific avatar in code like this:
This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.
Functions | Sound | Jasa SEO Jasa SEO Murah Sepatu Online Toko Sepatu Online Sepatu Sepatu Murah Sepatu Safety Sepatu Futsal Cheapes Hostgator Coupon Link Booking Televisori offerte Notebook Offerte Berita Terkini Internet Marketer Muda Internet Marketer Indonesia Portatile Apple RDAnet Lorks Karikatur Bisnis Modal Kecil Bisnis UKM Berita Terbaru Iklan Baris Jasa SEO Jasa SEO Murah SEO Indonesia Konsultan SEO SEO Belajar SEO Kursus SEO Kursus SEO Murah Jam Tangan Casio Jam Tangan Casio Jam Tangan Murah Jam Tangan Grosir Baju Terbaru Grosir Baju Baju Terbaru Grosir Baju Murah Bisnis Online Belajar SEO Kerupuk Kerupuk kulit Social Bookmark Dofollow Social Bookmark Kumpulan Puisi Kirim Puisi bola hantu Penumbuh Rambut Penumbuh Rambut timbangan WBC Wonogiri Jasa SEO Murah Jasa SEO Jam Tangan Murah