Difference between revisions of "LlDetectedLinkNumber"

From Second Life Wiki
Jump to navigation Jump to search
m
 
(18 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|inject-2={{Issues/SVC-2996}}{{LSL_Function/detected|number|linkNumber|error={{HoverText|0|zero}}}}
|func_id=40|func_sleep=0.0|func_energy=10.0
|func_id=40|func_sleep=0.0|func_energy=10.0
|func=llDetectedLinkNumber|return_type=integer|p1_type=integer|p1_name=number
|func=llDetectedLinkNumber
|return_type=integer
|return_subtype=link
|return_subtype_disp=link_number
|Return_text=of the triggered event. If not supported by the event, returns zero.
|p1_type=integer|p1_name=number
|func_footnote=For {{LSLGC|Touch|touch}} and {{LSLGC|Collision|collision}} categories of events only.
|func_footnote=For {{LSLGC|Touch|touch}} and {{LSLGC|Collision|collision}} categories of events only.
|func_desc
|func_desc
|return_text=that is the link number of the triggered event. If not supported by the event, returns zero.
|spec
|spec
|caveats
|caveats
|constants
|constants
|examples
|examples=
<source lang="lsl2">
default
{
// Drop this script into the root prim of of a build
// Touch any prim to learn its link number
    touch_start(integer num_detected)
    {
        llOwnerSay("Link number clicked: " + (string)llDetectedLinkNumber(0) );     
    }
}
</source>
|helpers
|helpers
|also_functions
|also_functions=
|also_events=* {{LSLG|touch_start}}
{{LSL DefineRow||[[llDetectedTouchFace]]|}}
* {{LSLG|touch}}
|also_events=
* {{LSLG|touch_end}}
{{LSL DefineRow||[[touch_start]]|}}
* {{LSLG|collision_start}}
{{LSL DefineRow||[[touch]]|}}
* {{LSLG|collision}}
{{LSL DefineRow||[[touch_end]]|}}
* {{LSLG|collision_end}}
{{LSL DefineRow||[[collision_start]]|}}
|also_articles=* {{LSLGC|Detected}}
{{LSL DefineRow||[[collision]]|}}
{{LSL DefineRow||[[collision_end]]|}}
|also_articles
|issues
|notes
|notes
|permission
|negative_index=false
|cat1=Link
|cat1=Link
|cat2
|cat2=Touch
|cat3
|cat3
|cat4
|cat4
}}
}}
{{LSLC|Detected|linkNumber}}

Latest revision as of 00:54, 22 January 2015

Summary

Function: integer llDetectedLinkNumber( integer number );
0.0 Forced Delay
10.0 Energy

Returns the link_number (an integer) 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]

Examples

default
{
// Drop this script into the root prim of of a build
// Touch any prim to learn its link number
    touch_start(integer num_detected)
    {
        llOwnerSay("Link number clicked: " + (string)llDetectedLinkNumber(0) );       
    }
}

See Also

Events

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

Functions

•  llDetectedTouchFace

Articles

•  Detected

Deep Notes

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 );