Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Object goes *OFF WORLD* how to fix this?

Anastasia Serenity
Registered User
Join date: 2 Jan 2009
Posts: 53
09-26-2009 06:53
Hello, I have a script that makes physical objects move around the land randomly in sky but it also makes the object go OFF WORLD - randomly. Thats script is almost moody like my cat :) I like to have a little bit more control ^^
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-26-2009 07:07
There are many ways to handle this problem. Try testing llOverMyLand, as in ...

if (llOverMyLand(llGetKey()) == FALSE){
llDie();
}
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Anastasia Serenity
Registered User
Join date: 2 Jan 2009
Posts: 53
09-26-2009 07:12
From: Rolig Loon
There are many ways to handle this problem. Try testing llOverMyLand, as in ...

if (llOverMyLand(llGetKey()) == FALSE){
llDie();
}


thank you Rolig - going online and test this now!
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-26-2009 09:37
Just to be sure (and because I suddenly got nervous at the thought of having maybe killed your beautiful co-copy object).... the important part of my suggestion is the if test. What you do if the test is true .... in this case llDie() ... is totally up to you. If you don't want to kill the wandering object, you can have it whine "Help me!", or drop to the ground and stop moving, or start sending out a particle stream........ :)
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Anastasia Serenity
Registered User
Join date: 2 Jan 2009
Posts: 53
09-27-2009 06:13
From: Rolig Loon
Just to be sure (and because I suddenly got nervous at the thought of having maybe killed your beautiful co-copy object).... the important part of my suggestion is the if test. What you do if the test is true .... in this case llDie() ... is totally up to you. If you don't want to kill the wandering object, you can have it whine "Help me!", or drop to the ground and stop moving, or start sending out a particle stream........ :)


Yes you killed my beautiful no-co-copy object :) I could not find the way to include this if case in the code but found out that i can tell the object to stay away from SIM borders - 50 meters are fine and the object now does not go off world - However I would like to know where to put the TRUE test exactly :) Thank you Rolig ;-)
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-27-2009 09:19
From: Anastasia Serenity
However I would like to know where to put the TRUE test exactly :)

That depends on the structure of your script. It may make sense to test a destination before your object moves to see if it's a valid destination, or it may make more sense to test after it arrives. Or maybe it is smarter to test while it's en route, so it doesn't fly over someone else's land on the way to a valid destination. You decide what's best. That determines where you put the test.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
09-28-2009 19:40
llOverMyLand is not useful to you, since it only tells you when your critter is NOT going OFF WORLD. You want to know when your critter is about to go off world and turn around. This turns out to be very difficult. If you are flying your critter around with llSetForce() it might overshoot and swing off world even if you tell it to turn back in time. If you are using llMoveToTarget(), you would think that this is safe, since you can be sure that your starting and ending points are both in-sim. However, a critter moving parallel to the edge of the sim can be bumped sideways by other objects in the way and still go off-sim.
If your critter is flying all around the sim, the easiest way to limit it is to test for closeness to the edges and add a force to turn them away. I've never tried that with a critter flying under llSetForce, I'll bet you have to start looking very far from the edge.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-28-2009 20:26
Actually, the OP never said anything about turning around and coming back. That's certainly one of the possible actions. As you point out, that can be harder to script than what I suggested, but it might be just the right thing to do. Still, if all you want to do is be environmentally conscious and keep from polluting the SL landscape with runaway objects, I think the easiest solution is to use llOverMyLand and then kill off the object if it strays. You can always rez another... :)
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
09-28-2009 20:35
Isn't the problem that the object goes offworld, not just off the owner's parcel?
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-28-2009 20:50
Ah... good point. In that case, the best thing to do --- or at least the easiest --- is to write llSetStatus(STATUS_RETURN_AT_EDGE, TRUE), which will simply cause the object to be returned to Lost & Found in the OP's inventory if it goes off world. It's either that or llSetStatus(STATUS_DIE_AT_EDGE, TRUE), which is like what I suggested, only not at the parcel level.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
09-28-2009 21:06
The LSL wiki at http://lslwiki.net/lslwiki/wakka.php?wakka=llSetStatus says:
"If set, objects created with llRezObject will be returned to inventory instead of deleted when going off-world. Overrides STATUS_DIE_AT_EDGE."

This sounds like it doesn't work for objects dragged inworld from inventory.

Is that correct or is the wiki poorly worded?
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-29-2009 07:38
I suspect that it's poorly worded. I haven't done the obvious test, but I can't see how any object is going to retain a memory of how it was rezzed. My guess is that it should say, "If set, objects will be returned to inventory instead of deleted when going off-world. Overrides STATUS_DIE_AT_EDGE." In fact, that's exactly what the entry on the "official" LSL Portal at http://wiki.secondlife.com/wiki/STATUS_RETURN_AT_EDGE says, so it must be true. ;)
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Bear Jharls
Registered User
Join date: 8 Sep 2009
Posts: 59
09-29-2009 18:17
From: Anastasia Serenity
Hello, I have a script that makes physical objects move around the land randomly in sky but it also makes the object go OFF WORLD - randomly. Thats script is almost moody like my cat :) I like to have a little bit more control ^^
For randomish movement, one way is to create target vectors within a bounded area then move to them. llMoveToTarget, then llStopMoveToTarget within the at_target event does this quite well. Just check that the target is within the bounds before you move and you're good.