Difference between revisions of "LlEdgeOfWorld"

From Second Life Wiki
Jump to navigation Jump to search
m (Replaced <source> with <syntaxhighlight>)
 
(18 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|inject-2={{LSL_Function/position|pos|region=*}}
|func=llEdgeOfWorld
|func=llEdgeOfWorld
|sort=EdgeOfWorld
|sort=EdgeOfWorld
|func_id=205|func_sleep=0.0|func_energy=10.0
|func_id=205|func_sleep=0.0|func_energy=10.0
|return_type=integer
|return_type=integer|return_subtype=boolean
|p1_type=vector|p1_name=pos|p2_type=vector|p2_name=dir
|p1_type=vector|p1_name=pos|p1_desc
|func_footnote
|p2_type=vector|p2_subtype=direction|p2_name=dir|p2_desc=direction
|func_desc=Checks to see whether the border hit by '''dir''' from '''pos''' is the edge of the world (has no neighboring simulator)
|func_footnote=The '''z''' component of {{LSLP|dir}} is ignored.
|return_text=that is a {{HoverText|boolean|TRUE or FALSE}}.
|func_desc=Checks to see whether the border hit by {{LSLP|dir}} from {{LSLP|pos}} is the edge of the world (has no neighboring simulator).
|return_text=value. [[FALSE]] indicating there is a simulator in the direction indicated.
|spec
|spec
|caveats
|caveats=*If the '''x''' and '''y''' components of {{LSLP|dir}} are zero (like with [[ZERO_VECTOR]]), [[TRUE]] is always returned.
* {{LSLP|pos}} must be in the region.
* Can only be used to detect directly adjacent regions, not diagonally adjacent regions
* This function will also return [[TRUE]] if [[llRequestSimulatorData]]() returns "up" for an adjacent region but that region doesn't visibly show when standing next to its border.
|constants
|constants
|examples=
|examples=
<lsl>
<syntaxhighlight lang="lsl2">
//--// Tells if there are neighboring sims on touch //--//
//--// Tells if there are neighboring sims on touch //--//


Line 32: Line 37:
   }
   }
}
}
</lsl>
</syntaxhighlight>
|helpers
|helpers
|also_functions
|also_constants=
{{LSL DefineRow||[[STATUS_DIE_AT_EDGE]]}}
{{LSL DefineRow||[[STATUS_RETURN_AT_EDGE]]}}
|also_functions=
{{LSL DefineRow||[[llScriptDanger]]}}
|also_events
|also_events
|also_tests
|also_tests
Line 41: Line 50:
|permission
|permission
|negative_index
|negative_index
|haiku={{Haiku|The world once though flat|indeed has come full circle|here there be dragons.}}
|cat1=Region
|cat1=Region
|cat2
|cat2=World Edge
|cat3
|cat3
|cat4
|cat4
}}
}}

Latest revision as of 05:17, 23 April 2022

Summary

Function: integer llEdgeOfWorld( vector pos, vector dir );
0.0 Forced Delay
10.0 Energy

Checks to see whether the border hit by dir from pos is the edge of the world (has no neighboring simulator).
Returns a boolean (an integer) value. FALSE indicating there is a simulator in the direction indicated.

• vector pos position in region coordinates
• vector dir direction

The z component of dir is ignored.

Caveats

  • If the x and y components of dir are zero (like with ZERO_VECTOR), TRUE is always returned.
  • pos must be in the region.
  • Can only be used to detect directly adjacent regions, not diagonally adjacent regions
  • This function will also return TRUE if llRequestSimulatorData() returns "up" for an adjacent region but that region doesn't visibly show when standing next to its border.

Examples

//--// Tells if there are neighboring sims on touch //--//

default{
  touch_start( integer vIntTouched ){
    vector vPosObject = llGetPos();
    if (!llEdgeOfWorld( vPosObject, <0.0, 1.0, 0.0> )){
      llOwnerSay( "There is a Sim to the North" );
    }
    if (!llEdgeOfWorld( vPosObject, <1.0, 0.0, 0.0> )){
      llOwnerSay( "There is a Sim to the East" );
    }
    if (!llEdgeOfWorld( vPosObject, <0.0, -1.0, 0.0> )){
      llOwnerSay( "There is a Sim to the South" );
    }
    if (!llEdgeOfWorld( vPosObject, <-1.0, 0.0, 0.0> )){
      llOwnerSay( "There is a Sim to the West" );
    }
  }
}

See Also

Constants

•  STATUS_DIE_AT_EDGE
•  STATUS_RETURN_AT_EDGE

Functions

•  llScriptDanger

Deep Notes

Signature

function integer llEdgeOfWorld( vector pos, vector dir );

Haiku

The world once though flat
indeed has come full circle
here there be dragons.