Jump to content

Get Parcel Dimension (N x N)


IZHRAH
 Share

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

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

Recommended Posts

If I'm going get the parcel size using PARCEL_DETAILS_AREA is there a way I can get the dimension of it (N x N).

Example: if I got 65536 Square Meter. How can I automate it in a script to figure out the (N x N)? The result I must get is 256 x 256 right?

Link to comment
Share on other sites

In this case and in all cases when the land/parcel is square the side equals the square root llSqrt
In general you have to make presumptions about the the parcel shape like you do when it is square
We do not have any LSL functions dealing with the length of parcel sides

:smileysurprised::):smileyvery-happy:

Link to comment
Share on other sites

loop using PARCEL_DETAILS_ID by 4 meters steps  ( a parcel dimension is always mutiple of 4 meters )

If the PARCEL_DETAILS_ID change , you will detect the borders of your land .

 

Some parcels are merged and can be neither squared , neither rectangular  . They can be U-shape , L-Shape , S-shape , O-shape etc ... They can have some holes too .

 

Link to comment
Share on other sites


Miranda Umino wrote:

loop using 
PARCEL_DETAILS_ID by 4 meters steps  ( a parcel dimension is always mutiple of 4 meters )

If the 
PARCEL_DETAILS_ID change , you will detect the borders of your land .

 

Some parcels are merged and can be neither squared , neither rectangular  . They can be U-shape , L-Shape , S-shape , O-shape etc ... They can have some holes too .

 

It's even more complicated than that- a parcel can be discontinuous, consisting of separated areas in different locations within a region. One way of forming such, by joining across a Linden RoW, is detailed here: http://community.secondlife.com/t5/General-Discussion/Make-two-parcels-to-one/td-p/1882731 . The other, by separation, can be done by isolating two or more areas of a parcel with intervening parcels.

[edited to show examples]

Link to comment
Share on other sites

The best way to check each 4 x 4 land square is to start at position <2, 2, 0> as that would place your prim in the center of the square that exists from 0 - 4 x and 0 - 4 y.  You would then iterate by 4 as you had mentioned ... so <6, 2, 0>, <10, 2, 0>, etc. 


Something along the lines of ...

list ldetailsvector vpos = <2, 2, 0>;vector vend = <254, 254, 0>;while (llGetPos() != vend) {    while (llGetPos() != vpos) {        llSetPos(vpos);    }    ldetails = llGetParcelDetails(vpos, [PARCEL_DETAILS_ID]));    //do something with the id to store it/etc.    if (vpos.x < 254) {        vpos = <vpos.x + 4, vpos.y, vpos.z>;    } else {        vpos = <2, vpos.y + 4, vpos.z>;    }}

 *CAUTION:  The code above was written spur of the moment right now as an example of how to work the process, it has not been tested in SL and there may very well be either a) issues or b) a better way to do it.

Link to comment
Share on other sites

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