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
Wings Auto-deploying wings  

Auto-deploying wings

Autodeploying Wings

Category: Wings
By : Dana Moore
Created: 2014-01-20 Edited: 2014-01-20
Worlds: Second Life

the Zip file

Download all files for Auto-deploying wings
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. auto wing deploy script.lsl
1
2 // Copyright (c) 2008, Scripting Your World
3 // All rights reserved.
4 //
5 // Scripting Your World
6 // By Dana Moore, Michael Thome, and Dr. Karen Zita Haigh
7 // http://syw.fabulo.us
8 // http://www.amazon.com/Scripting-Your-World-Official-Second/dp/0470339837/
9 //
10 // You are permitted to use, share, and adapt this code under the
11 // terms of the Creative Commons Public License described in full
12 // at http://creativecommons.org/licenses/by/3.0/legalcode.
13 // That means you must keep the credits, do nothing to damage our
14 // reputation, and do not suggest that we endorse you or your work.
15
16 // Autodeploying Wings
17 // The trick to making wings autodepoly is to link two wings to a third, invisible box.
18 // Set a Path Cut Begin to 0.625 and Path Cut End to 0.875 to cut each wing in half.
19 // This script goes into the 3rd, invisible prim. Link the prims so that the invisible prim is the root, or last prim clicked.
20
21
22 vector WINGLG = <0.75,3.0, 0.01>; // flying size
23 vector WINGSM = <0.2, 0.8, 0.01>; // not flying size
24 float TIMER_INTERVAL = 1.0;
25
26 integer gExtended = FALSE;
27 key gMyAvatar = NULL_KEY;
28
29 integer isFlying() {
30 return AGENT_FLYING == (llGetAgentInfo(gMyAvatar) & AGENT_FLYING);
31 }
32
33 checkWings() {
34 if(isFlying()) {
35 if(!gExtended) {
36 gExtended = TRUE;
37 setWings(WINGLG);
38 }
39 } else { // not flying
40 if(gExtended) {
41 gExtended = FALSE;
42 setWings(WINGSM);
43 }
44 }
45 }
46
47 setWings(vector scale) {
49 }
50
51 default {
52 on_rez(integer p) {
54 }
55 state_entry() {
56 gMyAvatar = llGetOwner();
57 gExtended = FALSE;
58 checkWings();
59 llSetTimerEvent(TIMER_INTERVAL);
60 }
61 timer() {
62 checkWings();
63 }
64 }

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