Difference between revisions of "LlDetectedLinkNumber"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
{{Issues/SVC-2996}}{{LSL_Function/detected|number|linkNumber}}{{LSL_Function
{{Issues/SVC-2996}}{{LSL_Function/detected|number|linkNumber|error={{HoverText|0|zero}}}}{{LSL_Function
|func_id=40|func_sleep=0.0|func_energy=10.0
|func_id=40|func_sleep=0.0|func_energy=10.0
|func=llDetectedLinkNumber
|func=llDetectedLinkNumber

Revision as of 12:35, 9 April 2010

Summary

Function: integer llDetectedLinkNumber( integer number );

Returns an integer that is the link number of the triggered event. If not supported by the event, returns zero.

• integer number Index of detection information

number does not support negative indexes. For touch and collision categories of events only.

Specification

llDetected* functions only work if called from within Detection events (collision, collision_start, collision_end, sensor, touch, touch_start, touch_end) or in functions called by Detection events. They will fail silently and return unusable values if called during other events.

Caveats

  • llDetectedLinkNumber will return 0 in collision_start and collision_end events of VolumeDetect objects (SVC-2996).
  • If number is out of bounds this function returns 0 and the script continues to execute without an error message.
  • Events that enable the llDetected* functions always return at least one detected item.
    • Detection events are not raised if there is nothing detected.[1]
    • The detection event's items detected parameter is initially never less than 1.[2]
All Issues ~ Search JIRA for related Bugs

Examples

<lsl> default {

   touch_start(integer num_detected)
   {
       integer i;
       for(i=0; i<num_detected; ++i) {
           llOwnerSay("Link number clicked: " + (string)llDetectedLinkNumber(i));
       }
   }

}

</lsl>

See Also

Events

•  touch_start
•  touch
•  touch_end
•  collision_start
•  collision
•  collision_end

Functions

•  llDetectedTouchFace

Articles

•  Detected

Deep Notes

All Issues

~ Search JIRA for related Issues
   llDetectedLinkNumber returns 0 with llVolumeDetect(TRUE)

Footnotes

  1. ^ The exception is no_sensor but it doesn't enable llDetected* functions.
  2. ^ Like all event parameters, the user can overwrite the initial value.

Signature

function integer llDetectedLinkNumber( integer number );