Jump to content

Landmark Teleport Scripts - Only Owner?


JaslynMaia
 Share

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

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

Recommended Posts

Okay, so I found this script on the LSL wiki page, meant to teleport anyone that clicks on the object with the script in it and teleports them to the landmark included in the item inventory. 

The script works well for me, but I can't quite grasp why it doesn't work for other people? Like my fiancé for example, it would teleport me, but if he were to click on the item, I'd get an error saying that Teleport LSL functions can only teleport the owner of the object. I don't quite understand why it does that, when the scripting doesn't seem to specify that its owner only?

key  teleportee;
 
default
{
    state_entry()
    {
        llSay(0, "Touch to teleport");
    }
 
    touch_start(integer total_num)
    {
        teleportee = llDetectedKey(0);
        llRequestPermissions(teleportee, PERMISSION_TELEPORT);
    }
 
    run_time_permissions(integer perm)
    {
        if(PERMISSION_TELEPORT & perm)
        {
            llTeleportAgent(teleportee, "//insert landmark name here", <13.0, 38.0, 23.5>, <13.0, 12.0, 23.5>);
        }
    }
}

 

Edited by JaslynMaia
Link to comment
Share on other sites

Per the LSL Wiki: "This function can only teleport the owner of the object (unless part of an Experience)." You'd have to make the script part of an experience in order to teleport other people. There are older functions that can do the job, but they'll bring up the world map and the person being teleported would have to click on the teleport button on the map.

  • Like 1
Link to comment
Share on other sites

All that fancy stuff is cool but I still just dump an app-uri on them: http://wiki.secondlife.com/wiki/Viewer_URI_Name_Space

default
{
    touch_start(integer total_number)
    { //Instant message whoever touches me a SLURL to click on
        llInstantMessage(llDetectedKey(0), "Click here: secondlife:///app/teleport/Perry/64/208/28");
    }
}

 

Link to comment
Share on other sites

1 hour ago, JaslynMaia said:

float auto_close_time = 30;//time in seconds before the gate closes

//Link number definitions
list chev_arrows    = [];
list chev_sockets   = [];
list chev_lights    = [];
integer portal = 0;
string tex_chev_on  = "chevron_on";
string tex_chev_off = "chevron_off";
integer first = TRUE;
integer busy = TRUE;
integer listener;
vector targetPos;

InitialSetup()
{
	first = FALSE;
	integer l = llGetNumberOfPrims();
	integer i = 1;
	for(; i<=l;i++) {
		string name = llGetLinkName(i);
		if (name == "Stargate_Chevron") chev_arrows = [i] + chev_arrows;
		else if (name == "Stargate_ChevronLight") chev_lights = [i] + chev_lights;
		else if (name == "Stargate_ChevronSlot") chev_sockets = [i] + chev_sockets;
		else if (name == "Stargate_Portal")
		{
			portal =i;
			llSetLinkTextureAnim(i,LOOP | ANIM_ON, ALL_SIDES, 4, 4, 0, 16, 12);
		}
	}
}

ChevPos(list linkset,float open)
{
	integer i = 0;
	integer l = llGetListLength(linkset);
	for(i = 0; i < l; i++) {
		integer link = llList2Integer(linkset,i);
		vector f = -llRot2Left(llList2Rot(llGetLinkPrimitiveParams(link,[PRIM_ROT_LOCAL]),0));
		llSetLinkPrimitiveParamsFast(link,[
			PRIM_POS_LOCAL,f*open
				]);
	}
}

OpenPortal() {
	llParticleSystem( [
		PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE_CONE,
		PSYS_SRC_BURST_PART_COUNT,30,
		PSYS_SRC_BURST_RATE,0.0,
		PSYS_PART_MAX_AGE,1.,
		PSYS_SRC_BURST_RADIUS,1.5,
		PSYS_SRC_INNERANGLE,0.0,
		PSYS_SRC_OUTERANGLE,0.0,
		PSYS_SRC_ANGLE_BEGIN,PI/2,
		PSYS_SRC_ANGLE_END,PI/2,
		PSYS_SRC_OMEGA,(<0,0,0>),
		PSYS_PART_START_GLOW,.1,
		PSYS_PART_END_GLOW,.1,
		PSYS_SRC_BURST_SPEED_MIN,-10,
		PSYS_SRC_BURST_SPEED_MAX,-20,
		PSYS_SRC_ACCEL,<-1,0,0>,
		PSYS_PART_START_SCALE,<.5,.5,.0>,
		PSYS_PART_END_SCALE,<1.,1.,0>,
		PSYS_PART_START_COLOR,<0.6, 0.6, 0.7>,
		PSYS_PART_END_COLOR,<0.6, 0.6, 0.7>,
		PSYS_PART_START_ALPHA,0.0,
		PSYS_PART_END_ALPHA,1.0,
		PSYS_SRC_TEXTURE,"4c6bee64-0869-63da-e2ba-71c984721a23",
		PSYS_SRC_MAX_AGE,0,
		PSYS_PART_FLAGS,
		PSYS_PART_EMISSIVE_MASK |           // particles glow
		PSYS_PART_FOLLOW_VELOCITY_MASK |    // particles rotate towards where they're going
		PSYS_PART_INTERP_COLOR_MASK |       // particles change color depending on *_END_COLOR
		PSYS_PART_INTERP_SCALE_MASK |       // particles change size using *_END_SCALE
		PSYS_PART_TARGET_POS_MASK
			] );
	llSetLinkPrimitiveParams(portal,[
		PRIM_GLOW,ALL_SIDES, 0.2,
		PRIM_COLOR,ALL_SIDES,<0.306, 0.349, 0.588>,0.5,
		PRIM_POINT_LIGHT,1,<0.306, 0.349, 0.588>,1,7,2]);
	llSleep(0.8);
	llParticleSystem( [
		PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE_CONE,
		PSYS_SRC_BURST_PART_COUNT,30,
		PSYS_SRC_BURST_RATE,0.1,
		PSYS_PART_MAX_AGE,1.6,
		PSYS_SRC_BURST_RADIUS,0.5,
		PSYS_SRC_INNERANGLE,0.0,
		PSYS_SRC_OUTERANGLE,0.0,
		PSYS_SRC_ANGLE_BEGIN,PI/2,
		PSYS_SRC_ANGLE_END,PI/2,
		PSYS_SRC_ACCEL,llRot2Up(llGetRot())*30,
		PSYS_PART_START_GLOW,.1,
		PSYS_PART_END_GLOW,.1,
		PSYS_SRC_TEXTURE,"4c6bee64-0869-63da-e2ba-71c984721a23",
		PSYS_SRC_BURST_SPEED_MIN,0.0,
		PSYS_SRC_BURST_SPEED_MAX,0.0,
		PSYS_PART_START_SCALE,<.2,.2,.0>,
		PSYS_PART_END_SCALE,<2.2,2.2,0>,
		PSYS_PART_START_COLOR,<0.6, 0.6, 0.7>,
		PSYS_PART_END_COLOR,<0.6, 0.6, 0.7>,
		PSYS_PART_START_ALPHA,1.0,
		PSYS_PART_END_ALPHA,0.0,
		PSYS_SRC_MAX_AGE,0.0,
		PSYS_PART_FLAGS,
		PSYS_PART_EMISSIVE_MASK |           // particles glow
		PSYS_PART_FOLLOW_VELOCITY_MASK |    // particles rotate towards where they're going
		PSYS_PART_INTERP_COLOR_MASK |       // particles change color depending on *_END_COLOR
		PSYS_PART_INTERP_SCALE_MASK |       // particles change size using *_END_SCALE
		PSYS_PART_TARGET_POS_MASK
			] );
	llSetLinkPrimitiveParams(portal,[
		PRIM_GLOW,ALL_SIDES, 0.4,
		PRIM_COLOR,ALL_SIDES,<0.306, 0.349, 0.588>,1,
		PRIM_POINT_LIGHT,1,<0.306, 0.349, 0.588>,1,7,2
			]);
	llSleep(0.8);
	llParticleSystem( [] );
}

SetLinksetGlowTexture(list linkset,float glow, string uuid)
{
	integer alpha_mode = PRIM_ALPHA_MODE_EMISSIVE;
	if (glow == 0) alpha_mode = PRIM_ALPHA_MODE_NONE;
	llSetLinkPrimitiveParamsFast(llList2Integer(linkset,0),[
		PRIM_GLOW,ALL_SIDES, glow,
		PRIM_TEXTURE, ALL_SIDES, uuid, <1,1,1>, ZERO_VECTOR, 0,
		PRIM_ALPHA_MODE, ALL_SIDES, alpha_mode,0,
		PRIM_LINK_TARGET,llList2Integer(linkset,1),
		PRIM_GLOW,ALL_SIDES, glow,
		PRIM_TEXTURE, ALL_SIDES, uuid, <1,1,1>, ZERO_VECTOR, 0,
		PRIM_ALPHA_MODE, ALL_SIDES, alpha_mode,0,
		PRIM_LINK_TARGET,llList2Integer(linkset,2),
		PRIM_GLOW,ALL_SIDES, glow,
		PRIM_TEXTURE, ALL_SIDES, uuid, <1,1,1>, ZERO_VECTOR, 0,
		PRIM_ALPHA_MODE, ALL_SIDES, alpha_mode,0,
		PRIM_LINK_TARGET,llList2Integer(linkset,3),
		PRIM_GLOW,ALL_SIDES, glow,
		PRIM_TEXTURE, ALL_SIDES, uuid, <1,1,1>, ZERO_VECTOR, 0,
		PRIM_ALPHA_MODE, ALL_SIDES, alpha_mode,0,
		PRIM_LINK_TARGET,llList2Integer(linkset,4),
		PRIM_GLOW,ALL_SIDES, glow,
		PRIM_TEXTURE, ALL_SIDES, uuid, <1,1,1>, ZERO_VECTOR, 0,
		PRIM_ALPHA_MODE, ALL_SIDES, alpha_mode,0,
		PRIM_LINK_TARGET,llList2Integer(linkset,5),
		PRIM_GLOW,ALL_SIDES, glow,
		PRIM_TEXTURE, ALL_SIDES, uuid, <1,1,1>, ZERO_VECTOR, 0,
		PRIM_ALPHA_MODE, ALL_SIDES, alpha_mode,0,
		PRIM_LINK_TARGET,llList2Integer(linkset,6),
		PRIM_GLOW,ALL_SIDES, glow,
		PRIM_TEXTURE, ALL_SIDES, uuid, <1,1,1>, ZERO_VECTOR, 0,
		PRIM_ALPHA_MODE, ALL_SIDES, alpha_mode,0,
		PRIM_LINK_TARGET,llList2Integer(linkset,7),
		PRIM_GLOW,ALL_SIDES, glow,
		PRIM_TEXTURE, ALL_SIDES, uuid, <1,1,1>, ZERO_VECTOR, 0,
		PRIM_ALPHA_MODE, ALL_SIDES, alpha_mode,0,
		PRIM_LINK_TARGET,llList2Integer(linkset,8),
		PRIM_GLOW,ALL_SIDES, glow,
		PRIM_TEXTURE, ALL_SIDES, uuid, <1,1,1>, ZERO_VECTOR, 0,
		PRIM_ALPHA_MODE, ALL_SIDES, alpha_mode,0
			]);
}

ClosePortal()
{
	llSetLinkPrimitiveParams(portal,[
		PRIM_GLOW,ALL_SIDES, 0.2,
		PRIM_COLOR,ALL_SIDES,<0.31, 0.35, 0.59>,0.5,
		PRIM_POINT_LIGHT,0,<0.31, 0.35, 0.59>,1,7,2
			]);

	llSetLinkPrimitiveParams(portal,[
		PRIM_GLOW,ALL_SIDES, 0.0,
		PRIM_COLOR,ALL_SIDES,<0.31, 0.35, 0.59>,0,
		PRIM_POINT_LIGHT,0,<0.31, 0.35, 0.59>,1,7,2
			]);
}


default
{
	state_entry()
	{
		llSetTimerEvent(0);
		busy = TRUE;
		if (first) InitialSetup();
		SetLinksetGlowTexture(chev_lights,0.0,tex_chev_off);
		SetLinksetGlowTexture(chev_arrows,0.0,tex_chev_off);
		SetLinksetGlowTexture(chev_sockets,0.0,tex_chev_off);
		ClosePortal();
		busy = FALSE;
	}

	touch_start(integer total_number)
	{
		llListenRemove(listener);
		integer n = llGetInventoryNumber(INVENTORY_LANDMARK);
		integer i = 0;
		list landmarks = [];
		if (n==0) {
			llDialog(llDetectedKey(0), "This stargate has not been fed any landmarks", [], -777);
		}
		else if (n==1) {
			llRequestInventoryData(llGetInventoryName(INVENTORY_LANDMARK,0));
		}
		else {
			for(;i<n;i++) {
				landmarks += llGetInventoryName(INVENTORY_LANDMARK,i);
			}
			llDialog(llDetectedKey(0), "Stargate", landmarks, -777);
			listener = llListen(-777, "", "", "");
			llSetTimerEvent(60);
		}
	}

	listen(integer chan, string name, key id, string msg)
	{
		if (!busy && llGetInventoryType(msg) != INVENTORY_NONE) {
			llSetTimerEvent(0.0);
			llRequestInventoryData(msg);
		}
	}

	dataserver( key vKeyNull, string vStrData )
	{
		targetPos = (vector)vStrData;
		state active;
	}

	timer()
	{
		llListenRemove(listener);
		llSetTimerEvent(0);
	}
}

state active {
	state_entry()
	{
		busy = TRUE;
		llPreloadSound("chevlock");
		llPlaySound("chevlock",1);
		llPreloadSound("gateopen");
		ChevPos(chev_arrows,0.06);
		SetLinksetGlowTexture(chev_lights,0.3,tex_chev_on);
		SetLinksetGlowTexture(chev_arrows,0.3,tex_chev_on);
		SetLinksetGlowTexture(chev_sockets,0.3,tex_chev_on);
		llSleep(0.5);
		llPlaySound("gateopen",1);
		ChevPos(chev_arrows,0.0);
		OpenPortal();
		busy = FALSE;
		llSetTimerEvent(auto_close_time);
	}

	touch_start(integer total_number)
	{
		if (busy) return;
		llMapDestination(llGetRegionName(), targetPos, ZERO_VECTOR);
	}

	timer() {
		llPreloadSound("gateclose");
		llPlaySound("gateclose",1);
		llSleep(1);
		state default;
	}
}

I do not know who the author was. It will do what you want. Strip out what is not needed. As was stated by another, your example only works for owner or an expeience.

 

Edited by steph Arnott
Link to comment
Share on other sites

9 hours ago, Parhelion Palou said:

... There are older functions that can do the job, but they'll bring up the world map and the person being teleported would have to click on the teleport button on the map.

Not quite. llMapDestination too only works for the owner. For other avatars it only works when used in a touch event.

So there is no useful way to teleport others by using a hud - except you use an experience. But experiences only work on land that have this experience enabled - so again, not useful for a hud.

Link to comment
Share on other sites

2 hours ago, Nova Convair said:

Not quite. llMapDestination too only works for the owner. For other avatars it only works when used in a touch event.

So there is no useful way to teleport others by using a hud - except you use an experience. But experiences only work on land that have this experience enabled - so again, not useful for a hud. 

The OP said 'meant to teleport anyone that clicks on the object'. I dropped all other teleport methods once the experience-based one came out, but all my public ones use touch. My tenants wouldn't use a HUD; neither would I. I use portal type activation for fun experiments, like infinite falling and exiting a tunnel the way you came in, but those aren't accessible to the public.

Link to comment
Share on other sites

11 minutes ago, Parhelion Palou said:

The OP said 'meant to teleport anyone that clicks on the object'. I dropped all other teleport methods once the experience-based one came out, but all my public ones use touch. My tenants wouldn't use a HUD; neither would I. I use portal type activation for fun experiments, like infinite falling and exiting a tunnel the way you came in, but those aren't accessible to the public.

Well assuming this means in the same sim or parcel then a point to point object type teleporter will suffice. The script i gave above is global.

llTeleportAgent
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1917 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...