Difference between revisions of "Template:LSL Constants Sensor"
Jump to navigation
Jump to search
m |
m |
||
Line 73: | Line 73: | ||
{ | { | ||
type = llDetectedType(0); | type = llDetectedType(0); | ||
if (type == | if (type == AGENT)// = 1 | ||
{ | { | ||
llSay(0, "This is impossible. Since there is no avatar who doesn't require the physical calculation."); | llSay(0, "This is impossible. Since there is no avatar who doesn't require the physical calculation."); | ||
Line 89: | Line 89: | ||
llSay(0, "This is impossible. Since there is no object which isn't physical nor non-physical."); | llSay(0, "This is impossible. Since there is no object which isn't physical nor non-physical."); | ||
} | } | ||
else if (type == ( | else if (type == (AGENT | ACTIVE) ) // 1 + 2 | ||
{ | { | ||
llSay(0, "I have been struck by an avatar."); | llSay(0, "I have been struck by an avatar."); | ||
Line 110: | Line 110: | ||
touch_start(integer numberDetected) | touch_start(integer numberDetected) | ||
{ | { | ||
llSensor("", "", ACTIVE | PASSIVE | | llSensor("", "", ACTIVE | PASSIVE | AGENT, 20.0, PI); // activates the sensor. | ||
} | } | ||
Line 122: | Line 122: | ||
message += (string)i + ", " + llDetectedName(i) + ", "; | message += (string)i + ", " + llDetectedName(i) + ", "; | ||
list typeList; | list typeList; | ||
if (type & | if (type & AGENT) | ||
{ | { | ||
typeList += " | typeList += "AGENT"; | ||
} | } | ||
if (type & ACTIVE) | if (type & ACTIVE) |
Revision as of 00:05, 5 November 2013
|
Using llDetectedType in collision event:
<lsl> 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