Difference between revisions of "Template:LSL Function/Pass"

From Second Life Wiki
Jump to navigation Jump to search
m
m
 
(One intermediate revision by the same user not shown)
Line 15: Line 15:
-->
-->


{{#if:{{{nlf|}}}{{{noconst|}}}{{#var:pass_constants}}||
{{#if:{{{noconst|}}}{{#var:pass_constants}}||
{{#vardefine:constants_nb|
{{#vardefine:constants_nb|
{{{!}} class="sortable" {{prettytable}}
{{LSL Constants/Pass|{{{1|}}}|{{{2|}}}|{{{3}}}|default={{{default|}}}}}{{#var:constants_nb}}}}
{{!}}-{{hl2}}
! {{LSLPT|{{{1|}}}}} Constant
! Value
! {{{2|}}} Script
! No {{{2|}}} Script
! Description
{{!}}-
{{!}} {{#vardefineecho:PASS_IF_NOT_HANDLED|{{LSL Const|PASS_IF_NOT_HANDLED|integer|0|c={{{3}}} are passed if there is no script handling the event in the prim.}}}}
{{!}} {{#var:value}}
{{!}} {{no|not passed}}
{{!}} {{yes|passed}}
{{!}} {{#ifeq:{{{default|}}}|{{#var:cname}}|'''Default:'''}} {{#var:comment}}
{{!}}-
{{!}} {{#vardefineecho:PASS_ALWAYS|{{LSL Const|PASS_ALWAYS|integer|1|c={{{3}}} are always passed to the root.}}}}
{{!}} {{#var:value}}
{{!}} {{yes|passed}}
{{!}} {{yes|passed}}
{{!}} {{#ifeq:{{{default|}}}|{{#var:cname}}|'''Default:'''}} {{#var:comment}}
{{!}}-
{{!}} {{#vardefineecho:PASS_NEVER|{{LSL Const|PASS_NEVER|integer|2|c={{{3}}} are never passed to the root.}}}}
{{!}} {{#var:value}}
{{!}} {{no|not passed}}
{{!}} {{no|not passed}}
{{!}} {{#ifeq:{{{default|}}}|{{#var:cname}}|'''Default:'''}} {{#var:comment}}
{{!}}}{{#var:constants_nb}}}}
{{#vardefine:pass_constants|*}}
{{#vardefine:pass_constants|*}}
}}
}}

Latest revision as of 21:01, 1 January 2016

#var value
p__desc PASS_* flag
also_functions
constants_nb
Constant Value Script No Script Description
PASS_IF_NOT_HANDLED 0 not passed passed {{{3}}} are passed if there is no script handling the event in the prim.
PASS_ALWAYS 1 passed passed {{{3}}} are always passed to the root.
PASS_NEVER 2 not passed not passed {{{3}}} are never passed to the root.
caveats
  • Has no known effect if called from within the root prim.
spec
deepnotes

TRUE & FALSE vs. PASS_* flags

Prior to Server Version 1.40.2, was couched in terms of being a boolean and the only meaningful values were 0 and 1. The best practice at that time was to use the integer constants TRUE and FALSE. The design of this function left much to be desired. The problem was that while TRUE always caused all {{{3}}} to be passed along to the the root, FALSE would only not pass {{{3}}} if there the prim had a script that handled a {{{2}}} event. This meant to fully utilize this function the prim must contain a script that handled {{{2}}} events! With the release of Server Version 1.40.2, the PASS_* flags were introduced and the subtype of the was changed. Specifically the introduction of PASS_NEVER solved this problem, allowing content creators to eliminate scripts that were only in the object to tweak the passing of {{{2}}} events.