Template:Lslfunc
From OpenSimulator
(Difference between revisions)
CodyCooper (Talk | contribs) |
CodyCooper (Talk | contribs) |
||
(One intermediate revision by one user not shown) | |||
Line 199: | Line 199: | ||
{{!}} [[Energy{{#var:lang}}|Energy]] | {{!}} [[Energy{{#var:lang}}|Energy]] | ||
{{!}}}</div>}} | {{!}}}</div>}} | ||
− | {{#if:{{#var:header_desc}}|{{#var:header_desc}}{{PBR}}{{#if:{{{return_type|}}}|<br id="bdart"/>}}}}{{#if:{{{return_type|}}}| Returns {{#if:{{{return_subtype|}}}|{{#if:{{{returns_text|}}}{{{Returns_text|}}}||{{ItBlind|{{#if:{{{return_subtype_disp|}}}|{{{return_subtype_disp|}}}|{{{return_subtype|}}}}}|{{{Return_text|}}}}}}} {{CAL|LSL {{ucfirst:{{{return_type|}}}}}/{{{return_subtype|}}}{{#var:lang}}|{{#if:{{{return_subtype_disp|}}}|{{{return_subtype_disp}}}|{{{return_subtype}}}}}}} ({{ItLink|{{{return_type|}}}}})|{{#if:{{{returns_text|}}}{{{Returns_text|}}}||{{ | + | {{#if:{{#var:header_desc}}|{{#var:header_desc}}{{PBR}}{{#if:{{{return_type|}}}|<br id="bdart"/>}}}}{{#if:{{{return_type|}}}| Returns {{#if:{{{return_subtype|}}}|{{#if:{{{returns_text|}}}{{{Returns_text|}}}||{{ItBlind|{{#if:{{{return_subtype_disp|}}}|{{{return_subtype_disp|}}}|{{{return_subtype|}}}}}|{{{Return_text|}}}}}}} {{CAL|LSL {{ucfirst:{{{return_type|}}}}}/{{{return_subtype|}}}{{#var:lang}}|{{#if:{{{return_subtype_disp|}}}|{{{return_subtype_disp}}}|{{{return_subtype}}}}}}} ({{ItLink|{{{return_type|}}}}})|{{#if:{{{returns_text|}}}{{{Returns_text|}}}||{{{{{return_type|}}}|{{{Return_text|}}}}}}}}} {{#if:{{#var:return_text}}| {{#var:return_text}} }}{{PBR}}}} |
{{#if:{{{p1_name|}}}{{{p1_type|}}}|{{{!}} | {{#if:{{{p1_name|}}}{{{p1_type|}}}|{{{!}} | ||
{{LSL DefineRow|1={{{p1_type|}}}|2={{#if:{{{p1_subtype|}}}|{{CAL|LSL {{ucfirst:{{{p1_type|}}}}}/{{{p1_subtype|}}}{{#var:lang}}|{{{p1_name|}}}}}|{{LSL_Parameter_Link|{{{p1_name|}}}}}}}|3={{#var:p_{{{p1_name|}}}_desc}}}} | {{LSL DefineRow|1={{{p1_type|}}}|2={{#if:{{{p1_subtype|}}}|{{CAL|LSL {{ucfirst:{{{p1_type|}}}}}/{{{p1_subtype|}}}{{#var:lang}}|{{{p1_name|}}}}}|{{LSL_Parameter_Link|{{{p1_name|}}}}}}}|3={{#var:p_{{{p1_name|}}}_desc}}}} | ||
Line 342: | Line 342: | ||
<div style="display:none" class="hidden-text" id="hidden-text">{{#var:hidden-text}}</div> | <div style="display:none" class="hidden-text" id="hidden-text">{{#var:hidden-text}}</div> | ||
{{#var:footer}} {{#if:{{#var:self}}|| {{#if:{{#pos:{{#var:moded}}|r}}{{#pos:{{#var:moded}}|u}}|| {{#if:{{{haiku|}}}|[[Category:Articles with haiku{{#var:lang}}]]|[[Category:Articles in need of haiku{{#var:lang}}]]}}[[Category:LSL Functions{{#var:lang}}]] {{#if:{{{return_type|}}}|{{LSLC|Functions/Returns {{AAn|{{{return_type|}}}}}{{#var:lang}}}} {{#if:{{{return_subtype|}}}|{{LSLC|Functions/Returns a {{{return_type|}}}/{{{return_subtype|}}}{{#var:lang}}}}}}|{{LSLC|Functions/Returns nothing{{#var:lang}}}}}} {{#if:{{{p1_name|}}}{{{p1_type|}}}|{{LSLC|Parameters/{{{p1_name|}}}{{#var:lang}}}}{{#if:{{{p2_name|}}}{{{p2_type|}}}|{{LSLC|Parameters/{{{p2_name|}}}{{#var:lang}}}}{{#if:{{{p3_name|}}}{{{p3_type|}}}|{{LSLC|Parameters/{{{p3_name|}}}{{#var:lang}}}}{{#if:{{{p4_name|}}}{{{p4_type|}}}|{{LSLC|Parameters/{{{p4_name|}}}{{#var:lang}}}}{{#if:{{{p5_name|}}}{{{p5_type|}}}|{{LSLC|Parameters/{{{p5_name|}}}{{#var:lang}}}}{{#if:{{{p6_name|}}}{{{p6_type|}}}|{{LSLC|Parameters/{{{p6_name|}}}{{#var:lang}}}}{{#if:{{{p7_name|}}}{{{p7_type|}}}|{{LSLC|Parameters/{{{p7_name|}}}{{#var:lang}}}}{{#if:{{{p8_name|}}}{{{p8_type|}}}|{{LSLC|Parameters/{{{p8_name|}}}{{#var:lang}}}}{{#if:{{{p9_name|}}}{{{p9_type|}}}|{{LSLC|Parameters/{{{p9_name|}}}{{#var:lang}}}}{{#if:{{{p10_name|}}}{{{p10_type|}}}|{{LSLC|Parameters/{{{p10_name|}}}{{#var:lang}}}}{{#if:{{{p11_name|}}}{{{p11_type|}}}|{{LSLC|Parameters/{{{p11_name|}}}{{#var:lang}}}}{{#if:{{{p12_name|}}}{{{p12_type|}}}|{{LSLC|Parameters/{{{p12_name|}}}{{#var:lang}}}}}}}}}}}}}}}}}}}}}}}}}}}} {{#if:{{#pos:{{#var:moded}}|f}}|[[Category:LSL Keywords/Pre-release{{#var:lang}}]]|[[Category:LSL Keywords/All{{#var:lang}}]]{{#ifexpr:{{#var:BugCounter|0}} > 0|[[Category:LSL topics with bugs{{#var:lang}}]] [[Category:LSL topics with the most bugs{{#var:lang}}| {{#pad:{{#expr:100-{{#var:BugCounter|0}}}}|2|0}}{{PAGENAME}}]]}}}} {{#iferror:{{#expr:{{#var:func_id}}}}|[[Category:LSL Functions/Without IDs{{#var:lang}}]]|[[Category:LSL Functions/ID{{#var:lang}}| {{padleft:{{#var:func_id}}|5|0}}]]}} {{#if:{{#var:examples}}||[[Category:LSL Needs Example{{#var:lang}}]]}} {{LSL Unhelpful|{{{func}}}|}}}} {{#if:{{{cat1|}}}|[[Category:LSL {{{cat1}}}{{#var:lang}}]]}} {{#if:{{{cat2|}}}|[[Category:LSL {{{cat2}}}{{#var:lang}}]]}} {{#if:{{{cat3|}}}|[[Category:LSL {{{cat3}}}{{#var:lang}}]]}} {{#if:{{{cat4|}}}|[[Category:LSL {{{cat4}}}{{#var:lang}}]]}} {{#if:{{{cat5|}}}|[[Category:LSL {{{cat5}}}{{#var:lang}}]]}} {{#if:{{{cat6|}}}|[[Category:LSL {{{cat6}}}{{#var:lang}}]]}} {{#if:{{{cat7|}}}|[[Category:LSL {{{cat7}}}{{#var:lang}}]]}} {{#if:{{{cat8|}}}|[[Category:LSL {{{cat8}}}{{#var:lang}}]]}} }}</includeonly> | {{#var:footer}} {{#if:{{#var:self}}|| {{#if:{{#pos:{{#var:moded}}|r}}{{#pos:{{#var:moded}}|u}}|| {{#if:{{{haiku|}}}|[[Category:Articles with haiku{{#var:lang}}]]|[[Category:Articles in need of haiku{{#var:lang}}]]}}[[Category:LSL Functions{{#var:lang}}]] {{#if:{{{return_type|}}}|{{LSLC|Functions/Returns {{AAn|{{{return_type|}}}}}{{#var:lang}}}} {{#if:{{{return_subtype|}}}|{{LSLC|Functions/Returns a {{{return_type|}}}/{{{return_subtype|}}}{{#var:lang}}}}}}|{{LSLC|Functions/Returns nothing{{#var:lang}}}}}} {{#if:{{{p1_name|}}}{{{p1_type|}}}|{{LSLC|Parameters/{{{p1_name|}}}{{#var:lang}}}}{{#if:{{{p2_name|}}}{{{p2_type|}}}|{{LSLC|Parameters/{{{p2_name|}}}{{#var:lang}}}}{{#if:{{{p3_name|}}}{{{p3_type|}}}|{{LSLC|Parameters/{{{p3_name|}}}{{#var:lang}}}}{{#if:{{{p4_name|}}}{{{p4_type|}}}|{{LSLC|Parameters/{{{p4_name|}}}{{#var:lang}}}}{{#if:{{{p5_name|}}}{{{p5_type|}}}|{{LSLC|Parameters/{{{p5_name|}}}{{#var:lang}}}}{{#if:{{{p6_name|}}}{{{p6_type|}}}|{{LSLC|Parameters/{{{p6_name|}}}{{#var:lang}}}}{{#if:{{{p7_name|}}}{{{p7_type|}}}|{{LSLC|Parameters/{{{p7_name|}}}{{#var:lang}}}}{{#if:{{{p8_name|}}}{{{p8_type|}}}|{{LSLC|Parameters/{{{p8_name|}}}{{#var:lang}}}}{{#if:{{{p9_name|}}}{{{p9_type|}}}|{{LSLC|Parameters/{{{p9_name|}}}{{#var:lang}}}}{{#if:{{{p10_name|}}}{{{p10_type|}}}|{{LSLC|Parameters/{{{p10_name|}}}{{#var:lang}}}}{{#if:{{{p11_name|}}}{{{p11_type|}}}|{{LSLC|Parameters/{{{p11_name|}}}{{#var:lang}}}}{{#if:{{{p12_name|}}}{{{p12_type|}}}|{{LSLC|Parameters/{{{p12_name|}}}{{#var:lang}}}}}}}}}}}}}}}}}}}}}}}}}}}} {{#if:{{#pos:{{#var:moded}}|f}}|[[Category:LSL Keywords/Pre-release{{#var:lang}}]]|[[Category:LSL Keywords/All{{#var:lang}}]]{{#ifexpr:{{#var:BugCounter|0}} > 0|[[Category:LSL topics with bugs{{#var:lang}}]] [[Category:LSL topics with the most bugs{{#var:lang}}| {{#pad:{{#expr:100-{{#var:BugCounter|0}}}}|2|0}}{{PAGENAME}}]]}}}} {{#iferror:{{#expr:{{#var:func_id}}}}|[[Category:LSL Functions/Without IDs{{#var:lang}}]]|[[Category:LSL Functions/ID{{#var:lang}}| {{padleft:{{#var:func_id}}|5|0}}]]}} {{#if:{{#var:examples}}||[[Category:LSL Needs Example{{#var:lang}}]]}} {{LSL Unhelpful|{{{func}}}|}}}} {{#if:{{{cat1|}}}|[[Category:LSL {{{cat1}}}{{#var:lang}}]]}} {{#if:{{{cat2|}}}|[[Category:LSL {{{cat2}}}{{#var:lang}}]]}} {{#if:{{{cat3|}}}|[[Category:LSL {{{cat3}}}{{#var:lang}}]]}} {{#if:{{{cat4|}}}|[[Category:LSL {{{cat4}}}{{#var:lang}}]]}} {{#if:{{{cat5|}}}|[[Category:LSL {{{cat5}}}{{#var:lang}}]]}} {{#if:{{{cat6|}}}|[[Category:LSL {{{cat6}}}{{#var:lang}}]]}} {{#if:{{{cat7|}}}|[[Category:LSL {{{cat7}}}{{#var:lang}}]]}} {{#if:{{{cat8|}}}|[[Category:LSL {{{cat8}}}{{#var:lang}}]]}} }}</includeonly> | ||
+ | <noinclude> | ||
+ | {{Documentation}} | ||
+ | <!-- Add categories to the /doc subpage, interwikis to Wikidata, not here --> | ||
+ | </noinclude> |
Latest revision as of 10:14, 12 March 2019
[edit] [ ] Template documentation
{{LSLfunc |func |func_id |func_sleep |func_energy |func_desc |func_footnote |return_type |return_text |p1_type|p1_name|p1_desc|p1_hover |p2_type|p2_name|p2_desc|p2_hover |p3_type|p3_name|p3_desc|p3_hover |p4_type|p4_name|p4_desc|p4_hover |p5_type|p5_name|p5_desc|p5_hover |p6_type|p6_name|p6_desc|p6_hover |p7_type|p7_name|p7_desc|p7_hover |p8_type|p8_name|p8_desc|p8_hover |p9_type|p9_name|p9_desc|p9_hover |p10_type|p10_name|p10_desc|p10_hover |p11_type|p11_name|p11_desc|p11_hover |p12_type|p12_name|p12_desc|p12_hover |constants |spec |caveats |examples |helpers |also_header |also_functions |also_tests |also_events |also_articles |also_footer |notes |mode |deprecated |location |cat1 |cat2 |cat3 |cat4 |cat5 |cat6 }}
The Lslfunc template is a intermediate template, which handles the formating for both functions and events (LSL_Event is also an intermediate template). The main job of this template is to change the parameter, names & setup the right-side floater. Also makes permission requirements a part of the template.
parameter | desc | example |
---|---|---|
func | Function name | |
func_id | Function ID | 1.0 |
func_sleep | Delay | 0.0 |
func_energy | Energy | 10.0 |
func_desc | Function description text. | Gives the monkey a banana |
func_footnote | Function footnote (appears after the parameters text). | Has the side effect of causing the avatar to run in circles shouting like on fire. |
return_type | return type | integer |
return_text | "Returns a return_type return_text" in most cases return_text can be used instead of func_desc. | that is a monkey |
p1_type | first parameter type | |
p1_name | first parameter name | |
p1_desc | first parameter desc | |
p1_hover | first parameter hover, if not included it defaults to p1_desc | |
p2_type | second parameter type | |
p2_name | second parameter name | |
p2_desc | second parameter desc | |
p2_hover | second parameter hover, if not included it defaults to p2_desc | |
... | ||
p12_type | twelfth parameter type | |
p12_name | twelfth parameter name | |
p12_desc | twelfth parameter desc | |
p12_hover | twelfth parameter hover, if not included it defaults to p12_desc | |
constants | constants area, no box, please use a table for this section. | |
spec | spec box | |
caveats | caveats box | |
examples | examples box | |
helpers | helper functions box | |
also_header | also header | |
also_functions | also functions indent | |
also_events | also events indent | |
also_articles | also articles indent | |
also_tests | also tests indent | |
also_footer | also footer | |
notes | notes box | |
mode | If mode equals 'god' then it is tagged as requiring godmode. If set to 'request' marks the page as a feature request. If set to 'user' avoids function being added to LSL Function Index, thus enabling usage of this template for documentation of User Functions. | |
deprecated | Marks the function as deprecated. Set the value to the replacement functions name or 'none'. If it is not set to none and it is infact set, it will include a link to the replacement function. | |
self | Special field that you only set if you don't want the function to be included in any categories. | |
cat1 | An LSL specific category and sets the proper sort. (example would add the function to the "LSL Stub" category) | Stub |
cat2 | " | |
cat3 | " | |
cat4 | " | |
cat5 | " | |
cat6 | " | |
sort | not required but used to specify the sort order, if excluded the wiki will calculate this value for you. | |
location | optional: location box, used to say which source file it is defined in. | |
history | a box for function history |
Contents |
Summary
Function: void MyFunction( integer i, float f, string s, key k, list l, vector v, rotation r );
A fictitious function
Returns Template:Void (aka nadda, nothing).
• integer | i | |||
• float | f | |||
• string | s | |||
• key | k | |||
• list | l | |||
• vector | v | |||
• rotation | r |
func_footnote
Specification
spec
Caveats
- This function causes the script to sleep for 100.5 seconds.caveats
Examples
examples
Useful Snippets
helpers
Notes
notes
See Also
also_header
Events
Functions
Articles
also_footer
Deep Notes
The above documentation is transcluded from Template:Lslfunc/doc. (edit | history) Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |