Difference between revisions of "Talk:LlTeleportAgent"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 114: Line 114:
Another often requested feature is the ability to rotate avatars. I'm very curious if teleporting an avatar to it's current position in the current sim but with a different lookat would effectively rotate it. Teleports often hang or fail when attempting to teleport short distances, so I hope this would work - unless there's going to be a more formal way to rotate avatars. We don't have one![[User:Adeon Writer|Adeon Writer]] 18:36, 29 December 2011 (PST)
Another often requested feature is the ability to rotate avatars. I'm very curious if teleporting an avatar to it's current position in the current sim but with a different lookat would effectively rotate it. Teleports often hang or fail when attempting to teleport short distances, so I hope this would work - unless there's going to be a more formal way to rotate avatars. We don't have one![[User:Adeon Writer|Adeon Writer]] 18:36, 29 December 2011 (PST)
: Apparently it can do that, or something very close. It helps to have the minimap on rotate to see this example in action -- When you walk through a Linden Realms portal, you are sent to a spot in the air just above a transparent llVolumeDetect prim. On collision with the prim, you can see that your avatar is spun around to face the workshop on landing. There is still a bit of a fall after this so it's maybe not strictly a teleport to the same spot, but the rotation part seems to be working OK inside the same region. --[[User:Cerise Sorbet|Cerise Sorbet]] 19:56, 29 December 2011 (PST)
: Apparently it can do that, or something very close. It helps to have the minimap on rotate to see this example in action -- When you walk through a Linden Realms portal, you are sent to a spot in the air just above a transparent llVolumeDetect prim. On collision with the prim, you can see that your avatar is spun around to face the workshop on landing. There is still a bit of a fall after this so it's maybe not strictly a teleport to the same spot, but the rotation part seems to be working OK inside the same region. --[[User:Cerise Sorbet|Cerise Sorbet]] 19:56, 29 December 2011 (PST)
::Cool. -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 09:36, 31 December 2011 (PST)

Revision as of 09:36, 31 December 2011

Alternate version for freaky future-proofness

Emblem-important-yellow.png LSL Feature Request
The described function does not exist. This article is a feature request.

Summary

Function: llTeleportAgent( list parameters );
0.1 Forced Delay
10.0 Energy

SignpostMarv Martin's freaky future-proofed multi-purpose take on llTeleportAgent.

  • TELEPORT_AGENT,(key) id - the key of the Resident you wish to teleport (required, also signals the start of a subset in batch queries- see the second example)
  • TELEPORT_REGION,(string) region - the name of the region you wish to send TELEPORT_AGENT to (if missing, defaults to current region)
  • TELEPORT_POSITION,(vector) position - the destination you wish to send TELEPORT_AGENT to, specified in local co-ordinates (if missing, defaults to <128.0, 128.0,0.0>)
  • TELEPORT_FOCUS,(vector) focus - is intended to focus the avatar's attention on a location, specified in local co-ordinates (if missing, defaults to TELEPORT_POSITION)
  • TELEPORT_PERMISSION_REQUIRED, (integer) boolean - supply either TRUE or FALSE (defaults to FALSE)
  • TELEPORT_LOGINURI, (string) uri - if specified, restarts the client as if called with -url secondlife://region/x/y/z/ -loginuri TELEPORT_LOGINURI (not required, if missing doesn't do anything)
  • TELEPORT_VALIDATE_ONLY (integer) boolean - if set to TRUE, the function only returns whether or not the supplied parameters are valid
• list parameters

Caveats

  • This function causes the script to sleep for 0.1 seconds.
  • TELEPORT_AGENT must be the script owner or must be on script owner's land.
  • If TELEPORT_AGENT is not on the script owner's land, PERMISSION_TELEPORT must be granted and TELEPORT_PERMISSION_REQUIRED is ignored/defaults to TRUE
  • Aside from TELEPORT_AGENT, the order of parameters within a subset does not matter. Only the last TELEPORT_VALIDATE_ONLY in the list is processed

Examples

Single-user teleportation:

teleport_to_ahern(key id)
{
    llTeleportAgent([TELEPORT_AGENT,id,TELEPORT_REGION,"Ahern"]);
}
default
{
    touch_start(integer touched)
    {
        if(llDetectedKey(0) == llGetOwner()) // Not sure of the correct way to handle things on deeded land
        {
            teleport_to_ahern(llDetectedKey(0));
        }
        else
        {
            llRequestPermissions(llDetectedKey(0),PERMISSION_TELEPORT);
        }
    }
    run_time_permissions(integer perms)
    {
        if(perms & PERMISSION_TELEPORT)
        {
            teleport_to_ahern(llGetPermissionKey());
        }
        else
        {
            llWhisper(0,"Teleportation permissions must be granted.");
        }
    }
}

Star-Trek style teleportation (works on script owner's land only):

vector transporter_size = ZERO_VECTOR;
vector transporter_pos = ZERO_VECTOR;
key caller = NULL_KEY;
integer n = 0;
list away_team = [];
list calibration = [TELEPORT_REGION,"Ahern"];
vector destination = <128.0,128.0,0.0>;
default
{
    state_entry()
    {
        transporter_size = llGetScale();
        llListen(1,"",NULL_KEY,"Beam me up Scotty");
    }
    listen(integer channel,string name,key id,string message)
    {
        caller = id;
        llSensor("",NULL_KEY,AGENT,transporter.x/2.0,PI_BY_TWO);
    }
    sensor(integer sensed)
    {
        llWhisper(0,"Energising");
        n = 0;
        while(n < sensed)
        {
            away_team = (away_team=[]) + away_team + [TELEPORT_AGENT,llDetectedKey(n)] + calibration + [TELEPORT_POSITION,llDetectedPos(n) - transporter_pos];
            ++n;
        }
        llTeleportAgent(away_team);
        away_team = [];
    }
    no_sensor()
    {
        llInstantMessage(caller,"I canee do it Captin");
    }
}

Deep Notes

Signature

//function void llTeleportAgent( list parameters );


Just a note, my take on the function returns a bitfield containing any errors in execution.

  • TELEPORT_ERROR_REGION_UNREACHABLE- would be used if the sim is offline, non-existant, teleporting to that region is disabled etc.
  • TELEPORT_ERROR_INVALID_URI- would be used when the login URI is either malformed, blacklisted or not whitelisted at the estate or parcel level
    • If TELEPORT_LOGINURI has been disabled entirely at the estate or parcel, this is also returned.
    • White/Blacklisting would be useful for Residents with places on multiple grids to prevent griefers from putting a prim over their kiosk to redirect them to a phishing site.
  • TELEPORT_INVALID_AGENT- would be used if the agent is not online, or not in the current sim. Or obviously, if the value passed along with TELEPORT_AGENT wasn't a valid UUID :-P

(it'd be nice if someone tweaked the template to have the correct parameters for the return stuffages based on these notes)

I'm thinking that for batch queries, the ordering restrictions should be relaxed a bit to allow for optimisation- e.g. any params specified before the first TELEPORT_AGENT set the defaults for the entire list. SignpostMarv Martin 19:54, 27 April 2007 (PDT)

LL will never change the parameters of a function as it would break existing script and lead to confusion. Request a new function. -- Strife Onizuka 08:11, 28 April 2007 (PDT)
This function doesn't exist, so that rule doesn't apply.
SignpostMarv Martin 08:48, 28 April 2007 (PDT)
Internally, the llTeleportAgent project's # is SL-13078. --Torley Linden 14:28, 30 April 2007 (PDT)
OMG I'm sorry for jumping on you I seriously thought there was a function in existence with this name (think it was confusing it with llTeleportAgentHome). -- Strife Onizuka 14:45, 30 April 2007 (PDT)
While a nice idea I think the function as already described is fine, just needs to be actually implemented, you know, before the world ends ^^
-- Haravikk (talk|contribs) 11:25, 14 October 2010 (UTC)



Was recently implemented

The function here (not the freaky one above, the original desired implementation) was recently implemented and seems to be recognised. Albeit disabled? --Nexii Malthus 17:23, 4 November 2011 (PDT)

Ah, okay, they are working on it, it is indeed currently limited. --Nexii Malthus 20:54, 4 November 2011 (PDT)
Limited in what way? The limitations described on the function's page are all reasonable, but I dread there being unreasonable limitations that render the function pointless.
-- Haravikk (talk|contribs) 04:08, 5 November 2011 (PDT)

Using this to Rotate Avatars

Another often requested feature is the ability to rotate avatars. I'm very curious if teleporting an avatar to it's current position in the current sim but with a different lookat would effectively rotate it. Teleports often hang or fail when attempting to teleport short distances, so I hope this would work - unless there's going to be a more formal way to rotate avatars. We don't have one!Adeon Writer 18:36, 29 December 2011 (PST)

Apparently it can do that, or something very close. It helps to have the minimap on rotate to see this example in action -- When you walk through a Linden Realms portal, you are sent to a spot in the air just above a transparent llVolumeDetect prim. On collision with the prim, you can see that your avatar is spun around to face the workshop on landing. There is still a bit of a fall after this so it's maybe not strictly a teleport to the same spot, but the rotation part seems to be working OK inside the same region. --Cerise Sorbet 19:56, 29 December 2011 (PST)
Cool. -- Strife (talk|contribs) 09:36, 31 December 2011 (PST)