Jump to content

RLVa Teleport Script


Renegade Travesty
 Share

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

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

Recommended Posts

Hello.

I have written a short script to teleport anyone who walks into a door way using the restrained love viewers. It works fine for me but when any one else walks into the prim it won't tp them it just tp's me because of the llOwnerSay(). Could some one explain how to work around this. I have tried a couple of options in the form of llKey2Name. Even  llGetOwner inside another prim for another person to wear with a listener in the object. I have been trying to learn to script for about 5 months so am fairly new to it.

Regards,

Renegade.

default
{
    state_entry() 
    {
        llSetObjectName( "" );  
    }
    collision_start( integer num ) 
    {
        if (llGetObjectDesc()=="Tardis in flight")
        {
          // Add extra stuff here.
        }
        else if(llGetObjectDesc()==llGetObjectDesc())
        {
            llOwnerSay("@tpto:"+ llGetObjectDesc() + "=force" );
        } 
    } 
}

 

Edited by Renegade Travesty
Link to comment
Share on other sites

That's a non-trivial scripting challenge because you need to specify the target location in global coordinates.  To see how it ought to be done, take a look at the example in http://wiki.secondlife.com/wiki/LSL_Protocol/RestrainedLoveAPI#Teleportation

Having said that, though, there are two things to think about.  First, you can try the obvious step of replacing llOwnerSay with llSay so that the script speaks fo someone othe4r than the owner.  Second, though, you may find that this function will not work at all for anyone except the owner.  I am not familiar enough with the RLV command to know for sure.  However, if it is analogous to the normal LSL command llTeleportAgent, you could only use it to teleport a non-owner if the script (and the user) were in an Experience.  Someone like Innula Zenovka could verify whether this RLV command has the same limitation.  If so, you are out of luck.

Link to comment
Share on other sites

1 hour ago, Renegade Travesty said:

Hello.

I have written a short script to teleport anyone who walks into a door way using the restrained love viewers. It works fine for me but when any one else walks into the prim it won't tp them it just tp's me because of the llOwnerSay(). Could some one explain how to work around this. I have tried a couple of options in the form of llKey2Name. Even  llGetOwner inside another prim for another person to wear with a listener in the object. I have been trying to learn to script for about 5 months so am fairly new to it.

Regards,

Renegade.


default
{
    state_entry() 
    {
        llSetObjectName( "" );  
    }
    collision_start( integer num ) 
    {
        if (llGetObjectDesc()=="Tardis in flight")
        {
          // Add extra stuff here.
        }
        else if(llGetObjectDesc()==llGetObjectDesc())
        {
            llOwnerSay("@tpto:"+ llGetObjectDesc() + "=force" );
        } 
    } 
}

 

Thanks Rolig. I placed the global coordinates in the objects description hence the llGetObjectDesc() call. Did the llSay for a guest wearer of an object so that teleports them but it also teleports both of us. Seems I'm stuck then with the llOwnerSay() limitation & out of luck.

Link to comment
Share on other sites

 

2 hours ago, Renegade Travesty said:

Did the llSay for a guest wearer of an object so that teleports them but it also teleports both of us.

Well, maybe that should be expected with llSay, since anybody in earshot will "hear" it, so presumably that would trigger their RLV response. Maybe you want to use llRegionSayTo() to the collider -- presumably llDetectedKey(0).

I have no experience with RLV, though; we're kinda shooting in the dark here without Innula or somebody who knows this stuff. I have the general impression that RLV by default only responds to llOwnerSay() text but that a "relay" is commonly used to forward other commands into llOwnerSay() messages for the RLV viewer to execute. Or something like that. 

Edited by Qie Niangao
Link to comment
Share on other sites

The link above to the doc API will help, but the critical step is the llSay or llShout,or llWhsisper or llRegionSay, and even llRegionSayTo.  

It must be on the standard RLV channel, including the UUID of the target AVI and the command and parameters.   The target avi *has* to be wearying a RLV relay device of some sort that is turned on and in either auto accept or ask mode.   That is where the magic happens.   The relay listens on the RLV channel, looks to see if the command is directed to its owner and then parses the command.  

You might be able to around all that with experience keys on the land.   But that is a different topic and discussion. 

 

Hope that helps

 

 

Link to comment
Share on other sites

Yes, Qie is, of course, completely correct.   RLV (or RLVa) causes the viewer to intercept all llOwnerSay messages that begin with the @ character and interpret them as commands.  This is a security precaution, but it leaves you with the problem of how to have RLV toys work for anyone but the owner.

The answer to this is the RLV Relay and its associated protocols.   The RLV relay listens on the agreed RLV channel (-1812221819).   If it hears something intended for the avatar who is wearing it, it attempts to parse the message into a valid RLV command and repeats that to the viewer as an llOwnerSay.

I don't know what you have in your object's description field, but since it works, I deduce you've correctly constructed the destination coordinates that RLV wants.  Since not everyone knows how to do this, I'll explain how it works, though.

As the link Roiig posted explains, RLV wants to be given the world coordinates of the destination vWorld in the form (string)vWorld.x+"/"+(string)vWorld.y+"/"+(string)vWorld.z.   When I was testing this, I was lazy and constructed the world coordinates by adding llGetRegionCorner()+llGetPos() at my target destination and copying the resulting vector into my teleporter's description field, so I have a vector with very large x and y coordinates.   This I translate into strDestination in state_entry, but you've presumably done all that beforehand and can simply use the description field as is.   

Anyway, this should do the trick if you change the stuff in state_entry as appropriate

integer iRLVRC = -1812221819;
key kVictim;
string strCommandName ="teleport";//arbitrary name to identify the command if necessary
//not used in this example but it has to be there
string strDestination;
default
{
    state_entry()
{
		//assumes the destination is a world coordinate 
		strDestination = llGetSubString(llStringTrim(llGetObjectDesc(),STRING_TRIM),1, -2);
		list temp = llCSV2List(strDestination);
		strDestination = llDumpList2String(temp,"/");
		llOwnerSay(strDestination);
		//may be possible simply to use strDestination = llGetObjectDesc() if the description is correctly formatted beforehand
	
       
    }

    collision_start(integer total_number)
    {
        if(llDetectedType(0) & AGENT_BY_LEGACY_NAME){//if an avatar collides with me
            
            kVictim = llDetectedKey(0);
            llRegionSayTo(kVictim,iRLVRC,strCommandName+","+(string)kVictim+","+"@tpto:"+strDestination +"=force");
        }
    }
}

 

Edited by Innula Zenovka
corrected typo
  • Like 2
Link to comment
Share on other sites

Thank you all this has cleared a few things up & helping me understand how RLV works.

Many thanks Innula. In answer to the objects description field holding the correct formatted coordinates you assumed right. They worked perfectly in the form of

Sandbox Island/123/117/26 once again Thank you. Certainly much more too it.

Link to comment
Share on other sites

Glad you got it working.   I hadn't realised that Marine had added the "user-friendly" teleport method whereby you simply specify the name of the target region and the local coordinates there, which is why I used the original method of calculating the destination's global coordinates (which still works, of course).

 

Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...