Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Typing Typing animation  

Typing animation

Put this in a prim and attach it to your spine.
When you type it triggers whatever prim holds the second script into appearing.

Category: Typing
By : Ferd Frederix
Created: 2013-09-06 Edited: 2013-09-06
Worlds: Second Life

the Zip file

Download all files for Typing animation
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Controller script.lsl
Get file # 2. top of prim.lsl

This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1
2
3 // you can tune these two variables
4
5 float volume = 0.2; // set volume
6 float HowLongToPlay = 3; // how long to play when they start typing - this is tunable
7
8
9
10 integer firstTime; // a flag to see if they started typing
11 float timertick = 45; // 1 sim frame = 24 times a second.
12 string NEW_ANI = "Arm Typing";
13 key TYPING = "c541c47f-e0c0-058b-ad1a-d6ae3a4584d9"; // typing animation ID
14 string typingSound = "37af3633-de9c-2e84-42e6-78995fb864ae"; //Typing sound ID
15
16 integer ticks;
17
18 default
19 {
20
22 {
23 ticks = 0;
24 HowLongToPlay = 3 * timertick;
25 llPreloadSound(typingSound);
26 }
27
28
29
30 attach(key id)
31 {
32 // if there is an avatar key, we are attached.
33 if(id != NULL_KEY) {
34 llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); // we must ask for animation permissions
35 }
36 else {
37 // we are detached, the script will run for a split second before it goes back to inventory.
38 llStopAnimation(TYPING); // shut off typing in case they take us off while we are typing.
39 }
40
41 }
42
44 {
46 {
47 ticks = -1;
48
49 llSetTimerEvent(1/timertick); // once per simulator frame is as fast as a timer can run
50 }
51 }
52
53
54
55 timer()
56 {
58 {
59 // Typing is happening, lets see if this is the first time so we can start the animation
60 if(firstTime++)
61 {
62 // yup, this is the first time.
63 llStopSound(); // stop our sound (will not affect typing sound)
64 llStopAnimation(TYPING); // stop the original typing animation
65 llStartAnimation(NEW_ANI); // play the new animation
66 llPlaySound(typingSound,volume);
67 llMessageLinked(LINK_SET, 34, "Screen on", "");
68 }
69 else
70 {
71 // nope this is the second or longer time, so do nothing
72 }
73
74 }
75 else
76 {
77 // not typing, run this only if timer has expired and we were actually typing
78 if(ticks++ > HowLongToPlay && firstTime)
79 {
80 llStopAnimation(NEW_ANI);
82 llMessageLinked(LINK_SET, 34, "Screen off", "");
83 ticks = 0;
84 firstTime = 0;
85 }
86 }
87
88 }
89
90
91
92 }

Typing animation

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.

Category: Typing
By : Ferd Frederix
Created: 2013-09-06 Edited: 2013-09-06
Worlds: Second Life


This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1
2 default
3 {
5 {
8 }
9
10
11 link_message(integer sender, integer num, string mess, key id){
12
13 if(mess == "Screen on"){
14 llSleep(.12);
16 llSetScale( <0.40, 0.11088, 0.32>);
17 }
18 if(mess == "Screen off") {
19 llSetScale(<0.01, 0.01, 0.01>);
21 }
22 }
23 }

Back to the Best Free Tools in Second Life and OpenSim.