Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Elevator Script...

Malina Chuwen
Evotive
Join date: 25 Apr 2008
Posts: 502
07-22-2008 21:48
Not trying anymore, I've already had to delete my stage due to a script that won't quit moving it. Will remake it later, I guess.

Looking for a simple 'on click' elevator, or by a group-only channel command. It would move up roughly 5 meters, then back down when selected/told. Has to be able to move at least 8 prims. No need for it to move avatars, though, just the prims.

I've searched around the forums, but most posts are old so I don't know if they'll still work and they didn't seem to do what I was looking for anyway.

Basically:

It moves up & down
Takes maybe 3-6 seconds, preferablly adjustable

That's all =x Will commission someone if there isn't one out there already.. I would go and buy a ton of scripts, but without knowing if they'll work or not.. that's alot of money to waste.

Anyone know where I might find this?

--

Also.. STILL seeking the Notecard from Ravanne's Dance Cage.. Still.. Been looking for at least a week now. If not longer..
Dekka Raymaker
thinking very hard
Join date: 4 Feb 2007
Posts: 3,898
07-23-2008 02:58
Yes, I'm after a good elevator script too, have a number of freebies I'm trying to use, modify but without luck, but seeing I've only had a couple of hours to actually play with them, I haven't testing them enough to say whether they are really crap as they appear to be or not.

The best elevator script I have likes to move 100 meters at a time, but getting it to move 5 meters is nightmare. If I ever have an luck I will let you know.

There is a very good elevator system on SLEX, but its like a complete builders edition and way to much for what I want, however, I might go ahead and buy it.
_____________________
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
07-23-2008 05:55
Here is a super basic short distance lift, script goes into the root prim (that is, the moving platform). The other prims to be moved need to either be physical or linked to the platform. Coordinates are set by hand, no super automatic stuff here.

Keep the coordinates reasonably close to reality, so the platform can get to where you intend and not get stuck. It doesn't try to stop if it gets stuck (you can touch to reverse), so make sure your avatar has good health insurance before you try to stand underneath.

This one will respond to group members' touches.

CODE

// With the editor, move the platform by hand to the low and high points you want, copy the
// position X, Y, Z for each here.
vector platform_pos_bottom = <200.3, 97.7, 1650.900>;
vector platform_pos_top = <200.3, 97.7, 1655.605>;

// Rotation here is in degrees just like the edit window.
vector platform_rot = <0., 0., 0.>;

// About how long it should take to get there, in seconds. It will really take longer,
// fiddle until it looks and works the way you like.
float travel_time = 2.;

integer platform_target; // event ID
vector last_destination; // where we tried to go last


Setup() {
llSetStatus(STATUS_PHYSICS, FALSE); // nonphysical for now
llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, TRUE); // allow rotation

// Go to the bottom and make sure we are straighened out.
llSetPos(platform_pos_bottom);
llSetRot(llEuler2Rot(platform_rot * DEG_TO_RAD));

// no matter where you go, there you are.
last_destination = platform_pos_bottom;
}


GoTo(vector position) {
llWhisper(0, "going to " + (string) position);
llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, FALSE); // lock rotation

// meh, 5 cm of slop
platform_target = llTarget(position, 0.05);

llSetStatus(STATUS_PHYSICS | STATUS_BLOCK_GRAB, TRUE); // become physical

// go where we are going
llMoveToTarget(position, travel_time);
}

default
{
state_entry() {
Setup();
}

on_rez(integer start_param) {
Setup();
}

touch_start(integer total_number) {

// do nothing if toucher's active group isn't ours.
if (! llSameGroup(llDetectedKey(0))) {
return;
}

if (last_destination == platform_pos_bottom) {
last_destination = platform_pos_top;
}
else {
last_destination = platform_pos_bottom;
}

GoTo(last_destination);
}

at_target(integer tnum, vector targetpos, vector ourpos) {
llWhisper(0, "Here.");
llTargetRemove(tnum); // we're here, stop waiting

llSetStatus(STATUS_PHYSICS, FALSE); // nonphysical for now
llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, TRUE); // allow rotation

// last little nudge
llSetPos(targetpos);

// shouldn't need to reset rotation, but bugs happen.
llSetRot(llEuler2Rot(platform_rot * DEG_TO_RAD));
}
}
_____________________
Malina Chuwen
Evotive
Join date: 25 Apr 2008
Posts: 502
07-23-2008 14:39
Too sweet! Trying it right now =) Will edit with results!~

--

Ok, thank you Vik for coming over and helping me! Silly errors seem to be my latest illness =x It works wonderfully!