Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Object crossing sim boundaries

Lum Pfohl
Registered User
Join date: 14 May 2007
Posts: 7
07-29-2008 18:18
I have been reading that llSetPos() has the ability to move a prim into another sim by specifying parameters beyond the current sim (ref: http://rpgstats.com/wiki/index.php?title=LlSetPos ).

I seem to be able to move a prim several meters into the next sim- but it seems to confound the script - it stops working properly for example:

llOwnerSay() - fails to report anything even though I'm in the same sim
llEmail() - fails to send email

If the prim does move into the next sim, and I attempt to move it to the center of that sim, for example, the prim ends up 3 sims away (where it stalls and gets autoreturned).

-----

What's a good way of moving a single prim, unattached, into an adjoining SIM, moving it to the center and have it return back to the place of origin?

Thank you in advance
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
07-29-2008 20:25
If you are using a "WarpPos" type solution, you might want to change that and instead warp to a position very close to the edge of the current sim, and then carefully make ONE call to llSetPos() or llSetPrimitiveParams() to a position in the other sim that you know is within the 10m movement limit before resuming the movement normally.
Lum Pfohl
Registered User
Join date: 14 May 2007
Posts: 7
07-30-2008 04:55
Thank you! That is exactly what I ended up doing -- The problem, it turns out, is the function I used to move the object:

CODE

travel(vector targetPos) {
// llResetScript();
vector myPos = llGetPos();

while( llVecDist(myPos, targetPos) > 0.01) {
llSetPos(targetPos);
myPos = llGetPos();
}
if (__debug) {
llOwnerSay("I'm at " + (string)llGetPos());
}

}


I would move the object to <255, 128, 100> then to <260, 128, 100>.

There is about a 5 second delay before the object passes from <260, 128, 100> in one sim to <4, 128, 100> in the next sim (presumably as the sims are negotiating a handoff of this prim).

Then the next problem is that the travel() function does not properly recognize sim crossings (that it was told to go beyond 0 - 255, and that the value did indeed change back to 0 - 255).

In effect, it was still trying to get to <260, 128, 100> when the handoff had occured and it was moving perpetually from <4, 128, 100> to <260, 128, 100> crossing multiple sims until it hit a place where it had given up.


I tried rewriting this using llMoveToTarget() and moving a physical prim around - same deal at the sim crossing.

So I ended up what you suggested -- go to the very edge. Then "jump in" using llSetPos() or llMoveToTarget() directly. Then I waited about 10 seconds (llSleep()) and verified that the llRegionName() had changed before attempting to use the travel() function again.


Thanks so much!!!!
Ollj Oh
Registered User
Join date: 28 Aug 2007
Posts: 522
07-30-2008 05:22
when a scripted object enters a new REGION it may not be able to do anything for up to 5 seconds and act desorientated during that time because local coordinate systems may get messed up.

you can always calculate position relative to the "great zero", "Da Boom (0,0,0)" to avoid messing up local region coordinates during a region handoff order crossing.
32bit floats are still large enough to cover all positions of sl accurately for a vehicle that is damping anyways.