Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Land Editor

Landing Normandy
Proposing 4968
Join date: 28 Nov 2005
Posts: 240
11-13-2006 05:54
This has been done before but I had to have a go myself. The whole thing took 5mins, with the exception of getting it to sit on the floor properly. Thanks to Strife Onizuka for setting me straight in world on that one.

This is a GUI powered landscaping tool. You click it to set parameters, and then once running you stick it in EDIT so you can drag it around. When done, click STOP to, erm, stop it!

There is a HELP notecard included so I'll provide the text for that should anyone care. The HELP button won't do anything without it in the prim. The prim should set itself up for you.

Can I please point out that while I'm happy for this script to be used and distributed in your own work, can you please ensure that you credit both myself and Strife, and if you're copying the script completely, can you ensure that the object is free, and full mod/copy/trans, as the original that I pass on in world is. Thank you

CODE
integer CHANNEL;
integer ACTION;
integer SIZE;

string MAIN_MENU_STRING;
string SIZE_MENU_STRING;

list MAIN_MENU = [ "Level", "Raise", "Lower", "Smooth", "Noise", "Revert", "Size", "Stop", "Help", "Ground"];
list SIZE_MENU = [ "Small (2x2)", "Medium (4x4)", "Large (8x8)", "Back" ];

default
{
state_entry()
{

llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, <1, 0, 0>, 0.5, PRIM_SIZE, <3, 3, 0.5>]);
//ACTION = LAND_LEVEL;
//SIZE = LAND_SMALL_BRUSH;
MAIN_MENU_STRING = "Pick a tool or size of tool";
SIZE_MENU_STRING = "Pick size of tool or back to return";
CHANNEL = llFloor(llFrand(100000.0)) + 1000;
llListen(CHANNEL, "", NULL_KEY, "");
}

touch_start(integer num_detected)
{
if (llDetectedOwner(0) == llGetOwner())
{
llDialog(llDetectedKey(0), MAIN_MENU_STRING, MAIN_MENU, CHANNEL);
}
}

listen(integer CHANNEL, string name, key id, string message)
{
if (llListFindList(MAIN_MENU + SIZE_MENU, [message]) != -1) // verify dialog choice
{
if (message == "Size")
{
llDialog(id, SIZE_MENU_STRING, SIZE_MENU, CHANNEL);
}

if (message == "Help")
{
llGiveInventory(id, "Land Leveller");
}

if (message == "Level")
{
ACTION = LAND_LEVEL;
llSetTimerEvent(0.1);
}

if (message == "Raise")
{
ACTION = LAND_RAISE;
llSetTimerEvent(0.1);
}

if (message == "Lower")
{
ACTION = LAND_LOWER;
llSetTimerEvent(0.1);
}

if (message == "Smooth")
{
ACTION = LAND_SMOOTH;
llSetTimerEvent(0.1);
}

if (message == "Noise")
{
ACTION = LAND_NOISE;
llSetTimerEvent(0.1);
}

if (message == "Revert")
{
ACTION = LAND_REVERT;
llSetTimerEvent(0.1);
}

if (message == "Small (2x2)")
{
SIZE = LAND_SMALL_BRUSH;
llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, <1, 0, 0>, 0.5, PRIM_SIZE, <3, 3, 0.5>]);
}

if (message == "Medium (4x4)")
{
SIZE = LAND_MEDIUM_BRUSH;
llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, <0, 1, 0>, 0.5, PRIM_SIZE, <5, 5, 0.5>]);
}

if (message == "Large (8x8)")
{
SIZE = LAND_LARGE_BRUSH;
llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, <0, 0, 1>, 0.5, PRIM_SIZE, <9, 9, 0.5>]);
}

if (message == "Stop")
{
llSetTimerEvent(0);
}

if (message == "Ground")
{
// THIS PORTION BY STRIFE ONIZUKA //
float height = llGround(ZERO_VECTOR);
vector pos = llGetPos();
integer count = llCeil(llFabs(height - pos.z) / 10.0);
pos.z = height;
for(;count;--count)
llSetPos(pos);
// THANK YOU STRIFE! //
llSay(0, "Now at ground level");
ACTION = LAND_LEVEL;
llSetTimerEvent(0.1);
}
}
}

timer()
{
llModifyLand((integer)ACTION, (integer)SIZE);
llSetTimerEvent(0.1);
}
}


And the notecard (to be called Land Leveller unless you've changed the script)

From: someone
This is the HELP notecard for Landing Normandy's LAND LEVELLER utility

The Land Leveller is a single object that you can move around your land and will terraform it for you. As default it operates on a small 2x2m tool and is only operable by the owner.

To use it you will need to edit it to drag it around, but first select the tools you want. Click it and note the menu.

The tools work as follows:

LEVEL: Levels the terrain with each call, raising it up to the current height of the object's center (even if already level).
RAISE: Raises the terrain with each call, up to the current height of the object's center.
LOWER: Lowers the terrain with each call, down to zero height.
SMOOTH: Smooths the terrain.
NOISE: Randomizes (adds noise to) the terrain.
REVERT: Revert terrain to state to how it was when first created

You also have a SIZE option, STOP and GROUND:

SIZE: Allows you to pick the size of the tool you want to use. Options are 2x2m, 4x4m and 8x8m. This is the same as the standard SL Land Editting Tool Sizes. Note, SL does not allow 1m tools at this point.
STOP: Stops the current tool
GROUND: Drops the tool to ground level, ideal when you want to level the rest of the plot to the same as wht is under the tool right now.

Thanks to Strife Onizuka for the GROUND portion of the tool, I couldn't get it to quite work properly.

This is a free tool, therefore I don't do warranty. If it doesn't work for you I'm sorry, I don't know why, it works for everyone else who has tried it to this point.

If you paid for this you should ask for your money back!


I would LOVE to see what other people have come up with regards this kinda thing
_____________________
<VOTE PROPOSITION 4968/>
http://jira.secondlife.com/browse/VWR-4968
For SecondLife Builders who need better mapping for better building
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
11-14-2006 12:24
/54/36/148950/1.html
_____________________
i've got nothing. ;)