osTeleport Agent

Creating scripts
Ohn Lang
Posts: 142
Joined: Sun Dec 23, 2012 5:11 pm
Has thanked: 38 times
Been thanked: 67 times

Re: osTeleport Agent

Post by Ohn Lang »

Marstol Nitely wrote:I don't know much more than how to modify scripts either Minethere. Always have the feeling the real coders want to say "that's not what we're talking about Marstol, hurry along and let the adult scripters talk..." :)
Pshaw, Marstol! Not true at all. It's good to find out the different things that people use to accomplish a similar goal. Personally, I tend to use OSSL functions whenever they are available, just because, lol. No good reason in some cases ... in others because the OSSL version doesn't require getting permissions for something first. I like teleporting in one step, by touch or collision, without the middle step of looking at the map if I can get away with it. But I would surmise that Minethere uses that method because when all else fails, that will work.

Hearing from everyone about the different ways that they do things and why is very handy, and it matters not a whit whether you are a scripter dude or not :)
User avatar
Marstol Nitely
Posts: 480
Joined: Mon Dec 24, 2012 1:42 am
Has thanked: 1019 times
Been thanked: 432 times

Re: osTeleport Agent

Post by Marstol Nitely »

Ohn Lang wrote:Hearing from everyone about the different ways that they do things and why is very handy, and it matters not a whit whether you are a scripter dude or not
You are very nice Ohn and knowledgeable (as usual) and I'm very proud that I actually understood a good deal of what you said. So OSSL function is OsTeleport Agent or OsTeleportOwner, right? And OSSL teleports are like the rowdy kids because they don't ask permission, they just go where they want, when they want. Therefore the name Blam! But the one Minethere put up is some other sort of function, so it, it, um, it asks something er other permission. See - almost. :D

Maybe if I keep learning from you I'll actually be able to write a script in 5 or 10 years.
Ohn Lang
Posts: 142
Joined: Sun Dec 23, 2012 5:11 pm
Has thanked: 38 times
Been thanked: 67 times

Re: osTeleport Agent

Post by Ohn Lang »

Marstol Nitely wrote:... So OSSL function is OsTeleport Agent or OsTeleportOwner, right?
That's right. OpenSim function names all begin with 'os' and all SL function names begin with 'll'

Marstol Nitely wrote: ... And OSSL teleports are like the rowdy kids because they don't ask permission, they just go where they want, when they want.
That's a good way of thinking about it, LOL! OpenSim has a few rowdy functions, ones that don't ask for permission, like the ones to animate and stop animating an avatar. Using the OpenSim animate functions involve less scripting, because they don't need the permissions. There are a number of force-attach OSSL functions too, LOL. in kitely, use of those types of OSSL functions are limited to the world owner.

Marstol Nitely wrote: ... Therefore the name Blam!
Maybe that is where they got that name! I have no idea. Wondered about that myself. :)

Marstol Nitely wrote: ... But the one Minethere put up is some other sort of function, so it, it, um, it asks something er other permission. See - almost. :D
... The one that Minethere used opens up the map, llMapDestination. And, if I understand it right, her script doesn't need to get any permissions because she's opening the world map to allow the avatar to choose to teleport to the specified coordinates. I haven't used that function before so I'm not positive about that. That's why I said earlier that it is quite likely that Minethere uses that method because it's known to be a solid method, and no permissions to fail. The other common method that people use is to do sit-to-teleport objects, at least for in-region transportation.
Marstol Nitely wrote: ... Maybe if I keep learning from you I'll actually be able to write a script in 5 or 10 years.
LOL, if you limited yourself to just listening to me, that might be true. There are others, that if you listen to them, you will likely find yourself scripting in a couple days! I'm not well known for being a teacher :D
User avatar
Marstol Nitely
Posts: 480
Joined: Mon Dec 24, 2012 1:42 am
Has thanked: 1019 times
Been thanked: 432 times

Re: osTeleport Agent

Post by Marstol Nitely »

I thought you taught that lesson pretty well - Thanks! :D
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1142 times

Re: osTeleport Agent

Post by Graham Mills »

From SL Forums, another option might be to teleport in high and drop the avatar onto a transparent prim with a collision event-activated llSitTarget hack -- or have a sign or barrier making it clear that they need to go another way.
These users thanked the author Graham Mills for the post:
Mykyl Nordwind
User avatar
Marstol Nitely
Posts: 480
Joined: Mon Dec 24, 2012 1:42 am
Has thanked: 1019 times
Been thanked: 432 times

Re: osTeleport Agent

Post by Marstol Nitely »

Graham Mills wrote:From SL Forums, another option might be to teleport in high and drop the avatar onto a transparent prim with a collision event-activated llSitTarget hack -- or have a sign or barrier making it clear that they need to go another way.
That's an ingenious solution. Wish I was adept enough in scripting to make it work. Might play around with it anyway and see what I can do just for fun sometime.
User avatar
Constance Peregrine
Posts: 2349
Joined: Sun Dec 23, 2012 11:35 am
Has thanked: 2778 times
Been thanked: 1482 times

Re: osTeleport Agent

Post by Constance Peregrine »

Marstol Nitely wrote:I don't know much more than how to modify scripts either Minethere. Always have the feeling the real coders want to say "that's not what we're talking about Marstol, hurry along and let the adult scripters talk..." :)
lolol-))
Laissez faire et laissez passer, le monde va de lui même!
My little sounds store https://www.kitely.com/market?store=2040306

Ephemeral wanderer...
User avatar
Constance Peregrine
Posts: 2349
Joined: Sun Dec 23, 2012 11:35 am
Has thanked: 2778 times
Been thanked: 1482 times

Re: osTeleport Agent

Post by Constance Peregrine »

Marstol Nitely wrote:
... But the one Minethere put up is some other sort of function, so it, it, um, it asks something er other permission. See - almost.
... The one that Minethere used opens up the map, llMapDestination. And, if I understand it right, her script doesn't need to get any permissions because she's opening the world map to allow the avatar to choose to teleport to the specified coordinates. I haven't used that function before so I'm not positive about that. That's why I said earlier that it is quite likely that Minethere uses that method because it's known to be a solid method, and no permissions to fail. The other common method that people use is to do sit-to-teleport objects, at least for in-region transportation.
Yea, I like things that...don't fail...[huh?????]
Laissez faire et laissez passer, le monde va de lui même!
My little sounds store https://www.kitely.com/market?store=2040306

Ephemeral wanderer...
User avatar
Constance Peregrine
Posts: 2349
Joined: Sun Dec 23, 2012 11:35 am
Has thanked: 2778 times
Been thanked: 1482 times

Re: osTeleport Agent

Post by Constance Peregrine »

ok, fine then!! here is another one!! and if I get in da mood, I may post a 3rd one!!

Code: Select all

// Script to use the llSitTarget properties to act as a teleporter. 
// Free to use, modify, and distribute. Not for resale!

// Destination can be 300m away, maximum. This limit is determined by LL's limitations on the use of llSitTarget.


// HOW TO SET UP TELEPORTER:
// STEP 1. Place this teleporter, then place the target teleport chamber. 


// STEP 2. Specify the total number of destinations that are to be used. Max number is no more than the destinations listed below.
integer totalDest = 7;


// STEP 3. Go to the destination chamber, write down its X, Y, and Z position, then come back and enter those values here. X and Y are the horizontal coords on your mini-map. Z is the height. For example, if your target is at Abbotts(100,54) at an altitude of 41.5 meters, enter a vector of <100, 54, 41.5>. 

// NOTE: This script only permits destinations within the same sim as the teleporter.

// Enter the destinations here:
vector dest1 = <195,221,21>;

vector dest2 = <206,179,21>;

vector dest3 = <207,109,21>;

vector dest4 = <215,45,21>;

vector dest5 = <174,30,22>;

vector dest6 = <81,201,22>;

vector dest7 = <29,229,21>;

// STEP 4. Optional: Replace name of destinations with a short name. Example: "second floor".
string dest1_name = "";
string dest2_name = "";
string dest3_name = "";
string dest4_name = "";
string dest5_name = "";
string dest6_name = "";
string dest7_name = "";

// STEP 5. Replace description of destinations with a short description. These will appear when the user clicks the button. Example: "living room and private bar".
string dest1_desc = "#1";
string dest2_desc = "#2";
string dest3_desc = "#3";
string dest4_desc = "$4";
string dest5_desc = "#5";
string dest6_desc = "#6";
string dest7_desc = "#7";

// STEP 6. Done! Now test it. 

// ------------------------- NO NEED TO MODIFY ANYTHING BELOW THIS LINE -------------------------
integer currentDestNum = 1;
vector currentDest;
string currentDestName;
string currentDestDesc;

rotate_to_zero() {
    llSetRot(<0,0,0,0>);
}

setDestination() {
    if (currentDestNum == 1) {
        currentDest = dest1;
        currentDestName = dest1_name;
        currentDestDesc = dest1_desc;
    }
    else if (currentDestNum == 2) {
        currentDest = dest2;
        currentDestName = dest2_name;
        currentDestDesc = dest2_desc;
    }
    else if (currentDestNum == 3) {
        currentDest = dest3;
        currentDestName = dest3_name;
        currentDestDesc = dest3_desc;
    }
    else if (currentDestNum == 4) {
        currentDest = dest4;
        currentDestName = dest4_name;
        currentDestDesc = dest4_desc;
    }
    else if (currentDestNum == 5) {
        currentDest = dest5;
        currentDestName = dest5_name;
        currentDestDesc = dest5_desc;
    }
    else if (currentDestNum == 6) {
        currentDest = dest6;
        currentDestName = dest6_name;
        currentDestDesc = dest6_desc;
    }
    else if (currentDestNum == 7) {
        currentDest = dest7;
        currentDestName = dest7_name;
        currentDestDesc = dest7_desc;
    }
        
    vector pos = llGetPos();
    vector offset = currentDest - pos;
    llSitTarget(offset, ZERO_ROTATION);
    string hoverText = "TELEPORT TO:\n"+currentDestName+"\n"+currentDestDesc+"\n\n(click to choose destination)";
    llSetText(hoverText,<0,1,0>,1);
}

default {
    state_entry() {
        rotate_to_zero();
        setDestination();
        llSetSitText("Teleport");
    }
    on_rez(integer num) {
        llResetScript();
    }
    changed(integer change) {
        if (change & CHANGED_LINK) {
            if (llAvatarOnSitTarget() != NULL_KEY) {
                llMessageLinked(LINK_SET, 0, "teleporting", "");
                llUnSit(llAvatarOnSitTarget());
            }
        }
    }
    touch_start(integer total_number) {
        currentDestNum += 1;
        if (currentDestNum > totalDest) currentDestNum = 1;
        rotate_to_zero();
        setDestination();
    }
}
These users thanked the author Constance Peregrine for the post (total 2):
Adagio GreenwoodMarstol Nitely
Laissez faire et laissez passer, le monde va de lui même!
My little sounds store https://www.kitely.com/market?store=2040306

Ephemeral wanderer...
User avatar
Mykyl Nordwind
Posts: 22
Joined: Sat Dec 29, 2012 11:05 am
Has thanked: 24 times
Been thanked: 16 times

Re: osTeleport Agent

Post by Mykyl Nordwind »

Thanks so much to all of you! I am not able to work on this for a few days yet, but if I cannot find a solution here then there must not be one :)
These users thanked the author Mykyl Nordwind for the post:
Marstol Nitely
Post Reply