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
Sit Magic Sit System  

Magic Sit System

Magic Sit system

Category: Sit
By : Whidou Bienstock
Created: 2014-12-04 Edited: 2014-12-04
Worlds: Second Life

the Zip file

Download all files for Magic Sit System
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Readme.txt
Get file # 2. Add this simple sit script.lsl
1 // :AUTHOR: Whidou Bienstock
2
3
4 ##############################################################
5 #
6 # Magic Sit System v1.1
7 #
8 # Open Source Sit Target Editor
9 # GPL v2.0 License
10 # Keep it full perms
11 #
12 ##############################################################
13
14 I. Presentation
15
16 Magic Sit System is the new easy way to configure sit targets on your chairs, beds, cars, rocks, walls, ...
17
18 No need of maths nor calculation scripts. This is the free and lagless alternative to the charmless poseballs.
19
20 II. Why you should not use poseballs
21
22 If you just want to allow residents to sit on your object, each new poseball adds an
23 unnecessary script to the simulator and therefore generates lag.
24
25 Each poseball adds a new prim to your object, diminishing your allowed
26 prims count and generating lag.
27
28 Poseballs are not natural to use, they are a convention.
29
30 Poseballs are not aesthetical.
31
32 III. How to use the Magic Kit
33
34 1) Put the script named "Magic Sit Script" into the object you want to configure
35 2) Rez the "Magic Sit Cube"
36 3) Sit on the cube (left click is enough)
37 4) Right-click on the cube and select "Edit" in the pizza menu that appears
38 5) Move and rotate the cube until your avatar is in the desired position
39 6) Unsit
40
41
42 To test the result, just sit on your object (left click should be enough).
43
44 At the end, the script named "Magic Sit Script" is automatically removed
45 from your object. You can remove the cube as well, or use it to set the
46 sit target of another object.
47
48 IV. Support for multiple sit targets
49
50 If you want several sit positions on your object (bank, couch...), repeat the above
51 sequence for the same number of prims in the object, using the "Edit linked parts"
52 checkbox.
53
54 V. Support for custom animations
55
56 Just drop your animation into the object befor you start the above sequence.
57
58 When you have finished setting the sit target, you can leave the animation
59 in the object and add a script to play that anymation when someone sits on your
60 object, for example the "Magic Anim Script" included in this kit.
61
62 There's no support for multiple animations at this time.
63
64 VI. Legal Mentions
65
66 This sitposing kit is licensed under GPL license version 2
67
68 In short: feel free to redistribute and modify it, as long as any copies of it
69 can be redistributed and modified as well.
70
71 The official text of the licence is available at
72
73 http://www.gnu.org/licences/gpl.html
74
75 (c) The owner of Avatar , 2008

Magic Sit System

Magic sit system

Category: Sit
By : Whidou Bienstock
Created: 2014-12-04 Edited: 2014-12-04
Worlds: Second Life

1 // :AUTHOR: Whidou Bienstock
2
3 // This script is licensed under GPL license version 2
4 //
5 // In short: feel free to redistribute and modify it, as long as
6 // any copies of it can be redistributed and modified as well.
7 //
8 // The official text of the licence is available at
9 // http://www.gnu.org/licences/gpl.html
10 //
11 // (c) The owner of Avatar Whidou Bienstock, 2008
12
13 integer CHANNEL = 48; // Channel of communication with the object
14 string NAME = "Magic Sit Cube - 1.2"; // Name of the Magic Sit Cube
15
16 // Wait for the owner to sit down on the cube
17 default
18 {
19 state_entry() // Set the default parameters
20 {
21 llSetObjectName(NAME);
22 llSitTarget(<0.0, 0.0, 0.00001>, ZERO_ROTATION);
23 llSetScale(<0.2, 0.2, 0.2>);
24 llSetText("Sit on the Magic Cube to begin", <1.0, 0.0, 0.0>, 1.0);
25 llSetTouchText("Doc");
26 llSetSitText("Sitpose");
27 }
28
29 changed(integer change)
30 {
31 if(change & CHANGED_LINK) // If someone sits down
32 {
34
35 if(who == llGetOwner()) // and if it's the owner
36 state config; // then change state
37 else // else
38 llUnSit(who); // unsit the intruder
39 }
40 }
41
42 touch_start(integer total_number) // If someone touches the cube
43 {
44 integer i;
45
46 for (i = 0; i < total_number; i++) // give the documentation
47 {
48 key who = llDetectedKey(i);
50 string name = llDetectedName(i);
51
52 llGiveInventory(who, what);
53 llInstantMessage(who, "Here is the documentation, " + name + ".");
54 }
55 }
56 }
57
58 // The owner sat on the cube
59 state config
60 {
61 state_entry() // Set the new parameters
62 {
63 llSetText("", ZERO_VECTOR, 0.0);
64 llOwnerSay("Welcome to the Magic Sit Configurator!\nPlease be sure to know how the Cube works before to use it.\nIf you don't, right click on the cube and select 'Manual' to get the documentation.\nHave fun!");
65 llSetScale(<5.0, 0.2, 0.2>);
66 llSay(CHANNEL, "*"); // Tell the object to start animating the avatar, if needed
67 }
68
69 changed(integer change)
70 {
71 if(change & CHANGED_LINK)
72 {
73 if(llAvatarOnSitTarget() == NULL_KEY) // When the user unsits
74 {
75 rotation rot = llGetRot(); // Rotation of the cube (and of the avatar)
76 vector pos = // Position of the avatar
77 llGetPos() + <0, 0, 0.4> * rot;
78
79 llSay(CHANNEL, // Send those data to the object
80 (string) pos + "|" + (string) rot);
81 state default; // Return to normal state
82 }
83 }
84 }
85 }

Magic Sit System

Magic Sit System for no poseballs

Category: Sit
By : Whidou Bienstock
Created: 2014-12-04 Edited: 2014-12-04
Worlds: Second Life

1 // :AUTHOR: Whidou Bienstock
2
3
4 // This script is licensed under GPL license version 2
5 //
6 // In short: feel free to redistribute and modify it, as long as
7 // any copies of it can be redistributed and modified as well.
8 //
9 // The official text of the licence is available at
10 // http://www.gnu.org/licences/gpl.html
11 //
12 // (c) The owner of Avatar Whidou Bienstock, 2008
13
14 integer CHANNEL = 48; // Channel of communication with the object
15 string NAME = "Magic Sit Cube - 1.2"; // Name of the Magic Sit Cube
16
17 integer listen_num;
18
19 // Start the first animation stored in the object, if any
20 startAnimation()
21 {
22 if(llGetInventoryNumber(INVENTORY_ANIMATION)) // If there is at least one animation in the inventory
23 {
25
26 if(perm & PERMISSION_TRIGGER_ANIMATION) // and if we can animate the avatar
27 {
29
30 llStopAnimation("sit"); // stop the default animation
31 llStartAnimation(name); // and start the new one
32 }
33 else // else ask the permission
35 }
36 }
37
38 // Stop the first animation stored in the object, if any
39 stopAnimation()
40 {
41 if(llGetInventoryNumber(INVENTORY_ANIMATION)) // If there is at least one animation in the inventory
42 {
44
45 if(perm & PERMISSION_TRIGGER_ANIMATION) // and if we can animate the avatar
46 {
48
49 llStopAnimation(name); // stop the animation
50 }
51 }
52 }
53
54 // Set the sit target
55 sitPose(string message)
56 {
57 list msg = llParseString2List(message, [ "|" ], []); // Split the data
58 vector avPos = (vector) llList2String(msg, 0); // Avatar's position
59 rotation avRot = (rotation) llList2String(msg, 1); // Avatar's rotation
60
61 rotation rot = avRot / llGetRot(); // Difference between the 2 rotations
62 vector pos = // Sit target offset
63 (avPos - llGetPos()) / llGetRot() - <0, 0, 0.4>;
64
65 llSitTarget(pos, rot); // Sitpose the objet (the purpose of the whole thing)
66 llOwnerSay("Object sitposed. I used the following instruction: \nllSitTarget(" + (string) pos + ", " + (string) rot + ");");
67 llSetClickAction(CLICK_ACTION_SIT); // Make it easy to sit for new residents
68 llOwnerSay("Sit target set. Your object is ready."); // Warn the owner
69 }
70
71 default
72 {
74 {
75 listen_num = llListen(CHANNEL, NAME, NULL_KEY, ""); // Listen to the cube
76 llOwnerSay("Magic Sit Script ready"); // Inform the owner
77 }
78
79 listen(integer channel, string name, key id, string message)
80 {
81 if(llGetOwnerKey(id) == llGetOwner()) // Check that the cube has the same owner as the object
82 {
83 if(message == "*") // If the owner sits on the cube
84 {
85 startAnimation(); // then possibly animate his/her avatar
86 }
87 else // else if the owner unsits from the cube
88 {
89 llListenRemove(listen_num); // then remove the listen
90 sitPose(message); // calculate the sit target
91 stopAnimation(); // possibly stop the animation
92 llRemoveInventory(llGetScriptName()); // and destroy this script
93 }
94 }
95 }
96
98 {
99 if(perm & PERMISSION_TRIGGER_ANIMATION) // If the permission is granted
100 {
102
103 llStopAnimation("sit"); // stop the default animation
104 llStartAnimation(name); // and start the new one
105 }
106 }
107 }

Magic Sit System

DESCRIPTION: []::Magic Sit System for no poseballs

Category: Sit
By : Whidou Bienstock
Created: 2014-12-04 Edited: 2014-12-04
Worlds: Second Life

1 // :AUTHOR: Whidou Bienstock
2
3
4 string animation;
5 string SIT_TEXT="";
6
7 default
8
9 {
11
12 {
13 if
14 (llStringLength(SIT_TEXT)>0)llSetSitText(SIT_TEXT);
15
16 }
17
18 changed(integer change)
19
20 {
21 if(change & CHANGED_LINK)
22 {
24 {
26 }
27 else
28 {
30 if((perm & PERMISSION_TRIGGER_ANIMATION) && llStringLength(animation)>0)
31 llStopAnimation(animation);
32 animation="";
33 }
34 }
35 }
36
38 {
40 {
41 llStopAnimation("sit");
43 llStartAnimation(animation);
44 }
45 }
46 }

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