removed useless _ folders
This commit is contained in:
3
Magic Sit System/Magic Sit System.sol
Normal file
3
Magic Sit System/Magic Sit System.sol
Normal file
@@ -0,0 +1,3 @@
|
||||
<Solution name="Magic Sit System">
|
||||
<Project name="Magic Sit System" path="Magic Sit System\Magic Sit System.prj" active="true"/>
|
||||
</Solution>
|
||||
@@ -0,0 +1,98 @@
|
||||
// :CATEGORY:Sit
|
||||
// :NAME:Magic Sit System
|
||||
// :AUTHOR:Whidou Bienstock
|
||||
// :KEYWORDS:
|
||||
// :CREATED:2014-12-04 12:16:31
|
||||
// :EDITED:2014-12-04
|
||||
// :ID:1059
|
||||
// :NUM:1689
|
||||
// :REV:1
|
||||
// :WORLD:Second Life
|
||||
// :DESCRIPTION:
|
||||
// Magic sit system
|
||||
// :CODE:
|
||||
// :AUTHOR: Whidou Bienstock
|
||||
|
||||
// This script is licensed under GPL license version 2
|
||||
//
|
||||
// In short: feel free to redistribute and modify it, as long as
|
||||
// any copies of it can be redistributed and modified as well.
|
||||
//
|
||||
// The official text of the licence is available at
|
||||
// http://www.gnu.org/licences/gpl.html
|
||||
//
|
||||
// (c) The owner of Avatar Whidou Bienstock, 2008
|
||||
|
||||
integer CHANNEL = 48; // Channel of communication with the object
|
||||
string NAME = "Magic Sit Cube - 1.2"; // Name of the Magic Sit Cube
|
||||
|
||||
// Wait for the owner to sit down on the cube
|
||||
default
|
||||
{
|
||||
state_entry() // Set the default parameters
|
||||
{
|
||||
llSetObjectName(NAME);
|
||||
llSitTarget(<0.0, 0.0, 0.00001>, ZERO_ROTATION);
|
||||
llSetScale(<0.2, 0.2, 0.2>);
|
||||
llSetText("Sit on the Magic Cube to begin", <1.0, 0.0, 0.0>, 1.0);
|
||||
llSetTouchText("Doc");
|
||||
llSetSitText("Sitpose");
|
||||
}
|
||||
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_LINK) // If someone sits down
|
||||
{
|
||||
key who = llAvatarOnSitTarget();
|
||||
|
||||
if (who == llGetOwner()) // and if it's the owner
|
||||
state config; // then change state
|
||||
else // else
|
||||
llUnSit(who); // unsit the intruder
|
||||
}
|
||||
}
|
||||
|
||||
touch_start(integer total_number) // If someone touches the cube
|
||||
{
|
||||
integer i;
|
||||
|
||||
for (i = 0; i < total_number; i++) // give the documentation
|
||||
{
|
||||
key who = llDetectedKey(i);
|
||||
key what = llGetInventoryName(INVENTORY_NOTECARD, 0);
|
||||
string name = llDetectedName(i);
|
||||
|
||||
llGiveInventory(who, what);
|
||||
llInstantMessage(who, "Here is the documentation, " + name + ".");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The owner sat on the cube
|
||||
state config
|
||||
{
|
||||
state_entry() // Set the new parameters
|
||||
{
|
||||
llSetText("", ZERO_VECTOR, 0.0);
|
||||
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!");
|
||||
llSetScale(<5.0, 0.2, 0.2>);
|
||||
llSay(CHANNEL, "*"); // Tell the object to start animating the avatar, if needed
|
||||
}
|
||||
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_LINK)
|
||||
{
|
||||
if (llAvatarOnSitTarget() == NULL_KEY) // When the user unsits
|
||||
{
|
||||
rotation rot = llGetRot(); // Rotation of the cube (and of the avatar)
|
||||
vector pos = // Position of the avatar
|
||||
llGetPos() + <0, 0, 0.4> * rot;
|
||||
|
||||
llSay(CHANNEL, // Send those data to the object
|
||||
(string) pos + "|" + (string) rot);
|
||||
state default; // Return to normal state
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
88
Magic Sit System/Magic Sit System/Magic Sit Cube/Readme.txt
Normal file
88
Magic Sit System/Magic Sit System/Magic Sit Cube/Readme.txt
Normal file
@@ -0,0 +1,88 @@
|
||||
// :CATEGORY:Sit
|
||||
// :NAME:Magic Sit System
|
||||
// :AUTHOR:Whidou Bienstock
|
||||
// :KEYWORDS:
|
||||
// :CREATED:2014-12-04 12:16:08
|
||||
// :EDITED:2014-12-04
|
||||
// :ID:1059
|
||||
// :NUM:1688
|
||||
// :REV:1
|
||||
// :WORLD:Second Life
|
||||
// :DESCRIPTION:
|
||||
// Magic Sit system
|
||||
// :CODE:
|
||||
// :AUTHOR: Whidou Bienstock
|
||||
|
||||
|
||||
##############################################################
|
||||
#
|
||||
# Magic Sit System v1.1
|
||||
#
|
||||
# Open Source Sit Target Editor
|
||||
# GPL v2.0 License
|
||||
# Keep it full perms
|
||||
#
|
||||
##############################################################
|
||||
|
||||
I. Presentation
|
||||
|
||||
Magic Sit System is the new easy way to configure sit targets on your chairs, beds, cars, rocks, walls, ...
|
||||
|
||||
No need of maths nor calculation scripts. This is the free and lagless alternative to the charmless poseballs.
|
||||
|
||||
II. Why you should not use poseballs
|
||||
|
||||
If you just want to allow residents to sit on your object, each new poseball adds an
|
||||
unnecessary script to the simulator and therefore generates lag.
|
||||
|
||||
Each poseball adds a new prim to your object, diminishing your allowed
|
||||
prims count and generating lag.
|
||||
|
||||
Poseballs are not natural to use, they are a convention.
|
||||
|
||||
Poseballs are not aesthetical.
|
||||
|
||||
III. How to use the Magic Kit
|
||||
|
||||
1) Put the script named "Magic Sit Script" into the object you want to configure
|
||||
2) Rez the "Magic Sit Cube"
|
||||
3) Sit on the cube (left click is enough)
|
||||
4) Right-click on the cube and select "Edit" in the pizza menu that appears
|
||||
5) Move and rotate the cube until your avatar is in the desired position
|
||||
6) Unsit
|
||||
|
||||
|
||||
To test the result, just sit on your object (left click should be enough).
|
||||
|
||||
At the end, the script named "Magic Sit Script" is automatically removed
|
||||
from your object. You can remove the cube as well, or use it to set the
|
||||
sit target of another object.
|
||||
|
||||
IV. Support for multiple sit targets
|
||||
|
||||
If you want several sit positions on your object (bank, couch...), repeat the above
|
||||
sequence for the same number of prims in the object, using the "Edit linked parts"
|
||||
checkbox.
|
||||
|
||||
V. Support for custom animations
|
||||
|
||||
Just drop your animation into the object befor you start the above sequence.
|
||||
|
||||
When you have finished setting the sit target, you can leave the animation
|
||||
in the object and add a script to play that anymation when someone sits on your
|
||||
object, for example the "Magic Anim Script" included in this kit.
|
||||
|
||||
There's no support for multiple animations at this time.
|
||||
|
||||
VI. Legal Mentions
|
||||
|
||||
This sitposing kit is licensed under GPL license version 2
|
||||
|
||||
In short: feel free to redistribute and modify it, as long as any copies of it
|
||||
can be redistributed and modified as well.
|
||||
|
||||
The official text of the licence is available at
|
||||
|
||||
http://www.gnu.org/licences/gpl.html
|
||||
|
||||
(c) The owner of Avatar , 2008
|
||||
16
Magic Sit System/Magic Sit System/Magic Sit System.prj
Normal file
16
Magic Sit System/Magic Sit System/Magic Sit System.prj
Normal file
@@ -0,0 +1,16 @@
|
||||
<Project name="Magic Sit System" guid="d44216b9-a3d1-4489-8b91-70feab4543bf">
|
||||
<Object name="Magic Sit Cube" guid="ade790de-a92d-495e-9afc-d8fa3225e438" active="true">
|
||||
<Notecard name="Readme.txt" guid="55f3aa84-d55b-4ecb-8da1-d84cc625c8d4">
|
||||
</Notecard>
|
||||
<Script name="Magic Sit Cube Script 1.2" guid="e736b38d-35ed-4b48-b354-7f7b1736508a">
|
||||
</Script>
|
||||
</Object>
|
||||
<Object name="Seat" guid="4869d078-29b3-4c95-9357-c11d9aa1ca83">
|
||||
<Animation name="Animation.ani" guid="984f6503-94cd-4f44-a5ea-93b98e135448">
|
||||
</Animation>
|
||||
<Script name="Magic Sit Script 1.2" guid="511b6d85-20dc-477c-85ae-575fabd13b67">
|
||||
</Script>
|
||||
<Script name="Add this simple sit script.lsl" guid="2aa9e8eb-ab2d-430d-a0e5-6f247601850e">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
@@ -0,0 +1,59 @@
|
||||
// :CATEGORY:Sit
|
||||
// :NAME:Magic Sit System
|
||||
// :AUTHOR:Whidou Bienstock
|
||||
// :KEYWORDS:
|
||||
// :CREATED:2014-12-04 12:26:01
|
||||
// :EDITED:2014-12-04
|
||||
// :ID:1059
|
||||
// :NUM:1691
|
||||
// :REV:1
|
||||
// :WORLD:Second Life
|
||||
// :DESCRIPTION:
|
||||
// DESCRIPTION: []::Magic Sit System for no poseballs
|
||||
// :CODE:
|
||||
// :AUTHOR: Whidou Bienstock
|
||||
|
||||
|
||||
string animation;
|
||||
string SIT_TEXT="";
|
||||
|
||||
default
|
||||
|
||||
{
|
||||
state_entry()
|
||||
|
||||
{
|
||||
if
|
||||
(llStringLength(SIT_TEXT)>0)llSetSitText(SIT_TEXT);
|
||||
|
||||
}
|
||||
|
||||
changed(integer change)
|
||||
|
||||
{
|
||||
if (change & CHANGED_LINK)
|
||||
{
|
||||
if (llAvatarOnSitTarget() != NULL_KEY)
|
||||
{
|
||||
llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
|
||||
}
|
||||
else
|
||||
{
|
||||
integer perm=llGetPermissions();
|
||||
if ((perm & PERMISSION_TRIGGER_ANIMATION) && llStringLength(animation)>0)
|
||||
llStopAnimation(animation);
|
||||
animation="";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
run_time_permissions(integer perm)
|
||||
{
|
||||
if (perm & PERMISSION_TRIGGER_ANIMATION)
|
||||
{
|
||||
llStopAnimation("sit");
|
||||
animation=llGetInventoryName(INVENTORY_ANIMATION,0);
|
||||
llStartAnimation(animation);
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Magic Sit System/Magic Sit System/Seat/Magic Sit Script 1.2
Normal file
120
Magic Sit System/Magic Sit System/Seat/Magic Sit Script 1.2
Normal file
@@ -0,0 +1,120 @@
|
||||
// :CATEGORY:Sit
|
||||
// :NAME:Magic Sit System
|
||||
// :AUTHOR:Whidou Bienstock
|
||||
// :KEYWORDS:
|
||||
// :CREATED:2014-12-04 12:25:56
|
||||
// :EDITED:2014-12-04
|
||||
// :ID:1059
|
||||
// :NUM:1690
|
||||
// :REV:1
|
||||
// :WORLD:Second Life
|
||||
// :DESCRIPTION:
|
||||
// Magic Sit System for no poseballs
|
||||
// :CODE:
|
||||
// :AUTHOR: Whidou Bienstock
|
||||
|
||||
|
||||
// This script is licensed under GPL license version 2
|
||||
//
|
||||
// In short: feel free to redistribute and modify it, as long as
|
||||
// any copies of it can be redistributed and modified as well.
|
||||
//
|
||||
// The official text of the licence is available at
|
||||
// http://www.gnu.org/licences/gpl.html
|
||||
//
|
||||
// (c) The owner of Avatar Whidou Bienstock, 2008
|
||||
|
||||
integer CHANNEL = 48; // Channel of communication with the object
|
||||
string NAME = "Magic Sit Cube - 1.2"; // Name of the Magic Sit Cube
|
||||
|
||||
integer listen_num;
|
||||
|
||||
// Start the first animation stored in the object, if any
|
||||
startAnimation()
|
||||
{
|
||||
if (llGetInventoryNumber(INVENTORY_ANIMATION)) // If there is at least one animation in the inventory
|
||||
{
|
||||
integer perm = llGetPermissions();
|
||||
|
||||
if (perm & PERMISSION_TRIGGER_ANIMATION) // and if we can animate the avatar
|
||||
{
|
||||
string name = llGetInventoryName(INVENTORY_ANIMATION, 0);
|
||||
|
||||
llStopAnimation("sit"); // stop the default animation
|
||||
llStartAnimation(name); // and start the new one
|
||||
}
|
||||
else // else ask the permission
|
||||
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
|
||||
}
|
||||
}
|
||||
|
||||
// Stop the first animation stored in the object, if any
|
||||
stopAnimation()
|
||||
{
|
||||
if (llGetInventoryNumber(INVENTORY_ANIMATION)) // If there is at least one animation in the inventory
|
||||
{
|
||||
integer perm = llGetPermissions();
|
||||
|
||||
if (perm & PERMISSION_TRIGGER_ANIMATION) // and if we can animate the avatar
|
||||
{
|
||||
string name = llGetInventoryName(INVENTORY_ANIMATION, 0);
|
||||
|
||||
llStopAnimation(name); // stop the animation
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set the sit target
|
||||
sitPose(string message)
|
||||
{
|
||||
list msg = llParseString2List(message, [ "|" ], []); // Split the data
|
||||
vector avPos = (vector) llList2String(msg, 0); // Avatar's position
|
||||
rotation avRot = (rotation) llList2String(msg, 1); // Avatar's rotation
|
||||
|
||||
rotation rot = avRot / llGetRot(); // Difference between the 2 rotations
|
||||
vector pos = // Sit target offset
|
||||
(avPos - llGetPos()) / llGetRot() - <0, 0, 0.4>;
|
||||
|
||||
llSitTarget(pos, rot); // Sitpose the objet (the purpose of the whole thing)
|
||||
llOwnerSay("Object sitposed. I used the following instruction: \nllSitTarget(" + (string) pos + ", " + (string) rot + ");");
|
||||
llSetClickAction(CLICK_ACTION_SIT); // Make it easy to sit for new residents
|
||||
llOwnerSay("Sit target set. Your object is ready."); // Warn the owner
|
||||
}
|
||||
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
listen_num = llListen(CHANNEL, NAME, NULL_KEY, ""); // Listen to the cube
|
||||
llOwnerSay("Magic Sit Script ready"); // Inform the owner
|
||||
}
|
||||
|
||||
listen(integer channel, string name, key id, string message)
|
||||
{
|
||||
if (llGetOwnerKey(id) == llGetOwner()) // Check that the cube has the same owner as the object
|
||||
{
|
||||
if (message == "*") // If the owner sits on the cube
|
||||
{
|
||||
startAnimation(); // then possibly animate his/her avatar
|
||||
}
|
||||
else // else if the owner unsits from the cube
|
||||
{
|
||||
llListenRemove(listen_num); // then remove the listen
|
||||
sitPose(message); // calculate the sit target
|
||||
stopAnimation(); // possibly stop the animation
|
||||
llRemoveInventory(llGetScriptName()); // and destroy this script
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
run_time_permissions(integer perm)
|
||||
{
|
||||
if (perm & PERMISSION_TRIGGER_ANIMATION) // If the permission is granted
|
||||
{
|
||||
string name = llGetInventoryName(INVENTORY_ANIMATION, 0);
|
||||
|
||||
llStopAnimation("sit"); // stop the default animation
|
||||
llStartAnimation(name); // and start the new one
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user