Bump 'n' Go: A simple Experience teleporter

I like to think it's useful for readers to learn about Experiences because Bay City has a high concentration of landowners, and landowners can enable Experiences on their parcel. There are also a large share of Premium subscribers, and they're eligible to define and use their very own custom Experiences.

Before enabling a custom Experience on your parcel, it must first be created -- an easy process, well documented in the knowledge base: https://community.secondlife.com/knowledgebase/english/experiences-in-second-life-r1365/#Section__4

One thing you can do with your own custom Experience is to make a simple collision-driven teleporter. Of course you could instead use other events besides collisions to trigger teleportation, but it's a neat trick to just walk through a fake door or fall through a "hole" in the floor and end up in a totally different place. So let's take the simplest collision-triggered Experience teleporter script as an example:

_______________

vector destiny = <56, 15, 2222>;
vector facing = <50, 15, 2222>;

default
{
state_entry()
  {
llVolumeDetect(TRUE);
  }
collision_start(integer num_detected)
  {
key collider = llDetectedKey(0);
if (ZERO_VECTOR == llGetAgentSize(collider))
return;
llRequestExperiencePermissions(collider, "");
  }
experience_permissions(key agent)
  {
llTeleportAgent(agent, "", destiny, facing);
  }
experience_permissions_denied(key agent, integer reason)
  {
if (17 != reason)
llRegionSayTo(agent, 0, "NO PERMS, reason: "+llGetExperienceErrorMessage(reason));
  }
}
_______________

That script would be placed in an object that, when the avatar steps into it, will teleport that avatar to a particular point in the same region (the "destiny" coordinates) oriented towards the "facing" coordinates when they arrive. So first you'll scope out where you want the avatar to go and which direction she should look on arrival, and change those two vectors to fit your situation.

(HINT: Don't set a "destiny" that's the EXACT same location of another teleporter because then you might arrive, collide with that teleporter, and be immediately teleported somewhere else -- or right back where you started. If BOTH ends specify each others' exact locations, it can be tricky to escape without relogging somewhere else.)

There are lots of ways to elaborate on this theme. For example, if this will serve the uninitiated, it wouldn't hurt to check first whether they're already enrolled in the Experience (llAgentInExperience), and if not, give them a little pep talk in chat before requesting experience permissions of them.

This form of teleporting also works for destinations in remote regions, but if you're unlucky, the destination region might be offline at the time. (There's also a separate step for finding the global coordinates of the remote region, and some trickiness with how the "facing" parameter is used, as well as a built-in "flyslow" animation that may need to be stopped.)

If there are a bunch of origin-destination pairs on a region, they might be networked to discover each other. (ADVANCED: They can even discover each other on very distant regions, using the "Key-Value Pair" persistent storage built-in to Experiences; that's how a network of walk-thru teleportation orbs work on Virtual Railway Consortium sites around the SLRR.)
Reporter Qie Niangao
190805

No comments:

Post a Comment

Calendar



Park Plaza Hotel

Park Plaza Hotel
Please visit our Sponsor!

Luxury Living in Bay City


Park Plaza residents enjoy beautiful views, fine dining, and a roof top patio with hot tub; all this near route 66, and within walking distance to Hairy Hippo Fun Land and aquarium. Rates start at 55L a week for studios, and 185L a week for full size apartments. Free furnishings available. Contact Roc Plutonium for more information!

Archive