Change font size
It is currently Tue Dec 18, 2018 11:49 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 4 posts ]
Author Message
 Post subject: Crude Teleporter
PostPosted: Sun Feb 10, 2008 10:55 pm 
User avatar

Joined: Tue Feb 05, 2008 12:13 am
Posts: 24
Location: Central California
It'll be nice when AvatarSitOnTarget works, but until then, this is a handy teleport script that works.

//Crude Teleporter

default {
state_entry() {
llSetPos(<83, 21, 21.5>);
}

touch_start(integer total_number) {
llSetPos(<83, 34, 103>);
llSetTimerEvent(2.0);
}
timer() {
llResetScript();
}
}

_________________
"...a book with no readers is not a fully effective work of art." Rudy Rucker


Top
 Profile  
 
 Post subject: Re: Crude Teleporter
PostPosted: Mon Feb 11, 2008 10:48 am 
Furious Typer
User avatar

Joined: Sat Feb 02, 2008 10:02 pm
Posts: 104
Location: Romania, Bucharest
Indeed, good teleporter and very useful so far. Yeah, when AvatarSitOnTarget will work, it will we able take you automatically when you sit instead of having to touch it. It will also be great when llUnSit works too, as then you'll both stand up automatically without having to click the Stand Up button, and you won't need a X second delay to have time to do so and the teleporter will just put you where you want in a quarter second and return instantly.


Top
 Profile  
 
 Post subject: Re: Crude Teleporter
PostPosted: Sun Apr 27, 2008 12:12 am 

Joined: Mon Feb 25, 2008 9:24 pm
Posts: 9
Location: Shreveport, Louisiana
I have this one running on Arkinville

{L_CODE}:
vector targetPos = <128,119, 136>; //The target location

reset()
{
    vector target;
   
    target = (targetPos- llGetPos()) * (ZERO_ROTATION / llGetRot());
    llSitTarget(target, ZERO_ROTATION);
    llSetSitText("Teleport");
}
default
{
    state_entry()
    {
        reset();
    }
   
    on_rez(integer startup_param)
    {
        reset();
    }
   
    changed(integer change)
    {
        llUnSit(llAvatarOnSitTarget());
        reset();
    }   
}


Top
 Profile  
 
 Post subject: Re: Crude Teleporter
PostPosted: Tue Apr 29, 2008 8:37 am 
User avatar

Joined: Tue Feb 05, 2008 12:13 am
Posts: 24
Location: Central California
Nice to know llUnsit works now! Here's my latest version:

{L_CODE}:
//Teleport v2.02 by Pablo Pharmanaut
//based on code by Cubey Terra

integer totalPos = 4;                    //This integer should equal total number of positions
integer currentPos = 1;
string currentpos;

vector vPos1 = <117,152,22>;             //These are vectors for the positions to
vector vPos2 = <81,23, 103>;             //which you wish to teleport
vector vPos3 = <83, 49.00, 29>;
vector vPos4 = <67,120,22>;
//vector vPos5 = <143.3,238.8,50.2>;

string sPos1 = "Position One";           //name of positions, if desired.  This helps
string sPos2 = "Position Two";           //you to know where you are going!
string sPos3 = "Position Three";
string sPos4 = "Position Four";
//string sPos5 = "Position Five";

vector currentvPos;

setPos()
{
   if (currentPos == 1)
   {
      currentpos = sPos1;
      currentvPos = vPos1;
   }
   else if (currentPos == 2)             
   {                                     
      currentpos = sPos2;               
      currentvPos = vPos2;             
   }                                     
   else if (currentPos == 3)
   {
      currentpos = sPos3;
      currentvPos = vPos3;
   }
   else if (currentPos == 4)
   {
      currentpos = sPos4;
      currentvPos = vPos4;
   }
//   else if (currentPos == 5)
//   {
//      currentpos = sPos5;
//      currentvPos = vPos5;
//   }
   
   //add else if section here with higher currentPos integer to add TP destinations.
   //Don't forget to increase totalPos integer at top of script

   vector pos = llGetPos();
   llSetText("Teleport to "+currentpos+"\nTouch me to change destination",<1,1,1>,1.0);
   vector offset = currentvPos - pos;
   llSitTarget(offset, ZERO_ROTATION);
}

default
{
   state_entry()
   {
      llSetSitText("Teleport");            //This changes HUD display from "sit" to "Teleport"
   }
   touch_start(integer total_number)
   {
      currentPos += 1;
      if (currentPos > totalPos) currentPos = 1;
      setPos();
   }
   changed(integer change)
   {
      if ((change & CHANGED_LINK)==CHANGED_LINK)
      {
         if (llAvatarOnSitTarget() != NULL_KEY)
         {
            llUnSit(llAvatarOnSitTarget());
         }
      }
   }
}


_________________
"...a book with no readers is not a fully effective work of art." Rudy Rucker


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 4 posts ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net