Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Ground Name and Description

Ulrika Zugzwang
Magnanimous in Victory
Join date: 10 Jun 2004
Posts: 6,382
05-25-2005 00:39
I'm working on dividing up a sim into many smaller lots and would like to make a map of the divisions using a script. Is there a command in LSL that will return the name and description of the ground under a given point? All lots have the same owner (so that can't be used to determine lot boundaries) but they do have unique names.

I looked in the LSL wiki but didn't turn anything up.

~Ulrika~
_____________________
Chik-chik-chika-ahh
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
05-25-2005 00:55
Alas, no. :(
_____________________
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
05-25-2005 01:20
Your best bet is defining it with one prim and a name you can hit with a sensor.
_____________________
---
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
05-25-2005 07:36
In an off-world Java implementation, what I did was a two-pass merge on the data. I'll publish it so you can see what I did.

OK, so spank me for publishing undocumented code, but since it's a private method the only reason to document it would be for this post!

All you really need to know is that:
1) A sim is divided into 4m x 4m parcels, and there are 64 x 64 parcels in a sim.
2) In the code below, data[0] holds the pre-queried owner keys and data[3] is then assigned a parcel or "lot" index during the execution of this method.

That said, the (working) Java version of the algorithm that I came up with was:

CODE
private static final int SIM_LAND = 4096;
private data[][] = new String[4][SIM_LAND];

private void processParcels() {
int parcelIndex = 0;
// assign parcels to lots
for (int i = 0; i < SIM_LAND; i++) {
if (data[3] == null) {
if (i > 0 && (i % 64) > 0 && data[i - 1][0].equals(data[0])) {
data[3] = data[i - 1][3];
} else if (i - 64 >= 0 && data[i - 64][0].equals(data[0])) {
data[3] = data[i - 64][3];
} else {
String parcel = String.valueOf(++parcelIndex);
parcelList.add(parcel);
data[3] = parcel;
}
}
}
// re-assign any adjacent lots
for (int i = 0; i < SIM_LAND; i++) {
if (i + 64 < SIM_LAND && data[i + 64][0].equals(data[0]) && !data[i + 64][3].equals(data[3])) {
//REASSIGN
String child = data[i + 64][3];
String parent = data[3];
parcelList.remove(child);
for (int j = 0; j < SIM_LAND; j++) {
if (data[j][3].equals(child)) {
data[j][3] = parent;
}
}
}
}
}


I'm not sure you'd have enough memory space in LSL to do this directly, so you may have to do a tricky mod to get around this.

/esc
_____________________
http://slurl.com/secondlife/Together