Difference between revisions of "Category:LSL List/instructions"

From Second Life Wiki
Jump to navigation Jump to search
m
m (The <lsl> tag was only available on very early & primitive versions of MediaWiki; nowadays, <syntaxhighlight lang="lsl2"> is the recommended way.)
 
Line 7: Line 7:


===Examples===
===Examples===
<lsl>llSetPrimitiveParams([PRIM_OMEGA, <1,0,0>, 1.0, 1.0, PRIM_TEXT, "6 * 9 = 42", <1,1,1>, 0.5 ]);</lsl>
<syntaxhighlight lang="lsl2">llSetPrimitiveParams([PRIM_OMEGA, <1,0,0>, 1.0, 1.0, PRIM_TEXT, "6 * 9 = 42", <1,1,1>, 0.5 ]);</syntaxhighlight>
{|{{prettytable}}
{|{{prettytable}}
|-{{Hl2}}
|-{{Hl2}}
Line 35: Line 35:
|}
|}


<lsl>list params = llGetPrimitiveParams([PRIM_OMEGA, PRIM_COLOR, 0]);</lsl>
<syntaxhighlight lang="lsl2">list params = llGetPrimitiveParams([PRIM_OMEGA, PRIM_COLOR, 0]);</syntaxhighlight>
{|{{prettytable}}
{|{{prettytable}}
|-{{Hl2}}
|-{{Hl2}}

Latest revision as of 10:54, 17 April 2022

instructions is a subtype of list.

The functions and constants in this category all take or return an instructions parameter. Events in this category expose an instructions parameter.


A list of instructions when passed to a function tell the function what to do or how to configure the primitive, the object, or the world around them.

Instruction lists are predominately are made of alternating commands and parameters. There are generally two types of instruction lists, those that configure (set functions) and those that query (get functions).

The big difference between these two sets of functions is that the instruction lists used for querying take fewer parameters, the missing parameters are what the function returns. This can be quite annoying as to pass the results into the Set function you have to inject the commands and missing parameters.

Examples

llSetPrimitiveParams([PRIM_OMEGA, <1,0,0>, 1.0, 1.0, PRIM_TEXT, "6 * 9 = 42", <1,1,1>, 0.5 ]);
Command Parameter Names
Parameter Values
PRIM_OMEGA vector axis float spinrate float gain
<1,0,0> 1.0 1.0
PRIM_TEXT string text vector color float alpha
"6 * 9 = 42" <1,1,1> 0.5
list params = llGetPrimitiveParams([PRIM_OMEGA, PRIM_COLOR, 0]);
Command Parameter Names Return Names
Parameter Values Return Values
PRIM_OMEGA No parameters vector axis float spinrate float gain
<1,0,0> 1.0 1.0
PRIM_COLOR integer face vector color float alpha
0 <1.0, 0.5, 0.2> 0.5

Functions

Set Terse Get * Full Get Category
llSetPrimitiveParams llGetPrimitiveParams GetPrimitiveParams PrimitiveParams
llSetLinkPrimitiveParams llGetLinkPrimitiveParams GetLinkPrimitiveParams PrimitiveParams
llSetPrimMediaParams llGetPrimMediaParams GetPrimMediaParams Media
llSetLinkMedia llGetLinkMedia GetLinkMedia Media
* Functions in this column return only parameters not supplied
† Functions in this column return commands and all parameters
‡ Indicates a user defined function