removed useless _ folders
This commit is contained in:
3
Typing animation/Typing animation.sol
Normal file
3
Typing animation/Typing animation.sol
Normal file
@@ -0,0 +1,3 @@
|
||||
<Solution name="Typing animation">
|
||||
<Project name="Typing animation" path="Typing animation\Typing animation.prj" active="true"/>
|
||||
</Solution>
|
||||
104
Typing animation/Typing animation/Object/Controller script.lsl
Normal file
104
Typing animation/Typing animation/Object/Controller script.lsl
Normal file
@@ -0,0 +1,104 @@
|
||||
// :CATEGORY:Typing
|
||||
// :NAME:Typing animation
|
||||
// :AUTHOR:Ferd Frederix
|
||||
// :CREATED:2013-09-06
|
||||
// :EDITED:2013-09-18 15:39:08
|
||||
// :ID:930
|
||||
// :NUM:1335
|
||||
// :REV:1.0
|
||||
// :WORLD:Second Life, OpenSim
|
||||
// :DESCRIPTION:
|
||||
// Put this in a prim and attach it to your spine.// When you type it triggers whatever prim holds the second script into appearing.
|
||||
// :CODE:
|
||||
|
||||
|
||||
// you can tune these two variables
|
||||
|
||||
float volume = 0.2; // set volume
|
||||
float HowLongToPlay = 3; // how long to play when they start typing - this is tunable
|
||||
|
||||
|
||||
|
||||
integer firstTime; // a flag to see if they started typing
|
||||
float timertick = 45; // 1 sim frame = 24 times a second.
|
||||
string NEW_ANI = "Arm Typing";
|
||||
key TYPING = "c541c47f-e0c0-058b-ad1a-d6ae3a4584d9"; // typing animation ID
|
||||
string typingSound = "37af3633-de9c-2e84-42e6-78995fb864ae"; //Typing sound ID
|
||||
|
||||
integer ticks;
|
||||
|
||||
default
|
||||
{
|
||||
|
||||
state_entry()
|
||||
{
|
||||
ticks = 0;
|
||||
HowLongToPlay = 3 * timertick;
|
||||
llPreloadSound(typingSound);
|
||||
}
|
||||
|
||||
|
||||
|
||||
attach(key id)
|
||||
{
|
||||
// if there is an avatar key, we are attached.
|
||||
if(id != NULL_KEY) {
|
||||
llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); // we must ask for animation permissions
|
||||
}
|
||||
else {
|
||||
// we are detached, the script will run for a split second before it goes back to inventory.
|
||||
llStopAnimation(TYPING); // shut off typing in case they take us off while we are typing.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
run_time_permissions(integer perm)
|
||||
{
|
||||
if(perm & PERMISSION_TRIGGER_ANIMATION)
|
||||
{
|
||||
ticks = -1;
|
||||
|
||||
llSetTimerEvent(1/timertick); // once per simulator frame is as fast as a timer can run
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
timer()
|
||||
{
|
||||
if (llListFindList(llGetAnimationList(llGetOwner()), [TYPING]) != -1)
|
||||
{
|
||||
// Typing is happening, lets see if this is the first time so we can start the animation
|
||||
if (firstTime++)
|
||||
{
|
||||
// yup, this is the first time.
|
||||
llStopSound(); // stop our sound (will not affect typing sound)
|
||||
llStopAnimation(TYPING); // stop the original typing animation
|
||||
llStartAnimation(NEW_ANI); // play the new animation
|
||||
llPlaySound(typingSound,volume);
|
||||
llMessageLinked(LINK_SET, 34, "Screen on", "");
|
||||
}
|
||||
else
|
||||
{
|
||||
// nope this is the second or longer time, so do nothing
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// not typing, run this only if timer has expired and we were actually typing
|
||||
if (ticks++ > HowLongToPlay && firstTime)
|
||||
{
|
||||
llStopAnimation(NEW_ANI);
|
||||
llStopSound();
|
||||
llMessageLinked(LINK_SET, 34, "Screen off", "");
|
||||
ticks = 0;
|
||||
firstTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
35
Typing animation/Typing animation/Object/top of prim.lsl
Normal file
35
Typing animation/Typing animation/Object/top of prim.lsl
Normal file
@@ -0,0 +1,35 @@
|
||||
// :CATEGORY:Typing
|
||||
// :NAME:Typing animation
|
||||
// :AUTHOR:Ferd Frederix
|
||||
// :CREATED:2013-09-06
|
||||
// :EDITED:2013-09-18 15:39:08
|
||||
// :ID:930
|
||||
// :NUM:1336
|
||||
// :REV:1.0
|
||||
// :WORLD:Second Life, OpenSim
|
||||
// :DESCRIPTION:
|
||||
// Makes a typewriter or other gadget appear when you type.// THis goes into 'screen prim' that will eppear when you type.// When you type it makes that prim appear.
|
||||
// :CODE:
|
||||
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llOwnerSay((string) llGetScale());
|
||||
llSetTextureAnim (ANIM_ON |SMOOTH| LOOP, ALL_SIDES, 0, 0,0, 0 ,.3);
|
||||
}
|
||||
|
||||
|
||||
link_message(integer sender, integer num, string mess, key id){
|
||||
|
||||
if(mess == "Screen on"){
|
||||
llSleep(.12);
|
||||
llSetAlpha(0.5, ALL_SIDES);
|
||||
llSetScale( <0.40, 0.11088, 0.32>);
|
||||
}
|
||||
if(mess == "Screen off") {
|
||||
llSetScale(<0.01, 0.01, 0.01>);
|
||||
llSetAlpha(0.0, ALL_SIDES);
|
||||
}
|
||||
}
|
||||
}
|
||||
8
Typing animation/Typing animation/Typing animation.prj
Normal file
8
Typing animation/Typing animation/Typing animation.prj
Normal file
@@ -0,0 +1,8 @@
|
||||
<Project name="Typing animation" guid="ddcfd75e-4fee-4091-b707-af952c23d547">
|
||||
<Object name="Object" guid="373d86d2-a977-4c98-9d77-f1e47bcd85c6" active="true">
|
||||
<Script name="Controller script.lsl" guid="7971f9e5-a9eb-4620-af8d-3732dbd3e16b">
|
||||
</Script>
|
||||
<Script name="top of prim.lsl" guid="ebb62cc8-ead8-4190-a198-dbc765493618">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user