LSL Addition
LSL Header:
{{LSL Header|ml=*}}__TOC__
void-box:
{{void-box
|title=[[:Category:LSL Operators|Operator]]: ''+''
|content=
=== Valid Types: ===
* [[#Integer|Integer]]
* [[#Vector|Vector]]
* [[#Rotation|Rotation]]
* [[#String|String]]
* [[#List|List]]
}}void-box:
{{void-box
|title=Integer
|content=
* Operation: Addition
** Example:
*** 1 + 1
*** Result = 2
Note: If one variable or value is a float, the integer value will be cast to a float automatically.
}}void-box:
{{void-box
|title=Float
|content=
* Operation: Addition
** Example:
*** 1.5 + 1.5
*** Result = 3.0
Note: If one variable or value is an integer, the integer value will be cast to a float automatically.
}}void-box:
{{void-box
|title=Vector
|content=
* Operation: Addition
** Examples:
*** <1.0, 1.0, 1.0> + <1.0, 0.0, -1.0>
*** Result = <2.0, 1.0, 0.0>
*** Action: <a.x, a.y, a.z> + <b.x, b.y, b.z> == <a.x + b.x, a.y + b.y, a.z + b.z>
*** <-1.0, 0.0, 1.0> + 1.0
*** Result: <0.0, 1.0, 2.0>
*** Action: <a.x, a.y, a.z> + b == <a.x + b, a.y + b, a.z + b>
Note: All elements are floats, if any are written as integers they will be cast to floats automatically
}}void-box:
{{void-box
|title=Rotation
|content=
* Operation: unknown!
Note: This operator is rarely used with this type as it is not a meaningful way of combining [[quaternion]]s being used to represent [[rotation]]s. Use Multiplication instead.
}}void-box:
{{void-box
|title=String
|content=
* Operation: Concatenation (adds to the end of)
** Example:
*** "abc" + "def"
*** Result = "abcdef"
Note: While [[Key]]s are a specialized type of [[String]] They cannot be directly used with this operator.
}}void-box:
{{void-box
|title=List
|content=
* Operation: Concatenation (adds to the end of)
** Example:
** [0, 0.0, <0.0, 0.0, 0.0>, ""] + [1, 1.0, <1.0, 1.0, 1.0>, "xyz"]
*** Result: [0, 0.0, <0.0, 0.0, 0.0>, "", 1, 1.0, <1.0, 1.0, 1.0>, "xyz"]
*** list + value = [contents_of_list, value]
Note: If the type of the variable or value being added to a list is not a list it will be cast to a list automatically
}}void-box:
{{void-box
|title=Notes
|content=
* needs link for article about min/max integer/float values
* needs link for article about max string and list lengths
* '''It'd be helpful if someone wrote a template for this page so that it might be abstracted to other operators after layout is finalized'''
** this is only a sample layout, feel free to suggest other layouts.
** ''I'll write one when I have some time'' -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]{{!}}[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 22:49, 24 January 2010 (UTC)
}}Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.