Jump to content

Restricted Area around an object


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

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

Recommended Posts

1 hour ago, Lissia6 said:

Can i do something ?

Certainly.  Avoid the tree.

I'm not really being facetious.  How important can it be for you to walk within a meter of that tree? If you were in real life and you were talking about a growling dog on a chain that's 1 meter long, what would you do?  Stay away from the dog.

Link to comment
Share on other sites

1 hour ago, Rolig Loon said:

Certainly.  Avoid the tree.

But trees are made for walking and lounging under, Rolig! ;)

 

3 hours ago, Lissia6 said:

Hi, i got a "restricted area" around an object, which is a tree. I can't walk below the tree.

Assuming this is a mesh tree, there are three possible explanations for this.

---

The easiest one to check and fix is that the physics of the tree may have been accidentally been changed to convex hull at some point. Right click on the tree, select "Edit" and then click on the "Feautres" tab in the edit window. Check that Physics Shape Type is set to "Prim", not "Convex Hull":

bilde.png.f0c3ae5e233c84c4e269b73172b4cf3b.png

Convex Hull is only for meshes thay only need very simple physics and should never be used for trees.

---

If that doesn't work, the creator has made a mistake. Everybody does that every now and then. If it's a skilled mesh plant maker who knows how to make workable physics models, contact them and I'm sure they will fix it, send you a corrected tree and probably even thank you for bringing their attention to the issue.

---

If it wasn't made by a skilled mesh plant maker, there may still be a solution. It's hardly ideal and it only works if the tree is modifiable (it shold be).

In the edit window, select the "object tab" and set the tree to phantom:

bilde.png.2f95c910a7ca1dfe74cf213b9f9f044f.png

That switches physics off completely for the tree so you can walk under it as much as you like. Unfortuantely it also means you can walk straight through it so it's not really a good solution.

However, there is a hack that many unskilled mesh maker use when they can't figure out how to make physics model: a "physics prim". Set the tree to phantom as described above, then rez a prim and change its size and postiion to roughly match the tree trunk:

bilde.png.85747b4e4d0f34b3361cfa23689661c8.png

It doesn't have to match the shape of the trunk precisely and it doesn't have to very far up. SL physics isn't that precise anyway.

Then set the transparency of the prim to 100% so you don't see it:

bilde.png.158b5eb6806e0e961cea5d37bba62691.png

As I said, this is a hack and it's not something any serious mesh plant maker would do. But if it's a tree you didn't make yourself, it may be the only reasonably acceptable way.

Edited by ChinRey
  • Like 2
Link to comment
Share on other sites

2 minutes ago, ChinRey said:

Assuming this is a mesh tree, there are three possible explanations for this.

Aha!  You had a completely different interpretation of the question than I did, and it's probably the correct one. I deal a lot of the time with security systems that define a "restricted area" that you are not allowed to enter, so I assumed that the OP had run across someone who had set up a security system  for some oddball reason to keep people from walking close to this tree.  She didn't say it was her tree, after all. So yes, ChinRey, you read the question better.  I think we have all had to deal with objects with odd physics shapes.  Your solutions are right on target.

  • Like 1
Link to comment
Share on other sites

54 minutes ago, Rolig Loon said:

Aha!  You had a completely different interpretation of the question than I did, and it's probably the correct one. I deal a lot of the time with security systems that define a "restricted area" that you are not allowed to enter, so I assumed that the OP had run across someone who had set up a security system  for some oddball reason to keep people from walking close to this tree.

Yes, that's the literal meaning of the OP's question but I don't think you can make a security orb with that small a range (and if you coudl it dwould be just as small range vertically too) and you can't partition off a pracel less tha 4x4 m of course.

Link to comment
Share on other sites

6 minutes ago, ChinRey said:

I don't think you can make a security orb with that small a range (and if you coudl it dwould be just as small range vertically too) and you can't partition off a pracel less tha 4x4 m of course.

I hear a challenge .....  🤓

  • Haha 1
Link to comment
Share on other sites

6 minutes ago, Rolig Loon said:

I hear a challenge .....  🤓

Come to think of it, you can use a physics prim to create a "restricted area" of any size. Then a simple little script to turn it phantom (or shrink away) whenever somebody who is supposed to have access tries to enter.

  • Like 1
Link to comment
Share on other sites

47 minutes ago, ChinRey said:

Come to think of it, you can use a physics prim to create a "restricted area" of any size. Then a simple little script to turn it phantom (or shrink away) whenever somebody who is supposed to have access tries to enter.

Yes, that would be a very easy way to do it.  Here's a different way that is actually a security system in a box. You could even make the tree multipurpose by combining it with your suggestion.  Let the tree have a switchable phantom/solid trunk with a switchable detection system that tells you when someone is even getting close to it.

1. Put this script into your tree (or into a transparent prim that is centered on its trunk).  

2. Type your desired 3D detection range into the tree's (or prim's) Description field as a vector ( to detect anyone 2m away in X, 3m away in Y, or 5m away in Z, type <2.0,3.0,5.0> ) .

3. Reset the script. (You have to reset it whenever you move it, but how often will you move a tree?)

Click the tree (prim) to activate the system.

float fRangeX;
float fRangeY;
float fRangeZ;
integer iON;
integer iCount;
vector vMyPos;
list lAllAvs;

integer IsInBox(vector Pos)
{
    if ( (llVecDist( vMyPos,<Pos.x,vMyPos.y,vMyPos.z>) < fRangeX) &&  (llVecDist( vMyPos,<vMyPos.x,Pos.y,vMyPos.z>) < fRangeY) && (llVecDist( vMyPos,<vMyPos.x,vMyPos.y,Pos.z>) < fRangeZ) )
    {
        return TRUE;
    }
    else
    {
        return FALSE;
    }
} 

default
{
    state_entry()
    {
        vMyPos = llGetPos();
        vector Desc = (vector)llGetObjectDesc(); // Detection range is in the object's Description as a vector
        fRangeX = Desc.x;
        fRangeY = Desc.y;
        fRangeZ = Desc.z;
    }

    touch_start(integer total_number)
    {
        llSetTimerEvent(0.5* (iON = !iON));
        llOwnerSay("The system is " + llList2String(["disarmed.","armed."],iON));
        iCount = 0;
    }
    
    timer()
    {
        if (iCount%60 == 0)
        {
            lAllAvs = llGetAgentList(AGENT_LIST_PARCEL,[]);
        }
        integer i;
        integer len = llGetListLength(lAllAvs);
        while ( i < len )
        {
            vector AvPos = llList2Vector(llGetObjectDetails(llList2Key(lAllAvs,i),[OBJECT_POS]),0);
            if (IsInBox(AvPos))
            {
                llOwnerSay("Got one!");
            }
            ++i;
        }
        ++iCount;
    }
}

This is a quick and dirty script, not cleaned up to be pretty and super efficient. It also doesn't have all the bells and whistles to make it a real security system (it doesn't tell you who it detected and it doesn't do anything to the person), but it demonstrates how to make a detector to protect a small, non-spherical volume like a tree or a cookie jar.  I have saved load on the region server by checking to see who's in the parcel every 30 seconds with llGetAgentList instead of using a repeating sensor, and then just polling that list with a timer. 

Anyway, this is really a diversion since it's not what the OP was asking, but since @ChinRey laid down a challenge and I am under house arrest like everyone else and felt like playing..... 😉

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Rolig Loon said:

Yes, that would be a very easy way to do it.  Here's a different way that is actually a security system in a box.

All this too keep people away from a tree... that's one of the most beautiful pieces of ove-engineering I've ever seen! ^_^

 

Link to comment
Share on other sites

Just now, ChinRey said:

All this too keep people away from a tree... that's one of the most beautiful pieces of ove-engineering I've ever seen! ^_^

Thank you. ;)    I think Rube Goldberg would be proud.

Stepping back from silliness for a second, though, it is useful to be able to define a non-spherical detection volume, whether it's for something dumb like a tree or something more logical like a treehouse.  I am surprised by how often I come up with something useful when I am just playing.

Link to comment
Share on other sites

It's worth noting that all objects have bounding boxes surrounding them.  The bounding boxes can be very close to the same size as the object or sometimes they can be much larger depending on a few factors during creation.  If the bounding boxes are close to the same size as the visible object, then you can usually walk near them, sit under them, and so forth.  If the boxes are too large then you find you can not even approach those objects.  You might be standing or walking quite a distance from what is visible, as if it is surrounded by something solid and invisible, which in-fact, it is.  Bounding boxes are not visible unless you elect to turn on the outline highlights.  This is an advanced tool some creators use.  It is amazing how many 'creators' have no clue about them though, hence there can be a lot of variation from object to object.  This is why you will sometimes find that you can walk, run or ride very close to a particular object such as a tree, rock or land form; sit next to them or even go over them while driving in some cases. Other times you'll notice that you can't go near them at all due to over sized bounding boxes.  A well made object by a conscientious builder should display characteristics similar to that which you would expect from the object.  If it can be modified, setting the object to phantom makes them simply that, a phantom with only the visual appearance of that object as well as the attendant land impact.

Link to comment
Share on other sites

29 minutes ago, Lissia6 said:

I guess the "restricted area" is a mistake from the creator.

I find it hard to believe Nadine Reverie would make such a mistake but this is a very old tree so it's probably made from sculpts rather than mesh. One of the many flaws with sculpt trees is that they don't have any useable physics and that is very likely to be the cause of your problems.

If it is sculpts, the only solution is the one you went for, set the whole thing to phantom and then maybe add a physics prim to keep people from walking right through the trunk.

Edited by ChinRey
  • Like 1
Link to comment
Share on other sites

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