LlModifyLand: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Ice12192 Dover (talk | contribs)
Added usage example
Tapple Gao (talk | contribs)
LAND_*_BRUSH -> LAND_BRUSH_*
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
|func=llModifyLand
|func=llModifyLand
|p1_type=integer|p1_name=action|p1_desc=LAND_* flag
|p1_type=integer|p1_name=action|p1_desc=LAND_* flag
|p2_type=integer|p2_name=brush|p2_desc=LAND_*_BRUSH flag
|p2_type=integer|p2_name=brush|p2_desc=LAND_BRUSH_* flag
|func_footnote=The position of the prim is used to determine the input for various flags.
|func_footnote=The position of the prim is used to determine the input for various flags.
|func_desc=Modify land with {{LSLP|action}} on {{LSLP|brush}}
|func_desc=Modify land with {{LSLP|action}} on {{LSLP|brush}}
Line 12: Line 12:
*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. ({{jira|BUG-9047}})
*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. ({{jira|BUG-9047}})
*This function has no effect if the scripted object is deeded to a group.
*This function has no effect if the scripted object is deeded to a group.
*Playing with this command, I have found that the LAND_SMALL_BRUSH edits a 4m x 4m area. The LAND_MEDIUM_BRUSH and the LAND_LARGE_BRUSH, both edit an 8m x 8m area. However using 0 instead of LAND_SMALL_BRUSH will edit a 2m x 2m area. I have bug reported this, but until it gets fixed, it should be noted. correct values for the brushes are 0, 1 and 2, not 1, 2, and 3. - [[User:Beverly Larkin|Bev]]
* "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. ({{jira|BUG-4929}})
*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. ({{jira|BUG-4929}})
*If land is not owned by script owner or the owner doesn't have terraform permissions, the script will silently fail.
*If land is not owned by script owner or the owner doesn't have terraform permissions, the script will silently fail.
Line 60: Line 60:
! Size
! Size
{{!}}-
{{!}}-
{{!}}<s>{{LSL Const|LAND_SMALL_BRUSH|integer|1|c=Should do 2m x 2m but does 4m x 4m|nolink=*}}</s>
{{!}}{{LSL Const|LAND_BRUSH_SMALL|integer|0|c=2m x 2m|nolink=*}}
{{!}}0
{{!}}0
{{!}}2m x 2m
{{!}}2m x 2m
{{!}}-
{{!}}-
{{!}}<s>{{LSL Const|LAND_MEDIUM_BRUSH|integer|2|c=Should do 4m x 4m but does 8m x 8m|nolink=*}}</s>
{{!}}{{LSL Const|LAND_BRUSH_MEDIUM|integer|1|c=4m x 4m|nolink=*}}
{{!}}1
{{!}}4m x 4m
{{!}}-
{{!}}{{LSL Const|LAND_BRUSH_LARGE|integer|2|c=8m x 8m|nolink=*}}
{{!}}2
{{!}}8m x 8m
{{!}}-
{{!}}<s>{{LSL Const|LAND_SMALL_BRUSH|integer|1|c=Should do 2m x 2m but does 4m x 4m|nolink=*}}</s>
{{!}}1
{{!}}1
{{!}}4m x 4m
{{!}}4m x 4m
{{!}}-
{{!}}<s>{{LSL Const|LAND_MEDIUM_BRUSH|integer|2|c=Should do 4m x 4m but does 8m x 8m|nolink=*}}</s>
{{!}}2
{{!}}8m x 8m
{{!}}-
{{!}}-
{{!}}<s>{{LSL Const|LAND_LARGE_BRUSH|integer|3|c=8m x 8m|nolink=*}}</s>
{{!}}<s>{{LSL Const|LAND_LARGE_BRUSH|integer|3|c=8m x 8m|nolink=*}}</s>
{{!}}2
{{!}}3
{{!}}8m x 8m
{{!}}8m x 8m
{{!}}-class="sortbottom"
{{!}}-class="sortbottom"
{{!}}colspan="3"{{!}}<small>The constant values in the compiler are wrong.<br/>Use these values instead.</small>
{{!}}colspan="3"{{!}}<small>The "LAND_*_BRUSH constants are wrong.<br/>Use the "LAND_BRUSH_*" constants instead.</small>
{{!}}style="display:none;"{{!}}
{{!}}style="display:none;"{{!}}
{{!}}style="display:none;"{{!}}
{{!}}style="display:none;"{{!}}
Line 90: Line 102:
     timer()
     timer()
     {
     {
         llModifyLand(LAND_LEVEL, 0);
         llModifyLand(LAND_LEVEL, LAND_BRUSH_SMALL);
     }
     }
}
}
Line 101: Line 113:
|notes
|notes
|signature=
|signature=
{{LSL Const/Signature|LAND_SMALL_BRUSH|integer|1|c=Should do 2m x 2m but does 4m x 4m}}
{{LSL Const/Signature|LAND_BRUSH_SMALL|integer|0|c=2m x 2m}}
{{LSL Const/Signature|LAND_MEDIUM_BRUSH|integer|2|c=Should do 4m x 4m but does 8m x 8m}}
{{LSL Const/Signature|LAND_BRUSH_MEDIUM|integer|1|c=4m x 4m}}
{{LSL Const/Signature|LAND_LARGE_BRUSH|integer|3|c=8m x 8m}}
{{LSL Const/Signature|LAND_BRUSH_LARGE|integer|2|c=8m x 8m}}
|cat1=Parcel
|cat1=Parcel
|cat2=Ground
|cat2=Ground

Latest revision as of 12:23, 5 June 2026

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