Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Single Neat Elavator

Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
12-21-2005 06:45
Hello there,

:::Introduction:::
This elevator allows you to transport yourself up to 768m.
You don't have to run on the floor. :p
You don't have to create any hole in your building for this elevator because this allwos you to pass through ceilings and floors. :D
Just create the elevator's floor and put this script into it.
You have to adjust each floor height. For that purpose, you should edit elements of top two lists in this script to fit your building.
I recommend you create and set this elevator on each floor because this returns
every time tranporting you so that you don't have to call.

:::Usage:::
1. Touch the floor and it shows a dialog box to select floor.
2. Right click and select "Get on". That's all.

:::Note:::
If you set the height over actual 768m, it would stop and wouldn't move anymore.
You can set like pose balls on the elevator floor to allow multi ppl to get on. But don't forget to let them unsit when you get to the target floor.

CODE
// SN_Elevator was made by Seagel Neville as public domain, Dec 2005.

list heightList = [300, 500, 700]; // You have to put down the height of each floor here
list menuList = ["2F", "3F", "Rooftop"]; // Dialog box's list. Go along with heightList.

key av;
float height;
integer CHANNEL;
integer HANDLE;
integer FloorSelection = FALSE;
vector StartPos;
vector AVsize;

StopSitAnim() // Don't sit on the floor. :p
{
llStopAnimation("sit_generic");
llStopAnimation("sit");
llStartAnimation("impatient"); // Needed keyframes of legs' parts.
} // If you want to know this more, make sure to replace this for "stand". :p

ElevatorMove()
{
if(FloorSelection)
{
vector TargetPos = <StartPos.x, StartPos.y, StartPos.z + height>;
while(llVecDist(llGetPos(), TargetPos) != 0)
{
llSetPos(TargetPos);
}
llUnSit(av);
llSleep(1);
while(llVecDist(llGetPos(), StartPos) != 0)
{
llSetPos(StartPos);
}
}
else
{
llUnSit(av);
llWhisper(0, "Plz touch this floor and select where you go first");
}
}

default
{
state_entry()
{
llSetSitText("Get on");
StartPos = llGetPos();
}
on_rez(integer start_param)
{
llResetScript();
}
changed(integer change)
{
if(change & CHANGED_LINK)
{
av = llAvatarOnSitTarget();
if(av != NULL_KEY)
{
llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);
}
}
}
run_time_permissions(integer perm)
{
StopSitAnim();
ElevatorMove();
FloorSelection = FALSE;
}
touch_start(integer change)
{
key avatar = llDetectedKey(0);
AVsize = llGetAgentSize(avatar);
llSitTarget(<0, 0, (AVsize.z / 2)>, ZERO_ROTATION); // Wow, don't you think this is a master touch? :p
CHANNEL = llRound(llFrand(1000000) - 10000000);
HANDLE = llListen(CHANNEL, "", "", "");
llDialog(avatar, "To what floor do you go?", menuList, CHANNEL);
}
listen(integer channel, string name, key id, string message)
{
height = llList2Float(heightList, llListFindList(menuList, [message]));
llListenRemove(HANDLE); // Is this a manner?
FloorSelection = TRUE;
}
}
_____________________
:) Seagel Neville :)
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
12-21-2005 13:21
/54/3b/78775/1.html
_____________________
i've got nothing. ;)
Varik Marat
Registered User
Join date: 13 Sep 2005
Posts: 3
nice elevator
01-16-2006 16:07
The action is smooth...I like it a lot....only problem I am having is with the altitude numbers...it takes me to the max and gets stuck...I noticed that I needed to subtract ground level number from my desired height to get the first stop but the sky box number does not seem to want to work...it will take me up 100M easily but to approach the 500 to 600 range it just goes to 7 something and as you say it then gets stuck....the sim keeps crashing...am I doing that?...I shall cease until I find out more...