Difference between revisions of "LlPassTouches"

From Second Life Wiki
Jump to: navigation, search
m
Line 1: Line 1:
 
{{LSL_Function
 
{{LSL_Function
|inject-2={{Issues/SVC-3306}}{{LSL Function/Pass|pass|{{LSLGC|Touch|touch}}|Touches|default=PASS_ALWAYS|tf=*}}
 
 
|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_type=integer|p1_subtype=pass|p1_name=pass
+
|func=llPassTouches|p1_type=integer|p1_name=pass|p1_desc=boolean, if [[TRUE]], touches are passed from children on to parents
|func_footnote
+
|func_footnote=The default is [[TRUE]] if there is no script to handle the touch events.
|func_desc=Sets the pass-touches [[prim]] attribute.
+
|func_desc=Sets pass-touches [[prim]] attribute.
 
|return_text
 
|return_text
 
|spec
 
|spec
|caveats
+
|caveats=This has no effect (whether set [[TRUE]] or [[FALSE]]) from the root. 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 by using this function, you must add a script with a touch event in the child and set to [[FALSE]].
 
|constants
 
|constants
|examples=Make a two-prim [[LINK_SET]] (Object). Name the root "Parent" and the child "Child". To the root, add this script: <source lang="lsl2">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.
 
        }
 
    }
 
}</source>
 
And to the child, add this script:
 
<source lang="lsl2">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.
 
            }
 
        }
 
    }
 
}</source>
 
 
|helpers
 
|helpers
 
|also_events=
 
|also_events=
Line 66: Line 19:
 
|notes
 
|notes
 
|permission
 
|permission
|history=
+
|negative_index
* Introduction: ?
+
* Change: {{Jira|SVC-5923}} - Server version 1.40.2 - New {{LSLPT|pass}} value added: 2
+
 
|sort=PassTouches
 
|sort=PassTouches
 
|cat1=Touch
 
|cat1=Touch
 
|cat2=Prim
 
|cat2=Prim
 
|cat3=Detected
 
|cat3=Detected
|cat4=Passable
+
|cat4
 
}}
 
}}

Revision as of 12:06, 3 November 2017

Summary

Function: llPassTouches( integer pass );

Sets pass-touches prim attribute.

• integer pass boolean, if TRUE, touches are passed from children on to parents

The default is TRUE if there is no script to handle the touch events.

Caveats

This has no effect (whether set TRUE or FALSE) from the root. 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 by using this function, you must add a script with a touch event in the child and set to FALSE.

All Issues ~ Search JIRA for related Bugs

Examples

See Also

Events

•  touch_start
•  touch
•  touch_end

Functions

•  llPassCollisions

Deep Notes

Search JIRA for related Issues

Signature

function void llPassTouches( integer pass );