Template:Lslfunc/doc

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
This template is to be used as follows (copy and paste the following into a new page):
 
 
{{lslfunc
 
|function_syntax=
 
|csharp_syntax=
 
|description=
 
|threat_level=
 
|permissions=
 
|delay=
 
|ossl_example=
 
|additional_info=
 
}}
 
 
<pre>
 
<pre>
{{lslfunc
+
{{LSL_Function
|function_syntax=
+
|func
|csharp_syntax=
+
|func_id
|description=
+
|func_sleep
|threat_level=
+
|func_energy
|permissions=
+
|func_desc
|delay=
+
|func_footnote
|ossl_example=
+
|return_type
|additional_info=
+
|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
 
}}
 
}}
 
</pre>
 
</pre>
  
{|border="1" cellspacing="0" width="80%"
+
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.
|- style="background-color:#DDDDFF;"
+
 
|Property||Description||Required
+
{| {{Prettytable}}
 +
|-{{Hl2}}
 +
!parameter
 +
!desc
 +
!example
 
|-
 
|-
|function_syntax||syntax in LSL||Yes
+
|func
 +
|Function name
 
|-
 
|-
|csharp_syntax||syntax in C#||No
+
|func_id
 +
|{{LSLG|Function ID}}
 +
|1.0
 
|-
 
|-
|description||definitions or descriptions||Yes
+
|func_sleep
 +
|{{LSLG|Delay}}
 +
|0.0
 
|-
 
|-
|threat_level||[[Threat level]]&nbsp;&nbsp;&nbsp;(Use ignored for functions that do not check threat level)||No
+
|func_energy
 +
|{{LSLG|Energy}}
 +
|10.0
 
|-
 
|-
|permissions||who may use this OSSL function&nbsp;&nbsp;&nbsp;(Use true for a function that is available to everyone) ||No
+
|func_desc
 +
|Function description text.
 +
|Gives the monkey a banana
 
|-
 
|-
|delay||any penalty (delay in seconds) for using this function||No
+
|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.
 
|-
 
|-
|ossl_example||sample codes||No
+
|return_type
 +
|return type
 +
|integer
 
|-
 
|-
|additional_info||notes, hints or so||No
+
|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
 
|}
 
|}
  
You can find some infomation about OSSL functions within IOSSL_Api.cs or OSSL_Api.cs. If you unsure what to fill in, feel free to leave it empty and wait for experts shown up:)
+
<div id="box">
 
+
{{LSL_Function
If you have added some additional common facilities like threat level, feel free to add it to this template.
+
|func=MyFunction
 
+
|func_id=-1
Features of this template:
+
|func_sleep=100.5
* Includes the <nowiki>{{quicklinks}}</nowiki> template
+
|func_energy=0.0
* Automatically adds the article to all the relevant categories
+
|func_desc=A fictitious function{{Footnote|Footnote test}}
* Displays a placeholder text when required information is missing, and adds the article to the relevant "missing" category/categories.
+
|func_footnote=func_footnote
 +
|return_type=void
 +
|return_text=(aka nadda, nothing).
 +
|p1_type=integer|p1_name=i|p1_desc
 +
|p2_type=float|p2_name=f|p2_desc
 +
|p3_type=string|p3_name=s|p3_desc
 +
|p4_type=key|p4_name=k|p4_desc
 +
|p5_type=list|p5_name=l|p5_desc
 +
|p6_type=vector|p6_name=v|p6_desc
 +
|p7_type=rotation|p7_name=r|p7_desc
 +
|constants=constants
 +
|spec=spec
 +
|caveats=caveats
 +
|examples=examples
 +
|helpers=helpers
 +
|also_header=also_header
 +
|also_events=*also_events
 +
|also_functions=*also_functions
 +
|also_articles=*also_articles
 +
|also_tests=*also_tests
 +
|also_footer=also_footer
 +
|notes=notes
 +
|mode
 +
|self=self
 +
|location=location
 +
|history=history
 +
}}
 +
</div>

Revision as of 11:21, 12 March 2019

{{LSL_Function
|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 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
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
Personal tools
General
About This Wiki