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
Jewelry Necklace_Generator  

Necklace_Generator

DO NOT TRY THIS AT HOME! A sandbox i...

Category: Jewelry
By : Ariane Brodie
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Necklace_Generator
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Necklace_Generator_1.lsl
Get file # 2. Necklace_Generator_2.lsl
Get file # 3. Necklace_Generator_3.lsl
1 //fine jewelry necklace generator
2 float a = 0.6; //elipse parameter between 0 (line) and 1 (perfect circle)
3 float b = 0.3; //bending parameter 0 = flat
4 string bead = "test bead"; //object to use
5 integer numbeads = 30; //how many beads should the necklace have
6 vector offsetrot = <0,0,0>; //rotation of test bead
7
8 make()
9 {
10 integer n;
11 float t; //parameter
12 float d; //derivitive angle
13 vector p; //position
14 vector re; //rotation in euler
15 rotation rot; //re in rot format
16 for(n = 1;n <= numbeads;n++) {
17 t = TWO_PI * ((float)n/(float)numbeads);
19 p.x = llCos(t);
20 p.y = a * llSin(t);
21 p.z = b * llCos(t)*llCos(t) + 1;
22 p = p + llGetPos();
23 re.x = -1 * llSin(t) + DEG_TO_RAD * offsetrot.x;
24 re.y = llCos(t) + DEG_TO_RAD * offsetrot.y;
25 re.z = t + DEG_TO_RAD * offsetrot.z;
26 rot = llEuler2Rot(re);
27 llRezObject(bead, p, ZERO_VECTOR, rot, 0);
28 }
29 }
30
31
32 default
33 {
35 {
36 llSay(0, "Touch to generate a Necklace");
37 }
38
39 touch_start(integer total_number)
40 {
41 make();
42 }
43 }

Necklace_Generator

Link Script

Category: Jewelry
By : Ariane Brodie
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

1 default
2 {
3
4 link_message(integer channel, integer sender, string message, key id) {
5
6 if(message == "gold")
8 PRIM_COLOR, ALL_SIDES, <0.9, 0.9, 0.5>, 1.0,
10
11 if(message == "silver")
13 PRIM_COLOR, ALL_SIDES, <0.8, 0.8, 0.8>, 1.0,
15
16 if(message == "glow")
19
20 if(message == "hideneck")
22 PRIM_COLOR, ALL_SIDES, <1,1,1>, 0.0,
24 }
25
26 }

Necklace_Generator

If you put the link script in, then linked all the chain links together then edit, replace the link script with this chain script.

Category: Jewelry
By : Ariane Brodie
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

1 //typing /1 gold turns necklace gold
2 //typing /1 silver turns necklace silver
3 //typing /1 glow turns on full bright with any color (best at night)
4 //typing /1 hideneck makes the necklace disappear, but you still wear it.
5
6 default
7 {
9 {
10 llListen(1, "", llGetOwner(), "");
11 }
12
13 listen(integer channel, string name, key id, string message)
14 {
16 }
17
18 link_message(integer channel, integer sender, string message, key id) {
19
20 if(message == "gold")
22 PRIM_COLOR, ALL_SIDES, <0.9, 0.9, 0.5>, 1.0,
24
25 if(message == "silver")
27 PRIM_COLOR, ALL_SIDES, <0.95, 0.95, 0.95>, 1.0,
29
30 if(message == "glow")
33
34 if(message == "hideneck")
36 PRIM_COLOR, ALL_SIDES, <1,1,1>, 0.0,
38 }
39 }

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