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
Movement Prim_Spin__SCRIPT_TEMPLATE  

Prim_Spin__SCRIPT_TEMPLATE

Prim Spin SCRIPT TEMPLATE.lsl

Category: Movement
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Prim_Spin__SCRIPT_TEMPLATE
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Prim_Spin__SCRIPT_TEMPLATE_1.lsl
1
2 //// "llTargetOmega()" SCRIPT TEMPLATE v1 - by Jopsy Pendragon - 4/8/2008
3 //// You are free to use this script as you please, so long as you include this line:
4 //** The original 'free' version of this script came from THE PARTICLE LABORATORY. **//
5
6 // SETUP: Use with CONTROLLER TEMPLATES to turn on/off spin effect.
7
8 // PURPOSE: This script will start a client side "spin" effect on any prim it's
9 // added to. (the whole object will spin if added to root prim).
10 // This is an 'illusionary' effect (not a physical one!)
11
12 float spin_rate = -1.00; // revolutions per second around vertical axis
13 float roll_rate = 0.00; // revs per sec around east/west axis
14 float yaw_rate = 0.00; // revs per second around north/south axis
15
16 integer LOCAL_AXIS = TRUE; // set to true to adjust spin around prim's axis instead of global.
17 // (NOTE: LOCAL_AXIS doesn't update when the prim is rotated by other methods!
18 // only when this effect is restarted.)
19 // May or may not reset to original position when turned off.
20
21
22 string CONTROLLER_ID = "A"; // See comments at end regarding CONTROLLERS.
23 integer AUTO_START = TRUE; // Optionally FALSE only if using CONTROLLERS.
24
25 rotation adjustment = ZERO_ROTATION;
26
27 default {
28 state_entry() {
29
30 if( LOCAL_AXIS ) adjustment = llGetRot();
31
32 if( AUTO_START ) llTargetOmega( <roll_rate, yaw_rate, spin_rate>*adjustment, 2.0, 2.0 );
33
34 }
35
36 link_message( integer sibling, integer num, string mesg, key target_key ) {
37 if( mesg != CONTROLLER_ID ) { // this message isn't for me. Bail out.
38 return;
39 } else if( num == 0 ) { // Message says to turn particles OFF:
40 llTargetOmega( <0, 0, 0>, 1.0, 1.0 );
42 } else if( num == 1 ) { // Message says to turn particles ON:
43 llTargetOmega( <roll_rate, yaw_rate, spin_rate>*adjustment, 2.0, 2.0 );
44 } else { // bad instruction number
45 // do nothing.
46 }
47 }
48
49 }
50
51 // for more visit:
52
53 // http://rpgstats.com/wiki/index.php?title=LlTargetOmega
54 // http://wiki.secondlife.com/wiki/LlTargetOmega
55 // http://lslwiki.net/lslwiki/wakka.php?wakka=llTargetOmega
56
57 // (each is different!)// END //

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