Difference between revisions of "LSL Function Style/Celierra Darling"

From Second Life Wiki
Jump to navigation Jump to search
(more additions)
(→‎Notes: spelling, on second thought OK to have incomplete infoboxes...)
 
(9 intermediate revisions by the same user not shown)
Line 38: Line 38:
}
}
-->
-->
 
<!-- Infobox begin
<!-- Infobox begin (float:right and clear:right manually added due to lack of infobox CSS class) -->
  (float:right; clear:right; bg color all manually added due to lack of infobox CSS class) -->
{| class="infobox" style="width: 20em; font-size: 95%; border-collapse: collapse; margin:0 0 1em 1em; float: right; clear: right" cellspacing="0" cellpadding="2"
{| class="infobox" style="width: 20em; font-size: 95%; border-collapse: collapse; margin:0 0 1em 1em; float: right; clear: right; background-color: #f9f9f9;" cellspacing="0" cellpadding="2"
|+ style="font-size: larger;" | '''llExample'''
|+ style="font-size: larger;" | '''llExample'''
<!-- Very short description -->
|-
| colspan="2" style="text-align:center; background-color: #FFFFFF" | Creates an annoying animation
<!-- Return val -->
<!-- Return val -->
|- style="border-top:1px solid #AAAAAA;"
|- style="border-top:1px solid #AAAAAA;"
Line 71: Line 74:
<!-- Stats -->
<!-- Stats -->
|-
|-
| [[Delay]]
| style="text-align: right" | [[Delay]]
| 0
| 0
|-
|-
| [[Energy]]
| style="text-align: right" | [[Energy]]
| 10
| 10
|-
|-
| Function ID
| style="text-align: right" | [[Runtime complexity|Complexity]]
| O(''n''<sup>3</sup>) <br/> <small>(or n/a)</small>
|-
| style="text-align: right" | Function ID
| -1
| -1
<!-- dependencies -->
<!-- likely-to-be-next related functions -->
|- style="background-color:#F0F0F0; border-top:1px solid #AAAAAA;"
|- style="background-color:#F0F0F0; border-top:1px solid #AAAAAA;"
| colspan="2" | '''Works with:'''
| colspan="2" | '''Related to:'''
|- style="background-color:#F0F0F0"
|- style="background-color:#F0F0F0"
| colspan="2" | [[llListen]], [[llListenRemove]], [[llListenControl]] (example for listen())
| colspan="2" | [[llListen]], [[llListenRemove]], [[llListenControl]] (example for listen()) <br/><br/> [[llList2Integer]], etc. (example for all those List2X functions)
<!-- infobox end -->
|-
|-
<!-- infobox end -->
|}
|}
'''This page is in progress and nowhere near done yet'''
'''This page is in progress and nowhere near done yet'''


This is the lede and should give a short overview of the function.  This [[LSL]] [[function]] takes in a number of pokes, a name for the animation, a list of parameters (see [[#Parameter_list|below table]]), the key of an avatar, and the position from which the giant hand should appear.  It caused the specified damaged to be poked repeatedly, for massive damage.
This is the lede (yes, lede is a word) and should give a short overview of the function.  This [[LSL]] [[function]] takes in a number of pokes, a name for the animation, a list of parameters (see [[#Parameter_list|below table]]), the key of an avatar, and the position from which the giant hand should appear.  It caused the specified damaged to be poked repeatedly, for massive damage.


Todo:
Todo is under [[#Notes|Notes]].
* Finish everything
* Templatize
* Make sample text for a real function
* Add cool things like
** Detection of incomplete infoboxes
** More modularity


== Specification ==
== Specification ==
The exact behavior of the function, its preconditions, postconditions, etc.
The exact behavior of the function, its preconditions (how its arguments must be formatted and what it expects the world to look like), postconditions (how the return value is formatted), side effects (what happens in-world), etc.


Ex. Channel number must be between x and y.  Channel 0 is main, everyone can hear.  Negatives are okay.
Unlike lede paragraph, has less high-level abstraction and more nitty-gritty, corner cases, error conditions, etc.
 
Ex. Channel number must be between x and y.  Channel 0 is main, everyone can hear.  Negatives are okay, and only objects can speak to negative channels.


=== Parameter list ===
=== Parameter list ===
A table would go here.
Constants, flags, etc, what is accepted into an ambiguously-typed parameter (lists, bitflags).  Constants used in multiple places should be linked to their articles.


=== Caveats ===
=== Caveats ===
Line 116: Line 118:


== Examples ==
== Examples ==
Short examples, blah blah, should try to demonstrate all the caveats, though not necessarily in one script.  Maybe some creative uses.
Short examples, blah blah, should try to demonstrate all the caveats, though not necessarily in one script.  Maybe some creative uses should go here too.  Should avoid any script that uses many other functions - examples should probably be single-purpose for this specific function and be as clear as possible.


== Notes ==
== Notes ==
Anything obscure that isn't covered above.
Anything obscure that isn't covered above. Whispers go 10m, normal talking goes 20m, shouting goes 100m.
 
Todo:
* Finish everything
* Templatize
* Make sample text for a real, complicated function
* Add cool things like
** More modularity
** Collapsible raw data tables


== Internal ==
== Internal ==
Line 127: Line 137:
* [[listen]]
* [[listen]]
* etc.
* etc.
* ...
* A box with list of closely-related articles (especially for things like particles or listen)
* ...loosely-related articles (all string-manipulation, for example)
* ...major LSL (only function?) categories
* ...SL Wiki portals (?)
* (don't necessarily need this many boxes)
Categories go at the bottom (here).

Latest revision as of 19:23, 23 February 2007

llExample
Creates an annoying animation
Returns:
boolean success
Parameters:
integer pokes
string descriptiveName
list parameterList
key target
vector position
Delay 0
Energy 10
Complexity O(n3)
(or n/a)
Function ID -1
Related to:
llListen, llListenRemove, llListenControl (example for listen())

llList2Integer, etc. (example for all those List2X functions)

This page is in progress and nowhere near done yet

This is the lede (yes, lede is a word) and should give a short overview of the function. This LSL function takes in a number of pokes, a name for the animation, a list of parameters (see below table), the key of an avatar, and the position from which the giant hand should appear. It caused the specified damaged to be poked repeatedly, for massive damage.

Todo is under Notes.

Specification

The exact behavior of the function, its preconditions (how its arguments must be formatted and what it expects the world to look like), postconditions (how the return value is formatted), side effects (what happens in-world), etc.

Unlike lede paragraph, has less high-level abstraction and more nitty-gritty, corner cases, error conditions, etc.

Ex. Channel number must be between x and y. Channel 0 is main, everyone can hear. Negatives are okay, and only objects can speak to negative channels.

Parameter list

Constants, flags, etc, what is accepted into an ambiguously-typed parameter (lists, bitflags). Constants used in multiple places should be linked to their articles.

Caveats

Common misunderstandings, mistakes, etc.

  • Listens are removed when changing state
  • The function returns a handle that should be used to manually remove the listen
  • Causes lag if you listen too many
  • Max number
  • etc.

Examples

Short examples, blah blah, should try to demonstrate all the caveats, though not necessarily in one script. Maybe some creative uses should go here too. Should avoid any script that uses many other functions - examples should probably be single-purpose for this specific function and be as clear as possible.

Notes

Anything obscure that isn't covered above. Whispers go 10m, normal talking goes 20m, shouting goes 100m.

Todo:

  • Finish everything
  • Templatize
  • Make sample text for a real, complicated function
  • Add cool things like
    • More modularity
    • Collapsible raw data tables

Internal

Design document, functional spec, test scripts, related functions - for LL use, mostly (see how they did llEmail).

See Also

  • listen
  • etc.
  • ...
  • A box with list of closely-related articles (especially for things like particles or listen)
  • ...loosely-related articles (all string-manipulation, for example)
  • ...major LSL (only function?) categories
  • ...SL Wiki portals (?)
  • (don't necessarily need this many boxes)

Categories go at the bottom (here).