Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Best way to TP somebody from a script to an objects location

Bones Outlander
Registered User
Join date: 16 Jan 2008
Posts: 30
11-18-2008 00:48
Hi,

I'm after some ideas please....

I'm writing a pager that customers can click on to page me, but I also want to be able to quickly TP back to the location where the pager is clicked.

Given that there could be multiple locations, I was hoping the pager could sent me a TP somehow that I can click on so I don't have to go to my landmarks to find the right one.

I know there's no llOfferTeleport type function, but is there a way of doing this another way?

So far all I can thinik of is to store a Landmark in the pager and send this with a llGiveInventory but this will add the LM to my invemtory so I'll have to keep deleting them.

So I'm open to other suggestion from those of you with a lot more scripting experience than me....

Cheers
Bones
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
11-18-2008 01:16
You could get the object to IM a SLurl to you. It would appear in your "Local Chat" window as a clickable link, so you'd just have to click to teleport.
Bones Outlander
Registered User
Join date: 16 Jan 2008
Posts: 30
11-18-2008 03:16
From: Pedro McMillan
You could get the object to IM a SLurl to you. It would appear in your "Local Chat" window as a clickable link, so you'd just have to click to teleport.


Thanks Pedro,

I'd really like a popup dialog box of some sort so it's really obvious I've been paged, but this may be an option if that's not possible.

Bones
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
11-18-2008 04:07
There is one other possibility. If you could get the other objects to communicate with something you wear yourself (e.g. your own pager object) then you could use "llMapDestination" to bring up the world map centred on the teleport location.

(I've never used the function myself, but apparently it only works from attached objects, or in touch events.)

To make it obvious what's bringing up the map, you could make it show a dialog first to confirm that you want to accept the teleport.
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
11-18-2008 05:21
From: Pedro McMillan
You could get the object to IM a SLurl to you. It would appear in your "Local Chat" window as a clickable link, so you'd just have to click to teleport.

How would you generate the SURL to send via IM?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-18-2008 05:53
map destination may fail for object locations that are nearby (well really any actual teleport)

if you want to go crazy, you can have the object send a temp on rez sit teleporter for close range clients, the sent object would calculate it's distance and offset from the target point onrez, set it's own sit target, and maybe if it's over a certain distance use another method
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
11-18-2008 06:42
From: Very Keynes
How would you generate the SURL to send via IM?


Offhand, not tested...

CODE

string getSLURL()
{
// Note, this function intentionally verbose to ease understanding

// base SLURL
string baseSLURL = "http://slurl.com/secondlife/";

// get the region name as a string
string regionName = llGetRegionName();

// get the prim's position in region coordinates as a vector
vector myPos = llGetPos();

// convert x, y and z positions to
// whole numbers and then into strings
string xPos = (string) ((integer) myPos.x);
string yPos = (string) ((integer) myPos.y);
string zPos = (string) ((integer) myPos.z);

// create a useful, informative title for the slurl link
// optional, can also be empty
// string title = "";
string title = "?&title=INFORMATIVE_TITLE_GOES_HERE";

// assemble the slurl
string theSLURL = baseSLURL + regionName + "/";
theSLURL = theSLURL + xPos + "/";
theSLURL = theSLURL + yPos + "/";
theSLURL = theSLURL + zPos + "/";
theSLURL = theSLURL + title;

// return the slurl to function caller
return theSLURL;
}


Should be able to drop that function into a script and call it
to generate a SLURL for a prim. Suggested change though...
add 1 to z before making the SLURL, just to be safe.
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
11-18-2008 07:14
Thanks Jeredin,

I ofen find myself opening the map and selecting copy SURL then pasting it into a message, that snippet will save me a lot of time :)

Thanks again, I'm kicking myself for not thinking of it.
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
11-18-2008 07:39
From: Very Keynes
Thanks Jeredin,

I ofen find myself opening the map and selecting copy SURL then pasting it into a message, that snippet will save me a lot of time :)

Thanks again, I'm kicking myself for not thinking of it.


Make sure it works first before thanking me hehe :)
Bones Outlander
Registered User
Join date: 16 Jan 2008
Posts: 30
11-18-2008 11:37
From: Very Keynes
How would you generate the SURL to send via IM?



Or there's this code.

/15/c2/152021/1.html

Bones
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
11-18-2008 12:13
From: Bones Outlander
Or there's this code.

/15/c2/152021/1.html

Bones


Alternatives are always good, thanks Bones :)