Difference between revisions of "Template:LSL Function/Pass"
m |
m |
||
(15 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
{{#switch:{{#if:{{{nc|}}}|Template|{{NAMESPACE}}}}|Template=|User=|}}}} | {{#switch:{{#if:{{{nc|}}}|Template|{{NAMESPACE}}}}|Template=|User=|}}}} | ||
{{#vardefine:p_{{{1|}}}_desc|PASS_* flag }} | |||
{{#vardefine:p_{{{1|}}}_hover|PASS_* flag }} | |||
<!-- | |||
<includeonly> | <includeonly> | ||
{{#ifeq:{{#var:article-type}}|event||{{#if:{{#pos:{{#var:moded}}|r}}{{#pos:{{#var:moded}}|u}}||{{#vardefine:hidden-text|{{#var:hidden-text}} | {{#ifeq:{{#var:article-type}}|event||{{#if:{{#pos:{{#var:moded}}|r}}{{#pos:{{#var:moded}}|u}}||{{#vardefine:hidden-text|{{#var:hidden-text}} | ||
Line 9: | Line 13: | ||
}}}}}} | }}}}}} | ||
</includeonly> | </includeonly> | ||
--> | |||
{{#if: | {{#if:{{{noconst|}}}{{#var:pass_constants}}|| | ||
{{#vardefine:constants_nb| | {{#vardefine:constants_nb| | ||
{{ | {{LSL Constants/Pass|{{{1|}}}|{{{2|}}}|{{{3}}}|default={{{default|}}}}}{{#var:constants_nb}}}} | ||
{{#vardefine:pass_constants|*}} | {{#vardefine:pass_constants|*}} | ||
}} | }} | ||
{{#if:{{{nocaveats|}}}|| | {{#if:{{{nocaveats|}}}|| | ||
{{#vardefine:caveats| | {{#vardefine:caveats| | ||
* Has no known effect if called from within the root prim. | |||
{{#var:caveats}}}} | {{#var:caveats}}}} | ||
}} | }} | ||
{{#if:{{{default|}}}| | |||
{{#vardefine:header_footnote|{{#var:header_footnote}}{{PBR}} | |||
Whether {{{3|}}} are passed to the root prim depends not only on which PASS_* flag is selected, but may also depend on if there is a script that in the prim that handles one of the {{{2|}}} events. For this reason most users will want to use {{#var:PASS_ALWAYS}} or {{#var:PASS_NEVER}} as they do not have this variable behavior. | |||
The default value for this attribute is {{#var:{{{default|}}}}}.{{PBR}} | |||
}} | |||
}} | |||
{{#if:{{{tf|<noinclude>*</noinclude>}}}| | |||
{{#vardefine:deepnotes|{{#vardefine:deepnotes|}}{{PBR}} | |||
==== [[TRUE]] & [[FALSE]] vs. PASS_* flags ==== | |||
Prior to Server Version 1.40.2, {{LSLPT|{{{1|}}}}} was couched in terms of being a [[:Category:LSL_Integer/boolean|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 {{LSLPT|{{{1|}}}}} was changed. Specifically the introduction of {{#var:PASS_NEVER}} solved this problem, allowing content creators to eliminate scripts that were only in the object to tweak the passing of {{{2}}} events. | |||
}} | |||
}} | |||
}}<noinclude> | }}<noinclude> | ||
Line 63: | Line 54: | ||
{{VarPair|constants_nb}} | {{VarPair|constants_nb}} | ||
|- | |- | ||
{{VarPair| | {{VarPair|caveats}} | ||
|- | |||
{{VarPair|spec}} | |||
|- | |||
{{VarPair|deepnotes}} | |||
|} | |} | ||
</noinclude> | </noinclude> |
Latest revision as of 21:01, 1 January 2016
#var | value | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
p__desc | PASS_* flag | ||||||||||||||||||||
also_functions |
| ||||||||||||||||||||
constants_nb |
| ||||||||||||||||||||
caveats |
| ||||||||||||||||||||
spec | |||||||||||||||||||||
deepnotes |
TRUE & FALSE vs. PASS_* flagsPrior 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. |