'Open Source Scripting' group (Second Life) wiki

Space Builder

Modified: 24/02/2007 10:33 by Shine.
An example how to build a platform at 2,000 meters. Place this script in a box, and place an object named "Sky Platform" in the box. Then sit down on the box. At 2,000 meters it rezzes the Sky Platform. Note: There are some strange rules at this altitude, e.g. when you try to move an object, it will be placed at 768 m height. Same for llSetPos. But looks like the physical movement commands are working.

See below for an elevator to this height.

 
// Space builder
//
// 2007 Copyright by Shine Renoir (fb@frank-buss.de)
// Use it for whatever you want, but keep this copyright notice
// and credit my name in notecards etc., if you use it in
// closed source objects
//
default
{
    state_entry()
    {
        llSitTarget(<0, 0, 0.5>, ZERO_ROTATION);
    }

changed(integer change) { // if someone sits down if (change & CHANGED_LINK) { key av = llAvatarOnSitTarget(); if (av) { vector start = llGetPos(); llOwnerSay("space lift engaged, destination: 2,000 m"); llSetBuoyancy(2.0); llSetStatus(STATUS_PHYSICS, TRUE); vector pos = llGetPos(); while (pos.z < 2000.0) { pos = llGetPos(); } llSetStatus(STATUS_PHYSICS, FALSE); pos = llGetPos(); llRezObject("Sky Platform", pos, ZERO_VECTOR, ZERO_ROTATION, 0); llSleep(0.1); llUnSit(av); llDie(); float delta = 1.0; while (delta > 0.1) { llSetPos(start); pos = llGetPos(); delta = pos.z - start.z; } } } } }



For moving up to the platform, you could use a space elevator. Move it along the x-axis beside the platform on ground. On sit up it pushs you a bit, which moves you on the platform.

 
// Space elevator
//
// 2007 Copyright by Shine Renoir (fb@frank-buss.de)
// Use it for whatever you want, but keep this copyright notice
// and credit my name in notecards etc., if you use it in
// closed source objects

// direction and power to push after sit up vector push = <50.0, 0.0, 0.0>;

// target height float height = 2005.0;

default { state_entry() { llSitTarget(<0, 0, 0.5>, ZERO_ROTATION); }

changed(integer change) { // if someone sits down if (change & CHANGED_LINK) { key av = llAvatarOnSitTarget(); if (av) { vector start = llGetPos(); llOwnerSay("space lift engaged, destination: 2,000 m"); llSetBuoyancy(2.0); llSetStatus(STATUS_PHYSICS, TRUE); vector pos = llGetPos(); while (pos.z < height) { pos = llGetPos(); } llSetStatus(STATUS_PHYSICS, FALSE); pos = llGetPos(); llSleep(0.1); llUnSit(av); llPushObject(av, push, ZERO_VECTOR, FALSE); float delta = 1.0; while (delta > 0.1) { llSetPos(start); pos = llGetPos(); delta = pos.z - start.z; } } } } }

ScrewTurn Wiki version 1.0.11. Some of the icons created by FamFamFam.