Difference between revisions of "Template:LSL Function"
Jump to navigation
Jump to search
constants
Line 267: | Line 267: | ||
''(Please use 'return_text' or 'func_desc' to describe the functions actions.)''</div></div>{{#if:{{{self|}}}|| {{LSLC|FixMe}} }} }}{{#vardefine:header_floater|<table><tr> | ''(Please use 'return_text' or 'func_desc' to describe the functions actions.)''</div></div>{{#if:{{{self|}}}|| {{LSLC|FixMe}} }} }}{{#vardefine:header_floater|<table><tr> | ||
<td> {{HoverText|{{#var:func_id}}|The function index number.}} | <td> {{HoverText|{{#var:func_id}}|The function index number.}} | ||
<td> | <td> [[LSL Function ID|Function ID]] | ||
</tr><tr> | </tr><tr> | ||
<td> {{HoverText|{{{func_sleep|}}}|The number of seconds this script will sleep after executing this function.}} | <td> {{HoverText|{{{func_sleep|}}}|The number of seconds this script will sleep after executing this function.}} | ||
<td> | <td> [[LSL Delay]] | ||
</tr><tr> | </tr><tr> | ||
<td> {{HoverText|{{{func_energy|}}}|The quantity of energy consumed by this function.}} | <td> {{HoverText|{{{func_energy|}}}|The quantity of energy consumed by this function.}} | ||
<td> | <td> [[Energy]] | ||
</tr></table>}}{{#vardefine:header_text|{{LSL Generic/Text}}}}{{#vardefine:header_title|Function: {{LSL Generic/Title}}}}{{LSL Generic}}{{#if:{{#var:self}}|| {{#ifeq:{{#var:mode}}|request|| {{LSLC|Functions|{{#var:sort}}}} {{#if:{{#var:examples}}||{{LSLC|Needs Example|{{#var:sort}}}}}}}} {{#if:{{{cat1|}}}|{{LSLC|{{{cat1}}}|{{#var:sort}}}}}} {{#if:{{{cat2|}}}|{{LSLC|{{{cat2}}}|{{#var:sort}}}}}} {{#if:{{{cat3|}}}|{{LSLC|{{{cat3}}}|{{#var:sort}}}}}} {{#if:{{{cat4|}}}|{{LSLC|{{{cat4}}}|{{#var:sort}}}}}} {{#if:{{{cat5|}}}|{{LSLC|{{{cat5}}}|{{#var:sort}}}}}} {{#if:{{{cat6|}}}|{{LSLC|{{{cat6}}}|{{#var:sort}}}}}} }}</includeonly> | </tr></table>}}{{#vardefine:header_text|{{LSL Generic/Text}}}}{{#vardefine:header_title|Function: {{LSL Generic/Title}}}}{{LSL Generic}}{{#if:{{#var:self}}|| {{#ifeq:{{#var:mode}}|request|| {{LSLC|Functions|{{#var:sort}}}} {{#if:{{#var:examples}}||{{LSLC|Needs Example|{{#var:sort}}}}}}}} {{#if:{{{cat1|}}}|{{LSLC|{{{cat1}}}|{{#var:sort}}}}}} {{#if:{{{cat2|}}}|{{LSLC|{{{cat2}}}|{{#var:sort}}}}}} {{#if:{{{cat3|}}}|{{LSLC|{{{cat3}}}|{{#var:sort}}}}}} {{#if:{{{cat4|}}}|{{LSLC|{{{cat4}}}|{{#var:sort}}}}}} {{#if:{{{cat5|}}}|{{LSLC|{{{cat5}}}|{{#var:sort}}}}}} {{#if:{{{cat6|}}}|{{LSLC|{{{cat6}}}|{{#var:sort}}}}}} }}</includeonly> |
Revision as of 11:38, 24 February 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
{{LSL_Function |func |func_id |func_sleep |func_energy |sort |func_desc |func_footnote |return_type |return_text |p1_type|p1_name|p1_desc |p2_type|p2_name|p2_desc |p3_type|p3_name|p3_desc |p4_type|p4_name|p4_desc |p5_type|p5_name|p5_desc |p6_type|p6_name|p6_desc |p7_type|p7_name|p7_desc |p8_type|p8_name|p8_desc |p9_type|p9_name|p9_desc |p10_type|p10_name|p10_desc |p11_type|p11_name|p11_desc |p12_type|p12_name|p12_desc |constants |spec |caveats |examples |helpers |also_header |also_functions |also_tests |also_events |also_articles |also_footer |notes |mode |deprecated |location |inventory |permission |negative_index |cat1 |cat2 |cat3 |cat4 |cat5 |cat6 }}
The LSL_Function template is a intermediate template for LSL_Generic, 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 | |
p2_type | second parameter type | |
p2_name | second parameter name | |
p2_desc | second parameter desc | |
... | ||
p12_type | twelfth parameter type | |
p12_name | twelfth parameter name | |
p12_desc | twelfth parameter 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. | |
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. | |
permission | Set to the PERMISSION_* flag that the function requires. It will amend the appropriate fields to show this requirement (without all the haste of doing it yourself) | PERMISSION_CHANGE_LINKS |
negative_index | 'true', 'false' or nothing. If set to true or false then it amends the appropriate fields so that the function is marked as supporting or not supporting negative indexes. | true |
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. | |
inventory | set to the name of the parameter that is an inventory item name. It makes a nice message in caveats about missing inventory items. |
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Function: void MyFunction( integer i, float f, string s, key k, list l, vector v, rotation r );
Function: void MyFunction( integer i, float f, string s, key k, list l, vector v, rotation r );-1 | Function ID |
100.5 | LSL Delay |
0.0 | Energy |
A fictitious function
Returns a 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
- also_events
Functions
- also_functions
Articles
- also_articles
also_footer
Deep Notes
Tests
- also_tests
Source
location
MyFunction