Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llMoveToTarget and sim borders

Karl Gyranaut
Registered User
Join date: 21 Feb 2009
Posts: 8
03-30-2009 07:35
Morning (if morning it be)

I'm using llMoveToTarget to get a prim attachment to follow (and subsequently drag the attchee) behind someone. Basically a leash. Everything works great until the drag-er crosses a sim boundry and then the dragee seems to be stuck like a fly in amber on the border. If the drag-er crosses back into the first sim it seems that about half the time the dragee comes unstuck and half the time they don't.

It works perfectly inside a sim and I've seen plenty of examples of it working in other people scripts so I know that I'm just doing something wrong, but what? With appologies to Wm Shakespeare, that is the question.

Thanks
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
03-30-2009 09:20
Sim boundaries are a bear. It's not uncommon to lose attachments, at least temporarily. Some boundaries behave better than others, and some days SL behaves better than others. This has to be one of SL's more annoying features. If anyone has a clever, failsafe way to minimize boundary-crossing problems, I'd love to hear it myself.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
03-30-2009 10:27
you dont really show any code, so can't really help.
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
03-30-2009 10:50
What I would do is... after a few seconds if you didn't make it to the target, check whether the region changed, and if it did, subtract 256 from elements that are greater than 256, and add 256 to elements that are less than 0, and try again... Ew :D
_____________________
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
03-30-2009 11:26
Another good question would be how you are getting the position of the target.

Are you using llGetObjectDetails()? If so, it may SOMETIMES stop functioning if the target leaves the current sim (though it is SUPPOSED to extend a decent distance into the other region).

Are you using llSensor()? That will completely stop functioning if the target leaves the sim.

Are you using llSensorRepeat()? If so, you need to make the period less than 5 seconds (or something like that), and may have to be patient because it'll only find people or objects in adjacent sims every once in a while.

Are you using chat and listeners? If so, you may need to switch from llRegionSay(), which will never extend to adjacent sims, to llShout() or something (which I believe can extend to adjacent sims). Also, for a chat solution, you may need to include something like the global position of the sim corner, for comparison with the follower's region. This gets around the issue of each object only knowing local, region coordinates.
Karl Gyranaut
Registered User
Join date: 21 Feb 2009
Posts: 8
Figured it out
03-31-2009 07:30
Hi guys, thanks for the responses. I think a combination of dumb luck and brute force solved the problem. I wanted the leash to work like it was taking up slack so I set the tau of llMoveToTarget to 1.0 seconds. Dropping it to .2 helped a lot but I still wound up with the leashee stuck on the sim border occasionally. I then tossed in a llPush to give a little extra nudge and it seems to work great.

I'm at work at the moment so I don't have the script at hand but I'll post my pastiche of pushes and shoves this evening for anyone that's interested.

Thanks again