Jump to content

First time here, so I'm not positive if this is in the right place or not :)


Britlan
 Share

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

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

Recommended Posts

So I have an old teleporter script that I have been using for a while. It actually works pretty well but I never liked the sitting in the air above the teleporter when you click it. Maybe it was created for a chair? Idk. It is an older teleporter script that was created by 8ball magic I think, but still functions good I think.  Anyway, since I started playing with scripts a bit I figured I would play around and see if I could add another lsl default pose like hover or a stand in the place of sitting in the air. I have gotten the script to compile and actually work several ways, but just not correct. The default pose I added tends to appear at the end of the teleport no matter how I write it. I'm thinking it might be the lines that say llAvatarOnSitTarget conflicting with my changes. My main question, is it possible to even do what I am trying to do? Maybe the llAvatarOnSitTarget command needs to be replaced with another?

Yes, it is a trivial issue I guess, I just always thought it looked wierd being in a sit position above the tp pad. :) I forgot to save the script before I came here tonight but I figured most of the long time scripters would know the one I was talking about. I'm not even sure how to paste it the way most like it in the forum haha. And yes, I realize that the script has the built in ability to add a pose "inside" of the teleporter contents with the script, but that really does not work much better I thought. It still defaults to the sitting in the air first and than moves to the added animation. Priority I guess. Anyway, I was just curious if I was attempting the impossible. :) 

Have a great day all  :)

Link to comment
Share on other sites

There are dozens of different ways that you might write a poseball script and combine it with a sit teleporter.  There's no way to tell how that specific script is written without looking at it, so nobody here can give you detailed advice.  In general, though, if you want to apply a specific pose when a person sits on your teleporter, you will need to

  • have a changed event that respond to CHANGED_LINK and then requests the llAvatarOnSitTarget for PERMISSION_TRIGGER_ANIMATION.
  • have a run_time_permission event that looks to see whether the person has given permission and then (1) uses llStopAnimation("sit") to cancel the default sit animation and (2) applies your new pose with llStartAnimation("My_new_pose");

The details of how you do this will depend on what else is in your teleporter script and what other safeguards and options you want to build in.

 

 

  • Like 1
Link to comment
Share on other sites

OK, so I had way to many edit versions of the tp script and was getting lost, so I just started over. This is an attempted redo of a previous edit. I must have a ) or . or whatever different because now this really does nothing but give script error on permissions. It compiles and still works, but just with the errors. I had this script working before with no errors, but it still was not correct. the default lsl pose I was trying to substitute was working, but at the end of the tp jump. I'm sure this is a simple mess up and i am wasting too much energy on a trivial pose but I am new to scripts, what can i say. lol

Hopefully this posts correct, and ty you again for your reply rolig :)

integer CHANNEL = -10001;float INTERVAL = 10.0;vector OFFSET = <0.0,0.0,1.2>;list descriptions = [];list positions = [];list timestamps = [];string ANIM_STAND = "hover";string ANIM_TP = "sit";list orderButtons(list buttons){    return(llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4)         + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10));}warpPos(vector destpos){    integer jumps = (integer)(llVecDist(destpos, llGetPos())/10.0) + 1;    if (jumps > 411) jumps = 411;    list rules = [ PRIM_POSITION, destpos ];    integer count = 1;    while ((count = count<<1) < jumps) rules = (rules=[]) + rules + rules;    llSetPrimitiveParams( rules + llList2List( rules, (count-jumps)<<1, count));    if (llVecDist(llGetPos(), destpos) > .001) while (--jumps) llSetPos( destpos );}default{    state_entry()    {        key owner = llGetOwner();        string description = llGetObjectDesc();        vector position = llGetPos()+OFFSET;        llRegionSay(CHANNEL, (string)owner + "\t" + description + "\t" + (string)position);        llSetTimerEvent(INTERVAL);        llListen(CHANNEL, "", "", "");        llSetSitText("Teleport");        llSitTarget(<0.0,0.0,1.2>, ZERO_ROTATION);    }    changed(integer change) {        if (change & CHANGED_LINK) {            key id = llAvatarOnSitTarget();/////////////////////////////////////////////////////////////////                 llStopAnimation(ANIM_TP);        llStartAnimation(ANIM_STAND);            /////////////////////////////////////////////////////////////////                        if (id) {                if (llGetInventoryNumber(INVENTORY_ANIMATION) >= 1) {                    llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION);                }                integer count = llGetListLength(descriptions);                if (count >= 2) {                    list buttons = orderButtons(llListSort(descriptions, 1, TRUE));                    llDialog(id, "Select destination:", buttons, CHANNEL);                }                else if (count == 1) {                    vector position = llGetPos();                    llSleep(0.5);                    if (llSubStringIndex(llList2String(descriptions, 0), "*") == 0 && !llSameGroup(id)) {                        llInstantMessage(id, "Only group members are allowed to teleport to locations marked with '*'");                        llUnSit(id);                    }                    else if (llSubStringIndex(llList2String(descriptions, 0), "!") == 0 && id != llGetOwner()) {                        llInstantMessage(id, "Only the owner are allowed to teleport to locations marked with '!'");                        llUnSit(id);                    }                    else {                        warpPos(llList2Vector(positions, 0));                        llUnSit(id);                        warpPos(position);                    }                }                else {                    llSleep(0.5);                    llUnSit(id);            }        }    }}    listen(integer channel, string name, key id, string message)    {        if (id == llAvatarOnSitTarget()) {        integer index = llListFindList(descriptions, [message]);            vector position = llGetPos();            if (llSubStringIndex(llList2String(descriptions, index), "*") == 0 && !llSameGroup(id)) {                llInstantMessage(id, "Only group members are allowed to teleport to locations marked with '*'");                llUnSit(id);            }            else if (llSubStringIndex(llList2String(descriptions, index), "!") == 0 && id != llGetOwner()) {                llInstantMessage(id, "Only the owner is allowed to teleport to locations marked with '!'");                llUnSit(id);            }            else {                warpPos(llList2Vector(positions, index));                llUnSit(id);                warpPos(position);            }    }        else {            list tokens = llParseString2List(message, ["\t"], []);            key owner = (key)llList2String(tokens, 0);            string description = llList2String(tokens, 1);            vector position = (vector)llList2String(tokens, 2);            integer timestamp = llGetUnixTime();            if (owner == llGetOwner()) {                integer index = llListFindList(descriptions, [description]);                if (~index) {                    descriptions = llDeleteSubList(descriptions, index, index);                    positions = llDeleteSubList(positions, index, index);                    timestamps = llDeleteSubList(timestamps, index, index);                }                descriptions += description;                positions += position;                timestamps += timestamp;            }    }}            on_rez(integer n)    {        llResetScript();    }    run_time_permissions(integer perm)    {        if (perm & PERMISSION_TRIGGER_ANIMATION) {                                llStopAnimation(ANIM_TP);                llStartAnimation(ANIM_STAND);                                    //            llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));        }    }     timer()    {        key owner = llGetOwner();        string description = llGetObjectDesc();        vector position = llGetPos()+OFFSET;        integer timestamp = llGetUnixTime();        llRegionSay(CHANNEL, (string)owner + "\t" + description + "\t" + (string)position);        if (llGetListLength(timestamps) && timestamp-llList2Integer(timestamps, 0) > INTERVAL+1.0) {            descriptions = llDeleteSubList(descriptions, 0, 0);            positions = llDeleteSubList(positions, 0, 0);            timestamps = llDeleteSubList(timestamps, 0, 0);        }    }}
Link to comment
Share on other sites

Hmmmm... Several observations, not necessarily in order of importance.

1.  This is an OLD script and probably way more complicated than you need.  Unless you want a system that lets you select among a list of possible destinations, I'd lose this one and find (or write) something a lot simpler.

2. One antiquated feature of this script is its use of WarpPos, which was an old hack that was fine in its day but rendered useless in about 2011.  Remove it entirely and replace every mention of warpPos with llSetRegionPos.  It's the only way to go.

3. The script does compile without any errors.  If it's not working for you, it may be because it expects to be hearing destination names and locations from some other copies of the script that are in companion teleporters around your region.  If it doesn't hear any messages from other teleporters, it won't offer you any destinations and you won't be going anywhere.  This script and its companions in all the other teleporters announce their names and positions every ten seconds. (BTW, that is a really wasteful use of server resources.  There's no reason to do that over and over again.  Do it ONCE, when you place a new teleporter in the network.  Write a segment in a touch_start event that yells a teleporter's name and position when you set it up and touch it, and then listens for a specific ping response from all the other teleporters. If you do it right, all the teleporters will update when they hear that one message and you'll never have to do it again.  If you're worried about what happens if you remove a teleporter from the system, write another tiny segment that sends a ping and listens for a response just before it tries to TP you.  If there's no response, don't teleport.)

4. The run_time_permissions event does indeed fire up the change in your animation, as it should. As written, though, it will execute after you arrive at the destination, not before.  That's because the entire changed event has to finish being executed before the script can get to the run_time _permissions event.  If you want to change animations before you TP, then you'll have to move everything in the changed event after that first if test into the run_time_permissions event.  That will leave the changed event with only

    changed(integer change) {        if (change & CHANGED_LINK) {            key id = llAvatarOnSitTarget();            if (id) {                if (llGetInventoryNumber(INVENTORY_ANIMATION) >= 1) {                    llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION);                }            }        }    } 

You want all the rest of the stuff -- including the TP -- to execute after permission has been granted.

5.  Finally, you won't be changing anims to your own chosen one unless you have placed your own anim in the Contents of the teleporter.  After all, that if statement says, "Don't even bother asking for permissions unless there's an anim in Contents."

  • Like 1
Link to comment
Share on other sites

First and foremost thank you for your replies and the help you gave Rolig. I dont really use the forums much but I tend to end up here a lot through google trying to work out issues. This was my first post and as I expected you commented. Lol I see 3 or so peeps a lot here in the forums that really try to help out and I have been helped out on several issues just by reading the posts, so you all are appreciated. :) Now in order I'll try to answer or reply to your comments.

1. I was not aware this was that old of script really. I got it from an older avatar friend and they said it was the best teleporting script they have used. I have a point to point tp script, but I have 7 areas on a small parcel so this script just worked better there.

2. I have heard of the term Warpos but was not aware it was an old hack.  I think my point to point tp actually uses llSetRegionPos, so that is a plus I guess. :)  I did try to mod the script I uploaded but I guess there is a lot of extra code changes to accept llSetRegionPos. I never got the script to even compile right. I am still a script noob I guess, sorry.

3. As I mentioned, the script I uploaded compiles fine and actually works. I can still TP from one pad to another. I just get script error warnings on permissions. I am trying to understand the less server load script coding but I am still learning. I really understand the lag issue and hate it. I was proud when I found my dance ball that only used 1 script to control all the dances and effects compared to an older one that had 30 scripts just for dancers.

4. I got lost here. The script does except an animation inside of the TP pad contents, but why should it be coded to play both back to back? I really did not care about adding my own pose. I was just trying to hard code if you will a new lsl animation like a basic stand into the script. As you said this script is older so maybe it was added to a chair in the begining. Looks weird above a tp pad now though. I will try to add the original script I have without changes so others may improve on it. .

5. I added an animation and it worked, but rather redundant if the script defaults to the internal animation first. This tp script basically resits you twice? You sit in the air above the pad and than go to the added pose. Really no need to add a pose if the default pose has priority.

*Bonus. Just continue to help while being respectful and peeps will love you, even if we don't catch on as quick as others. :) I am actually probably too old to be here and catch on as quick as most, but is is very disheartening when some just try to tear you apart. Thankfully the forums do not seem to be as bad as many of the groups on SL.


This is the original script I recieved unchanged. Keep in mind, Rolig said this is a dated script as well as a server resource hog, maybe you can tweak and improve it. The only issue I ever had was the default pose sitting in the air above the tp pad, otherwise it worked ok.

integer CHANNEL = -10001;float INTERVAL = 10.0;vector OFFSET = <0.0,0.0,1.2>;list descriptions = [];list positions = [];list timestamps = [];string ANIM_STAND = "hover";string ANIM_TP = "sit";list orderButtons(list buttons){    return(llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4)         + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10));}warpPos(vector destpos){    integer jumps = (integer)(llVecDist(destpos, llGetPos())/10.0) + 1;    if (jumps > 411) jumps = 411;    list rules = [ PRIM_POSITION, destpos ];    integer count = 1;    while ((count = count<<1) < jumps) rules = (rules=[]) + rules + rules;    llSetPrimitiveParams( rules + llList2List( rules, (count-jumps)<<1, count));    if (llVecDist(llGetPos(), destpos) > .001) while (--jumps) llSetPos( destpos );}default{    state_entry()    {        key owner = llGetOwner();        string description = llGetObjectDesc();        vector position = llGetPos()+OFFSET;        llRegionSay(CHANNEL, (string)owner + "\t" + description + "\t" + (string)position);        llSetTimerEvent(INTERVAL);        llListen(CHANNEL, "", "", "");        llSetSitText("Teleport");        llSitTarget(<0.0,0.0,1.2>, ZERO_ROTATION);    }    changed(integer change) {        if (change & CHANGED_LINK) {            key id = llAvatarOnSitTarget();                        if (id) {                if (llGetInventoryNumber(INVENTORY_ANIMATION) >= 1) {                    llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION);                }                integer count = llGetListLength(descriptions);                if (count >= 2) {                    list buttons = orderButtons(llListSort(descriptions, 1, TRUE));                    llDialog(id, "Select destination:", buttons, CHANNEL);                }                else if (count == 1) {                    vector position = llGetPos();                    llSleep(0.5);                    if (llSubStringIndex(llList2String(descriptions, 0), "*") == 0 && !llSameGroup(id)) {                        llInstantMessage(id, "Only group members are allowed to teleport to locations marked with '*'");                        llUnSit(id);                    }                    else if (llSubStringIndex(llList2String(descriptions, 0), "!") == 0 && id != llGetOwner()) {                        llInstantMessage(id, "Only the owner are allowed to teleport to locations marked with '!'");                        llUnSit(id);                    }                    else {                        warpPos(llList2Vector(positions, 0));                        llUnSit(id);                        warpPos(position);                    }                }                else {                    llSleep(0.5);                    llUnSit(id);            }        }    }}    listen(integer channel, string name, key id, string message)    {        if (id == llAvatarOnSitTarget()) {        integer index = llListFindList(descriptions, [message]);            vector position = llGetPos();            if (llSubStringIndex(llList2String(descriptions, index), "*") == 0 && !llSameGroup(id)) {                llInstantMessage(id, "Only group members are allowed to teleport to locations marked with '*'");                llUnSit(id);            }            else if (llSubStringIndex(llList2String(descriptions, index), "!") == 0 && id != llGetOwner()) {                llInstantMessage(id, "Only the owner is allowed to teleport to locations marked with '!'");                llUnSit(id);            }            else {                warpPos(llList2Vector(positions, index));                llUnSit(id);                warpPos(position);            }    }        else {            list tokens = llParseString2List(message, ["\t"], []);            key owner = (key)llList2String(tokens, 0);            string description = llList2String(tokens, 1);            vector position = (vector)llList2String(tokens, 2);            integer timestamp = llGetUnixTime();            if (owner == llGetOwner()) {                integer index = llListFindList(descriptions, [description]);                if (~index) {                    descriptions = llDeleteSubList(descriptions, index, index);                    positions = llDeleteSubList(positions, index, index);                    timestamps = llDeleteSubList(timestamps, index, index);                }                descriptions += description;                positions += position;                timestamps += timestamp;            }    }}            on_rez(integer n)    {        llResetScript();    }    run_time_permissions(integer perm)    {        if (perm & PERMISSION_TRIGGER_ANIMATION) {            llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));        }    }     timer()    {        key owner = llGetOwner();        string description = llGetObjectDesc();        vector position = llGetPos()+OFFSET;        integer timestamp = llGetUnixTime();        llRegionSay(CHANNEL, (string)owner + "\t" + description + "\t" + (string)position);        if (llGetListLength(timestamps) && timestamp-llList2Integer(timestamps, 0) > INTERVAL+1.0) {            descriptions = llDeleteSubList(descriptions, 0, 0);            positions = llDeleteSubList(positions, 0, 0);            timestamps = llDeleteSubList(timestamps, 0, 0);        }    }}
Link to comment
Share on other sites

Yeah, WarpPos and the slightly better hack, PosJump, were really the only ways to write sit teleporters until Linden Lab finally introduced llSetRegionPos.  They were always problematic, but they were all we had.  Now, however, they are only found in ancient scripts. 

Here's a version of your script, modified along the lines I suggested earlier:

integer CHANNEL = -10001;float INTERVAL = 10.0;vector OFFSET = <0.0,0.0,1.2>;list descriptions = [];list positions = [];list timestamps = [];string ANIM_STAND = "hover";string ANIM_TP = "sit";key gAv;list orderButtons(list buttons){    return(llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4)         + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10));}default{    state_entry()    {        llSetClickAction(CLICK_ACTION_SIT);        key owner = llGetOwner();        string description = llGetObjectDesc();        vector position = llGetPos()+OFFSET;        llRegionSay(CHANNEL, (string)owner + "\t" + description + "\t" + (string)position);        llSetTimerEvent(INTERVAL);        llListen(CHANNEL, "", "", "");        llSetSitText("Teleport");        llSitTarget(<0.0,0.0,1.2>, ZERO_ROTATION);    }    changed(integer change) {        if (change & CHANGED_LINK) {            gAv = llAvatarOnSitTarget();            if (gAv) {                    llRequestPermissions(gAv, PERMISSION_TRIGGER_ANIMATION);            }        }    }    listen(integer channel, string name, key id, string message)    {        if (id == gAv) {        integer index = llListFindList(descriptions, [message]);            vector position = llGetPos();            if (llSubStringIndex(llList2String(descriptions, index), "*") == 0 && !llSameGroup(gAv)) {                llInstantMessage(gAv, "Only group members are allowed to teleport to locations marked with '*'");                llUnSit(gAv);            }            else if (llSubStringIndex(llList2String(descriptions, index), "!") == 0 && gAv != llGetOwner()) {                llInstantMessage(gAv, "Only the owner is allowed to teleport to locations marked with '!'");                llUnSit(gAv);            }            else {                llSetRegionPos(llList2Vector(positions, index));                llUnSit(gAv);                llSetRegionPos(position);            }        }        else {            list tokens = llParseString2List(message, ["\t"], []);            key owner = (key)llList2String(tokens, 0);            string description = llList2String(tokens, 1);            vector position = (vector)llList2String(tokens, 2);            integer timestamp = llGetUnixTime();            if (owner == llGetOwner()) {                integer index = llListFindList(descriptions, [description]);                if (~index) {                    descriptions = llDeleteSubList(descriptions, index, index);                    positions = llDeleteSubList(positions, index, index);                    timestamps = llDeleteSubList(timestamps, index, index);                }                descriptions += description;                positions += position;                timestamps += timestamp;            }        }    }    on_rez(integer n)    {        llResetScript();    }    run_time_permissions(integer perm)    {        if (perm & PERMISSION_TRIGGER_ANIMATION) {            llStopAnimation(ANIM_TP);                    llStartAnimation(ANIM_STAND); //Comment this out and replace it with the next line if you want           //            llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION,0));            integer count = llGetListLength(descriptions);            if (count >= 2) {                list buttons = orderButtons(llListSort(descriptions, 1, TRUE));                llDialog(gAv, "Select destination:", buttons, CHANNEL);            }            else if (count == 1) {                vector position = llGetPos();                llSleep(0.5);                if (llSubStringIndex(llList2String(descriptions, 0), "*") == 0 && !llSameGroup(gAv)) {                    llInstantMessage(gAv, "Only group members are allowed to teleport to locations marked with '*'");                    llUnSit(gAv);                }                else if (llSubStringIndex(llList2String(descriptions, 0), "!") == 0 && gAv != llGetOwner()) {                    llInstantMessage(gAv, "Only the owner are allowed to teleport to locations marked with '!'");                    llUnSit(gAv);                }                else {                    llSetRegionPos(llList2Vector(positions, 0));                    llUnSit(gAv);                    llSetRegionPos(position);                }            }            else {                llSleep(0.5);                llUnSit(gAv);            }        }    }    timer()    {        key owner = llGetOwner();        string description = llGetObjectDesc();        vector position = llGetPos()+OFFSET;        integer timestamp = llGetUnixTime();        llRegionSay(CHANNEL, (string)owner + "\t" + description + "\t" + (string)position);        if (llGetListLength(timestamps) && timestamp-llList2Integer(timestamps, 0) > INTERVAL+1.0) {            descriptions = llDeleteSubList(descriptions, 0, 0);            positions = llDeleteSubList(positions, 0, 0);            timestamps = llDeleteSubList(timestamps, 0, 0);        }    }}

I have tested it and it works quite well. If you study it, you'll see that I added a global variable, gAv, to guarantee some contiuity between the changed event, the listen event, and the run_time_permissions event, where it might not always be true that they are identifying the same avatar.  I also set the click action at the start to save you the trouble of having to click for a sit menu.  If you decide to use your own animation, all you need to do is swap out the commented line in the run_time_permissions event.

Having done this, I will point out again that although the script works, there are much shorter and efficient ways to write a script for a network of sit teleporters.  My own favorite -- the one that I use in the networked teleporter I sell in Marketplace -- avoids maintaining any lists of current locations. When you sit on any teleporter in the system, it yells in llRegionSay, "Hey!  I gotta fare that wants to teleport.  Where are the other taxi stands in this region?"  All of the other teleporters yell back, "Here I am!" and send their locations.  You pick one in a dialog menu and teleport.  There's no need for continuous polling with a timer or for maintaining a list of locations.  It takes a little fancier scripting than that to make it pretty, but that's all there is to a bare bones teleport network.

BTW -- closing note -- don't apologize for being "too old to be here and catch on as quick as most."  Lots of the rest of us could say the same.  My birthday is next week and I've been around for the better part of seven decades.

Link to comment
Share on other sites

Well Happy Birthday Rolig :) Wow, seven decades, I guess I am just a wee youngin at almost 2/3 of a century old. Hmmmmmm, no need to cross check those figures, I thought it might sound better that way. lol Sometimes the coding just tends to all blur together these days after an hour or so I guess.

So, after testing your upgraded version I found I still had a problem, of course. LOL All on my side though by overlooking one key issue, an AO. I sat, yet I was still "sitting in the air." I took it off to check since you had tested it with success and sure enough, I sat properly as I should. I now wonder how many versions of the old code I changed may have worked if I had always removed the AO. I actually did take the AO off for a few tests of the changes and I never
saw an improvement so I will just say all my attempts were flawed. hahaha I really did not think "my" AO would cause an issue anyway because it was a newer one that supposedly dealt with sitting issues, I remember reading it in the description and it has seemed to work well since I got it.

Anyway, some good came from the experimenting I guess. You took an old outdated code, cleaned it up and updated it a bit and it does work much better now I think. I noticed it was a few less lines of coding as well, always a good thing I think. So Thank you very much for your replies and help.

Speaking of the amount of lines of coding, I do have a question that most scripters probably know but I'm not sure I have ever heard if it makes a diffence. Does the amount of code in a script have effect on lag? I think one of the first scripts I ever played with was a particle effect. It was well over 300 lines of coding but was really just a basic sparkle script. I managed to rewrite that script at about 30 lines I think and that included adding a touch on and off event. I know the touch on/off feature helps on the lag issue because before the script just always ran. But does the amount of coding make a big difference? I was just always curious about that

Again, thank you very much for your help and replies Rolig. I hope you and yours have wonderful and Happy Thanksgiving :)

Link to comment
Share on other sites


Britlan wrote:

Does the amount of code in a script have effect on lag?

Scripts are executed on the simulator servers, and those servers apportion a fixed amount of time for their execution. The amount of compute time a script requires is more a function of its design and the functions it calls than of length. You can set up a scan event for once a minute or 100 times a second. It's the same code either way, differing only by a constant. If you need something to recur in your script, like a scan or a movement, don't do it more often than is necessary. Replacing WarpPos() is an example. The new function makes an arbitrary distance move in one go, wherease WarpPos did it in 10m steps. The new code is a few lines shorter, but that's not what's speeding up the script.

All else (on the server) being fairly equal, shorter scripts are not necessarily better. Better scripts are better. If expressing an algorithm in a few extra lines of code makes it easier for someone else to understand, add the extra lines.

And finally, you aren't the first person to whack away at a bit of code that's doomed never to work because of some stupid thing you forgot to do. During my career designing medical instrumentation, it was not uncommon for me to forget to uncomment some line of code, set some software switch to the correct value, or perform every step of the code build process, and then spend the better part of the day trying to figure out why, no matter how much I banged on the program, nothing changed.

Given enough time, we all do dumb stuff.

;-).

Link to comment
Share on other sites

No, scripts can't lag a region.  The most they can do is lag each other.  When the region's servers are prioritizing tasks, they give scripts the lowest priority.  If you watch the Statistics Bar (CTRL + Shift + 1), you'll usually see that there's a bit of unused time ("spare time") if things are running right.  When things get really busy, that unused time disappears and the next thing that gets capped is script time..  So, a script that's a real server hog could eat up more than it's fair share of resources at a time like that, and make other scripts start to stall.  Otherwise, though, scripts don't compete with anything.

Also, it's not generally the number of lines in a script that make it "big".  It's the amount of memory the script ties up in things like lists and the amount of time it locks up in repetitive operations (like running a fast timer and doing a mess of calculations at each step).  I have written long scripts that use hardly any resources and have screwed up on short ones that generate a stack/heap error in an instant.

On the subject of AO's .... An AO that uses the new llRequestAnimationOverride and related functions is truly a nice improvement on the old ZHAO AO's.  It cuts way down on the number of times you have to request permission to stop and start anims.  It will still run afoul of animation priorities, though.  If your AO sets a Priority 4 anim as your replacement for "sit", it's great until some pose ball has a Priority 5 anim in it.  That's what was probably happening to your sit TP unit, although in reverse.  Your AO was trumping the anim in the TP pad.

Good luck with your scripting.  It's a worthy use of time.  And fun.

Link to comment
Share on other sites


Madelaine McMasters wrote:

 .... ]  And finally, you aren't the first person to whack away at a bit of code that's doomed never to work because of some stupid thing you forgot to do. [ .... ]

The most common stupid thing I do is to forget to stand back and consider the whole picture.  "To a man with a hammer, every problem looks like a nail."  And to a scripter, every problem looks like something you ought to be able to fix with a script.  I trip over permission errors and transparent texture problems, mislabeled child prims, listeners that are just outside of chat range, and mesh objects that have poorly made physics shapes -- and am so SURE that I can fix them if I only bang on my script a little harder with my hammer........

Link to comment
Share on other sites


Rolig Loon wrote:

The most common stupid thing I do is to forget to stand back and consider the whole picture.  "To a man with a hammer, every problem looks like a nail."


 

I think part of my career success was due to my ability to stand back and see a big picture (sometimes more than one) that was quite different from what others saw. I am both lazy and curious, so I've amassed a sizeable toolkit that I can apply to problems to avoid doing serious work. Unfortunately, I am also so scatter brained that even the few morsels of serious work I couldn't avoid left me making so many stupid mistakes that I was always in fear somebody would discover I didn't know what the hell I was doing.

Think about that the next time someone puts defibrillator paddles on your chest. That might be my code deciding what to do to you.

;-).

Link to comment
Share on other sites

I considered myself pretty smart until I started making things in SL. It has been a most humbling experience.

I thank God I found Rolig, who knows if there is any way I can misunderstand how a script works, I will. With me as the dumbest beta tester imaginable, she has been responsible for making my most complicated stuff as idiot proof as possible. 

Link to comment
Share on other sites


Pamela Galli wrote:

I considered myself pretty smart until I started making things in SL. It has been a most humbling experience.

I thank God I found Rolig, who knows if there is any way I can misunderstand how a script works, I will. With me as the dumbest beta tester imaginable, she has been responsible for making my most complicated stuff as idiot proof as possible. 

Every time I think I'm smart, someone proves me wrong.

I suspect Rolig appreciates your ability to misunderstand scripts. It's valuable to have someone misunderstand something you think you understand. The explaining of it sometimes prove you don't.

There was a product manager at my old company who was (in)famous for being able to make our prototypes malfunction. We, who'd designed the things, knew to much to be good testers. We needed his ignorance of our precious work.

I've seen your work, Pamela. It's lovely. You've clearly learned from your humbling experiences. I'm not sure I can say the same about mine.

;-).

Link to comment
Share on other sites

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