Difference between revisions of "LlDetectedDamage"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "{{LSL_Function |inject-2={{LSL_Function/detected|number|damage}} |func_id=33|func_sleep=0.0|func_energy=10.0 |sort=DetectedDamage |func=llDetectedDamage|return_type=list|p1_ty...")
(No difference)

Revision as of 11:04, 21 March 2024

Summary

Function: list llDetectedDamage( integer number );

Returns the list containing pending damage information.

• integer number Index of detection information

number does not support negative indexes. Returns an empty list if number does not relate to a valid damage source or if called from a handler other than on_damage

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. llDetectedDamge returns a list describing a single damage event. This function is only available from within an on_damage handler. If called from another detection event or from a non detection handler, it will return an empty list.

The list has the following format: [ float damage, integer damage_type, float original_damage ]

damage
The current amount of damage that will be applied after all on_damage events have completed processing.
damage_type
An integer describing the type of damage that will be applied to the avatar.
original_damage
The original amount of damage that was specified when the event was triggered.

Template:LSL Constants/Damage Type

Caveats

  • If number is out of bounds 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

See Also

Events

•  on_damage

Functions

•  llAdjustDamage

Articles

•  Detected

Deep Notes

Search JIRA for related Issues

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 list llDetectedDamage( integer number );