DAMAGEABLE
Jump to navigation
Jump to search
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Description
Constant: integer DAMAGEABLE = 0x20;The integer constant DAMAGEABLE has the value 0x20
If it is contained in the result of llDetectedType, it means what was detected is either an agent that can take damage, or is an object containing a script with either on_damage or final_damage events (able to process damage).
If it is used as a filter of llSensor or llSensorRepeat, it will search for agents or objects which match the same criteria mentioned above.
Caveats
- The sensor will detect nothing if DAMAGEABLE is used by itself.
Related Articles
Constants
|
Functions
• | llDetectedType | |||
• | llSensor | |||
• | llSensorRepeat |
Examples
Using llDetectedType in collision event: <source lang="lsl2"> integer type;
default {
state_entry() { llVolumeDetect(TRUE); } collision_start(integer detected) { type = llDetectedType(0); if (type == AGENT)// = 1 { llSay(0, "This is impossible. Since there is no avatar who doesn't require the physical calculation."); } else if (type == ACTIVE)// = 2 { llSay(0, "I have been struck by a physical object not containing any script."); } else if (type == PASSIVE)// = 4 { llSay(0, "This is impossible. Non-physical objects cannot trigger this event."); } else if (type == SCRIPTED)// = 8 { llSay(0, "This is impossible. Since there is no object which isn't physical nor non-physical."); } else if (type == (AGENT