|
Tybalt Brando
Catalyst
Join date: 25 Dec 2006
Posts: 347
|
06-16-2007 08:44
Is there a simple straight up Microphone script out there? And where could I find it?
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
06-16-2007 11:21
Can you be a bit more specific? 'simple straight up Microphone script ' is a little bit vague..
A script to play an animation is pretty simple, the differences between it being an attachment or not are minor.
_____________________
I'm back......
|
|
Russ Allen
scripter
Join date: 22 Mar 2007
Posts: 22
|
06-16-2007 11:41
default { state_entry() { llListen(0, "", llGetOwner(), ""  ; } listen(integer chan, string name, key id, string mes) { llRegionSay(0, mes); } } hope this helps =)
|
|
Jeff Kelley
Registered User
Join date: 8 Nov 2006
Posts: 223
|
06-16-2007 16:28
There is no simple straight up microphone script out there but you can do the following:
- Give the microphone object an axis (like a real microphone) - Sense a 2 meters radius, PI/4 front - Pick the nearest agent (llVecDist(llDetectedPos(n),llPos()) - Chek this agent points to the microphone (llDetectedRot(n)) - Listen to this agent
Perfect Signal/Noise ratio !
|
|
miranda Ashby
Registered User
Join date: 15 Mar 2007
Posts: 27
|
06-17-2007 09:23
From: Russ Allen default { state_entry() { llListen(0, "", llGetOwner(), ""  ; } listen(integer chan, string name, key id, string mes) { llRegionSay(0, mes); } } hope this helps =) got an error: Object: Cannot use llRegionSay() on channel 0. Any fix?
|
|
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
|
06-17-2007 09:42
llRegionSay does not chat on channel 0.
Looks like that's more of a megaphone script anyways, not a microphone.
Though if you needed something like that on your own land, you might use llShout instead of llRegionSay.
If it's not on your own land though, it would probably be seen as griefing to shout what you are saying all over the sim if done too much...
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
06-17-2007 10:34
The "amplified" text will be color-coded (green by default) as coming from an object rather than an avatar--nothing you can do about that. But you can make it at least identify itself as the speaker with a call to llSetObjectName()... either to llGetOwner() if it's a "unidirectional" microphone attachment, or to the "name" parameter of the listen() event if it's to be "omnidirectional."
You can also do something kind of "backwards" of a microphone, to *reduce* the radius of chat by llWhisper()ing to channel 0 anything you say on some other channel to which the script is llListen()ing.
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
06-18-2007 10:27
I had made a similar object to this for an auditorium.
Basically all I did is code it to where it starts as open, and a person can click on it and get a dialog menu to turn it on. Once it's on, if they click it again, it will give them the option to turn it off, (free it up for someone else to turn it on) pause it (in case they want to say something and not broadcast it), or select new speaker (where the next person to click it becomes the speaker)
What it essentially does is it shouts the name of the speaker on a hidden channel (this was before regionsay), and the 'speakers' rename themselves to the same name as the speaker. From that point on it just repeats everything said on another channel that the prims then 'speak' on channel 0. The effect makes it appear the same as if the original speaker is saying everything except for the chat color. When on Pause, Off or Change Speaker, it just stops listening, and when off, the speakers rename to 'Speaker'.
|