Difference between revisions of "LlModifyLand"

From Second Life Wiki
Jump to navigation Jump to search
m
(Added usage example)
 
(21 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|inject-2={{Issues/SVC-3272}}{{Issues/STORM-2006}}{{Issues|BUG-4929|[[llModifyLand]] modifies wrong location in region, when called in a child prim|type=bug}}
|func_id=159|func_sleep=0.0|func_energy=10.0
|func_id=159|func_sleep=0.0|func_energy=10.0
|func=llModifyLand
|func=llModifyLand
Line 5: Line 6:
|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 '''action''' on '''brush'''
|func_desc=Modify land with {{LSLP|action}} on {{LSLP|brush}}
|return_text
|return_text
|spec
|spec
|caveats=*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]]
|caveats=*This function has no effect if the script's owner is offline or not in the same sim as the scripted object.
|constants={{{!}}
*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}})
{{!}}-valign="top"
*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]]
{{{!}} {{Prettytable}}
*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.
*You cannot change altitude beyond land terraform limits for the specified parcel..
|constants=
<div>
<div style="width:auto; height:auto; display:inline; vertical-align:top;">
<div style="display:table-cell; vertical-align:top;" valign="top">
{{{!}} class="sortable" border="2" cellspacing="0" cellpadding="3" rules="all" style="margin:0 1em 1em 0; border:solid 1px #AAAAAA; border-collapse:collapse; background-color:#F9F9F9; font-size:90%; empty-cells:show; vertical-align:top;"
{{!}}-{{Hl2}}
{{!}}-{{Hl2}}
!colspan="2"{{!}}Brush
!Action
!Size
!title="Value"{{!}}
!class="unsortable"{{!}}Description
{{!}}-
{{!}}-
{{!}}{{LSLG|LAND_SMALL_BRUSH}}
{{!}}{{LSL Const|LAND_LEVEL|integer|0|c=Levels on prim center}}
{{!}}0
{{!}}{{#var:value}}
{{!}}2m x 2m
{{!}}{{#var:comment}}
{{!}}-
{{!}}{{LSL Const|LAND_RAISE|integer|1|c=Raises the land}}
{{!}}{{#var:value}}
{{!}}{{#var:comment}}
{{!}}-
{{!}}{{LSL Const|LAND_LOWER|integer|2|c=Lowers the land}}
{{!}}{{#var:value}}
{{!}}{{#var:comment}}
{{!}}-
{{!}}{{LSL Const|LAND_SMOOTH|integer|3|c=Smooths the land}}
{{!}}{{#var:value}}
{{!}}{{#var:comment}}
{{!}}-
{{!}}-
{{!}}{{LSLG|LAND_MEDIUM_BRUSH}}
{{!}}{{LSL Const|LAND_NOISE|integer|4|c=Makes the land rough}}
{{!}}1
{{!}}{{#var:value}}
{{!}}4m x 4m
{{!}}{{#var:comment}}
{{!}}-
{{!}}-
{{!}}{{LSLG|LAND_LARGE_BRUSH}}
{{!}}{{LSL Const|LAND_REVERT|integer|5|c=Restores to baked value}}
{{!}}2
{{!}}{{#var:value}}
{{!}}8m x 8m
{{!}}{{#var:comment}}
{{!}}}
{{!}}}
{{!}}
</div>
{{{!}} {{Prettytable}}
</div>
<div style="width:auto; height:auto; display:inline; vertical-align:top;">
<div style="display:table-cell; vertical-align:top;" valign="top">
{{{!}} class="sortable" border="2" cellspacing="0" cellpadding="3" rules="all" style="margin:0 1em 1em 0; border:solid 1px #AAAAAA; border-collapse:collapse; background-color:#F9F9F9; font-size:90%; empty-cells:show; vertical-align:top;"
{{!}}-{{Hl2}}
{{!}}-{{Hl2}}
!colspan="2"{{!}}Action
!Brush
!Description
!{{HoverText|Value|Use these instead of the constant names}}
! Size
{{!}}-
{{!}}-
{{!}}{{LSLG|LAND_LEVEL}}
{{!}}<s>{{LSL Const|LAND_SMALL_BRUSH|integer|1|c=Should do 2m x 2m but does 4m x 4m|nolink=*}}</s>
{{!}}0
{{!}}0
{{!}}Levels on prim center
{{!}}2m x 2m
{{!}}-
{{!}}-
{{!}}{{LSLG|LAND_RAISE}}
{{!}}<s>{{LSL Const|LAND_MEDIUM_BRUSH|integer|2|c=Should do 4m x 4m but does 8m x 8m|nolink=*}}</s>
{{!}}1
{{!}}1
{{!}}Raises the land
{{!}}4m x 4m
{{!}}-
{{!}}-
{{!}}{{LSLG|LAND_LOWER}}
{{!}}<s>{{LSL Const|LAND_LARGE_BRUSH|integer|3|c=8m x 8m|nolink=*}}</s>
{{!}}2
{{!}}2
{{!}}Lowers the land
{{!}}8m x 8m
{{!}}}
{{!}}-class="sortbottom"
{{!}}
{{!}}colspan="3"{{!}}<small>The constant values in the compiler are wrong.<br/>Use these values instead.</small>
{{{!}} {{Prettytable}}
{{!}}style="display:none;"{{!}}
{{!}}-{{Hl2}}
{{!}}style="display:none;"{{!}}
!colspan="2"{{!}}Action
!Description
{{!}}-
{{!}}{{LSLG|LAND_SMOOTH}}
{{!}}3
{{!}}Smooths the land
{{!}}-
{{!}}{{LSLG|LAND_NOISE}}
{{!}}4
{{!}}Makes the land rough
{{!}}-
{{!}}{{LSLG|LAND_REVERT}}
{{!}}5
{{!}}Restores to baked value
{{!}}}
{{!}}}
{{!}}}
|examples
</div>
</div>
</div>
|examples=
<source lang="lsl2">
default
{
    state_entry()
    {
        llSetTimerEvent(0.1);
    }
   
    timer()
    {
        llModifyLand(LAND_LEVEL, 0);
    }
}
</source>
|helpers
|helpers
|also_functions
|also_functions
Line 73: Line 100:
|also_articles
|also_articles
|notes
|notes
|signature=
{{LSL Const/Signature|LAND_SMALL_BRUSH|integer|1|c=Should do 2m x 2m but does 4m x 4m}}
{{LSL Const/Signature|LAND_MEDIUM_BRUSH|integer|2|c=Should do 4m x 4m but does 8m x 8m}}
{{LSL Const/Signature|LAND_LARGE_BRUSH|integer|3|c=8m x 8m}}
|cat1=Parcel
|cat1=Parcel
|cat2=Ground
|cat2=Ground

Latest revision as of 10:26, 16 December 2023

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_SMALL_BRUSH 0 2m x 2m
LAND_MEDIUM_BRUSH 1 4m x 4m
LAND_LARGE_BRUSH 2 8m x 8m
The constant values in the compiler are wrong.
Use these values 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.
  • 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. - Bev
  • 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, 0);
    }
}

Deep Notes

Signature

function void llModifyLand( integer action, integer brush );
integer LAND_SMALL_BRUSH = 1;//Should do 2m x 2m but does 4m x 4m
integer LAND_MEDIUM_BRUSH = 2;//Should do 4m x 4m but does 8m x 8m
integer LAND_LARGE_BRUSH = 3;//8m x 8m