removed useless _ folders
This commit is contained in:
3
Magic Door/Magic Door.sol
Normal file
3
Magic Door/Magic Door.sol
Normal file
@@ -0,0 +1,3 @@
|
||||
<Solution name="Magic Door">
|
||||
<Project name="Magic Door" path="Magic Door\Magic Door.prj" active="true"/>
|
||||
</Solution>
|
||||
8
Magic Door/Magic Door/Magic Door.prj
Normal file
8
Magic Door/Magic Door/Magic Door.prj
Normal file
@@ -0,0 +1,8 @@
|
||||
<Project name="Magic Door" guid="88d18c45-2370-4224-a28b-ed275fa3efbb">
|
||||
<Object name="Object" guid="75887cd1-b9cf-4f50-b229-6bb8cf73e881" active="true">
|
||||
<Script name="Fairy door script.lsl" guid="aaead990-4d57-4db2-b8b3-2bef3d395256">
|
||||
</Script>
|
||||
<Script name="moving prim for door.lsl" guid="6e5301ce-37a0-4a1f-935b-c3ca7beba146">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
173
Magic Door/Magic Door/Object/Fairy door script.lsl
Normal file
173
Magic Door/Magic Door/Object/Fairy door script.lsl
Normal file
@@ -0,0 +1,173 @@
|
||||
// :CATEGORY:Door
|
||||
// :NAME:Magic Door
|
||||
// :AUTHOR:Ferd Frederix
|
||||
// :CREATED:2013-09-06
|
||||
// :EDITED:2013-09-18 15:38:56
|
||||
// :ID:499
|
||||
// :NUM:667
|
||||
// :REV:1
|
||||
// :WORLD:Second Life
|
||||
// :DESCRIPTION:
|
||||
// teleporting door
|
||||
// :CODE:
|
||||
|
||||
// Ferd Frederix
|
||||
|
||||
|
||||
integer debug = 1;
|
||||
|
||||
|
||||
float TIME = 6.0;
|
||||
integer channel = -44442; // listener from other prim
|
||||
integer listener; // channel handle
|
||||
string myName; // Name of this prim
|
||||
|
||||
vector DestPosition = <0,0,0.1>; // offset to the other door
|
||||
rotation DestRotation = <0,0,0,1>; // rotation when we get there
|
||||
|
||||
vector MYOFFSET = <1,0,0.1>; // offset to the other door
|
||||
rotation MYROT = <0,0,0,1>; // rotation when we get there
|
||||
|
||||
string animation ;
|
||||
|
||||
key AvatarKey; // key of who touched the door
|
||||
|
||||
|
||||
Tell()
|
||||
{
|
||||
string location = (string) llGetPos() + "|" + (string) llGetRot();
|
||||
if (! debug)
|
||||
llRegionSay(channel,location);
|
||||
else
|
||||
llSay(channel,location);
|
||||
}
|
||||
|
||||
Go()
|
||||
{
|
||||
if (debug) llOwnerSay("starting animation");
|
||||
llStartAnimation(animation);
|
||||
llSleep(TIME);
|
||||
if (debug) llOwnerSay("starting movement to " + (string )DestPosition);
|
||||
warpPos();
|
||||
|
||||
if (debug) llOwnerSay("ending animation");
|
||||
llSleep(TIME);
|
||||
llStopAnimation(animation);
|
||||
llUnSit(AvatarKey);
|
||||
|
||||
string location = (string) llGetPos() + "|" + (string) llGetRot();
|
||||
if (debug)
|
||||
llOwnerSay(location);
|
||||
else
|
||||
llRegionSay(channel,location);
|
||||
|
||||
}
|
||||
|
||||
warpPos()
|
||||
{ //R&D by Keknehv Psaltery, 05/25/2006
|
||||
//with a little poking by Strife, and a bit more
|
||||
//some more munging by Talarus Luan
|
||||
//Final cleanup by Keknehv Psaltery
|
||||
//Changed jump value to 411 (4096 ceiling) by Jesse Barnett
|
||||
// Compute the number of jumps necessary
|
||||
// rotated by Ferd Frederix
|
||||
//llSitTarget(destpos, ROT);//Set the sit target
|
||||
integer jumps = (integer)(llVecDist(DestPosition, llGetPos()) / 10.0) + 1;
|
||||
// Try and avoid stack/heap collisions
|
||||
if (jumps > 411)
|
||||
jumps = 411;
|
||||
list rules = [ PRIM_POSITION, DestPosition ]; //The start for the rules list
|
||||
integer count = 1;
|
||||
while ( ( count = count << 1 ) < jumps)
|
||||
rules = (rules=[]) + rules + rules; //should tighten memory use.
|
||||
llSetPrimitiveParams( rules + llList2List( rules, (count - jumps) << 1, count) );
|
||||
if ( llVecDist( llGetPos(), DestPosition ) > .001 ) //Failsafe
|
||||
while ( --jumps )
|
||||
llSetPos( DestPosition );
|
||||
if (debug)
|
||||
llOwnerSay("open");
|
||||
else
|
||||
llWhisper(channel,"open");
|
||||
llSetRot(DestRotation); // set dest rotation
|
||||
if (! debug)
|
||||
llDie();
|
||||
}
|
||||
|
||||
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
if (debug)
|
||||
channel = 0;
|
||||
|
||||
animation = llGetInventoryName(INVENTORY_ANIMATION,0);
|
||||
llSetSitText("Enter");
|
||||
llSitTarget( MYOFFSET, MYROT);
|
||||
myName = llGetObjectName();
|
||||
listener = llListen(channel,myName,NULL_KEY,"");
|
||||
if (debug)
|
||||
llSay(channel,"reset");
|
||||
else
|
||||
llRegionSay(channel,"reset");
|
||||
Tell();
|
||||
}
|
||||
|
||||
changed (integer what)
|
||||
{
|
||||
if (what & CHANGED_LINK)
|
||||
{
|
||||
if (debug) llOwnerSay("changed");
|
||||
AvatarKey = llAvatarOnSitTarget();
|
||||
if (AvatarKey != NULL_KEY)
|
||||
{
|
||||
if (debug) llOwnerSay("request perms");
|
||||
llRequestPermissions(AvatarKey,PERMISSION_TRIGGER_ANIMATION );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
animation = llGetInventoryName(INVENTORY_ANIMATION,0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
listen(integer channel,string name, key id, string message)
|
||||
{
|
||||
if (id == llGetKey())
|
||||
return;
|
||||
if (message == "reset")
|
||||
{
|
||||
Tell();
|
||||
return;
|
||||
}
|
||||
if (message == "open")
|
||||
return;
|
||||
|
||||
if(debug) llOwnerSay("Heard:" + message);
|
||||
if (id != llGetKey())
|
||||
{
|
||||
list params = llParseString2List(message,["|"],[""]);
|
||||
DestPosition = (vector) llList2String(params,0);
|
||||
DestRotation = (rotation) llList2String(params,1);
|
||||
if (debug) llOwnerSay("Set Pos:" + (string) DestPosition + " rot:" + (string) DestRotation);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
run_time_permissions(integer perm)
|
||||
{
|
||||
if(PERMISSION_TRIGGER_ANIMATION & perm)
|
||||
{
|
||||
if (debug) llOwnerSay("perms granted");
|
||||
Go();
|
||||
}
|
||||
}
|
||||
|
||||
on_rez(integer p)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
151
Magic Door/Magic Door/Object/moving prim for door.lsl
Normal file
151
Magic Door/Magic Door/Object/moving prim for door.lsl
Normal file
@@ -0,0 +1,151 @@
|
||||
// :CATEGORY:Door
|
||||
// :NAME:Magic Door
|
||||
// :AUTHOR:Ferd Frederix
|
||||
// :CREATED:2013-09-06
|
||||
// :EDITED:2013-09-18 15:38:56
|
||||
// :ID:499
|
||||
// :NUM:668
|
||||
// :REV:1
|
||||
// :WORLD:Second Life
|
||||
// :DESCRIPTION:
|
||||
// moving prim
|
||||
// :CODE:
|
||||
|
||||
integer debug = 1;
|
||||
|
||||
integer channel = -44443; // listener from other prim
|
||||
integer listener; // channel handle
|
||||
string myName; // Name of this prim
|
||||
|
||||
vector OFFSET = <0,0,0.1>; // offset to the other door
|
||||
rotation ROT = <0,0,0,1>; // rotation when we get there
|
||||
|
||||
vector MYOFFSET = <0,0,0.1>; // offset to the other door
|
||||
rotation MYROT = <0,0,0,1>; // rotation when we get there
|
||||
|
||||
string animation ;
|
||||
|
||||
key AvatarKey; // key of who touched the door
|
||||
|
||||
Go()
|
||||
{
|
||||
|
||||
if (debug) llOwnerSay("starting animation");
|
||||
llStartAnimation(animation);
|
||||
llSleep(3);
|
||||
if (debug) llOwnerSay("starting movement to " + (string )OFFSET);
|
||||
UpdateSitTarget(OFFSET,ROT);
|
||||
if (debug) llOwnerSay("ending animation");
|
||||
llSleep(3);
|
||||
llStopAnimation(animation);
|
||||
llUnSit(AvatarKey);
|
||||
|
||||
string location = (string) llGetPos() + "|" + (string) llGetRot();
|
||||
llRegionSay(channel,location);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//Sets / Updates the sit target moving the avatar on it if necessary.
|
||||
UpdateSitTarget(vector pos, rotation rot)
|
||||
{
|
||||
//Using this while the object is moving may give unpredictable results.
|
||||
llSitTarget(pos, rot);//Set the sit target
|
||||
key user = llAvatarOnSitTarget();
|
||||
if(user)//true if there is a user seated on the sittarget, if so update their position
|
||||
{
|
||||
vector size = llGetAgentSize(user);
|
||||
if(size)//This tests to make sure the user really exists.
|
||||
{
|
||||
//We need to make the position and rotation local to the current prim
|
||||
rotation localrot = ZERO_ROTATION;
|
||||
vector localpos = ZERO_VECTOR;
|
||||
if(llGetLinkNumber() > 1)//only need the local rot if it's not the root.
|
||||
{
|
||||
localrot = llGetLocalRot();
|
||||
localpos = llGetLocalPos();
|
||||
}
|
||||
pos.z += 0.4;
|
||||
integer linkNum = llGetNumberOfPrims();
|
||||
do{
|
||||
if(user == llGetLinkKey( linkNum ))//just checking to make sure the index is valid.
|
||||
{
|
||||
llSetLinkPrimitiveParams(linkNum,
|
||||
[PRIM_POSITION, ((pos - (llRot2Up(rot) * size.z * 0.02638)) * localrot) + localpos,
|
||||
PRIM_ROTATION, rot * localrot / llGetRootRotation()]);
|
||||
jump end;//cheaper but a tad slower then return
|
||||
}
|
||||
}while( --linkNum );
|
||||
}
|
||||
else
|
||||
{//It is rare that the sit target will bork but it does happen, this can help to fix it.
|
||||
llUnSit(user);
|
||||
}
|
||||
}
|
||||
@end;
|
||||
} //Written by Strife Onizuka, size adjustment provided by Escort DeFarge
|
||||
|
||||
|
||||
|
||||
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
animation = llGetInventoryName(INVENTORY_ANIMATION,0);
|
||||
llSetSitText("Enter");
|
||||
llSitTarget( MYOFFSET, MYROT);
|
||||
myName = llGetObjectName();
|
||||
listener = llListen(channel,myName,NULL_KEY,"");
|
||||
string location = (string) llGetPos() + "|" + (string) llGetRot();
|
||||
llRegionSay(channel,location);
|
||||
|
||||
}
|
||||
|
||||
changed (integer what)
|
||||
{
|
||||
if (what & CHANGED_LINK)
|
||||
{
|
||||
if (debug) llOwnerSay("changed");
|
||||
if (llAvatarOnSitTarget() != NULL_KEY)
|
||||
{
|
||||
if (debug) llOwnerSay("request perms");
|
||||
AvatarKey = llAvatarOnSitTarget();
|
||||
llRequestPermissions(AvatarKey,PERMISSION_TRIGGER_ANIMATION );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
animation = llGetInventoryName(INVENTORY_ANIMATION,0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
listen(integer channel,string name, key id, string message)
|
||||
{
|
||||
if(debug) llOwnerSay("Heard:" + message);
|
||||
if (id != llGetKey())
|
||||
{
|
||||
list params = llParseString2List(message,["|"],[""]);
|
||||
OFFSET = (vector) llList2String(params,0);
|
||||
ROT = (rotation) llList2String(params,1);
|
||||
if (debug) llOwnerSay("Set Pos:" + (string) OFFSET + " rot:" + (string) ROT);
|
||||
}
|
||||
}
|
||||
|
||||
run_time_permissions(integer perm)
|
||||
{
|
||||
if(PERMISSION_TRIGGER_ANIMATION & perm)
|
||||
{
|
||||
if (debug) llOwnerSay("perms granted");
|
||||
Go();
|
||||
}
|
||||
}
|
||||
|
||||
on_rez(integer p)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user