Difference between revisions of "LlPassTouches"

From Second Life Wiki
Jump to navigation Jump to search
(minor wording change to my previous edit)
(reworking of documentation)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|inject-2={{LSL_Function/boolean|pass|if=*|td=touches are passed from children on to the root|fd=touches are not passed on to the root}}
|func_id=154|func_sleep=0.0|func_energy=10.0
|func_id=154|func_sleep=0.0|func_energy=10.0
|func=llPassTouches|p1_subtype=boolean|p1_type=integer|p1_name=pass
|func=llPassTouches|p1_type=integer|p1_name=pass|p1_desc=integer in the interval {{Interval|gte=0|lte=2|center=pass}}|p1_hover=integer in the interval {{Interval/Text|gte=0|lte=2|center=pass}}
|func_footnote=The default is [[TRUE]] if there is no script to handle the touch events in the prim.
|func_footnote=
* '''As of server version 1.40.2, this function now has 3 inputs for operation: 1,2, anything else behaves like 0.''' See {{Jira|SVC-5923}}
{{{!}}{{prettytable}}
* An input of 2 will not pass touches to root even with no touch script in the child prim.
{{!}}-{{hl2}}
! Value
! Child Scripted
! Child Unscripted
! Description
{{!}}-
{{!}} 0
{{!}} {{no|not passed}}
{{!}} {{yes|passed}}
{{!}} Touches are not passed on to the root while there is a script in the prim.
{{!}}-
{{!}} 1
{{!}} {{yes|passed}}
{{!}} {{yes|passed}}
{{!}} '''Default:''' Touches are passed from children on to the root.
{{!}}-
{{!}} 2
{{!}} {{no|not passed}}
{{!}} {{no|not passed}}
{{!}} Touches are never passed on to the root.
{{!}}}
|func_desc=Sets pass-touches [[prim]] attribute.
|func_desc=Sets pass-touches [[prim]] attribute.
|return_text
|return_text
Line 70: Line 89:
|notes
|notes
|permission
|permission
|negative_index
|history=
* Introduction: ?
* Change: {{Jira|SVC-5923}} - Server version 1.40.2 - New {{LSLPT|pass}} value added: 2
|sort=PassTouches
|sort=PassTouches
|cat1=Touch
|cat1=Touch

Revision as of 16:14, 1 January 2016

Summary

Function: llPassTouches( integer pass );
0.0 Forced Delay
10.0 Energy

Sets pass-touches prim attribute.

• integer pass integer in the interval [0, 2]

Value Child Scripted Child Unscripted Description
0 not passed passed Touches are not passed on to the root while there is a script in the prim.
1 passed passed Default: Touches are passed from children on to the root.
2 not passed not passed Touches are never passed on to the root.

Caveats

  • This has no effect when called on the root prim.
  • Touches are always passed to the parent when there is no touch event script in the child, even if this is set (TRUE or FALSE) within another event in a child's script.
    • If you want to block touches from a child , you must add a script with a touch event in the child. This creates a default no passes.

Examples

Make a two prim LINK_SET (Object). Name the root "Parent" and the child "Child". To the root add this script -
integer told;

default
{
    state_entry()
    {
        told = FALSE;
    }
    touch_start(integer total_number)
    {
        if(!(llDetectedLinkNumber(0) == llGetLinkNumber()))// We can use a condition like this to filter from which prims touches are triggered.
        {
            llSay(0, "My child tells me you touched it. Abuse report pending.");// This will only be spoken if the child is touched twice.
            told = TRUE;
        }
        else
        {
            if(!told)
                llSay(0, "You can touch me all you like");// The unaware Parent leads you on.
            else
                llSay(0, "If I had my way you would have your hands cut off!");// Not any more.
        }
    }
}

And to the child add this script -

integer once_is_too_often;
default
{
    state_entry()
    {
        llPassTouches(FALSE);// Innocent child doesn't know to say something the first time.
        once_is_too_often = FALSE;
    }
    touch_start(integer total_number)
    {
        if(llDetectedLinkNumber(0) == llGetLinkNumber())// Again we check who is being touched.
        {
            if(!once_is_too_often)
            {
                llSay(0, "If you touch me again I'm telling.");
                llPassTouches(TRUE); // But if a second time, it will tell.
                once_is_too_often = TRUE;// And then fall silent.
            }
        }
    }
}

See Also

Events

•  touch_start
•  touch
•  touch_end

Functions

•  llPassCollisions

Deep Notes

History

  • Introduction: ?
  • Change: SVC-5923 - Server version 1.40.2 - New pass value added: 2

Footnotes

  1. ^ The ranges in this article are written in Interval Notation.

Signature

function void llPassTouches( integer pass );