Change font size
It is currently Thu Nov 22, 2018 6:35 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 2 posts ]
Author Message
 Post subject: Simple TP Script
PostPosted: Mon Sep 15, 2008 5:53 pm 

Joined: Fri Sep 12, 2008 4:08 pm
Posts: 8
{L_CODE}:
vector targetPos = <180, 226, 367>; //The target location

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



Top
 Profile  
 
 Post subject: Re: Simple TP Script
PostPosted: Wed Sep 17, 2008 4:10 pm 
Furious Typer
User avatar

Joined: Sat Feb 02, 2008 10:02 pm
Posts: 104
Location: Romania, Bucharest
This is the TP script I use and its also very simple and useful so far;

{L_CODE}:
vector position = <98,88,22>;
vector destination = <98,88,45>;

default
{
    state_entry()
    {
        llSitTarget(<0,0,0>, <0,0,0,0>);
        llSetSitText("Teleport");
        llSetPos(position);
    }
   
    changed(integer change)
    {
        if((change & CHANGED_LINK) == CHANGED_LINK)
        {
            key avatar = llAvatarOnSitTarget();
            llSetPos(destination);
            llUnSit(avatar);
            llSetPos(position);
        }
    }
}


Important: As of recent, opensim requires you to change the value ScriptDistanceLimitFactor from opensim.ini to something greater then the default, otherwise llSetPos will be limited to 10 meters only (added as a protection against loosing prims during scripting). The default 1.0 means 10m, so if you want llSetPos to work at a greater distance you should probably set that to 10.0 (100m) or smaller / larger depending on how far you need your teleporter script to take you.


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


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron


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