//------------------------------------------------------------
//Foreign Language Proximity Labeler
//by Doktor Tammas
//04-05-08
//When an avatar approaches the object that contains this script,
//the word for that object appears in the lower left corner and
//the word is pronounced in the target language with an audio clip.
//If the object is 'no modify', place this script in the CONTENTS of a prim,
//place the prim near the object, reduce the size of the prim and set the
//transparency to 90%. That way it will be small and almost invisible.
//If you want the students to see a translation in their native language,
//write the word in the EDIT panel under the GENERAL tab.
//There are 4 parameters in the script that you need to change;
//1. DISTANCE from the object before the script is triggered.
//2. TARGET LANGUAGE TEXT which appears in the lower left corner when the avatar
// approaches.
//3. AUDIO CLIP must be uploaded and placed in the same folder as the script under the // CONTENTS tab in the EDIT //pallette. Change the name of the audio file in the
// script to match the actual filename of the audio file. Maximum length = 10 seconds,
// 44Khz, mono, 16-bit, .wav format only
//4. VOLUME: 0.0 = silent, 1.0 = full volume, or any value inbetween (0.5 = half volume)
//Finally, drag the sound file from your INVENTORY to the CONTENTS section of the //object's EDIT palette (where the script is) and change the name of the object
//in the GENERAL section. This name will appear with the TARGET LANGUAGE TEXT.
//Public Domain
integer SomebodyNear = 0;
default
{
state_entry()
{
llSetTimerEvent(5.0);
}
timer()
{
//Change DISTANCE: 5 refers to distance in meters when triggered by avatar.
llSensor("",NULL_KEY,AGENT,5,PI);
}
sensor(integer num_detected)
{
if (SomebodyNear == 0)
{
llWhisper(23, "Sign_On");
//Change TARGET LANGUAGE TEXT
//Replace the words in quotation marks below. Your text will appear in the
//lower left corner when an avatar approaches. You can comment out this line.
llSay(0, "der Stuhl");
//The text in the next line floats above the object. You can comment out this line.
llSetText("der Stuhl", <1,1,1>, 1.5);
//Change name of AUDIO CLIP below after llTriggerSound, change VOLUME if desired.
//Play audioclip at full volume (0.0 = no volume, 1.0 = full volume)
//You can select any increment in between (.25, 5.0. etc.)
//Drag the audio clip from your inventory into the CONTENTS folder.
llTriggerSound("stuhl", 1.0);
SomebodyNear = 1;
}
}
no_sensor()
{
llWhisper(23, "Sign_Off");
SomebodyNear = 0;
}
}
// ------------------------------------------
|
Comments (0)
You don't have permission to comment on this page.