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

From Second Life Wiki
Jump to navigation Jump to search
(more additions)
(more description)
Line 38: Line 38:
}
}
-->
-->
 
<!-- Infobox begin
<!-- Infobox begin (float:right and clear:right manually added due to lack of infobox CSS class) -->
(float:right and clear:right 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" cellspacing="0" cellpadding="2"
|+ style="font-size: larger;" | '''llExample'''
|+ style="font-size: larger;" | '''llExample'''
Line 89: Line 89:
'''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:
* Finish everything
* Finish everything
* Templatize
* Templatize
* Make sample text for a real function
* Make sample text for a real, complicated function
* Add cool things like
* Add cool things like
** Detection of incomplete infoboxes
** Detection of incomplete infoboxes
Line 100: Line 100:


== 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.
 
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.
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.


== Internal ==
== Internal ==

Revision as of 10:59, 16 February 2007

llExample
Returns:
boolean success
Parameters:
integer pokes
string descriptiveName
list parameterList
key target
vector position
Delay 0
Energy 10
Function ID -1
Works with:
llListen, llListenRemove, llListenControl (example for listen())

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:

  • Finish everything
  • Templatize
  • Make sample text for a real, complicated function
  • Add cool things like
    • Detection of incomplete infoboxes
    • More modularity

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.

Internal

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

See Also