Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Radio

Grizzly Ogg
Registered User
Join date: 10 May 2006
Posts: 39
02-09-2007 07:09
Hello i would need to have a radio script , its like this
/p hello . And only thoes peoples that got the radio on can hear if they are pretty near me , so thoes ppl that not have it and they are even near me cant hear if i talk in the radio but only the ppl that got it.

Plz can someone help me ?
Tyann Toll
It went... where?!
Join date: 17 Dec 2006
Posts: 37
02-09-2007 07:58
You want the radio to retransmit what you are saying to other people? Here is some rough psuedocode that might do what you want. I'm sorry I don't have the time to work this into actual code, but here is my idea.

CODE


integer RadioFrequency = -2504;
integer RadioSpeakChannel = 104;

Radio State()
{

state_entry
{
start a listener on channel RadioFrequency;
start a listener on channel RadioSpeakChannel;
}

EVENT If you hear something on RadioSpeakChannel said by the owner of this radio
{rebroadcast repeat this message on RadioFrequency};

EVENT If you hear something on RadioFrequency not said by the owner
{rebroadcast this with llOwnerSay};

}


The idea here is that you talk to your radio by starting the line of text with /104
Your radio will then rebroadcast this line of text on a "frequency" it shares with other radios. When your radio hears something not said by the you on this frequency it uses llOwnerSay to repeat the message to you. Only the owner hears this.

Crosstalking should be prevented by the ownership check.

Although I am not sure objects can talk to each other at massive ranges, so you might not get quite the distance you want. Yelling on the RadioChannel might increase the range.
Grizzly Ogg
Registered User
Join date: 10 May 2006
Posts: 39
02-09-2007 10:32
its only say " syntax Error .... " i dont know much about script help me??
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
02-09-2007 10:41
http://lslwiki.org/index.php/LSL101
_____________________
Tyann Toll
It went... where?!
Join date: 17 Dec 2006
Posts: 37
02-09-2007 11:15
Its not a complete script. Its a structure for you to build your own script up around. Im sorry I didn't make that clear. You might want to take a look at the LSL wiki that Jill linked to.

Scripting is not all that difficult. ^^