Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Slope lift

Justin Slade
Registered User
Join date: 6 Feb 2007
Posts: 132
07-15-2007 10:49
Can someone help with making a prim lift 10m and return to it's start. But it has to raise and lower on an angle. Could it be possible to have a menu driving ride command so an avatar can ride it. Also if it's not to much trouble have a comment in the script to enter the pitch of the angle by Y or R, Z would be the 10m. Similar to what a stair looks like, but the lift would be to put objects and avatar on it.

BTW, I looked in the wiki library and didn't find anything I could use.

Many Thanks
Justin
Lyn Mimistrobell
(waiting)
Join date: 11 Jan 2007
Posts: 179
07-16-2007 00:29
How about you multiply the vertical translation with a rotation to make it move at an angle? :)

Lyn
Justin Slade
Registered User
Join date: 6 Feb 2007
Posts: 132
07-16-2007 03:49
Somewhere I ran across an elevator script that call for horizontal motion. Can't find it. Good suggestion
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
07-16-2007 12:26
Read this event documentation and see if it doesn't address your need (for an avatar sitting on the object in the example script)

http://www.lslwiki.net/lslwiki/wakka.php?wakka=at_target
_____________________
http://slurl.com/secondlife/Together
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
07-16-2007 14:08
I think llMoveToTarget should be all you need, if you first capture the source and destination coordinates by manually moving the object to each spot, calling that in a script will cause it to move from wherever it is to the target location (and you can specify speed). It will move in a straight line so should suit your purpose?

If you need something fancier I have a flying couch script (I use it as a transport between my skyboxes, inspired a bit from the hitchhikers guide ;). I'm in the process of cleaning up the script and making it a freebie at my shop, so look for that soon if you want.

What it does is:
-notecard with named locations and directions
-menu to select where to go
-camera control to set camera when you sit (ie locks the camera to face where you want).
-a little particle rocket engine effect (realllly bad one lol) thrusting out of boosters mounted below the couch

So that might cover a lot of what you're looking for if you don't mind waiting a bit till I can clean it up and make the freebie/post the script :).
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
07-17-2007 18:20
Not sure if its what ya wanted but here, I posted it in script library but dunno how long that will take so I'll link to that later if it shows up there lol. Like I said for a gentle ride over shorter distance you could get rid of the warpPos use and use llMoveToTarget instead. The rest should be pretty relevant.

CODE

// Menu Driven Transport Script, by Shadow Subagja 07/17/2007
//
// Reads a notecard called "TransportLocations" with each line formatted
// as follows:
// LOCATION|<X,Y,Z>|DIRECTION_TO_FACE
// where:
// LOCATION = name of destination, which will show up on the touch menu
// <x,y,z> = global vector coordinates of destination
// DIRECTION_TO_FACE = direction Transport should face at destination
// (NORTH,SOUTH,EAST,WEST)
// Example:
// GROUND|<245.984,251.110,47.994>|SOUTH


//Communication Channel for llDialog
integer Transport_channel=990;
integer listenHandle;

//NoteCard
string PositionCardName="TransportLocations";
integer PositionCardLine=0;
key DataQueryId;

//Lists To Populate from NoteCard
list PositionNameList;
list PositionVectorList;
list PositionDirectionList;


// warpPos - movement function
// R&D by Keknehv Psaltery, 05/25/2006
// with a little pokeing by Strife, and a bit more
// some more munging by Talarus Luan
// Final cleanup by Keknehv Psaltery
// Compute the number of jumps necessary
warpPos( vector destpos )
{
integer jumps = (integer)(llVecDist(destpos, llGetPos()) / 10.0) + 1;
// Try and avoid stack/heap collisions
if (jumps > 100 )
jumps = 100; // 1km should be plenty
list rules = [ PRIM_POSITION, destpos ]; //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) );
}

// Rotate the Transport to face a compass direction
RotateTransport(string direction)
{
if(direction=="NORTH")
{
llSetRot(llEuler2Rot( < 0, 0, 180 * DEG_TO_RAD > ));
}
else if(direction=="SOUTH")
{
llSetRot(llEuler2Rot( < 0, 0, 0 * DEG_TO_RAD > ));
}
else if(direction=="EAST")
{
llSetRot(llEuler2Rot( < 0, 0, 90 * DEG_TO_RAD > ));
}
else if(direction=="WEST")
{
llSetRot(llEuler2Rot( < 0, 0, 270 * DEG_TO_RAD > ));
}
}

default
{
state_entry()
{
// Set the camera to behind and slightly above, assuming
// an initial facing direction of SOUTH.
// +ve Y values are to the north of object
// -ve Y values are to the south of object

// Location of Camera itself
llSetCameraEyeOffset(<0, 3, 3>);

// point in space that camera is facing
llSetCameraAtOffset(<0, -2, 2>);

// go parse notecard
state readingLocs;
}
}

state readingLocs
{
state_entry()
{
llOwnerSay("Reading: "+PositionCardName);
PositionCardLine = 0;

//read first line of card, then wait for callback
DataQueryId = llGetNotecardLine(PositionCardName,PositionCardLine);
}

// handler for llGetNotecardLine function
dataserver(key queryid, string data)
{
if(queryid == DataQueryId)
{
// check if note card end is reached
if(EOF!=data)
{
// parse line into a list based on | separator character
list tmp = llParseString2List(data, ["|"], []);

// store values from card based on expected line format
PositionNameList += llList2String(tmp,0);
PositionVectorList += (vector)llList2String(tmp,1);
PositionDirectionList += llList2String(tmp,2);

// read next line
DataQueryId = llGetNotecardLine(PositionCardName,++PositionCardLine);
}
else
{
// done parsing card, move on to next state
state active;
}
}
}

// since it uses notecards, reset when inventory changes
changed(integer change)
{
if (change&CHANGED_INVENTORY)
llResetScript();
}

}

state active
{

// when touched raise a dialog with destination options
touch_start(integer total_number)
{
// here is a good place to check for owner, or in this case whether
// the user's gorup is the same as that of the Transport
if(llDetectedGroup(0))
{
// activate listener
listenHandle=llListen( Transport_channel, "", "", "");
// raise dialog
llDialog( llDetectedKey( 0 ), "Transport", PositionNameList, Transport_channel);
}
else
{
llSay(0, "Only group members may use the Transport");
}
}

// listener will be called when dialog selection is made
listen( integer channel, string name, key id, string message )
{
// find index of selection in name list
integer index = llListFindList(PositionNameList,[message]);
// move to corresponding index in position list
warpPos(llList2Vector(PositionVectorList,index));
// rotate Transport to corresponding index in direction list
RotateTransport(llList2String(PositionDirectionList,index));
llListenRemove(listenHandle);
}

// since it uses notecards, reset when inventory changes
changed(integer change)
{
if (change&CHANGED_INVENTORY)
llResetScript();
}

}
Justin Slade
Registered User
Join date: 6 Feb 2007
Posts: 132
07-21-2007 08:08
Shadow, thanks fir the script..sorry but I didn't realize you posted it..

I'll try it out and get back with you

Thanks again
Justin
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
07-23-2007 10:07
Hey hope all is going well in world with the tweaks we worked out. Just goes to show ya, jamming a few extra features into a script can always cause unexpected wierdness!

Cheers,
-S
Justin Slade
Registered User
Join date: 6 Feb 2007
Posts: 132
07-23-2007 10:27
From: Shadow Subagja
Hey hope all is going well in world with the tweaks we worked out. Just goes to show ya, jamming a few extra features into a script can always cause unexpected wierdness!

Cheers,
-S


O do tell what I can expect by using this script?
I haven't tryed it yet.

Justin
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
07-23-2007 13:01
I was actually replying to the wrong guy haha, another fellow took this script and used it for an elevator in world, we worked on some pretty hefty changes to suit his needs.

A few things I did verify/learn in the process:
-Using llMoveToTarget worked fine to do a nice controlled speed movement.
-You have to turn physics on for the lift to move, and ideally back off when at rest (so it doesn't get knocked around by anybody)
-You must limit the movement on the X/Y axis to prevent the lift from tipping while moving with an avatar on it.

Maybe he'll post the script here with all the changes, he paid for the work so I'll leave that to him but feel free to ask if you need any help sorting out what this script is doing.

Cheers,
S
Justin Slade
Registered User
Join date: 6 Feb 2007
Posts: 132
07-23-2007 14:58
HAHA, you mean you sold that thing... Great good for you... I'll take that stuff you posted and when I finally get to it..maybe it will work.

One reason why I didn't get to it yet is I went to open it and my Laptop blue screened me and fried my hard drive....


I went MAN the script is powerful,...lololool

Now I have to beg people to get another hard drive.


If you want to post the whole thing here it probably be better..seeing hows I'm not having a very good week

Justin
Blaze Nielsen
Registered User
Join date: 24 May 2005
Posts: 276
try the timeless door script in library
07-23-2007 17:03
you can set distance, angle, the works, shape your prim how you want, wala, simple