llModifyLand

From Second Life Wiki
Revision as of 12:23, 5 June 2026 by Tapple Gao (talk | contribs) (LAND_*_BRUSH -> LAND_BRUSH_*)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Summary

Function: llModifyLand( integer action, integer brush );
0.0 Forced Delay
10.0 Energy

Modify land with action on brush

• integer action LAND_* flag
• integer brush LAND_BRUSH_* flag

The position of the prim is used to determine the input for various flags.

Action Description
LAND_LEVEL 0 Levels on prim center
LAND_RAISE 1 Raises the land
LAND_LOWER 2 Lowers the land
LAND_SMOOTH 3 Smooths the land
LAND_NOISE 4 Makes the land rough
LAND_REVERT 5 Restores to baked value
Brush Value Size
LAND_BRUSH_SMALL 0 2m x 2m
LAND_BRUSH_MEDIUM 1 4m x 4m
LAND_BRUSH_LARGE 2 8m x 8m
LAND_SMALL_BRUSH 1 4m x 4m
LAND_MEDIUM_BRUSH 2 8m x 8m
LAND_LARGE_BRUSH 3 8m x 8m
The "LAND_*_BRUSH constants are wrong.
Use the "LAND_BRUSH_*" constants instead.

Caveats

  • This function has no effect if the script's owner is offline or not in the same sim as the scripted object.
  • Uncontrolled use of llModifyLand in scripted objects may force the region's navmesh to rebake continually and cause Memory Allocated for the region to exceed its limit, making it impossible to rez objects. (BUG-9047)
  • This function has no effect if the scripted object is deeded to a group.
  • "LAND_BRUSH_*" constants are only present on Lua-enabled sims. On older sims, use their values 0, 1, and 2 instead. The "LAND_*_BRUSH" constants have incorrect values and are not recommended
  • If the script is in a prim that is attached to an avatar or is in the child prim of a linkset, then the local position relative to it's attachment point or root prim is used rather than the position within the region. (BUG-4929)
  • If land is not owned by script owner or the owner doesn't have terraform permissions, the script will silently fail.
  • You cannot change altitude beyond land terraform limits for the specified parcel..

Examples

default
{
    state_entry()
    {
        llSetTimerEvent(0.1);
    }
    
    timer()
    {
        llModifyLand(LAND_LEVEL, LAND_BRUSH_SMALL);
    }
}

Deep Notes

Signature

function void llModifyLand( integer action, integer brush );
integer LAND_BRUSH_SMALL = 0;//2m x 2m
integer LAND_BRUSH_MEDIUM = 1;//4m x 4m
integer LAND_BRUSH_LARGE = 2;//8m x 8m