Jump to content

LLglobalTeleport


steph Arnott
 Share

You are about to reply to a thread that has been inactive for 1944 days.

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

Recommended Posts

Just now, Innula Zenovka said:

No, 


        ownerid = llGetOwner();
        llListen(-200600, "", ownerid, "");

won't work.   

Rolig and I are suggesting


	state_entry()
	{
		ownerid = llGetOwner();
		llListen(-200600, "", "", "");

	}
	listen(integer channel, string name, key id, string message)
	{
		if(llGetOwnerKey(id)==ownerid)
		{
			//do stuff
		}
	}

 

Innula, it does not work. I have tryed everything. As soon as you add an owner check it refuses the input data. Why? Damned if i know. It should, but it will not.

Link to comment
Share on other sites

1 minute ago, steph Arnott said:

Innula, it does not work. I have tryed everything. As soon as you add an owner check it refuses the input data. Why? Damned if i know. It should, but it will not.

Very strange.    Try putting in a debug message in the listen event to establish what it thinks the owner's uuid and llGetOwnerKey(id) are.    That's my first response when something falls over for no apparent reason -- make sure I know exactly what the script thinks is happening.

Link to comment
Share on other sites

23 minutes ago, Innula Zenovka said:


////////////////////////////////////////////////////////////////////////////////////////////////
//Steph Arnott, Rolig Loon and Innula Zenovka. This was created as a tri lateral team effort. //
//Tests inworld have proven code function.                                                    //
//This script is licenced using the Creative Commons Attribution-Share Alike 3. As such it    //
// can be used or modified as you wish. The creators must be acknoledged. In short do not     //
//claim it is your work.                                                                      //
////////////////////////////////////////////////////////////////////////////////////////////////


string simName;
vector simGlobalCoords;
vector simLocalCoords;

vector rot;//was left out


key  agent;
key ownerid;

default
{
    state_entry()
    {
        ownerid = llGetOwner();
        llListen(-200600, "", "", "");
        llRequestSimulatorData( simName, DATA_SIM_POS );
    }
    listen(integer channel, string name, key id, string params)
    {
        //integer length = llStringLength(parms);
        llStringTrim(params, STRING_TRIM);
        list parameters = llParseString2List(params, ["|"], []);
        simName =  llList2String(parameters,0);
        simLocalCoords = (vector)llList2String(parameters, 1);
        rot = (vector)llList2String(parameters, 2);
        llRequestSimulatorData( simName, DATA_SIM_POS );
    }
    touch_start( integer total_number )
    {
        agent = llDetectedKey(0);
        if(llGetPermissions() & PERMISSION_TELEPORT && agent == llGetPermissionsKey())//if script has permissions granted by this avatar to telport her
        {
            llTeleportAgentGlobalCoords( agent, simGlobalCoords, simLocalCoords, rot );
        }
        else
        {
            llRequestPermissions( agent, PERMISSION_TELEPORT );
        }
    }
    run_time_permissions( integer perm )
    {
        if ( simGlobalCoords == ZERO_VECTOR )
        {
            llOwnerSay( "Sim not found." );
            return;
        }
        else if ( PERMISSION_TELEPORT & perm )
        {
            llTeleportAgentGlobalCoords( agent, simGlobalCoords, simLocalCoords, rot );
        }
    }
    dataserver(key query_id, string data)
    {
        simGlobalCoords = (vector)data;
    }
    changed(integer change)
    {
        if (change & CHANGED_OWNER)
            llResetScript();
    }
}

I will give it a go. Issue is that it should work but something else is blocking it. This is a cleaned up version

 

Edited by steph Arnott
left out an assigned variable
Link to comment
Share on other sites

 

43 minutes ago, steph Arnott said:
49 minutes ago, Wulfie Reanimator said:

ZERO_VECTOR is a perfectly valid argument for any function, just like 0, NULL_KEY, empty string, or an empty list.. as long as you understand what the output is supposed to be.

If you are not able to predict when your code produces a <0.0, 0.0, 0.0>, you probably don't understand your code. It is also easy to detect if a user ("customer") gives your script that value.

Well from a person who does not understand the simulator code in the head movement and uses a stick through the mid i frankly do not care what you caim. Also if you are so smart sort out an issue three of us have not been able to solve on the 'owner key' in the LL teleport. Which i noticed you avoided.

I've been summoned..

On 1/3/2019 at 7:29 PM, steph Arnott said:

I just do not want the owner having to repeatedly give permission.

This is all I changed (your code first, then my changes):

touch_start( integer total_number )
{
    agent = llDetectedKey(0);
    llRequestPermissions( agent, PERMISSION_TELEPORT );
}
touch_start( integer total_number)
{
    agent = llDetectedKey(0);

    // if the agent is the one who has already given teleport permissions to this script, teleport them
    if(llGetPermissionsKey() == agent && llGetPermissions() & PERMISSION_TELEPORT)
    {
        llTeleportAgentGlobalCoords( agent, simGlobalCoords, simLocalCoords, ZERO_VECTOR );
    }
    else // otherwise, request permission
    {
        llRequestPermissions( agent, PERMISSION_TELEPORT );
    }
}

Here's the full code:

 string simName;// = " my sim removed";//this temp to see what is doing what
vector simGlobalCoords;
vector simLocalCoords;// = <30.0, 90.0, 24.0>;//

key  agent;
key ownerid;


default
{
    state_entry()
    {
        ownerid = llGetOwner();
        llListen(-200600, "", ownerid, "");
    }
    listen(integer channel, string name, key id, string params)
    {
        list parameters = llParseString2List(params, ["|"], []);
        string simName = (string)llList2String(parameters,0);
        vector simLocalCoords = (vector)llList2String(parameters, 1);
        //rotation rot = (rotation)llList2String(parameters, 2);
        llRequestSimulatorData( simName, DATA_SIM_POS );
    }
    touch_start( integer total_number )
    {
        agent = llDetectedKey(0);

        // if the agent is the one who has already given teleport permission to this script, teleport them
        if( llGetPermissionsKey() == agent && llGetPermissions() & PERMISSION_TELEPORT )
        {
            llTeleportAgentGlobalCoords( agent, simGlobalCoords, simLocalCoords, ZERO_VECTOR );
        }
        else // otherwise, request permission
        {
            llRequestPermissions( agent, PERMISSION_TELEPORT );
        }
    }
    run_time_permissions( integer perm )
    {
        if ( simGlobalCoords == ZERO_VECTOR )
        {
            llOwnerSay( "Sim not found.");
            return;
        }
        else if ( PERMISSION_TELEPORT & perm )
        {
            llTeleportAgentGlobalCoords( agent, simGlobalCoords, simLocalCoords, ZERO_VECTOR );
        }
    }
    dataserver(key query_id, string data)
    {
        simGlobalCoords = (vector)data;
    }
    changed(integer change)
    {
        if (change & CHANGED_OWNER)
            llResetScript();
    }
} 

 

Edited by Wulfie Reanimator
Link to comment
Share on other sites

Just now, Wulfie Reanimator said:

 

I've been summoned..

This is all I changed (your code first, then my changes):


touch_start( integer total_number )
{
    agent = llDetectedKey(0);
    llRequestPermissions( agent, PERMISSION_TELEPORT );
}

touch_start( integer total_number)
{
    avatar = llDetectedKey(0);

    // if the avatar is the one who has already given teleport permissions to this script, teleport them
    if(llGetPermissionsKey() == avatar && llGetPermissions() & PERMISSION_TELEPORT)
    {
        llTeleportAgentGlobalCoords( avatar, simGlobalCoords, simLocalCoords, ZERO_VECTOR );
    }
    else // otherwise, request permission
    {
        llRequestPermissions( avatar, PERMISSION_TELEPORT );
    }
}

Here's the full cod

 

LOL, you seriously think i have not tried that. In SL is does not pass and the sim info and is not recognised as valid.

Link to comment
Share on other sites

1 minute ago, steph Arnott said:

LOL, you seriously think i have not tried that. In SL is does not pass and the sim info and is not recognised as valid.

Either you haven't tried it or you don't know what you're doing.

I tested this. I pass it the info, click the object, it asks me for permission, I accept, I get teleported, I come back to click again, I get teleported instantly without being asked for permission.

Link to comment
Share on other sites

Just now, Wulfie Reanimator said:

Either you haven't tried it or you don't know what you're doing.

I tested this. I pass it the info, click the object, it asks me for permission, I accept, I get teleported, I come back to click again, I get teleported instantly without being asked for permission.

You try it in world then smart arse. Then come back a admit it will not work. Rollig, innula and i have all come to a 'do not know' conclussion.

Link to comment
Share on other sites

4 minutes ago, Wulfie Reanimator said:

Either you haven't tried it or you don't know what you're doing.

I tested this. I pass it the info, click the object, it asks me for permission, I accept, I get teleported, I come back to click again, I get teleported instantly without being asked for permission.

In world result 'Sim not found'.

Link to comment
Share on other sites

Just now, Wulfie Reanimator said:

You will get a "Sim not found." error until you properly give it a sim to send you to. Try saying /-200600 Curious|<128.000, 126.500, 22.848> in local chat near the object.

Why would i do that? The data stream is passed from another script. It is trimmed and split. The issue is else where.

Link to comment
Share on other sites

Just now, steph Arnott said:

Why would i do that?

To actually test it...

Just now, steph Arnott said:

The data stream is passed from another script. It is trimmed and split. The issue is else where.

Yes! It seems very likely that the issue is in the script you are passing the information from. Probably because the info is sent in a different format. Will you post the other script here as well?

Link to comment
Share on other sites

Just now, Wulfie Reanimator said:

To actually test it...

Yes! It seems very likely that the issue is in the script you are passing the information from. Probably because the info is sent in a different format. Will you post the other script here as well?

No. It would fail allways if that was the case.

                    // sim = llList2String(destinations, a + 0);

                    region = llDeleteSubString(llList2String(destinations, a - 1), 0, 0);

                    //X/Y/Z global vector and local rotation values
                    string temp = llList2String(destinations, a + 1);
                    string temp1 = llList2String(destinations, a + 2);
                    llShout( 0, region + "|" +  temp  + "|" + temp1 );

 

Link to comment
Share on other sites

Not to muddy the waters, but the first full script that I posted in this thread last Thursday worked just fine.  I posted it after I had tested it in world.  To be doubly sure, I tested it again just now.  It still works.  I'm tired and aching from a nasty cold, so I really don't want to dive back into a conversation right now, but do please go back and give that script another try.

Link to comment
Share on other sites

1 minute ago, Rolig Loon said:

Not to muddy the waters, but the first full script that I posted in this thread last Thursday worked just fine.  I posted it after I had tested it in world.  To be doubly sure, I tested it again just now.  It still works.  I'm tired and aching from a nasty cold, so I really don't want to dive back into a conversation right now, but do please go back and give that script another try.

It refuses where i am. And tried in twenty other sims. It just comes up 'sim not found'. So either LL is changing something or i gone gagga. I agree it should damned weel work, but it will not..

Link to comment
Share on other sites

8 minutes ago, steph Arnott said:

I agree it should damned weel work, but it will not..

That is most strange indeed, Steph.  If you use that script without sending it any data in chat at all, it should send you to the "Sweet Serenity" region that you were using as a test.   Then, if you use a simple script like this one to send it data ...

default
{
    touch_start(integer num)
    {
        llSay(-200600, "Cookie|<128,128,22>");
    }
}

and then touch your test object again, it should send you to the center of the Cookie region.  It does for me.

Oh, gosh yes.  Wear the HUD.

Edited by Rolig Loon
Link to comment
Share on other sites

18 minutes ago, steph Arnott said:

You have the relievent passing data. Why do you want a huge data base script when the pass data  works fine until an owner ID is added to the filter?

I give up. Even when I put aside all of my frustration and disdain for your stubborn and poisonous attitude to actually help you, you still can't put aside your "I'm right you're wrong" mentality. (This was the main reason why I originally avoided this thread like you noticed.)

For the record, I did not read the suggestions given by others, but I'm sure Rolig and Innula were on the right track and probably even had working solutions. The main problem is not the scripts, but Steph's inability and unwillingness to test and show all the code involved because he deems it "unnecessary" while still demanding help or proclaiming that "they couldn't figure it out so there is no solution, it must be LL's fault again."

11 minutes ago, steph Arnott said:

or i gone gagga

I already called this in the other thread. I don't know why I bother...

Edited by Wulfie Reanimator
Link to comment
Share on other sites

1 minute ago, Rolig Loon said:

That is most strange indeed, Steph.  If you use that script without sending it any data in chat at all, it should send you to the "Sweet Serenity" region that you were using as a test.   Then, if you use a simple script like this one to send it data ...


default
{
    touch_start(integer num)
    {
        llSay(-200600, "Cookie|<128,128,22>");
    }
}

and then touch your test object again, it should send you to the center of the Cookie region.  It does for me.

Oh, gosh yes.  Wear the HUD.

Itook the assingned varibles out.

Link to comment
Share on other sites

1 minute ago, steph Arnott said:

Itook the assingned varibles out.

That's OK.  They are easy enough to put back in.  It's always good to build a set of default values into a script like this so that it has a "home" to go to if you don't send it other data. 

Link to comment
Share on other sites

1 minute ago, Rolig Loon said:

That's OK.  They are easy enough to put back in.  It's always good to build a set of default values into a script like this so that it has a "home" to go to if you don't send it other data. 

I will assese the attatched. Could be that.

Link to comment
Share on other sites

13 hours ago, Rolig Loon said:

Not to muddy the waters, but the first full script that I posted in this thread last Thursday worked just fine.  I posted it after I had tested it in world.  To be doubly sure, I tested it again just now.  It still works.  I'm tired and aching from a nasty cold, so I really don't want to dive back into a conversation right now, but do please go back and give that script another try.

I switched the filter to the first in the listen. It works fine. What you tested must still have the assigned values. The listen event will not fire if the second filter is set. It is due to this

if(llGetPermissionsKey() == avatar && llGetPermissions() & PERMISSION_TELEPORT)
Edited by steph Arnott
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1944 days.

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...