Jump to content
You are about to reply to a thread that has been inactive for 61 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Dear Scriblers and Scripters

 

I hope you are all doing well. I have been trying to read up on Agent teleports and have noticed llTeleportAgent does not take a SURL like one from the location bar.

 

I looked at llTargetAgentGlobalPosition( and was not informed by the wiki page all it showed was how to teleport to your own region utterly useless when i had a SURL.

I think I can use this but need a better explanation please how to use SURL from browsers location copied into script.

 

Thanks for looking 

 

Link to post
Share on other sites

Re-read the specification for llTeleportAgentGlobalCoords again (I'm assuming that's what you meant to say, as there is no llTargetAgentGlobalPosition function). It tells you right at the beginning that the function targets the destination region by using global coordinates and that you can discover any region's global coordinates via llRequestSimulatorData(region_name, DATA_SIM_POS). If you have the SLURL, then you have the region name. Parse it out and feed it to the other function.

Edit: ok, you can't feed it in directly. You need to go through the dataserver event, as that is where the actual coordinates are given when you call llRequestSimulatorData.

Edited by Fenix Eldritch
additional clarification
Link to post
Share on other sites
Posted (edited)

thanks Fenix I had not seen that 

 

I tried llteleportAgenGlobalCoords(teleportee,l,ZERO_VECTOR,ZERO_VECTOR); but it gave a syntax error  but worked in previous one if there was a LM in the inventory of the script.

 

As lRequestSimulatorData(SURL DATA_SIM_POS) returns a key how do i get the actual vector position please?

 

I presume its by dataserver(key Q, string data ) { if(q == key_from_above) { newGlobalVector = (vector)DATA;} }

Edited by VirtualKitten
Link to post
Share on other sites

Sorry, I was speaking pretty loosely when I said you can plug that into the other function. I will clarify and edit the above post afterwards.

llRequestSimulatorData returns a handler for the dataserver event. You actually get the information you requested in that event, not instantly from the function itself. If you look at the example on llTeleportAgentGlobalCoords, it shows the basic sequence. The script starts by requesting the data in state_entry. When the dataserver event fires, it populates the global variable with the coordinates. Finally, the teleport function is triggered on a touch_start, hopefully after the initial setup is done (it does a sanity check beforehand to ensure the global coordinates are indeed populated and if not, request again).

Link to post
Share on other sites

A teleport freezing/failing halfway might just be a generic network problem. They can still happen once in a while, though it's getting rarer in my experience. Just try again in a moment.

If you are using the example from llTeleportAgentGlobalCoords, all you need to do is change the top variable simName to be your target region. In your case you would need to parse "MiddleEarth" from the SLURL. I've tried it now and the teleport works fine.

The example script as written will ask you every time it is reset. You can move the request out of the state_entry to lessen the immediate ping, but the script will need to ask you at some point before doing the teleport. Once you do grant permissions, they will persist and it won't ask you again.... unless you reset the script, or someone new tries to use it (recall that a script can only hold permissions for one avatar at a time). You can also use Experience Permissions to make the script not bother users with repeat requests, providing they are in the same experience as the script.

Link to post
Share on other sites
Posted (edited)

So I tried 

 

dataserver(key Q,string D) {

if (D== OrigKeyfromReqest)  llTeleportAgentGlobalCoords(teleportee, (vector)D,NULL_VECTOR,NULL_VECTOR);

}

It didn't teleport at all could this be name of Region?

 

If i have to separate it how do i convert /233/16/3500 to vector is it <233,16,3500>?

Edited by VirtualKitten
Link to post
Share on other sites

See the Knowledge Base article on experiences for more generic information. It was a passing suggestion, but if you aren't down on the basics yet, then it's probably best to ignore experiences for now. Work on getting more comfortable with the regular stuff first.

As with all things, having additional llOwnerSay commands peppered throughout are helpful in debugging. Have an llOwnerSay speak the result of the parsed region name. If you're not extracting a valid name from your SLURL, then the subsequent call to lRequestSimulatorData will be using a non-existent region name, and the dataserver entry will never fire.

Link to post
Share on other sites
Posted (edited)

Golly even Experience needs perms too that would be two request and doesn't seem better:

It suggests 

if(llAgentInExperience (llDetectedKey(0)))

 

YOU HAVE TO 

llRequestExperiencePermissions(llDetectedKey(0), ""); gRRR another one:)

 

Then create keys with LlCreateKeyValue

I cant see how this helps?

Edited by VirtualKitten
lost text when posted
Link to post
Share on other sites

Also you have to be a Premium User to use and create an experience key  them stupid SL so as you see its a waste of programming and pretty wholly useless. I certainly will not be allowing its use on the basis of this discrimination

Link to post
Share on other sites

No. You've gone off the rails entirely. Forget about experiences, I regret even bringing them up. They will not help you with where you are at right now. Focus on just getting the teleport example to work. Endure the permission requests each time you reset the script.

Edit: "discrimination" are you kidding me? Get out of here with that nonsense. And no, you don't need to be premium to use an experience key. Only to create one. But that's neither here nor there.

You have a SLRUL. Contained within that is the name of the region. You must extract the region name from the SLURL before you give it to llRequestSimulatorData. Given a string, strip out the unneeded junk until you are left with what you want.

For example, this is what a SLURL to MiddleEarth might look like:

http://maps.secondlife.com/secondlife/MiddleEarth/128/128/25

All you want, all llRequestSimulatorData cares about, is the region name i.e. "MiddleEarth". None of that other stuff makes a valid region name. Discard it. All you want is the stuff between "http://maps.secondlife.com/secondlife/" and "/128/128/25"

llParseString2List can be used to break up the slurl into individual sections, such as separating them by "/".

You can then grab the specific list entry that contains the region name.

If the region name has spaces in it, they will be denoted by %20. You can convert that back to spaces with llUnescapeURL.

Good luck, I'm out.

Edited by Fenix Eldritch
Link to post
Share on other sites

I m asking Firestorm support to remove it all as it discriminates from Premium Users to normal users . Its not nonsense why would it discriminate if you don't pay Premium Fee and dont have a linden home?

  • Haha 1
Link to post
Share on other sites
1 hour ago, VirtualKitten said:

I m asking Firestorm support to remove it all as it discriminates from Premium Users to normal users . Its not nonsense why would it discriminate if you don't pay Premium Fee and dont have a linden home?

that we have to pay for a Experience Key (Premium fee) is a Linden business decision. The residents who produce the Firestorm viewer have no say in deciding this

residents who produce viewers for other residents to use (Firestorm, etc) must include in their viewers all the functionality that is in the official Linden viewer

if you want to raise this as a topic for debate, it being a business matter and not a scripting matter, then suggest a search of these forums where this topic has been discussed previously  on a number of occasions

  • Like 1
Link to post
Share on other sites
Posted (edited)

Hi Molly yes , Someone sent me knowledge base on here for experience to get rid of pop up tp requests but cant use it its a dreadful waste of sl resources as its only for super rich:(

Thank god Tila owns it now it might get better.

Edited by VirtualKitten
Link to post
Share on other sites

Kitten, I encourage you to keep on your learning pathway

when you do then in time you will reach a point where if you choose, you will be able to sell your stuff. And when your stuff pleases other people they will buy it, and then you will be in a position to have your work generate enough income to be able afford a Premium Experience Key if you want it, and afford other things as well

  • Like 2
Link to post
Share on other sites
Posted (edited)
8 minutes ago, Mollymews said:

Kitten, I encourage you to keep on your learning pathway

when you do then in time you will reach a point where if you choose, you will be able to sell your stuff. And when your stuff pleases other people they will buy it, and then you will be in a position to have your work generate enough income to be able afford a Premium Experience Key if you want it, and afford other things as well

Oh i give to my friends what i make :) and my family on SL too who are big in number ;) My family has a region thanks

Edited by VirtualKitten
Link to post
Share on other sites

I still cant get this tp thing working molly :) i will try

/but its not tping i am unsure why

I have a string SURL= "http://maps.secondlife.com/secondlife/MiddleEarth/232/16/3200";

 

I have

   listen(integer ch, string name, key id, string msg) 
    {
        list params = llParseString2List(msg,["|"],[""]);
        if (ch == ourch && llList2String(params,0)== "SURL:") {
            SURL = llList2String(params,1);
            list listURL = llParseString2List(SURL,["/"],[""]);
            gRegionName = llList2String(listURL,4);
            gRegionVector = <llList2Float(listURL,7),llList2Float(listURL,6),llList2Float(listURL,5)>;
        
        }

  }

    dataserver( key Q, string D) {
        if (Q == gVectorKey) 
            llTeleportAgentGlobalCoords(teleportee, (vector)D,  gRegionVector, ZERO_VECTOR);
        
    }

    run_time_permissions(integer perm)
    {
        if(PERMISSION_TELEPORT & perm)
        {
            gVectorKey  = llRequestSimulatorData(SURL, DATA_SIM_POS );
            
        }

    }

 

I dunno why it doesn't TP i must be doing something silly

Link to post
Share on other sites

I changed another thing but noticed this script does tp others how do i do that: it brings up error in console how do i get around that

is it like animation scripts and the script keeps the key

 

gRegionName = llList2String(listURL,3);
            gRegionVector = <llList2Float(listURL,4),llList2Float(listURL,5),llList2Float(listURL,6)>;

 

Link to post
Share on other sites

The Error Message says you can only teleport the owner of the object , This is crazy How to teleport gates do this , or are they only in region and this code does do anything useful at all

 

It reports at Consol "Teleport LSL functions can only teleport the object owner" yes the Teleport by LM does the same so how are teleport systems doing tis it seems through a map screen is this the only way it can be done as this sucks

Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 61 days.

Please take a moment to consider if this thread is worth bumping.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...