<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.secondlife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Omei+Turnbull</id>
	<title>Second Life Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.secondlife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Omei+Turnbull"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/wiki/Special:Contributions/Omei_Turnbull"/>
	<updated>2026-07-14T01:24:01Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Sculpted_Prims_with_Wings_3D&amp;diff=1141812</id>
		<title>Sculpted Prims with Wings 3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Sculpted_Prims_with_Wings_3D&amp;diff=1141812"/>
		<updated>2011-04-27T16:00:47Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: /* Troubleshooting Tips */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Help|Object=*}}&lt;br /&gt;
[[Image:Pillow snap.jpg|thumb|250 px||A one prim pillow scultped in Wings 3D]]&lt;br /&gt;
If you came here because you want to use Wings 3D to create sculpties, you came to the right place.  If you want to still review all your options, look at the [[Sculpted Prims: Creator&#039;s Guide]] and return here later.&lt;br /&gt;
&lt;br /&gt;
The pillow to the right is one prim.  That is the whole point of a sculpty.  You can make a highly irregular shape from only one prim.  (This picture is from Wings, so the sculpty is not painted yet.)&lt;br /&gt;
&lt;br /&gt;
You can also make things like staircases or vases, using many fewer prims than is usual.  There are examples in your Inventory/Library, and other examples [[Sculpted Prims: Sculpt Maps and Textures|here]].&lt;br /&gt;
&lt;br /&gt;
Wings 3D is an open source 3D modeler with an active user community outside of Second Life.  See the many demos and tutorials at [http://www.youtube.com YouTube].  Wings can be used to create complex 3D models, and a plug-in is available to export the model as a [[Sculpted_Prims:_Sculpt_Maps_and_Textures | sculpt map]] compatible with Second Life. It can also be used to help with the painting of the object (UV mapping).&lt;br /&gt;
 &lt;br /&gt;
When making a sculpty in Wings, you can not use some of the built in features.  In particular, you should not &#039;&#039;&#039;add or delete&#039;&#039;&#039; vertexes, edges, or faces as you create your model.  As described below, you start with a 32x31 sphere (or smaller), and model by deforming and painting it.&lt;br /&gt;
The &#039;&#039;normal&#039;&#039; use of Wings involves adding more and more polygons where you need them to modify the overall shape.  You will see this in the various Wings 3D tutorials on the web.&lt;br /&gt;
However, Second Life sculpties require a very specific set of polygons.  Don&#039;t add or delete as you go along.&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
*Obtain the current Wings 3D release from http://sourceforge.net/projects/wings/files/wings/. Any version between from 1.2 onward should work, but you might as well use the most recent stable release. &lt;br /&gt;
*Obtain the [[Wings 3D Exporter|Wings sculpty plug-in and templates]] from &lt;br /&gt;
** [http://pkpounceworks.com/2010/08/01/wings-3d-plugin-files/ Importer/exporter plug-in and .wings templates].&lt;br /&gt;
** [http://pkpounceworks.com/2010/08/01/wings-3d-plugin-files/ Non-sphere Templates]:  cylinder, torus, and plane&lt;br /&gt;
*Install the plug-in with the Wings&#039; &amp;quot;File/Install Plug-in&amp;quot; command.&lt;br /&gt;
*Exit and restart Wings.&lt;br /&gt;
*Take some time to become familiar with Wings, perhaps following one of the tutorials at YouTube or at the Wings site.&lt;br /&gt;
*Look at the [[#Tutorials|tutorials]]!&lt;br /&gt;
&lt;br /&gt;
===Basic sculpty creation in Wings===&lt;br /&gt;
# Start Wings.  turn on the &#039;&#039;advanced&#039;&#039; menu options.  There are several things there you will want to use.&lt;br /&gt;
# Start with one of the standard Second Life Wings templates (sphere, cylinder, torus) available on the forums, or create one from scratch.  To create one from scratch, create a sphere.  It should be 8x7, 16x15, 32x31, or 64x63.  32x31 is a good size.  &lt;br /&gt;
# The object you start with will contain the exact final set of polygons you must maintain.  If you add or delete vertexes, your object will appear freaked out in Second Life.  (Look for the preset model of cylinder and torus, too.)&lt;br /&gt;
# Shape your object.  Think of it as a lump of clay, and push and pull it into shape without tearing it.  Always keep an eye on the message bar at the bottom of the window.  It will tell you what tool you are using, and will also tell you ways you can modify the tools behavior.&lt;br /&gt;
#The basic technique is to &#039;&#039;Select&#039;&#039; some vertices, edges, or faces, and then to transform them in various ways.   &lt;br /&gt;
##Selection: there are numerous tools for selecting sets of vertexes, edges, and faces.  At the top of the window, you can select different modes, such as Vertex or Face.  Then click on or surround the parts you want to work on.&lt;br /&gt;
##It is useful to grow or shrink the selection itself (using + or -), then transform, then grow or shrink a little more, then transform,, and so on.&lt;br /&gt;
## Right-click on the window and you can choose Move, Scale, Rotate, and several other transformations.  Only the selected items will be affected.&lt;br /&gt;
##Tweaking:  In &#039;&#039;tweak&#039;&#039; mode, you can grab one vertex, edge, or face and move it around.  This is best combined with &#039;&#039;magnetism&#039;&#039;, which causes  nearby polygons to also move along with it.  The strength of the magnetic field can be adjusted.  A weak (blue) field moves the closest neighbors, while a stronger field moves ones that are farther away.  Tweaking is like pushing and pulling on the sphere as if it were a lump of clay.&lt;br /&gt;
##Magnetism:  If you turn on magnetism, then transformations smoothly spill over onto nearby vertices.  See DanielFox&#039;s excellent video [[#Tutorials|tutorials]] for examples.&lt;br /&gt;
## There are tools for bending, inflating, deflating, and so on.  Browse the menues.&lt;br /&gt;
## Another useful trick is &#039;&#039;tighten&#039;&#039;.  Select a large number of edges, and tighten them.  Wings will readjust them so that they are all more equal in length, without distorting the model. This makes the sculpty smoother.  &lt;br /&gt;
## Remember, you should not use operations that change the number of vertices or the edges between them.&lt;br /&gt;
# Save the 3D model.  This will be called a .wings file.  YOu can of course open it again later to work on it.&lt;br /&gt;
# Choose Menu&amp;gt;File&amp;gt;Export.  You should see the Second Life plug-in, &#039;&#039;export&#039;&#039; the sculpt map.  A .bmp file will be created. See [[Wings 3D Exporter]] for details.  If you have the standard Second Life templates, you might also have a UV-map (the paint job on the scultpy.&lt;br /&gt;
# Upload the .bmp file to Second Life, and apply it to a sculpted prim.  If it is not a sphere topology, yuo will need a script to set the type.&lt;br /&gt;
# Optionally,  [[UV maps in Wings3D|  paint the sculpty]].   &lt;br /&gt;
# Upload the paint job, and apply it to the sculpty. &lt;br /&gt;
&lt;br /&gt;
(See this [http://forums.secondlife.com/showthread.php?t=188429&amp;amp;highlight=wings thread] about UV mapping in Wings for more details.&lt;br /&gt;
&lt;br /&gt;
A lot of useful commands have quick keyboard shortcuts:&lt;br /&gt;
:* &#039;&#039;x, y, z&#039;&#039; - Look down the x, y, or z axis&lt;br /&gt;
:* &#039;&#039;v, e, f, b&#039;&#039; - enter vertex, edge, face, and object selection mode&lt;br /&gt;
:* &#039;&#039;o&#039;&#039; - toggle orthographic view&lt;br /&gt;
:* &#039;&#039;r&#039;&#039; - reset view&lt;br /&gt;
:* &#039;&#039;a&#039;&#039; - aim camera at current selection&lt;br /&gt;
:* &#039;&#039;space&#039;&#039; - deselect current selection&lt;br /&gt;
&lt;br /&gt;
Also go to Edit, Preferences, Advanced, and make sure Advanced Menus is checked.&lt;br /&gt;
&lt;br /&gt;
===Allowable Editing Commands===&lt;br /&gt;
If you are going to export your model as a sculpty, you &amp;lt;b&amp;gt;can&#039;t&amp;lt;/b&amp;gt; use those Wings commands that add or delete vertices.  These are the editing commands that you &amp;lt;b&amp;gt;can&amp;lt;/b&amp;gt; use.&lt;br /&gt;
&lt;br /&gt;
Vertex mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flatten&lt;br /&gt;
* Tighten&lt;br /&gt;
* Deform&lt;br /&gt;
* Bend (all varieties)&lt;br /&gt;
* Shift&lt;br /&gt;
&lt;br /&gt;
Edge mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Slide&lt;br /&gt;
* Absolute&lt;br /&gt;
* Intersect&lt;br /&gt;
&lt;br /&gt;
Face mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flatten&lt;br /&gt;
&lt;br /&gt;
Object Mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flip&lt;br /&gt;
* Invert&lt;br /&gt;
&lt;br /&gt;
Tools (not a mode like the above four)&lt;br /&gt;
* Align&lt;br /&gt;
* Center&lt;br /&gt;
* Bounding Box (all varieties)&lt;br /&gt;
* Tweak&lt;br /&gt;
&lt;br /&gt;
===Some relevant features of Wings===&lt;br /&gt;
*In Second Life, alt-mouse is used to zoom around and rotate the camera view.  In Wings, there are several different ways to accomplish the same thing.  Preferences can be used to make Wings emulate several other 3D modeling packages.  Maybe someone will make Wings emulate the Second Life viewer, or better yet, will add similar options to the viewer so that it can be made to emulate Wings, Maya, or Blender.&lt;br /&gt;
* The x, y, z coordinates in Wings are not aligned with Second Life coordinates.&lt;br /&gt;
* The default sphere in Wings will make a small object in Second Life.&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting Tips===&lt;br /&gt;
Just a few things account for almost all problems you are likely to encounter.&lt;br /&gt;
* &amp;lt;b&amp;gt;The Sculpty option doesn&#039;t appear in the File/Export command.&amp;lt;/b&amp;gt; If the version of Wings you are using is greater than 1.1, the original plug-in files won&#039;t work.  You&#039;ll need to use updated plugin files available at http://pkpounceworks.com/2010/08/01/wings-3d-plugin-files/. &lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;quot;Unsupported Mesh Size&amp;quot; message when you export.&amp;lt;/b&amp;gt; You probably overlooked the restrictions on the use of Wings commands.  Start with one of the templates supplied with the exporter, and don&#039;t use Wings commands that change the number of vertices.  The other possibility is that you imported a sculpty bitmap with an unsupported size.  The importer will allow you to do that without any warning, but the exporter won&#039;t be able to handle it.  &#039;&#039;&#039;This is most likely to occur if you import a 128x128 bitmap, which the exporter does not know how to export.&#039;&#039;&#039;  (The exporter can create a 128x128 bitmap from a lower resolution model, but that option exists only as a workaround for historical problems with compression artifacts.)&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
These tutorials deal specifically with creating sculpties in Wings 3D.  There are other tutorials for Wings 3D, but they may use techniques that will prevent the exporter from creating the sculpt map.&lt;br /&gt;
====Web====&lt;br /&gt;
* Natalia Zelmanov&#039;s blog:  These are all very good, with detailed advice for beginner and intermediate.&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/sculpted-prims-sculpties-second-life.html Part 1], &lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-265-sculpted-prims-tutorial-part-2.html Part 2].&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-272-day-265-sculpted-prims-tutorial.html Wings in conjunction with Rokuro].&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-279-sculpted-prims-tutorial-part-4.html Texturing with Wings].&lt;br /&gt;
* By Nibb&lt;br /&gt;
** [http://forums.jeuxonline.info/showthread.php?t=794652  Apprenons à faire des prims sculptés avec Wings 3D] (Learning to make sculpties with Wings 3D).&lt;br /&gt;
====Video====&lt;br /&gt;
* [http://www.youtube.com/v/lzgb2BrOjbw Wings 3D sculpty creation and importing] by [[Paulee Perenti]].&lt;br /&gt;
* [http://www.virtualworldsvideo.com/item/NTVVMRR42L0TX9KF Wings 3D sculpty texturing] and [http://secondlifevideo.com/item/HNYYCHTVKKL746G2 Sculpt a Heart] by [[Ty Gould]].  Note that the texturing video was made before the plug-in created UV maps automatically. So when watching it, you can skip over the first five minutes, where Ty shows how to get and attach an appropriate UV map. Start paying attention when he opens the Outline window and makes the bitmap External.&lt;br /&gt;
* DanielFox Abernathy&#039;s series of tutorials.  &lt;br /&gt;
*# [http://video.google.com/videoplay?docid=5695483392055008122 Staircase]: How to shape and bend objects in Wings, DanielFox makes a beautiful curved set of steps using only two prims.&lt;br /&gt;
*# [http://video.google.com/videoplay?docid=-965279131856302227 Revolutions]: Like Rokuro, you can make a prim that looks like it came off the lathe.  Unlike Rokuro, you can then bend it, curve it, or otherwise perfect it.&lt;br /&gt;
*# [http://video.google.com/videoplay?docid=-1896380109653226562 Interlocking Rings]:  Learn to make two links of  a chain using only one prim.&lt;br /&gt;
* Gaia Rossini&#039;s step-by-step introduction to setting up and using Wings 3D and the Sculpty Exporter.  Although in Italian, the steps are shown visually, so it can be very helpful even if you don&#039;t understand the Italian narration. [http://www.youtube.com/watch?v=U87UATe3yQw] and [http://www.youtube.com/watch?v=7s9oGYc3eaM]&lt;br /&gt;
&lt;br /&gt;
===Wings 3D References (not specific to sculpties)===&lt;br /&gt;
* [[Wings 3D Exporter]]&lt;br /&gt;
* [http://en.wikibooks.org/wiki/Wings_3D:_User_Manual Wings 3D Manual (Wikibooks, in progress)]&lt;br /&gt;
&lt;br /&gt;
===Other Useful Information===&lt;br /&gt;
* Read through the [http://forums.secondlife.com Second Life Forum] articles about sculpties.  You might learn something.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Sculpted Prims]]&lt;br /&gt;
&lt;br /&gt;
For other info regarding this and other 3d software, check out [[Sculpted Prims: 3d Software Guide]].&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Sculpted_Prims_with_Wings_3D&amp;diff=1134848</id>
		<title>Sculpted Prims with Wings 3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Sculpted_Prims_with_Wings_3D&amp;diff=1134848"/>
		<updated>2011-02-22T03:14:28Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: /* Getting Started */ - updated version compatibility requirement and updated download URLs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Help|Object=*}}&lt;br /&gt;
[[Image:Pillow snap.jpg|thumb|250 px||A one prim pillow scultped in Wings 3D]]&lt;br /&gt;
If you came here because you want to use Wings 3D to create sculpties, you came to the right place.  If you want to still review all your options, look at the [[Sculpted Prims: Creator&#039;s Guide]] and return here later.&lt;br /&gt;
&lt;br /&gt;
The pillow to the right is one prim.  That is the whole point of a sculpty.  You can make a highly irregular shape from only one prim.  (This picture is from Wings, so the sculpty is not painted yet.)&lt;br /&gt;
&lt;br /&gt;
You can also make things like staircases or vases, using many fewer prims than is usual.  There are examples in your Inventory/Library, and other examples [[Sculpted Prims: Sculpt Maps and Textures|here]].&lt;br /&gt;
&lt;br /&gt;
Wings 3D is an open source 3D modeler with an active user community outside of Second Life.  See the many demos and tutorials at [http://www.youtube.com YouTube].  Wings can be used to create complex 3D models, and a plug-in is available to export the model as a [[Sculpted_Prims:_Sculpt_Maps_and_Textures | sculpt map]] compatible with Second Life. It can also be used to help with the painting of the object (UV mapping).&lt;br /&gt;
 &lt;br /&gt;
When making a sculpty in Wings, you can not use some of the built in features.  In particular, you should not &#039;&#039;&#039;add or delete&#039;&#039;&#039; vertexes, edges, or faces as you create your model.  As described below, you start with a 32x31 sphere (or smaller), and model by deforming and painting it.&lt;br /&gt;
The &#039;&#039;normal&#039;&#039; use of Wings involves adding more and more polygons where you need them to modify the overall shape.  You will see this in the various Wings 3D tutorials on the web.&lt;br /&gt;
However, Second Life sculpties require a very specific set of polygons.  Don&#039;t add or delete as you go along.&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
*Obtain the current Wings 3D release from http://sourceforge.net/projects/wings/files/wings/. Any version between from 1.2 onward should work, but you might as well use the most recent stable release. &lt;br /&gt;
*Obtain the [[Wings 3D Exporter|Wings sculpty plug-in and templates]] from &lt;br /&gt;
** [http://pkpounceworks.com/2010/08/01/wings-3d-plugin-files/ Importer/exporter plug-in and .wings templates].&lt;br /&gt;
** [http://pkpounceworks.com/2010/08/01/wings-3d-plugin-files/ Non-sphere Templates]:  cylinder, torus, and plane&lt;br /&gt;
*Install the plug-in with the Wings&#039; &amp;quot;File/Install Plug-in&amp;quot; command.&lt;br /&gt;
*Exit and restart Wings.&lt;br /&gt;
*Take some time to become familiar with Wings, perhaps following one of the tutorials at YouTube or at the Wings site.&lt;br /&gt;
*Look at the [[#Tutorials|tutorials]]!&lt;br /&gt;
&lt;br /&gt;
===Basic sculpty creation in Wings===&lt;br /&gt;
# Start Wings.  turn on the &#039;&#039;advanced&#039;&#039; menu options.  There are several things there you will want to use.&lt;br /&gt;
# Start with one of the standard Second Life Wings templates (sphere, cylinder, torus) available on the forums, or create one from scratch.  To create one from scratch, create a sphere.  It should be 8x7, 16x15, 32x31, or 64x63.  32x31 is a good size.  &lt;br /&gt;
# The object you start with will contain the exact final set of polygons you must maintain.  If you add or delete vertexes, your object will appear freaked out in Second Life.  (Look for the preset model of cylinder and torus, too.)&lt;br /&gt;
# Shape your object.  Think of it as a lump of clay, and push and pull it into shape without tearing it.  Always keep an eye on the message bar at the bottom of the window.  It will tell you what tool you are using, and will also tell you ways you can modify the tools behavior.&lt;br /&gt;
#The basic technique is to &#039;&#039;Select&#039;&#039; some vertices, edges, or faces, and then to transform them in various ways.   &lt;br /&gt;
##Selection: there are numerous tools for selecting sets of vertexes, edges, and faces.  At the top of the window, you can select different modes, such as Vertex or Face.  Then click on or surround the parts you want to work on.&lt;br /&gt;
##It is useful to grow or shrink the selection itself (using + or -), then transform, then grow or shrink a little more, then transform,, and so on.&lt;br /&gt;
## Right-click on the window and you can choose Move, Scale, Rotate, and several other transformations.  Only the selected items will be affected.&lt;br /&gt;
##Tweaking:  In &#039;&#039;tweak&#039;&#039; mode, you can grab one vertex, edge, or face and move it around.  This is best combined with &#039;&#039;magnetism&#039;&#039;, which causes  nearby polygons to also move along with it.  The strength of the magnetic field can be adjusted.  A weak (blue) field moves the closest neighbors, while a stronger field moves ones that are farther away.  Tweaking is like pushing and pulling on the sphere as if it were a lump of clay.&lt;br /&gt;
##Magnetism:  If you turn on magnetism, then transformations smoothly spill over onto nearby vertices.  See DanielFox&#039;s excellent video [[#Tutorials|tutorials]] for examples.&lt;br /&gt;
## There are tools for bending, inflating, deflating, and so on.  Browse the menues.&lt;br /&gt;
## Another useful trick is &#039;&#039;tighten&#039;&#039;.  Select a large number of edges, and tighten them.  Wings will readjust them so that they are all more equal in length, without distorting the model. This makes the sculpty smoother.  &lt;br /&gt;
## Remember, you should not use operations that change the number of vertices or the edges between them.&lt;br /&gt;
# Save the 3D model.  This will be called a .wings file.  YOu can of course open it again later to work on it.&lt;br /&gt;
# Choose Menu&amp;gt;File&amp;gt;Export.  You should see the Second Life plug-in, &#039;&#039;export&#039;&#039; the sculpt map.  A .bmp file will be created. See [[Wings 3D Exporter]] for details.  If you have the standard Second Life templates, you might also have a UV-map (the paint job on the scultpy.&lt;br /&gt;
# Upload the .bmp file to Second Life, and apply it to a sculpted prim.  If it is not a sphere topology, yuo will need a script to set the type.&lt;br /&gt;
# Optionally,  [[UV maps in Wings3D|  paint the sculpty]].   &lt;br /&gt;
# Upload the paint job, and apply it to the sculpty. &lt;br /&gt;
&lt;br /&gt;
(See this [http://forums.secondlife.com/showthread.php?t=188429&amp;amp;highlight=wings thread] about UV mapping in Wings for more details.&lt;br /&gt;
&lt;br /&gt;
A lot of useful commands have quick keyboard shortcuts:&lt;br /&gt;
:* &#039;&#039;x, y, z&#039;&#039; - Look down the x, y, or z axis&lt;br /&gt;
:* &#039;&#039;v, e, f, b&#039;&#039; - enter vertex, edge, face, and object selection mode&lt;br /&gt;
:* &#039;&#039;o&#039;&#039; - toggle orthographic view&lt;br /&gt;
:* &#039;&#039;r&#039;&#039; - reset view&lt;br /&gt;
:* &#039;&#039;a&#039;&#039; - aim camera at current selection&lt;br /&gt;
:* &#039;&#039;space&#039;&#039; - deselect current selection&lt;br /&gt;
&lt;br /&gt;
Also go to Edit, Preferences, Advanced, and make sure Advanced Menus is checked.&lt;br /&gt;
&lt;br /&gt;
===Allowable Editing Commands===&lt;br /&gt;
If you are going to export your model as a sculpty, you &amp;lt;b&amp;gt;can&#039;t&amp;lt;/b&amp;gt; use those Wings commands that add or delete vertices.  These are the editing commands that you &amp;lt;b&amp;gt;can&amp;lt;/b&amp;gt; use.&lt;br /&gt;
&lt;br /&gt;
Vertex mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flatten&lt;br /&gt;
* Tighten&lt;br /&gt;
* Deform&lt;br /&gt;
* Bend (all varieties)&lt;br /&gt;
* Shift&lt;br /&gt;
&lt;br /&gt;
Edge mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Slide&lt;br /&gt;
* Absolute&lt;br /&gt;
* Intersect&lt;br /&gt;
&lt;br /&gt;
Face mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flatten&lt;br /&gt;
&lt;br /&gt;
Object Mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flip&lt;br /&gt;
* Invert&lt;br /&gt;
&lt;br /&gt;
Tools (not a mode like the above four)&lt;br /&gt;
* Align&lt;br /&gt;
* Center&lt;br /&gt;
* Bounding Box (all varieties)&lt;br /&gt;
* Tweak&lt;br /&gt;
&lt;br /&gt;
===Some relevant features of Wings===&lt;br /&gt;
*In Second Life, alt-mouse is used to zoom around and rotate the camera view.  In Wings, there are several different ways to accomplish the same thing.  Preferences can be used to make Wings emulate several other 3D modeling packages.  Maybe someone will make Wings emulate the Second Life viewer, or better yet, will add similar options to the viewer so that it can be made to emulate Wings, Maya, or Blender.&lt;br /&gt;
* The x, y, z coordinates in Wings are not aligned with Second Life coordinates.&lt;br /&gt;
* The default sphere in Wings will make a small object in Second Life.&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting Tips===&lt;br /&gt;
Just a few things account for almost all problems you are likely to encounter.&lt;br /&gt;
* &amp;lt;b&amp;gt;The Sculpty option doesn&#039;t appear in the File/Export command.&amp;lt;/b&amp;gt; The plug-in does not work with the current version of Wings. You can get Wings version 1.1, which is the most recent version that does work, from http://sourceforge.net/projects/wings/files/wings/.  If you&#039;ve verified the Wings version, use File/Install Plug-in to install the Sculpty plug-in, exit Wings and try again.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;quot;Unsupported Mesh Size&amp;quot; message when you export.&amp;lt;/b&amp;gt; You probably overlooked the restrictions on the use of Wings commands.  Start with one of the templates supplied with the exporter, and don&#039;t use Wings commands that change the number of vertices.  The other possibility is that you imported a sculpty bitmap with an unsupported size.  The importer will allow you to do that without any warning, but the exporter won&#039;t be able to handle it.  &#039;&#039;&#039;This is most likely to occur if you import a 128x128 bitmap, which the exporter does not know how to export.&#039;&#039;&#039;  (The exporter can create a 128x128 bitmap from a lower resolution model, but that option exists only as a workaround for historical problems with compression artifacts.)&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
These tutorials deal specifically with creating sculpties in Wings 3D.  There are other tutorials for Wings 3D, but they may use techniques that will prevent the exporter from creating the sculpt map.&lt;br /&gt;
====Web====&lt;br /&gt;
* Natalia Zelmanov&#039;s blog:  These are all very good, with detailed advice for beginner and intermediate.&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/sculpted-prims-sculpties-second-life.html Part 1], &lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-265-sculpted-prims-tutorial-part-2.html Part 2].&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-272-day-265-sculpted-prims-tutorial.html Wings in conjunction with Rokuro].&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-279-sculpted-prims-tutorial-part-4.html Texturing with Wings].&lt;br /&gt;
* By Nibb&lt;br /&gt;
** [http://forums.jeuxonline.info/showthread.php?t=794652  Apprenons à faire des prims sculptés avec Wings 3D] (Learning to make sculpties with Wings 3D).&lt;br /&gt;
====Video====&lt;br /&gt;
* [http://www.youtube.com/v/lzgb2BrOjbw Wings 3D sculpty creation and importing] by [[Paulee Perenti]].&lt;br /&gt;
* [http://www.virtualworldsvideo.com/item/NTVVMRR42L0TX9KF Wings 3D sculpty texturing] and [http://secondlifevideo.com/item/HNYYCHTVKKL746G2 Sculpt a Heart] by [[Ty Gould]].  Note that the texturing video was made before the plug-in created UV maps automatically. So when watching it, you can skip over the first five minutes, where Ty shows how to get and attach an appropriate UV map. Start paying attention when he opens the Outline window and makes the bitmap External.&lt;br /&gt;
* DanielFox Abernathy&#039;s series of tutorials.  &lt;br /&gt;
*# [http://video.google.com/videoplay?docid=5695483392055008122 Staircase]: How to shape and bend objects in Wings, DanielFox makes a beautiful curved set of steps using only two prims.&lt;br /&gt;
*# [http://video.google.com/videoplay?docid=-965279131856302227 Revolutions]: Like Rokuro, you can make a prim that looks like it came off the lathe.  Unlike Rokuro, you can then bend it, curve it, or otherwise perfect it.&lt;br /&gt;
*# [http://video.google.com/videoplay?docid=-1896380109653226562 Interlocking Rings]:  Learn to make two links of  a chain using only one prim.&lt;br /&gt;
* Gaia Rossini&#039;s step-by-step introduction to setting up and using Wings 3D and the Sculpty Exporter.  Although in Italian, the steps are shown visually, so it can be very helpful even if you don&#039;t understand the Italian narration. [http://www.youtube.com/watch?v=U87UATe3yQw] and [http://www.youtube.com/watch?v=7s9oGYc3eaM]&lt;br /&gt;
&lt;br /&gt;
===Wings 3D References (not specific to sculpties)===&lt;br /&gt;
* [[Wings 3D Exporter]]&lt;br /&gt;
* [http://en.wikibooks.org/wiki/Wings_3D:_User_Manual Wings 3D Manual (Wikibooks, in progress)]&lt;br /&gt;
&lt;br /&gt;
===Other Useful Information===&lt;br /&gt;
* Read through the [http://forums.secondlife.com Second Life Forum] articles about sculpties.  You might learn something.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Sculpted Prims]]&lt;br /&gt;
&lt;br /&gt;
For other info regarding this and other 3d software, check out [[Sculpted Prims: 3d Software Guide]].&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Sculpted_Prims_with_Wings_3D&amp;diff=1070492</id>
		<title>Sculpted Prims with Wings 3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Sculpted_Prims_with_Wings_3D&amp;diff=1070492"/>
		<updated>2010-10-21T20:40:40Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: /* Troubleshooting Tips */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Help|Object=*}}&lt;br /&gt;
[[Image:Pillow snap.jpg|thumb|250 px||A one prim pillow scultped in Wings 3D]]&lt;br /&gt;
If you came here because you want to use Wings 3D to create sculpties, you came to the right place.  If you want to still review all your options, look at the [[Sculpted Prims: Creator&#039;s Guide]] and return here later.&lt;br /&gt;
&lt;br /&gt;
The pillow to the right is one prim.  That is the whole point of a sculpty.  You can make a highly irregular shape from only one prim.  (This picture is from Wings, so the sculpty is not painted yet.)&lt;br /&gt;
&lt;br /&gt;
You can also make things like staircases or vases, using many fewer prims than is usual.  There are examples in your Inventory/Library, and other examples [[Sculpted Prims: Sculpt Maps and Textures|here]].&lt;br /&gt;
&lt;br /&gt;
Wings 3D is an open source 3D modeler with an active user community outside of Second Life.  See the many demos and tutorials at [http://www.youtube.com YouTube].  Wings can be used to create complex 3D models, and a plug-in is available to export the model as a [[Sculpted_Prims:_Sculpt_Maps_and_Textures | sculpt map]] compatible with Second Life. It can also be used to help with the painting of the object (UV mapping).&lt;br /&gt;
 &lt;br /&gt;
When making a sculpty in Wings, you can not use some of the built in features.  In particular, you should not &#039;&#039;&#039;add or delete&#039;&#039;&#039; vertexes, edges, or faces as you create your model.  As described below, you start with a 32x31 sphere (or smaller), and model by deforming and painting it.&lt;br /&gt;
The &#039;&#039;normal&#039;&#039; use of Wings involves adding more and more polygons where you need them to modify the overall shape.  You will see this in the various Wings 3D tutorials on the web.&lt;br /&gt;
However, Second Life sculpties require a very specific set of polygons.  Don&#039;t add or delete as you go along.&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
*Obtain Wings 3D version &amp;lt;b&amp;gt;1.1&amp;lt;/b&amp;gt; from http://sourceforge.net/projects/wings/files/wings/. Any version between 0.98.36a and 1.1 should work.  But there is a problem with version 1.2 (the current &amp;quot;stable&amp;quot; release) that hasn&#039;t been diagnosed yet.&lt;br /&gt;
*Obtain the [[Wings 3D Exporter|Wings sculpty plug-in and templates]] from &lt;br /&gt;
** [http://pkpounceworks.com/index.php?option=com_remository&amp;amp;Itemid=28&amp;amp;func=fileinfo&amp;amp;id=119 PK Pounceworks]: Importer/exporter plug-in and .wings templates.&lt;br /&gt;
** [http://pkpounceworks.com/index.php?option=com_remository&amp;amp;Itemid=28&amp;amp;func=startdown&amp;amp;id=120 Non-sphere Templates]:  cylinder, torus, and plane&lt;br /&gt;
*Install the plug-in with the Wings&#039; &amp;quot;File/Install Plug-in&amp;quot; command.&lt;br /&gt;
*Exit and restart Wings.&lt;br /&gt;
*Take some time to become familiar with Wings, perhaps following one of the tutorials at YouTube or at the Wings site.&lt;br /&gt;
*Look at the [[#Tutorials|tutorials]]!&lt;br /&gt;
&lt;br /&gt;
===Basic sculpty creation in Wings===&lt;br /&gt;
# Start Wings.  turn on the &#039;&#039;advanced&#039;&#039; menu options.  There are several things there you will want to use.&lt;br /&gt;
# Start with one of the standard Second Life Wings templates (sphere, cylinder, torus) available on the forums, or create one from scratch.  To create one from scratch, create a sphere.  It should be 8x7, 16x15, 32x31, or 64x63.  32x31 is a good size.  &lt;br /&gt;
# The object you start with will contain the exact final set of polygons you must maintain.  If you add or delete vertexes, your object will appear freaked out in Second Life.  (Look for the preset model of cylinder and torus, too.)&lt;br /&gt;
# Shape your object.  Think of it as a lump of clay, and push and pull it into shape without tearing it.  Always keep an eye on the message bar at the bottom of the window.  It will tell you what tool you are using, and will also tell you ways you can modify the tools behavior.&lt;br /&gt;
#The basic technique is to &#039;&#039;Select&#039;&#039; some vertices, edges, or faces, and then to transform them in various ways.   &lt;br /&gt;
##Selection: there are numerous tools for selecting sets of vertexes, edges, and faces.  At the top of the window, you can select different modes, such as Vertex or Face.  Then click on or surround the parts you want to work on.&lt;br /&gt;
##It is useful to grow or shrink the selection itself (using + or -), then transform, then grow or shrink a little more, then transform,, and so on.&lt;br /&gt;
## Right-click on the window and you can choose Move, Scale, Rotate, and several other transformations.  Only the selected items will be affected.&lt;br /&gt;
##Tweaking:  In &#039;&#039;tweak&#039;&#039; mode, you can grab one vertex, edge, or face and move it around.  This is best combined with &#039;&#039;magnetism&#039;&#039;, which causes  nearby polygons to also move along with it.  The strength of the magnetic field can be adjusted.  A weak (blue) field moves the closest neighbors, while a stronger field moves ones that are farther away.  Tweaking is like pushing and pulling on the sphere as if it were a lump of clay.&lt;br /&gt;
##Magnetism:  If you turn on magnetism, then transformations smoothly spill over onto nearby vertices.  See DanielFox&#039;s excellent video [[#Tutorials|tutorials]] for examples.&lt;br /&gt;
## There are tools for bending, inflating, deflating, and so on.  Browse the menues.&lt;br /&gt;
## Another useful trick is &#039;&#039;tighten&#039;&#039;.  Select a large number of edges, and tighten them.  Wings will readjust them so that they are all more equal in length, without distorting the model. This makes the sculpty smoother.  &lt;br /&gt;
## Remember, you should not use operations that change the number of vertices or the edges between them.&lt;br /&gt;
# Save the 3D model.  This will be called a .wings file.  YOu can of course open it again later to work on it.&lt;br /&gt;
# Choose Menu&amp;gt;File&amp;gt;Export.  You should see the Second Life plug-in, &#039;&#039;export&#039;&#039; the sculpt map.  A .bmp file will be created. See [[Wings 3D Exporter]] for details.  If you have the standard Second Life templates, you might also have a UV-map (the paint job on the scultpy.&lt;br /&gt;
# Upload the .bmp file to Second Life, and apply it to a sculpted prim.  If it is not a sphere topology, yuo will need a script to set the type.&lt;br /&gt;
# Optionally,  [[UV maps in Wings3D|  paint the sculpty]].   &lt;br /&gt;
# Upload the paint job, and apply it to the sculpty. &lt;br /&gt;
&lt;br /&gt;
(See this [http://forums.secondlife.com/showthread.php?t=188429&amp;amp;highlight=wings thread] about UV mapping in Wings for more details.&lt;br /&gt;
&lt;br /&gt;
A lot of useful commands have quick keyboard shortcuts:&lt;br /&gt;
:* &#039;&#039;x, y, z&#039;&#039; - Look down the x, y, or z axis&lt;br /&gt;
:* &#039;&#039;v, e, f, b&#039;&#039; - enter vertex, edge, face, and object selection mode&lt;br /&gt;
:* &#039;&#039;o&#039;&#039; - toggle orthographic view&lt;br /&gt;
:* &#039;&#039;r&#039;&#039; - reset view&lt;br /&gt;
:* &#039;&#039;a&#039;&#039; - aim camera at current selection&lt;br /&gt;
:* &#039;&#039;space&#039;&#039; - deselect current selection&lt;br /&gt;
&lt;br /&gt;
Also go to Edit, Preferences, Advanced, and make sure Advanced Menus is checked.&lt;br /&gt;
&lt;br /&gt;
===Allowable Editing Commands===&lt;br /&gt;
If you are going to export your model as a sculpty, you &amp;lt;b&amp;gt;can&#039;t&amp;lt;/b&amp;gt; use those Wings commands that add or delete vertices.  These are the editing commands that you &amp;lt;b&amp;gt;can&amp;lt;/b&amp;gt; use.&lt;br /&gt;
&lt;br /&gt;
Vertex mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flatten&lt;br /&gt;
* Tighten&lt;br /&gt;
* Deform&lt;br /&gt;
* Bend (all varieties)&lt;br /&gt;
* Shift&lt;br /&gt;
&lt;br /&gt;
Edge mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Slide&lt;br /&gt;
* Absolute&lt;br /&gt;
* Intersect&lt;br /&gt;
&lt;br /&gt;
Face mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flatten&lt;br /&gt;
&lt;br /&gt;
Object Mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flip&lt;br /&gt;
* Invert&lt;br /&gt;
&lt;br /&gt;
Tools (not a mode like the above four)&lt;br /&gt;
* Align&lt;br /&gt;
* Center&lt;br /&gt;
* Bounding Box (all varieties)&lt;br /&gt;
* Tweak&lt;br /&gt;
&lt;br /&gt;
===Some relevant features of Wings===&lt;br /&gt;
*In Second Life, alt-mouse is used to zoom around and rotate the camera view.  In Wings, there are several different ways to accomplish the same thing.  Preferences can be used to make Wings emulate several other 3D modeling packages.  Maybe someone will make Wings emulate the Second Life viewer, or better yet, will add similar options to the viewer so that it can be made to emulate Wings, Maya, or Blender.&lt;br /&gt;
* The x, y, z coordinates in Wings are not aligned with Second Life coordinates.&lt;br /&gt;
* The default sphere in Wings will make a small object in Second Life.&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting Tips===&lt;br /&gt;
Just a few things account for almost all problems you are likely to encounter.&lt;br /&gt;
* &amp;lt;b&amp;gt;The Sculpty option doesn&#039;t appear in the File/Export command.&amp;lt;/b&amp;gt; The plug-in does not work with the current version of Wings. You can get Wings version 1.1, which is the most recent version that does work, from http://sourceforge.net/projects/wings/files/wings/.  If you&#039;ve verified the Wings version, use File/Install Plug-in to install the Sculpty plug-in, exit Wings and try again.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;quot;Unsupported Mesh Size&amp;quot; message when you export.&amp;lt;/b&amp;gt; You probably overlooked the restrictions on the use of Wings commands.  Start with one of the templates supplied with the exporter, and don&#039;t use Wings commands that change the number of vertices.  The other possibility is that you imported a sculpty bitmap with an unsupported size.  The importer will allow you to do that without any warning, but the exporter won&#039;t be able to handle it.  &#039;&#039;&#039;This is most likely to occur if you import a 128x128 bitmap, which the exporter does not know how to export.&#039;&#039;&#039;  (The exporter can create a 128x128 bitmap from a lower resolution model, but that option exists only as a workaround for historical problems with compression artifacts.)&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
These tutorials deal specifically with creating sculpties in Wings 3D.  There are other tutorials for Wings 3D, but they may use techniques that will prevent the exporter from creating the sculpt map.&lt;br /&gt;
====Web====&lt;br /&gt;
* Natalia Zelmanov&#039;s blog:  These are all very good, with detailed advice for beginner and intermediate.&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/sculpted-prims-sculpties-second-life.html Part 1], &lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-265-sculpted-prims-tutorial-part-2.html Part 2].&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-272-day-265-sculpted-prims-tutorial.html Wings in conjunction with Rokuro].&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-279-sculpted-prims-tutorial-part-4.html Texturing with Wings].&lt;br /&gt;
* By Nibb&lt;br /&gt;
** [http://forums.jeuxonline.info/showthread.php?t=794652  Apprenons à faire des prims sculptés avec Wings 3D] (Learning to make sculpties with Wings 3D).&lt;br /&gt;
====Video====&lt;br /&gt;
* [http://www.youtube.com/v/lzgb2BrOjbw Wings 3D sculpty creation and importing] by [[Paulee Perenti]].&lt;br /&gt;
* [http://www.virtualworldsvideo.com/item/NTVVMRR42L0TX9KF Wings 3D sculpty texturing] and [http://secondlifevideo.com/item/HNYYCHTVKKL746G2 Sculpt a Heart] by [[Ty Gould]].  Note that the texturing video was made before the plug-in created UV maps automatically. So when watching it, you can skip over the first five minutes, where Ty shows how to get and attach an appropriate UV map. Start paying attention when he opens the Outline window and makes the bitmap External.&lt;br /&gt;
* DanielFox Abernathy&#039;s series of tutorials.  &lt;br /&gt;
*# [http://video.google.com/videoplay?docid=5695483392055008122 Staircase]: How to shape and bend objects in Wings, DanielFox makes a beautiful curved set of steps using only two prims.&lt;br /&gt;
*# [http://video.google.com/videoplay?docid=-965279131856302227 Revolutions]: Like Rokuro, you can make a prim that looks like it came off the lathe.  Unlike Rokuro, you can then bend it, curve it, or otherwise perfect it.&lt;br /&gt;
*# [http://video.google.com/videoplay?docid=-1896380109653226562 Interlocking Rings]:  Learn to make two links of  a chain using only one prim.&lt;br /&gt;
* Gaia Rossini&#039;s step-by-step introduction to setting up and using Wings 3D and the Sculpty Exporter.  Although in Italian, the steps are shown visually, so it can be very helpful even if you don&#039;t understand the Italian narration. [http://www.youtube.com/watch?v=U87UATe3yQw] and [http://www.youtube.com/watch?v=7s9oGYc3eaM]&lt;br /&gt;
&lt;br /&gt;
===Wings 3D References (not specific to sculpties)===&lt;br /&gt;
* [[Wings 3D Exporter]]&lt;br /&gt;
* [http://en.wikibooks.org/wiki/Wings_3D:_User_Manual Wings 3D Manual (Wikibooks, in progress)]&lt;br /&gt;
&lt;br /&gt;
===Other Useful Information===&lt;br /&gt;
* Read through the [http://forums.secondlife.com Second Life Forum] articles about sculpties.  You might learn something.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Sculpted Prims]]&lt;br /&gt;
&lt;br /&gt;
For other info regarding this and other 3d software, check out [[Sculpted Prims: 3d Software Guide]].&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:Sculpted_Prims_with_Wings_3D&amp;diff=945042</id>
		<title>Talk:Sculpted Prims with Wings 3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:Sculpted_Prims_with_Wings_3D&amp;diff=945042"/>
		<updated>2010-06-21T17:21:29Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: /* New NCI Class */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Wings 3D tutorial...&lt;br /&gt;
&lt;br /&gt;
Obviously, it needs a lot more detail.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t talk about it.  Don&#039;t discuss it.  Edit it, grow it, improve it.&lt;br /&gt;
&lt;br /&gt;
== Forum references ==&lt;br /&gt;
&lt;br /&gt;
I&#039;d like to point out that basic account users have no access to the SL-Forums. Any information which requires forum access will only be available to a certain group of users.&lt;br /&gt;
&lt;br /&gt;
Should you wish to make the information available to everyone, extra measures need to be made.--[[User:Vernes Veranes|Vernes Veranes]] 14:13, 23 June 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
Point taken.  Actually, basic accounts do have access to the Wiki. (I know because I have a basic membership.)  But you do have to provide your credit card number, or whatever else they&#039;re requiring right now for identification.&lt;br /&gt;
&lt;br /&gt;
Still, the Wiki is a much better place than the forums for long-term documentation, so I hope all the information migrates here as it becomes stable.  The forums are a better place for identifying and working out issues, which is why new information will always appear there first. --[[User:Omei Turnbull|Omei Turnbull]] 09:49, 25 June 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
== New NCI Class ==&lt;br /&gt;
&lt;br /&gt;
NCI have started an in-world class on using Wings 3D to make sculpties, but I can&#039;t currently recommend it (posted June 2010). Unless there&#039;s been a major change in the exporter, allowing a non-standard mesh to be remapped to a sculpty-valid mesh as part of the export, which hasn&#039;t been documented here, the class is badly misleading.&lt;br /&gt;
&lt;br /&gt;
(This sort of thing might be possible: I think there are in-world tools to make sculpties which match assemblies of ordinary prims. But has it been done?) [[User:WolfBaginski Bearsfoot|WolfBaginski Bearsfoot]] 07:16, 21 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Qarl Linden created sculpties as an easy way to give SL builders more flexibility than they had with traditional SL prims.  They can be seen as a very constrained subset of 3D meshes.  The result is that a general-purpose 3D modeling tool (like Wings 3D, Blender, Maya, 3d Max, etc) can create them, but only if the tool is used in a constrained manner.  There is no (practical) automatated technique for remapping an arbitrary 3D model into a valid sculpty.  Any class teaching how to use a general purpose 3D modeling tool for sculpties needs to cover what capabilities of the tool to use, &amp;lt;b&amp;gt;and not to use,&amp;lt;/B&amp;gt; when creating sculpties.  That&#039;s as true for high-end professional tools such as Maya and Blender as it is for less complex tools like Wings 3D.&lt;br /&gt;
&lt;br /&gt;
A different approach, which various people have taken, is to create new programs specifically for generating sculpties, and only sculpties.  These can be even easier to learn, and very useful for those cases where what you want to build fits well with what the program developer had in mind.  But then when you decide to model a shape that is outside the targeted design space of that program, using that tool may give very poor results, if it is even possible.  &lt;br /&gt;
&lt;br /&gt;
Disclaimer: I wrote the Wings 3D exporter at a time when there were no other good options for most people.  I had to learn Wings 3D in order to do that, and it is the only 3D tool I have ever really used.  So undoubtedly I am biased in favor of it.  But I think it is still one of the two best options (the other being Blender) for someone who actually wants to develop 3D modeling skills while they are making their sculpties.  When making recommendations, keep in mind that once SL supports more general meshes (Real Soon Now), sculpty-specific tools will probably be of little interest any more.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Sculpted_Prims_with_Wings_3D&amp;diff=843222</id>
		<title>Sculpted Prims with Wings 3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Sculpted_Prims_with_Wings_3D&amp;diff=843222"/>
		<updated>2010-04-06T17:27:39Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: Added two video tutorials&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Help|Object=*}}&lt;br /&gt;
[[Image:Pillow snap.jpg|thumb|250 px||A one prim pillow scultped in Wings 3D]]&lt;br /&gt;
If you came here because you want to use Wings 3D to create sculpties, you came to the right place.  If you want to still review all your options, look at the [[Sculpted Prims: Creator&#039;s Guide]] and return here later.&lt;br /&gt;
&lt;br /&gt;
The pillow to the right is one prim.  That is the whole point of a sculpty.  You can make a highly irregular shape from only one prim.  (This picture is from Wings, so the sculpty is not painted yet.)&lt;br /&gt;
&lt;br /&gt;
You can also make things like staircases or vases, using many fewer prims than is usual.  There are examples in your Inventory/Library, and other examples [[Sculpted Prims: Sculpt Maps and Textures|here]].&lt;br /&gt;
&lt;br /&gt;
Wings 3D is an open source 3D modeler with an active user community outside of Second Life.  See the many demos and tutorials at [http://www.youtube.com YouTube].  Wings can be used to create complex 3D models, and a plug-in is available to export the model as a [[Sculpted_Prims:_Sculpt_Maps_and_Textures | sculpt map]] compatible with Second Life. It can also be used to help with the painting of the object (UV mapping).&lt;br /&gt;
 &lt;br /&gt;
When making a sculpty in Wings, you can not use some of the built in features.  In particular, you should not &#039;&#039;&#039;add or delete&#039;&#039;&#039; vertexes, edges, or faces as you create your model.  As described below, you start with a 32x31 sphere (or smaller), and model by deforming and painting it.&lt;br /&gt;
The &#039;&#039;normal&#039;&#039; use of Wings involves adding more and more polygons where you need them to modify the overall shape.  You will see this in the various Wings 3D tutorials on the web.&lt;br /&gt;
However, Second Life sculpties require a very specific set of polygons.  Don&#039;t add or delete as you go along.&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
*Obtain Wings 3D version &amp;lt;b&amp;gt;1.1&amp;lt;/b&amp;gt; from http://sourceforge.net/projects/wings/files/wings/. Any version between 0.98.36a and 1.1 should work.  But there is a problem with version 1.2 (the current &amp;quot;stable&amp;quot; release) that hasn&#039;t been diagnosed yet.&lt;br /&gt;
*Obtain the [[Wings 3D Exporter|Wings sculpty plug-in and templates]] from &lt;br /&gt;
** [http://pkpounceworks.com/index.php?option=com_remository&amp;amp;Itemid=28&amp;amp;func=fileinfo&amp;amp;id=119 PK Pounceworks]: Importer/exporter plug-in and .wings templates.&lt;br /&gt;
** [http://pkpounceworks.com/index.php?option=com_remository&amp;amp;Itemid=28&amp;amp;func=startdown&amp;amp;id=120 Non-sphere Templates]:  cylinder, torus, and plane&lt;br /&gt;
*Install the plug-in with the Wings&#039; &amp;quot;File/Install Plug-in&amp;quot; command.&lt;br /&gt;
*Exit and restart Wings.&lt;br /&gt;
*Take some time to become familiar with Wings, perhaps following one of the tutorials at YouTube or at the Wings site.&lt;br /&gt;
*Look at the [[#Tutorials|tutorials]]!&lt;br /&gt;
&lt;br /&gt;
===Basic sculpty creation in Wings===&lt;br /&gt;
# Start Wings.  turn on the &#039;&#039;advanced&#039;&#039; menu options.  There are several things there you will want to use.&lt;br /&gt;
# Start with one of the standard Second Life Wings templates (sphere, cylinder, torus) available on the forums, or create one from scratch.  To create one from scratch, create a sphere.  It should be 8x7, 16x15, 32x31, or 64x63.  32x31 is a good size.  &lt;br /&gt;
# The object you start with will contain the exact final set of polygons you must maintain.  If you add or delete vertexes, your object will appear freaked out in Second Life.  (Look for the preset model of cylinder and torus, too.)&lt;br /&gt;
# Shape your object.  Think of it as a lump of clay, and push and pull it into shape without tearing it.  Always keep an eye on the message bar at the bottom of the window.  It will tell you what tool you are using, and will also tell you ways you can modify the tools behavior.&lt;br /&gt;
#The basic technique is to &#039;&#039;Select&#039;&#039; some vertices, edges, or faces, and then to transform them in various ways.   &lt;br /&gt;
##Selection: there are numerous tools for selecting sets of vertexes, edges, and faces.  At the top of the window, you can select different modes, such as Vertex or Face.  Then click on or surround the parts you want to work on.&lt;br /&gt;
##It is useful to grow or shrink the selection itself (using + or -), then transform, then grow or shrink a little more, then transform,, and so on.&lt;br /&gt;
## Right-click on the window and you can choose Move, Scale, Rotate, and several other transformations.  Only the selected items will be affected.&lt;br /&gt;
##Tweaking:  In &#039;&#039;tweak&#039;&#039; mode, you can grab one vertex, edge, or face and move it around.  This is best combined with &#039;&#039;magnetism&#039;&#039;, which causes  nearby polygons to also move along with it.  The strength of the magnetic field can be adjusted.  A weak (blue) field moves the closest neighbors, while a stronger field moves ones that are farther away.  Tweaking is like pushing and pulling on the sphere as if it were a lump of clay.&lt;br /&gt;
##Magnetism:  If you turn on magnetism, then transformations smoothly spill over onto nearby vertices.  See DanielFox&#039;s excellent video [[#Tutorials|tutorials]] for examples.&lt;br /&gt;
## There are tools for bending, inflating, deflating, and so on.  Browse the menues.&lt;br /&gt;
## Another useful trick is &#039;&#039;tighten&#039;&#039;.  Select a large number of edges, and tighten them.  Wings will readjust them so that they are all more equal in length, without distorting the model. This makes the sculpty smoother.  &lt;br /&gt;
## Remember, you should not use operations that change the number of vertices or the edges between them.&lt;br /&gt;
# Save the 3D model.  This will be called a .wings file.  YOu can of course open it again later to work on it.&lt;br /&gt;
# Choose Menu&amp;gt;File&amp;gt;Export.  You should see the Second Life plug-in, &#039;&#039;export&#039;&#039; the sculpt map.  A .bmp file will be created. See [[Wings 3D Exporter]] for details.  If you have the standard Second Life templates, you might also have a UV-map (the paint job on the scultpy.&lt;br /&gt;
# Upload the .bmp file to Second Life, and apply it to a sculpted prim.  If it is not a sphere topology, yuo will need a script to set the type.&lt;br /&gt;
# Optionally,  [[UV maps in Wings3D|  paint the sculpty]].   &lt;br /&gt;
# Upload the paint job, and apply it to the sculpty. &lt;br /&gt;
&lt;br /&gt;
(See this [http://forums.secondlife.com/showthread.php?t=188429&amp;amp;highlight=wings thread] about UV mapping in Wings for more details.&lt;br /&gt;
&lt;br /&gt;
A lot of useful commands have quick keyboard shortcuts:&lt;br /&gt;
:* &#039;&#039;x, y, z&#039;&#039; - Look down the x, y, or z axis&lt;br /&gt;
:* &#039;&#039;v, e, f, b&#039;&#039; - enter vertex, edge, face, and object selection mode&lt;br /&gt;
:* &#039;&#039;o&#039;&#039; - toggle orthographic view&lt;br /&gt;
:* &#039;&#039;r&#039;&#039; - reset view&lt;br /&gt;
:* &#039;&#039;a&#039;&#039; - aim camera at current selection&lt;br /&gt;
:* &#039;&#039;space&#039;&#039; - deselect current selection&lt;br /&gt;
&lt;br /&gt;
Also go to Edit, Preferences, Advanced, and make sure Advanced Menus is checked.&lt;br /&gt;
&lt;br /&gt;
===Allowable Editing Commands===&lt;br /&gt;
If you are going to export your model as a sculpty, you &amp;lt;b&amp;gt;can&#039;t&amp;lt;/b&amp;gt; use those Wings commands that add or delete vertices.  These are the editing commands that you &amp;lt;b&amp;gt;can&amp;lt;/b&amp;gt; use.&lt;br /&gt;
&lt;br /&gt;
Vertex mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flatten&lt;br /&gt;
* Tighten&lt;br /&gt;
* Deform&lt;br /&gt;
* Bend (all varieties)&lt;br /&gt;
* Shift&lt;br /&gt;
&lt;br /&gt;
Edge mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Slide&lt;br /&gt;
* Absolute&lt;br /&gt;
* Intersect&lt;br /&gt;
&lt;br /&gt;
Face mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flatten&lt;br /&gt;
&lt;br /&gt;
Object Mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flip&lt;br /&gt;
* Invert&lt;br /&gt;
&lt;br /&gt;
Tools (not a mode like the above four)&lt;br /&gt;
* Align&lt;br /&gt;
* Center&lt;br /&gt;
* Bounding Box (all varieties)&lt;br /&gt;
* Tweak&lt;br /&gt;
&lt;br /&gt;
===Some relevant features of Wings===&lt;br /&gt;
*In Second Life, alt-mouse is used to zoom around and rotate the camera view.  In Wings, there are several different ways to accomplish the same thing.  Preferences can be used to make Wings emulate several other 3D modeling packages.  Maybe someone will make Wings emulate the Second Life viewer, or better yet, will add similar options to the viewer so that it can be made to emulate Wings, Maya, or Blender.&lt;br /&gt;
* The x, y, z coordinates in Wings are not aligned with Second Life coordinates.&lt;br /&gt;
* The default sphere in Wings will make a small object in Second Life.&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting Tips===&lt;br /&gt;
Just a few things account for almost all problems you are likely to encounter.&lt;br /&gt;
* &amp;lt;b&amp;gt;The Sculpty option doesn&#039;t appear in the File/Export command.&amp;lt;/b&amp;gt; Use File/Install Plug-in to install the Sculpty plug-in, exit Wings and try again.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;quot;Unsupported Mesh Size&amp;quot; message when you export.&amp;lt;/b&amp;gt; You probably overlooked the restrictions on the use of Wings commands.  Start with one of the templates supplied with the exporter, and don&#039;t use Wings commands that change the number of vertices.  The other possibility is that you imported a sculpty bitmap with an unsupported size.  The importer will allow you to do that without any warning, but the exporter won&#039;t be able to handle it.  &#039;&#039;&#039;This is most likely to occur if you import a 128x128 bitmap, which the exporter does not know how to export.&#039;&#039;&#039;  (The exporter can create a 128x128 bitmap from a lower resolution model, but that option exists only as a workaround for historical problems with compression artifacts.)&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
These tutorials deal specifically with creating sculpties in Wings 3D.  There are other tutorials for Wings 3D, but they may use techniques that will prevent the exporter from creating the sculpt map.&lt;br /&gt;
====Web====&lt;br /&gt;
* Natalia Zelmanov&#039;s blog:  These are all very good, with detailed advice for beginner and intermediate.&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/sculpted-prims-sculpties-second-life.html Part 1], &lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-265-sculpted-prims-tutorial-part-2.html Part 2].&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-272-day-265-sculpted-prims-tutorial.html Wings in conjunction with Rokuro].&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-279-sculpted-prims-tutorial-part-4.html Texturing with Wings].&lt;br /&gt;
* By Nibb&lt;br /&gt;
** [http://forums.jeuxonline.info/showthread.php?t=794652  Apprenons à faire des prims sculptés avec Wings 3D] (Learning to make sculpties with Wings 3D).&lt;br /&gt;
====Video====&lt;br /&gt;
* [http://www.youtube.com/v/lzgb2BrOjbw Wings 3D sculpty creation and importing] by [[Paulee Perenti]].&lt;br /&gt;
* [http://www.virtualworldsvideo.com/item/NTVVMRR42L0TX9KF Wings 3D sculpty texturing] and [http://secondlifevideo.com/item/HNYYCHTVKKL746G2 Sculpt a Heart] by [[Ty Gould]].  Note that the texturing video was made before the plug-in created UV maps automatically. So when watching it, you can skip over the first five minutes, where Ty shows how to get and attach an appropriate UV map. Start paying attention when he opens the Outline window and makes the bitmap External.&lt;br /&gt;
* DanielFox Abernathy&#039;s series of tutorials.  &lt;br /&gt;
*# [http://video.google.com/videoplay?docid=5695483392055008122 Staircase]: How to shape and bend objects in Wings, DanielFox makes a beautiful curved set of steps using only two prims.&lt;br /&gt;
*# [http://video.google.com/videoplay?docid=-965279131856302227 Revolutions]: Like Rokuro, you can make a prim that looks like it came off the lathe.  Unlike Rokuro, you can then bend it, curve it, or otherwise perfect it.&lt;br /&gt;
*# [http://video.google.com/videoplay?docid=-1896380109653226562 Interlocking Rings]:  Learn to make two links of  a chain using only one prim.&lt;br /&gt;
* Gaia Rossini&#039;s step-by-step introduction to setting up and using Wings 3D and the Sculpty Exporter.  Although in Italian, the steps are shown visually, so it can be very helpful even if you don&#039;t understand the Italian narration. [http://www.youtube.com/watch?v=U87UATe3yQw] and [http://www.youtube.com/watch?v=7s9oGYc3eaM]&lt;br /&gt;
&lt;br /&gt;
===Wings 3D References (not specific to sculpties)===&lt;br /&gt;
* [[Wings 3D Exporter]]&lt;br /&gt;
* [http://en.wikibooks.org/wiki/Wings_3D:_User_Manual Wings 3D Manual (Wikibooks, in progress)]&lt;br /&gt;
&lt;br /&gt;
===Other Useful Information===&lt;br /&gt;
* Read through the [http://forums.secondlife.com Second Life Forum] articles about sculpties.  You might learn something.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Sculpted Prims]]&lt;br /&gt;
&lt;br /&gt;
For other info regarding this and other 3d software, check out [[Sculpted Prims: 3d Software Guide]].&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Sculpted_Prims_with_Wings_3D&amp;diff=775863</id>
		<title>Sculpted Prims with Wings 3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Sculpted_Prims_with_Wings_3D&amp;diff=775863"/>
		<updated>2010-02-28T19:34:00Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: /* Getting Started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Help|Object=*}}&lt;br /&gt;
[[Image:Pillow snap.jpg|thumb|250 px||A one prim pillow scultped in Wings 3D]]&lt;br /&gt;
If you came here because you want to use Wings 3D to create sculpties, you came to the right place.  If you want to still review all your options, look at the [[Sculpted Prims: Creator&#039;s Guide]] and return here later.&lt;br /&gt;
&lt;br /&gt;
The pillow to the right is one prim.  That is the whole point of a sculpty.  You can make a highly irregular shape from only one prim.  (This picture is from Wings, so the sculpty is not painted yet.)&lt;br /&gt;
&lt;br /&gt;
You can also make things like staircases or vases, using many fewer prims than is usual.  There are examples in your Inventory/Library, and other examples [[Sculpted Prims: Sculpt Maps and Textures|here]].&lt;br /&gt;
&lt;br /&gt;
Wings 3D is an open source 3D modeler with an active user community outside of Second Life.  See the many demos and tutorials at [http://www.youtube.com YouTube].  Wings can be used to create complex 3D models, and a plug-in is available to export the model as a [[Sculpted_Prims:_Sculpt_Maps_and_Textures | sculpt map]] compatible with Second Life. It can also be used to help with the painting of the object (UV mapping).&lt;br /&gt;
 &lt;br /&gt;
When making a sculpty in Wings, you can not use some of the built in features.  In particular, you should not &#039;&#039;&#039;add or delete&#039;&#039;&#039; vertexes, edges, or faces as you create your model.  As described below, you start with a 32x31 sphere (or smaller), and model by deforming and painting it.&lt;br /&gt;
The &#039;&#039;normal&#039;&#039; use of Wings involves adding more and more polygons where you need them to modify the overall shape.  You will see this in the various Wings 3D tutorials on the web.&lt;br /&gt;
However, Second Life sculpties require a very specific set of polygons.  Don&#039;t add or delete as you go along.&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
*Obtain Wings 3D version &amp;lt;b&amp;gt;1.1&amp;lt;/b&amp;gt; from http://sourceforge.net/projects/wings/files/wings/. Any version between 0.98.36a and 1.1 should work.  But there is a problem with version 1.2 (the current &amp;quot;stable&amp;quot; release) that hasn&#039;t been diagnosed yet.&lt;br /&gt;
*Obtain the [[Wings 3D Exporter|Wings sculpty plug-in and templates]] from &lt;br /&gt;
** [http://pkpounceworks.com/index.php?option=com_remository&amp;amp;Itemid=28&amp;amp;func=fileinfo&amp;amp;id=119 PK Pounceworks]: Importer/exporter plug-in and .wings templates.&lt;br /&gt;
** [http://pkpounceworks.com/index.php?option=com_remository&amp;amp;Itemid=28&amp;amp;func=startdown&amp;amp;id=120 Non-sphere Templates]:  cylinder, torus, and plane&lt;br /&gt;
*Install the plug-in with the Wings&#039; &amp;quot;File/Install Plug-in&amp;quot; command.&lt;br /&gt;
*Exit and restart Wings.&lt;br /&gt;
*Take some time to become familiar with Wings, perhaps following one of the tutorials at YouTube or at the Wings site.&lt;br /&gt;
*Look at the [[#Tutorials|tutorials]]!&lt;br /&gt;
&lt;br /&gt;
===Basic sculpty creation in Wings===&lt;br /&gt;
# Start Wings.  turn on the &#039;&#039;advanced&#039;&#039; menu options.  There are several things there you will want to use.&lt;br /&gt;
# Start with one of the standard Second Life Wings templates (sphere, cylinder, torus) available on the forums, or create one from scratch.  To create one from scratch, create a sphere.  It should be 8x7, 16x15, 32x31, or 64x63.  32x31 is a good size.  &lt;br /&gt;
# The object you start with will contain the exact final set of polygons you must maintain.  If you add or delete vertexes, your object will appear freaked out in Second Life.  (Look for the preset model of cylinder and torus, too.)&lt;br /&gt;
# Shape your object.  Think of it as a lump of clay, and push and pull it into shape without tearing it.  Always keep an eye on the message bar at the bottom of the window.  It will tell you what tool you are using, and will also tell you ways you can modify the tools behavior.&lt;br /&gt;
#The basic technique is to &#039;&#039;Select&#039;&#039; some vertices, edges, or faces, and then to transform them in various ways.   &lt;br /&gt;
##Selection: there are numerous tools for selecting sets of vertexes, edges, and faces.  At the top of the window, you can select different modes, such as Vertex or Face.  Then click on or surround the parts you want to work on.&lt;br /&gt;
##It is useful to grow or shrink the selection itself (using + or -), then transform, then grow or shrink a little more, then transform,, and so on.&lt;br /&gt;
## Right-click on the window and you can choose Move, Scale, Rotate, and several other transformations.  Only the selected items will be affected.&lt;br /&gt;
##Tweaking:  In &#039;&#039;tweak&#039;&#039; mode, you can grab one vertex, edge, or face and move it around.  This is best combined with &#039;&#039;magnetism&#039;&#039;, which causes  nearby polygons to also move along with it.  The strength of the magnetic field can be adjusted.  A weak (blue) field moves the closest neighbors, while a stronger field moves ones that are farther away.  Tweaking is like pushing and pulling on the sphere as if it were a lump of clay.&lt;br /&gt;
##Magnetism:  If you turn on magnetism, then transformations smoothly spill over onto nearby vertices.  See DanielFox&#039;s excellent video [[#Tutorials|tutorials]] for examples.&lt;br /&gt;
## There are tools for bending, inflating, deflating, and so on.  Browse the menues.&lt;br /&gt;
## Another useful trick is &#039;&#039;tighten&#039;&#039;.  Select a large number of edges, and tighten them.  Wings will readjust them so that they are all more equal in length, without distorting the model. This makes the sculpty smoother.  &lt;br /&gt;
## Remember, you should not use operations that change the number of vertices or the edges between them.&lt;br /&gt;
# Save the 3D model.  This will be called a .wings file.  YOu can of course open it again later to work on it.&lt;br /&gt;
# Choose Menu&amp;gt;File&amp;gt;Export.  You should see the Second Life plug-in, &#039;&#039;export&#039;&#039; the sculpt map.  A .bmp file will be created. See [[Wings 3D Exporter]] for details.  If you have the standard Second Life templates, you might also have a UV-map (the paint job on the scultpy.&lt;br /&gt;
# Upload the .bmp file to Second Life, and apply it to a sculpted prim.  If it is not a sphere topology, yuo will need a script to set the type.&lt;br /&gt;
# Optionally,  [[UV maps in Wings3D|  paint the sculpty]].   &lt;br /&gt;
# Upload the paint job, and apply it to the sculpty. &lt;br /&gt;
&lt;br /&gt;
(See this [http://forums.secondlife.com/showthread.php?t=188429&amp;amp;highlight=wings thread] about UV mapping in Wings for more details.&lt;br /&gt;
&lt;br /&gt;
A lot of useful commands have quick keyboard shortcuts:&lt;br /&gt;
:* &#039;&#039;x, y, z&#039;&#039; - Look down the x, y, or z axis&lt;br /&gt;
:* &#039;&#039;v, e, f, b&#039;&#039; - enter vertex, edge, face, and object selection mode&lt;br /&gt;
:* &#039;&#039;o&#039;&#039; - toggle orthographic view&lt;br /&gt;
:* &#039;&#039;r&#039;&#039; - reset view&lt;br /&gt;
:* &#039;&#039;a&#039;&#039; - aim camera at current selection&lt;br /&gt;
:* &#039;&#039;space&#039;&#039; - deselect current selection&lt;br /&gt;
&lt;br /&gt;
Also go to Edit, Preferences, Advanced, and make sure Advanced Menus is checked.&lt;br /&gt;
&lt;br /&gt;
===Allowable Editing Commands===&lt;br /&gt;
If you are going to export your model as a sculpty, you &amp;lt;b&amp;gt;can&#039;t&amp;lt;/b&amp;gt; use those Wings commands that add or delete vertices.  These are the editing commands that you &amp;lt;b&amp;gt;can&amp;lt;/b&amp;gt; use.&lt;br /&gt;
&lt;br /&gt;
Vertex mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flatten&lt;br /&gt;
* Tighten&lt;br /&gt;
* Deform&lt;br /&gt;
* Bend (all varieties)&lt;br /&gt;
* Shift&lt;br /&gt;
&lt;br /&gt;
Edge mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Slide&lt;br /&gt;
* Absolute&lt;br /&gt;
* Intersect&lt;br /&gt;
&lt;br /&gt;
Face mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flatten&lt;br /&gt;
&lt;br /&gt;
Object Mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flip&lt;br /&gt;
* Invert&lt;br /&gt;
&lt;br /&gt;
Tools (not a mode like the above four)&lt;br /&gt;
* Align&lt;br /&gt;
* Center&lt;br /&gt;
* Bounding Box (all varieties)&lt;br /&gt;
* Tweak&lt;br /&gt;
&lt;br /&gt;
===Some relevant features of Wings===&lt;br /&gt;
*In Second Life, alt-mouse is used to zoom around and rotate the camera view.  In Wings, there are several different ways to accomplish the same thing.  Preferences can be used to make Wings emulate several other 3D modeling packages.  Maybe someone will make Wings emulate the Second Life viewer, or better yet, will add similar options to the viewer so that it can be made to emulate Wings, Maya, or Blender.&lt;br /&gt;
* The x, y, z coordinates in Wings are not aligned with Second Life coordinates.&lt;br /&gt;
* The default sphere in Wings will make a small object in Second Life.&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting Tips===&lt;br /&gt;
Just a few things account for almost all problems you are likely to encounter.&lt;br /&gt;
* &amp;lt;b&amp;gt;The Sculpty option doesn&#039;t appear in the File/Export command.&amp;lt;/b&amp;gt; Use File/Install Plug-in to install the Sculpty plug-in, exit Wings and try again.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;quot;Unsupported Mesh Size&amp;quot; message when you export.&amp;lt;/b&amp;gt; You probably overlooked the restrictions on the use of Wings commands.  Start with one of the templates supplied with the exporter, and don&#039;t use Wings commands that change the number of vertices.  The other possibility is that you imported a sculpty bitmap with an unsupported size.  The importer will allow you to do that without any warning, but the exporter won&#039;t be able to handle it.  &#039;&#039;&#039;This is most likely to occur if you import a 128x128 bitmap, which the exporter does not know how to export.&#039;&#039;&#039;  (The exporter can create a 128x128 bitmap from a lower resolution model, but that option exists only as a workaround for historical problems with compression artifacts.)&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
These tutorials deal specifically with creating sculpties in Wings 3D.  There are other tutorials for Wings 3D, but they may use techniques that will prevent the exporter from creating the sculpt map.&lt;br /&gt;
====Web====&lt;br /&gt;
* Natalia Zelmanov&#039;s blog:  These are all very good, with detailed advice for beginner and intermediate.&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/sculpted-prims-sculpties-second-life.html Part 1], &lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-265-sculpted-prims-tutorial-part-2.html Part 2].&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-272-day-265-sculpted-prims-tutorial.html Wings in conjunction with Rokuro].&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-279-sculpted-prims-tutorial-part-4.html Texturing with Wings].&lt;br /&gt;
* By Nibb&lt;br /&gt;
** [http://forums.jeuxonline.info/showthread.php?t=794652  Apprenons à faire des prims sculptés avec Wings 3D] (Learning to make sculpties with Wings 3D).&lt;br /&gt;
====Video====&lt;br /&gt;
* [http://www.youtube.com/v/lzgb2BrOjbw Wings 3D sculpty creation and importing] by [[Paulee Perenti]].&lt;br /&gt;
* [http://www.virtualworldsvideo.com/item/NTVVMRR42L0TX9KF Wings 3D sculpty texturing] and [http://secondlifevideo.com/item/HNYYCHTVKKL746G2 Sculpt a Heart] by [[Ty Gould]].  Note that the texturing video was made before the plug-in created UV maps automatically. So when watching it, you can skip over the first five minutes, where Ty shows how to get and attach an appropriate UV map. Start paying attention when he opens the Outline window and makes the bitmap External.&lt;br /&gt;
* DanielFox Abernathy&#039;s series of tutorials.  &lt;br /&gt;
*# [http://video.google.com/videoplay?docid=5695483392055008122 Staircase]: How to shape and bend objects in Wings, DanielFox makes a beautiful curved set of steps using only two prims.&lt;br /&gt;
*# [http://video.google.com/videoplay?docid=-965279131856302227 Revolutions]: Like Rokuro, you can make a prim that looks like it came off the lathe.  Unlike Rokuro, you can then bend it, curve it, or otherwise perfect it.&lt;br /&gt;
*# [http://video.google.com/videoplay?docid=-1896380109653226562 Interlocking Rings]:  Learn to make two links of  a chain using only one prim.&lt;br /&gt;
&lt;br /&gt;
===Wings 3D References (not specific to sculpties)===&lt;br /&gt;
* [[Wings 3D Exporter]]&lt;br /&gt;
* [http://en.wikibooks.org/wiki/Wings_3D:_User_Manual Wings 3D Manual (Wikibooks, in progress)]&lt;br /&gt;
&lt;br /&gt;
===Other Useful Information===&lt;br /&gt;
* Read through the [http://forums.secondlife.com Second Life Forum] articles about sculpties.  You might learn something.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Sculpted Prims]]&lt;br /&gt;
&lt;br /&gt;
For other info regarding this and other 3d software, check out [[Sculpted Prims: 3d Software Guide]].&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Sculpted_Prims_with_Wings_3D&amp;diff=725883</id>
		<title>Sculpted Prims with Wings 3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Sculpted_Prims_with_Wings_3D&amp;diff=725883"/>
		<updated>2010-02-10T19:42:31Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: /* Troubleshooting Tips */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Help|Object=*}}&lt;br /&gt;
[[Image:Pillow snap.jpg|thumb|250 px||A one prim pillow scultped in Wings 3D]]&lt;br /&gt;
If you came here because you want to use Wings 3D to create sculpties, you came to the right place.  If you want to still review all your options, look at the [[Sculpted Prims: Creator&#039;s Guide]] and return here later.&lt;br /&gt;
&lt;br /&gt;
The pillow to the right is one prim.  That is the whole point of a sculpty.  You can make a highly irregular shape from only one prim.  (This picture is from Wings, so the sculpty is not painted yet.)&lt;br /&gt;
&lt;br /&gt;
You can also make things like staircases or vases, using many fewer prims than is usual.  There are examples in your Inventory/Library, and other examples [[Sculpted Prims: Sculpt Maps and Textures|here]].&lt;br /&gt;
&lt;br /&gt;
Wings 3D is an open source 3D modeler with an active user community outside of Second Life.  See the many demos and tutorials at [http://www.youtube.com YouTube].  Wings can be used to create complex 3D models, and a plug-in is available to export the model as a [[Sculpted_Prims:_Sculpt_Maps_and_Textures | sculpt map]] compatible with Second Life. It can also be used to help with the painting of the object (UV mapping).&lt;br /&gt;
 &lt;br /&gt;
When making a sculpty in Wings, you can not use some of the built in features.  In particular, you should not &#039;&#039;&#039;add or delete&#039;&#039;&#039; vertexes, edges, or faces as you create your model.  As described below, you start with a 32x31 sphere (or smaller), and model by deforming and painting it.&lt;br /&gt;
The &#039;&#039;normal&#039;&#039; use of Wings involves adding more and more polygons where you need them to modify the overall shape.  You will see this in the various Wings 3D tutorials on the web.&lt;br /&gt;
However, Second Life sculpties require a very specific set of polygons.  Don&#039;t add or delete as you go along.&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
*Obtain Wings 3D version &amp;lt;b&amp;gt;0.98.36&amp;lt;/b&amp;gt; or later from the [http://www.wings3d.com Wings 3D site]. Versions 1.0 is recommended, and 1.1 is believed to work, though 1.1 is still experimental. &amp;lt;b&amp;gt;Please note:&amp;lt;/b&amp;gt; The exporter will &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; work if you get version 0.98.32a or earlier&lt;br /&gt;
*Obtain the [[Wings 3D Exporter|Wings sculpty plug-in and templates]] from &lt;br /&gt;
** [http://forums.secondlife.com/showthread.php?t=183764 SL Building Tips forum]: Links to plug-in and templates, plus tons of information.&lt;br /&gt;
** [http://pkpounceworks.com/index.php?option=com_remository&amp;amp;Itemid=28&amp;amp;func=fileinfo&amp;amp;id=119 PK Pounceworks]: Importer/exporter plug-in and .wings templates.&lt;br /&gt;
** [http://pkpounceworks.com/index.php?option=com_remository&amp;amp;Itemid=28&amp;amp;func=startdown&amp;amp;id=120 Non-sphere Templates]:  cylinder, torus, and plane&lt;br /&gt;
*Install the plug-in with the Wings&#039; &amp;quot;File/Install Plug-in&amp;quot; command.&lt;br /&gt;
*Exit and restart Wings.&lt;br /&gt;
*Take some time to become familiar with Wings, perhaps following one of the tutorials at YouTube or at the Wings site.&lt;br /&gt;
*Look at the [[#Tutorials|tutorials]]!&lt;br /&gt;
&lt;br /&gt;
===Basic sculpty creation in Wings===&lt;br /&gt;
# Start Wings.  turn on the &#039;&#039;advanced&#039;&#039; menu options.  There are several things there you will want to use.&lt;br /&gt;
# Start with one of the standard Second Life Wings templates (sphere, cylinder, torus) available on the forums, or create one from scratch.  To create one from scratch, create a sphere.  It should be 8x7, 16x15, 32x31, or 64x63.  32x31 is a good size.  &lt;br /&gt;
# The object you start with will contain the exact final set of polygons you must maintain.  If you add or delete vertexes, your object will appear freaked out in Second Life.  (Look for the preset model of cylinder and torus, too.)&lt;br /&gt;
# Shape your object.  Think of it as a lump of clay, and push and pull it into shape without tearing it.  Always keep an eye on the message bar at the bottom of the window.  It will tell you what tool you are using, and will also tell you ways you can modify the tools behavior.&lt;br /&gt;
#The basic technique is to &#039;&#039;Select&#039;&#039; some vertices, edges, or faces, and then to transform them in various ways.   &lt;br /&gt;
##Selection: there are numerous tools for selecting sets of vertexes, edges, and faces.  At the top of the window, you can select different modes, such as Vertex or Face.  Then click on or surround the parts you want to work on.&lt;br /&gt;
##It is useful to grow or shrink the selection itself (using + or -), then transform, then grow or shrink a little more, then transform,, and so on.&lt;br /&gt;
## Right-click on the window and you can choose Move, Scale, Rotate, and several other transformations.  Only the selected items will be affected.&lt;br /&gt;
##Tweaking:  In &#039;&#039;tweak&#039;&#039; mode, you can grab one vertex, edge, or face and move it around.  This is best combined with &#039;&#039;magnetism&#039;&#039;, which causes  nearby polygons to also move along with it.  The strength of the magnetic field can be adjusted.  A weak (blue) field moves the closest neighbors, while a stronger field moves ones that are farther away.  Tweaking is like pushing and pulling on the sphere as if it were a lump of clay.&lt;br /&gt;
##Magnetism:  If you turn on magnetism, then transformations smoothly spill over onto nearby vertices.  See DanielFox&#039;s excellent video [[#Tutorials|tutorials]] for examples.&lt;br /&gt;
## There are tools for bending, inflating, deflating, and so on.  Browse the menues.&lt;br /&gt;
## Another useful trick is &#039;&#039;tighten&#039;&#039;.  Select a large number of edges, and tighten them.  Wings will readjust them so that they are all more equal in length, without distorting the model. This makes the sculpty smoother.  &lt;br /&gt;
## Remember, you should not use operations that change the number of vertices or the edges between them.&lt;br /&gt;
# Save the 3D model.  This will be called a .wings file.  YOu can of course open it again later to work on it.&lt;br /&gt;
# Choose Menu&amp;gt;File&amp;gt;Export.  You should see the Second Life plug-in, &#039;&#039;export&#039;&#039; the sculpt map.  A .bmp file will be created. See [[Wings 3D Exporter]] for details.  If you have the standard Second Life templates, you might also have a UV-map (the paint job on the scultpy.&lt;br /&gt;
# Upload the .bmp file to Second Life, and apply it to a sculpted prim.  If it is not a sphere topology, yuo will need a script to set the type.&lt;br /&gt;
# Optionally,  [[UV maps in Wings3D|  paint the sculpty]].   &lt;br /&gt;
# Upload the paint job, and apply it to the sculpty. &lt;br /&gt;
&lt;br /&gt;
(See this [http://forums.secondlife.com/showthread.php?t=188429&amp;amp;highlight=wings thread] about UV mapping in Wings for more details.&lt;br /&gt;
&lt;br /&gt;
A lot of useful commands have quick keyboard shortcuts:&lt;br /&gt;
:* &#039;&#039;x, y, z&#039;&#039; - Look down the x, y, or z axis&lt;br /&gt;
:* &#039;&#039;v, e, f, b&#039;&#039; - enter vertex, edge, face, and object selection mode&lt;br /&gt;
:* &#039;&#039;o&#039;&#039; - toggle orthographic view&lt;br /&gt;
:* &#039;&#039;r&#039;&#039; - reset view&lt;br /&gt;
:* &#039;&#039;a&#039;&#039; - aim camera at current selection&lt;br /&gt;
:* &#039;&#039;space&#039;&#039; - deselect current selection&lt;br /&gt;
&lt;br /&gt;
Also go to Edit, Preferences, Advanced, and make sure Advanced Menus is checked.&lt;br /&gt;
&lt;br /&gt;
===Allowable Editing Commands===&lt;br /&gt;
If you are going to export your model as a sculpty, you &amp;lt;b&amp;gt;can&#039;t&amp;lt;/b&amp;gt; use those Wings commands that add or delete vertices.  These are the editing commands that you &amp;lt;b&amp;gt;can&amp;lt;/b&amp;gt; use.&lt;br /&gt;
&lt;br /&gt;
Vertex mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flatten&lt;br /&gt;
* Tighten&lt;br /&gt;
* Deform&lt;br /&gt;
* Bend (all varieties)&lt;br /&gt;
* Shift&lt;br /&gt;
&lt;br /&gt;
Edge mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Slide&lt;br /&gt;
* Absolute&lt;br /&gt;
* Intersect&lt;br /&gt;
&lt;br /&gt;
Face mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flatten&lt;br /&gt;
&lt;br /&gt;
Object Mode&lt;br /&gt;
* Move&lt;br /&gt;
* Rotate&lt;br /&gt;
* Scale (all varieties)&lt;br /&gt;
* Absolute&lt;br /&gt;
* Flip&lt;br /&gt;
* Invert&lt;br /&gt;
&lt;br /&gt;
Tools (not a mode like the above four)&lt;br /&gt;
* Align&lt;br /&gt;
* Center&lt;br /&gt;
* Bounding Box (all varieties)&lt;br /&gt;
* Tweak&lt;br /&gt;
&lt;br /&gt;
===Some relevant features of Wings===&lt;br /&gt;
*In Second Life, alt-mouse is used to zoom around and rotate the camera view.  In Wings, there are several different ways to accomplish the same thing.  Preferences can be used to make Wings emulate several other 3D modeling packages.  Maybe someone will make Wings emulate the Second Life viewer, or better yet, will add similar options to the viewer so that it can be made to emulate Wings, Maya, or Blender.&lt;br /&gt;
* The x, y, z coordinates in Wings are not aligned with Second Life coordinates.&lt;br /&gt;
* The default sphere in Wings will make a small object in Second Life.&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting Tips===&lt;br /&gt;
Just a few things account for almost all problems you are likely to encounter.&lt;br /&gt;
* &amp;lt;b&amp;gt;The Sculpty option doesn&#039;t appear in the File/Export command.&amp;lt;/b&amp;gt; Use File/Install Plug-in to install the Sculpty plug-in, exit Wings and try again.&lt;br /&gt;
* &amp;lt;b&amp;gt;&amp;quot;Unsupported Mesh Size&amp;quot; message when you export.&amp;lt;/b&amp;gt; You probably overlooked the restrictions on the use of Wings commands.  Start with one of the templates supplied with the exporter, and don&#039;t use Wings commands that change the number of vertices.  The other possibility is that you imported a sculpty bitmap with an unsupported size.  The importer will allow you to do that without any warning, but the exporter won&#039;t be able to handle it.  &#039;&#039;&#039;This is most likely to occur if you import a 128x128 bitmap, which the exporter does not know how to export.&#039;&#039;&#039;  (The exporter can create a 128x128 bitmap from a lower resolution model, but that option exists only as a workaround for historical problems with compression artifacts.)&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
These tutorials deal specifically with creating sculpties in Wings 3D.  There are other tutorials for Wings 3D, but they may use techniques that will prevent the exporter from creating the sculpt map.&lt;br /&gt;
====Web====&lt;br /&gt;
* Natalia Zelmanov&#039;s blog:  These are all very good, with detailed advice for beginner and intermediate.&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/sculpted-prims-sculpties-second-life.html Part 1], &lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-265-sculpted-prims-tutorial-part-2.html Part 2].&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-272-day-265-sculpted-prims-tutorial.html Wings in conjunction with Rokuro].&lt;br /&gt;
** [http://slnatalia.blogspot.com/2007/06/day-279-sculpted-prims-tutorial-part-4.html Texturing with Wings].&lt;br /&gt;
* By Nibb&lt;br /&gt;
** [http://forums.jeuxonline.info/showthread.php?t=794652  Apprenons à faire des prims sculptés avec Wings 3D] (Learning to make sculpties with Wings 3D).&lt;br /&gt;
====Video====&lt;br /&gt;
* [http://www.youtube.com/v/lzgb2BrOjbw Wings 3D sculpty creation and importing] by [[Paulee Perenti]].&lt;br /&gt;
* [http://www.virtualworldsvideo.com/item/NTVVMRR42L0TX9KF Wings 3D sculpty texturing] and [http://secondlifevideo.com/item/HNYYCHTVKKL746G2 Sculpt a Heart] by [[Ty Gould]].  Note that the texturing video was made before the plug-in created UV maps automatically. So when watching it, you can skip over the first five minutes, where Ty shows how to get and attach an appropriate UV map. Start paying attention when he opens the Outline window and makes the bitmap External.&lt;br /&gt;
* DanielFox Abernathy&#039;s series of tutorials.  &lt;br /&gt;
*# [http://video.google.com/videoplay?docid=5695483392055008122 Staircase]: How to shape and bend objects in Wings, DanielFox makes a beautiful curved set of steps using only two prims.&lt;br /&gt;
*# [http://video.google.com/videoplay?docid=-965279131856302227 Revolutions]: Like Rokuro, you can make a prim that looks like it came off the lathe.  Unlike Rokuro, you can then bend it, curve it, or otherwise perfect it.&lt;br /&gt;
*# [http://video.google.com/videoplay?docid=-1896380109653226562 Interlocking Rings]:  Learn to make two links of  a chain using only one prim.&lt;br /&gt;
&lt;br /&gt;
===Wings 3D References (not specific to sculpties)===&lt;br /&gt;
* [[Wings 3D Exporter]]&lt;br /&gt;
* [http://en.wikibooks.org/wiki/Wings_3D:_User_Manual Wings 3D Manual (Wikibooks, in progress)]&lt;br /&gt;
&lt;br /&gt;
===Other Useful Information===&lt;br /&gt;
* Read through the [http://forums.secondlife.com Second Life Forum] articles about sculpties.  You might learn something.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Sculpted Prims]]&lt;br /&gt;
&lt;br /&gt;
For other info regarding this and other 3d software, check out [[Sculpted Prims: 3d Software Guide]].&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/LSL_in_Focus:_Integers&amp;diff=699983</id>
		<title>LSL 101/LSL in Focus: Integers</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/LSL_in_Focus:_Integers&amp;diff=699983"/>
		<updated>2010-01-08T03:29:59Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: /* Other Uses of Integers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NavNextPrev|prefix=LSL in Focus:_|prev=Types|topic=Language Topics in Focus|next=Floats}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Integers in LSL roughly correspond to integers in mathematics.  They can be written in either the familiar decimal (e.g. 20, 0, -1) or [[#Hexadecimal Notation|hexadecimal]] (e.g. 0x14, 0x0, 0xFFFFFFFF).&lt;br /&gt;
&lt;br /&gt;
Integers in LSL are used in four distinct ways:&lt;br /&gt;
* Signed integers&lt;br /&gt;
* Truth values (Booleans)&lt;br /&gt;
* Enumerations&lt;br /&gt;
* Bit vectors&lt;br /&gt;
&lt;br /&gt;
There are a three operators, namely = (assignment), == (test for equality) and != (test for inequality) that are common to all uses of integers.  Other than those, the four different uses of integers generally involve separate sets of operators.&lt;br /&gt;
&lt;br /&gt;
== Signed Integers ==&lt;br /&gt;
This is the use of integers that corresponds to the normal use in mathematics.  The only substantive difference is that in mathematics, there are infinitely many integers, while in LSL integers are limited to the range −2,147,483,648 to 2,147,483,647.  Also, in LSL, no commas or other separators are allowed when writing integers, so these numbers would be written −2147483648 and 2147483647.&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
LSL has the normal arithmetic operators +, -, * and / (for division).  The first three have the same meaning as what you used in grade school &#039;&#039;&#039;as long as the result is in the range −2147483648 to 2147483647&#039;&#039;&#039;.  If the result is outside that range, different rules apply. The typical scripter doesn&#039;t need to use numbers that are so big (or small), so there&#039;s nor reason to feel you need to learn the details of what happens when the limits are exceeded.  But there are instances where it is actually useful to allow numbers to exceed the limits. For the details of what happens in that case, see the Integer Overflow section, below.&lt;br /&gt;
&lt;br /&gt;
Division of integers in LSL is a variation on what you learned in elementary school. If the division results in a whole number, say 10/2, the answer is 5.  But 15/2 is neither 7.5 nor 7 with a remainder of 1.  Instead, it is exactly 7.  Any remainder is simply thrown away.  Alternatively, you can think of it as being rounded toward zero.  It&#039;s more accurate to say &amp;quot;rounded toward zero&amp;quot; than &amp;quot;rounded down&amp;quot;, because -15/2 is -7, not -8.  If you&#039;re scripting something where you really want 15 divided by 2 to be 7.5, don&#039;t despair.  You&#039;ll just need to use the &amp;quot;float&amp;quot; type instead of integers.&lt;br /&gt;
&lt;br /&gt;
Closely related to integer division is the remainder operator, written as %.  It gives you what would remain if you were to ask for integer division on the same numbers.  Here are some examples:&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer i;&lt;br /&gt;
 i = 15 % 2;     // i is assigned the value 1&lt;br /&gt;
 i = 15 % 4;     // i is assigned the value 3&lt;br /&gt;
 i = -15 % 4;    // i is assigned the value -3&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If an attempt is made to divide by 0 (using either / or %), a run-time error occurs and script execution halts.&lt;br /&gt;
&lt;br /&gt;
Each of the arithmetic operators also has a corresponding assignment type operation.  For example&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer x;&lt;br /&gt;
 integer y;&lt;br /&gt;
 x += y;    // Synonymous with x = x + y;&lt;br /&gt;
 x -= y;    // Synonymous with x = x - y;&lt;br /&gt;
 x *= y;    // Synonymous with x = x * y;&lt;br /&gt;
 x /= y;    // Synonymous with x = x / y;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, since incrementing or decrementing by 1 is quite common, is special unary operator for that. The operator is written ++ and is pronounced plus-plus. To increment the variable i by 1, we can write either ++i or i++.  So for example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer i = 0;&lt;br /&gt;
 i++;     // i now has the value of 1&lt;br /&gt;
 ++i;     // i now has the value of 2&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But the two operators are not identical, because i++ and ++i are expressions that can occur as part of a larger expression.  When used as part of a larger expression, i++ contributes its value to the expression &#039;&#039;before&#039;&#039; it is incremented.  For example, the fragment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer i = 0;&lt;br /&gt;
 if (i++ == 0)&lt;br /&gt;
    llSay( 0, &amp;quot;The value of i was 0 when the comparison was done&amp;quot; )&lt;br /&gt;
 else&lt;br /&gt;
    llSay( 0, &amp;quot;The value of i was 1 when the comparison was done&amp;quot; )&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
would chat &amp;quot;The value of i was 0 when the comparison was done&amp;quot; even though i ends up with the value of 1.  On the other hand, if we switch i++ to ++i, i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer i = 0;&lt;br /&gt;
 if (++i == 0)&lt;br /&gt;
    llSay( 0, &amp;quot;The value of i was 0 when the comparison was done&amp;quot; )&lt;br /&gt;
 else&lt;br /&gt;
    llSay( 0, &amp;quot;The value of i was 1 when the comparison was done&amp;quot; )&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the chat output would be &amp;quot;The value of i was 1 when the comparison was done&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The operator minus-minus (written --) works similarly.&lt;br /&gt;
&lt;br /&gt;
=== Comparison Operators ===&lt;br /&gt;
In addition to the arithmetic operators, there are also the normal integer comparison operators &amp;lt; (less than) and &amp;gt; (greater than).  For &amp;quot;less than or equal&amp;quot;, or &amp;quot;greater than or equal&amp;quot;, there are two-character operators &amp;lt;= and &amp;gt;=.  There can&#039;t be any space between the two characters of a two-character operator. &lt;br /&gt;
&lt;br /&gt;
The result of a comparison operator is either 0 (representing &#039;&#039;&#039;FALSE&#039;&#039;&#039;) or 1 (representing &#039;&#039;&#039;TRUE&#039;&#039;&#039;).  See [[#Truth Values (Booleans)|Truth Values (Booleans)]].&lt;br /&gt;
&lt;br /&gt;
=== Integer Overflow ===&lt;br /&gt;
* During script execution, integers wraps from 2147483647 to -2147483648 in the normal way&lt;br /&gt;
* The compiler treats integers outside the range -2147483648 to 2147483647 somewhat strangely.  No compile time warning or error is generated. (If the following explanation, doesn&#039;t make sense to you don&#039;t worry -- just know to avoid using numbers outside the valid range in your script.)  &lt;br /&gt;
** For an integer outside the range -2147483648 to 2147483647, the absolute value of the number is reduced to fall in the range 0 to 4294967295 (0xFFFFFFFF).  &lt;br /&gt;
** This number is then parsed as an unsigned 32 bit integer and cast to the corresponding signed integer.  &lt;br /&gt;
** If the value in the script had a negative sign, the sign of the internal representation is switched.&lt;br /&gt;
** The net effect is that very large positive numbers get mapped to -1 and very large negative numbers get mapped to 1.&lt;br /&gt;
&lt;br /&gt;
== Truth Values (Booleans) ==&lt;br /&gt;
There is not a special type for TRUE and FALSE in LSL.  Instead, TRUE is defined to be the integer 1 and FALSE is defined to be the integer 0.&lt;br /&gt;
&lt;br /&gt;
This has an interesting consequence in a conditional statement.  Consider the following example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer i = 3;     // 3 is neither TRUE nor FALSE&lt;br /&gt;
 if (i)&lt;br /&gt;
    llSay( 0, &amp;quot;i is treated as being true.&amp;quot; );&lt;br /&gt;
 else&lt;br /&gt;
    llSay( 0, &amp;quot;i is treated as being false.&amp;quot; );&lt;br /&gt;
 if (i == TRUE)&lt;br /&gt;
    llSay( 0, &amp;quot;i is equal to TRUE.&amp;quot; );&lt;br /&gt;
 else&lt;br /&gt;
    llSay( 0, &amp;quot;i is not equal to TRUE.&amp;quot; );&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When run, the output will be&lt;br /&gt;
&lt;br /&gt;
 i is treated as being true.&lt;br /&gt;
 i is not equal to TRUE.&lt;br /&gt;
&lt;br /&gt;
This is because the condition in the &#039;&#039;&#039;if&#039;&#039;&#039; statement can be any integer.  Any non-zero value will cause the &#039;&#039;true&#039;&#039; block or statement to be executed, while a zero value will cause the &#039;&#039;false&#039;&#039; block or statement to be executed.&lt;br /&gt;
&lt;br /&gt;
The same zero/non-zero distinction is made wherever a truth value is expected.  In what follows, we&#039;ll use the word &#039;&#039;&#039;true&#039;&#039;&#039; and &#039;&#039;&#039;false&#039;&#039;&#039; to mean non-zero versus zero, while &#039;&#039;&#039;TRUE&#039;&#039;&#039; and &#039;&#039;&#039;FALSE&#039;&#039;&#039; will mean one and zero.&lt;br /&gt;
&lt;br /&gt;
=== Truth Value Operators ===&lt;br /&gt;
&lt;br /&gt;
There are three truth value operators in LSL:&lt;br /&gt;
* ! (representing &#039;&#039;&#039;not&#039;&#039;&#039;)&lt;br /&gt;
* &amp;amp;&amp;amp; (representing &#039;&#039;&#039;and&#039;&#039;&#039;)&lt;br /&gt;
* || (representing &#039;&#039;&#039;or&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
The ! operator takes a single operand and evaluates to &#039;&#039;&#039;TRUE&#039;&#039;&#039; if the operand is false, and &#039;&#039;&#039;FALSE&#039;&#039;&#039; otherwise.  For example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer i;&lt;br /&gt;
 i = !(3 == 7);     // 3 == 7 is FALSE, so i gets the value TRUE&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;&amp;amp; operator takes two operands and evaluates to &#039;&#039;&#039;TRUE&#039;&#039;&#039; if both its operands are true, and &#039;&#039;&#039;FALSE&#039;&#039;&#039; otherwise.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; i = (3 &amp;lt; 7) &amp;amp;&amp;amp; (3 &amp;gt; 7);     // 3 &amp;lt; 7 is TRUE, but (3 &amp;gt; 7) is FALSE, so i gets the value FALSE&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The || operator takes two operands and evaluates to &#039;&#039;&#039;TRUE&#039;&#039;&#039; if either one of its operands are true, and &#039;&#039;&#039;FALSE&#039;&#039;&#039; otherwise.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; i = (3 &amp;lt; 7) || (3 &amp;gt; 7);     // one of the operands (3 &amp;lt; 7) is TRUE, so i gets the value TRUE&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the binary arithmetic operators, &amp;amp;&amp;amp; and || have a corresponding assignment type operator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer x;&lt;br /&gt;
 integer y;&lt;br /&gt;
 x &amp;amp;&amp;amp;= y;    // Synonymous with x = x &amp;amp;&amp;amp; y;&lt;br /&gt;
 x ||= y;    // Synonymous with x = x || y;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Statements Requiring Truth Values ===&lt;br /&gt;
There are four statement types that require a truth value condition:&lt;br /&gt;
* if&lt;br /&gt;
* for&lt;br /&gt;
* while&lt;br /&gt;
* do-while&lt;br /&gt;
&lt;br /&gt;
== Enumerations ==&lt;br /&gt;
Many built-in functions have a parameter or return value that takes one of a fixed number of alternatives.  For example, [[llAttachToAvatar]] has a single parameter which specifies the attachment point.  The attachment point is specified to be an integer, but the specific integer corresponding to each attachment point is arbitrary. Since the numbers themselves have no significance, LSL defines names such as [[ATTACH_HEAD]], [[ATTACH_LFOOT]] and [[ATTACH_BELLY]], which are simply meaningful names for the arbitrary integers.  Integers used in this way are called &#039;&#039;&#039;enumerations&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Generally, no operators besides the ubiquitous =, == and != are used with enumerations because there is no expected relationship between the arbitrarily selected integer values.&lt;br /&gt;
&lt;br /&gt;
== Bit Vectors ==&lt;br /&gt;
&lt;br /&gt;
=== Bit Vector Operators ===&lt;br /&gt;
Analogous to the truth value operators, LSL defines three operators specifically for bit vectors:&lt;br /&gt;
&lt;br /&gt;
* ~ (bitwise not)&lt;br /&gt;
* &amp;amp; (bitwise and)&lt;br /&gt;
* | (bitwise or)&lt;br /&gt;
&lt;br /&gt;
In contract to the truth value operators, these operate independently on each bit position.&lt;br /&gt;
&lt;br /&gt;
== Other Uses of Integers ==&lt;br /&gt;
&lt;br /&gt;
Although the four uses described above cover all the ways that integers are used with LSL built-in functions, they are not really exhaustive of the ways integers &#039;&#039;can&#039;&#039; be used.  There are algorithms in mathematics and computer science that mix arithmetic and bit vector operations, along with bit shift operators.  LSL supports this kind of computation with the bit shift operators inherited from C:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;&amp;lt; shift bits left&lt;br /&gt;
* &amp;gt;&amp;gt; shift bits right&lt;br /&gt;
&lt;br /&gt;
and their assignment analogs&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;&amp;gt;=&lt;br /&gt;
* &amp;lt;&amp;lt;=&lt;br /&gt;
&lt;br /&gt;
Discussion of these algorithms is beyond the scope of this article, but see [http://graphics.stanford.edu/~seander/bithacks.html Bit Twiddling Hacks] for some examples.&lt;br /&gt;
&lt;br /&gt;
== Type conversions ==&lt;br /&gt;
=== Other types to integers ===&lt;br /&gt;
=== Integers to other types ===&lt;br /&gt;
&lt;br /&gt;
== Differences between Integers in LSL and in C ==&lt;br /&gt;
Much of LSL is patterned after the C programming language, and integers are no exception.  Programmers who already know C can immediately apply most of their understanding of integers to LSL.&lt;br /&gt;
&lt;br /&gt;
Differences to note are&lt;br /&gt;
* The type must be spelled &#039;&#039;integer&#039;&#039; instead of &#039;&#039;int&#039;&#039;.&lt;br /&gt;
* There are no size modifiers (short, long, ...).  All integers are 32 bits.&lt;br /&gt;
* There is no unsigned modifier.  All integers are signed.&lt;br /&gt;
* Comparison operators evaluate to an integer (1 or 0), as they did in C prior to C99.&lt;br /&gt;
* The &amp;amp;&amp;amp; and || operators are strict, i.e. both operands are always evaluated, even if the result can be determined after evaluating the left operand.&lt;br /&gt;
&lt;br /&gt;
== Hexadecimal Notation ==&lt;br /&gt;
There&#039;s actually not much use for hexadecimal notation in LSL.  If you do feel a need to use it, you probably already know how it works.  If not, you can consult {{Wikipedia|Hexadecimal notation|Wikipedia}}.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Category_talk:LSL_Integer&amp;diff=699973</id>
		<title>Category talk:LSL Integer</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Category_talk:LSL_Integer&amp;diff=699973"/>
		<updated>2010-01-08T03:28:03Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Are these numbers correct? &amp;quot;values between −2,147,483,648 and +2,147,483,647&amp;quot; . And if they are why the difference between the figures? -- &#039;&#039;&#039;[[User:EddyFragment Robonaught|Eddy]]&#039;&#039;&#039;  &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:EddyFragment_Robonaught|talk]]|[[Special:Contributions/EddyFragment_Robonaught|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 17:30, 27 June 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Aye correct as saved.&lt;br /&gt;
&lt;br /&gt;
:This truth makes more visual sense in hex. A 32-bit two&#039;s complement integer is 0x0, or +0x1 thru +0x7FFFffff, or -1 thru -0x7FFFffff, or -0x80000000.  In decimal, that is 0, or 1 thru 2147483647, or -1 thru -2147483647, or -2147483648.  The assymetry comes from the zero: both positive integers and zero have the uppermost most bit of the 32 bits zeroed, so the list of positive values loses one element to make room for zero.&lt;br /&gt;
&lt;br /&gt;
:A correspondingly counterintuitive result here is that negating -2147483648 has no effect (-2147483648 == ( 0 - -2147483648 ) == ( 2147483647 + 1 ) ). Ugly as all this is, it&#039;s less ugly than the known alternatives, such as the one&#039;s complement encoding that can have two zeroes: a positive zero and a negative zero.  All that I&#039;m saying here is the convention I remember learning years ago, I imagine LSL behaves this way at these limits, but I haven&#039;t tried to see yet ...  -- [[User:Ppaatt Lynagh|Ppaatt Lynagh]] 18:10, 27 June 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Thanx Ppaatt. I thought it might be a zero issue but didn&#039;t get as far as thinking that (of course) there would have to be (as you say) two zeros for the reach (both pos and neg) to be equal. &amp;quot;Positive Zero&amp;quot;. Sounds like a good title for a science fiction novel. Cheers Ppaatt. -- &#039;&#039;&#039;[[User:EddyFragment Robonaught|Eddy]]&#039;&#039;&#039;  &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:EddyFragment_Robonaught|talk]]|[[Special:Contributions/EddyFragment_Robonaught|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 18:16, 27 June 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
::In addition to (--2147483648 == -2147483648) so does (-1 * -2147483648). Everyone knows that 1/0 causes a fatal error in integer math but what few people know is that (-2147483648 / -1) does as well on x86 processors (modulo is equally affected). I have yet to find any mention of this on the internet (except where I have posted it), I found it by accident while exploring edge cases (it crashed the sim). In LSL we papered over the exception, any time you divide by -1 we just apply the &amp;quot;-&amp;quot; operator, and for modulo -1 we just return 0. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 09:27, 29 June 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
::: *insert foot in mouth* http://www.codeguru.com/cpp/sample_chapter/article.php/c11111__3/ -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 10:00, 29 June 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
lolz (although not at the fact that you can do &amp;quot;Integer math&amp;quot;. Now I have to relearn stuff *slumps*). -- &#039;&#039;&#039;[[User:EddyFragment Robonaught|Eddy]]&#039;&#039;&#039;  &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:EddyFragment_Robonaught|talk]]|[[Special:Contributions/EddyFragment_Robonaught|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 10:03, 29 June 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Sub-classification Constants/Functions ==&lt;br /&gt;
&lt;br /&gt;
I thought I&#039;d take a quick peek at possible Integer-related Functions.&lt;br /&gt;
A sea of Constants greeted me. Is a Sub classification perhaps useful? --[[User:Vernes Veranes|Vernes]] 00:43, 8 January 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
: [[LSL_101/LSL_in_Focus:_Integers|LSL in Focus: Integers]] classifies how integers are used in LSL, and might be what you are looking for.  The uses are: signed integers, truth values, enumerations and bit vectors.  I think every LSL integer constant clearly falls in exactly one of these four categories.--[[User:Omei Turnbull|Omei Turnbull]] 03:28, 8 January 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlParcelMediaCommandList&amp;diff=681833</id>
		<title>LlParcelMediaCommandList</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlParcelMediaCommandList&amp;diff=681833"/>
		<updated>2009-12-07T19:31:53Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Issues/SVC-1764}}{{LSL_Function&lt;br /&gt;
|func=llParcelMediaCommandList&lt;br /&gt;
|func_id=298|func_sleep=2.0|func_energy=10.0&lt;br /&gt;
|func_desc=Controls the playback of movies and other multimedia resources on a parcel or for an agent.&lt;br /&gt;
|func_footnote&lt;br /&gt;
|return_type&lt;br /&gt;
|return_text&lt;br /&gt;
|p1_type=list&lt;br /&gt;
|p1_name=commandList&lt;br /&gt;
|p1_desc=A list of integer flags and parameters&lt;br /&gt;
|constants={{LSL Constants/Parcel Media|all|b=*}}&lt;br /&gt;
|spec&lt;br /&gt;
|caveats= * This script&#039;s object must be owned by the landowner or the function will silently fail.&lt;br /&gt;
* If the script&#039;s object is over group owned land, then the object must be deeded to &#039;&#039;&#039;that&#039;&#039;&#039; group.&lt;br /&gt;
* If the [[PARCEL_MEDIA_COMMAND_URL]] value is greater than 254 characters, the command will silently fail.&lt;br /&gt;
* If using [[PARCEL_MEDIA_COMMAND_URL]] and [[PARCEL_MEDIA_COMMAND_AGENT]], make sure the &#039;&#039;Media URL&#039;&#039; in the &#039;&#039;About Land ...&#039;&#039; dialog is unset. See {{JIRA|SVC-4478}}.&lt;br /&gt;
|examples=&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
key myTexture = llGetTexture(0);&lt;br /&gt;
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_TEXTURE,myTexture,PARCEL_MEDIA_COMMAND_PLAY]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
|helpers&lt;br /&gt;
|also_header&lt;br /&gt;
|also_functions=&lt;br /&gt;
{{LSL DefineRow||{{LSLG|llParcelMediaQuery}}|}}&lt;br /&gt;
{{LSL DefineRow||{{LSLG|llSetTextureAnim}}|}}&lt;br /&gt;
{{LSL DefineRow||{{LSLG|llSetTexture}}|}}&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_articles&lt;br /&gt;
|also_footer&lt;br /&gt;
|notes&lt;br /&gt;
|issues&lt;br /&gt;
|mode&lt;br /&gt;
|deprecated&lt;br /&gt;
|permission&lt;br /&gt;
|negative_index&lt;br /&gt;
|cat1=Video&lt;br /&gt;
|cat2=Media&lt;br /&gt;
|cat3=Parcel&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlList2CSV&amp;diff=638253</id>
		<title>LlList2CSV</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlList2CSV&amp;diff=638253"/>
		<updated>2009-10-30T19:34:54Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: Expanded on relationship to llCSV2List&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function&lt;br /&gt;
|func_id=195|func_sleep=0.0|func_energy=10.0&lt;br /&gt;
|func=llList2CSV|return_type=string|p1_type=list|p1_name=src&lt;br /&gt;
|func_footnote=More precisely the values are separated with a comma and a space (&amp;quot;, &amp;quot;).&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
This function&#039;s functionality is equivalent to &amp;lt;code style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;[[llDumpList2String]](&#039;&#039;&#039;src&#039;&#039;&#039;, &amp;quot;, &amp;quot;);&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The result of this function is more or less the {{Wikipedia|CSV|CSV}} format, but it does not conform in all its details.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
To reverse the process use [[llCSV2List]].  But see the Caveat.&lt;br /&gt;
|func_desc&lt;br /&gt;
|return_text=of comma separated values taken in order from &#039;&#039;&#039;src&#039;&#039;&#039;.&lt;br /&gt;
|spec&lt;br /&gt;
|caveats=*[[llCSV2List]] will not reverse the process if there are commas in any of the original strings.  One way around this is to first use [[llEscapeURL]] on any user-supplied strings before adding them to the list.  [[llUnescapeURL]] will reverse [[llEscapeURL]].&lt;br /&gt;
|constants&lt;br /&gt;
|examples=&amp;lt;lsl&amp;gt;default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        list my_list = [1, 2.0, &amp;quot;a string&amp;quot;, llGetPos(), llGetRot(), llGetOwner()];&lt;br /&gt;
        llOwnerSay(llList2CSV(my_list));        &lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
|helpers&lt;br /&gt;
|also_functions={{LSL DefineRow||[[llCSV2List]]}}&lt;br /&gt;
{{LSL DefineRow||[[llDumpList2String]]}}&lt;br /&gt;
{{LSL DefineRow||[[llParseString2List]]}}&lt;br /&gt;
{{LSL DefineRow||[[llParseStringKeepNulls]]}}&lt;br /&gt;
|also_events&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_articles={{LSL DefineRow||[[Typecast]]}}&lt;br /&gt;
|notes&lt;br /&gt;
|permission&lt;br /&gt;
|negative_index&lt;br /&gt;
|sort=List2CSV&lt;br /&gt;
|cat1=List&lt;br /&gt;
|cat2=String&lt;br /&gt;
|cat3=Data Conversion&lt;br /&gt;
|cat4=CSV&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Category:LSL_Integer&amp;diff=637223</id>
		<title>Category:LSL Integer</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Category:LSL_Integer&amp;diff=637223"/>
		<updated>2009-10-29T20:17:20Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: Created /*Further Reading */ and added link to LSL101 page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Header|ml=*}}&lt;br /&gt;
{{LSLC|}}{{LSLC|Types}}&lt;br /&gt;
&lt;br /&gt;
=Integers=&lt;br /&gt;
An  integer data types are signed 32 bit values between −2,147,483,648 and +2,147,483,647 (that is 0x80000000 to 0x7FFFFFFF in hex). Integers are whole numbers. The fractional datatype is the [[float]].&lt;br /&gt;
&lt;br /&gt;
[[DEBUG_CHANNEL]] can be used as a constant for the maximum integer (for that is the value it is defined as).&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
All of the following are integers:&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer firstInt = 5512623;&lt;br /&gt;
integer secondInt = ACTIVE;&lt;br /&gt;
integer thirdInt = 0x61EC1A;&lt;br /&gt;
integer fourthInt = -160693;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following are NOT integers, use {{LSLG|float}} for them:&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
integer decimalValue = 125.2; // ERROR : Type mismatch -- Integer literals can&#039;t have a decimal.&lt;br /&gt;
integer bigValue = 3147483647; // An undocumented way to say -1,147,483,649 // Integer literals can&#039;t be larger than 2,147,483,647.&lt;br /&gt;
integer biggerValue = 10123456789; // An undocumented way to say -1 // Integer literals can&#039;t be larger than 2,147,483,647.&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
For a more extensive coverage of integers, including the different ways they are used in LSL, see [[LSL_101/LSL_in_Focus:_Integers|LSL in Focus: Integers]].&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Youtube_TV&amp;diff=600313</id>
		<title>Youtube TV</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Youtube_TV&amp;diff=600313"/>
		<updated>2009-10-15T18:34:00Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: Not currently working&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Note: these scripts rely on a private external server, http://secondtools.ismywebsite.com/youtube/getvideotext.php.  On 10/15/09, I tried it and that server isn&#039;t returning anything meaningful.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make a YouTube TV you only need 2 scripts, each one in one prim:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Get Video.lsl&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
integer listenid;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer i)&lt;br /&gt;
    {&lt;br /&gt;
        if(llDetectedKey(0) == llGetOwner())&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;Please type: /65 (Youtube video id) Example: Video URL: http://youtube.com/video?v=blablabla Video ID: blablabla&amp;quot;);&lt;br /&gt;
            listenid = llListen(65, &amp;quot;&amp;quot;, llGetOwner(),&amp;quot;&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    listen(integer c, string n, key k, string m)&lt;br /&gt;
    {&lt;br /&gt;
        llListenRemove(listenid);&lt;br /&gt;
        if(k == llGetOwner())&lt;br /&gt;
        {&lt;br /&gt;
            llHTTPRequest(&amp;quot;http://secondtools.ismywebsite.com/youtube/getvideotext.php?v=&amp;quot;+m,[],&amp;quot;&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    http_response(key requestid, integer status, list metadata, string body)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Connecting...&amp;quot;);&lt;br /&gt;
        llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,body]);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Get Texture.lsl&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer i)&lt;br /&gt;
    {&lt;br /&gt;
        if(llDetectedKey(0) == llGetOwner())&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;Getting Parcel Media Texture...&amp;quot;);&lt;br /&gt;
            string landTexture;&lt;br /&gt;
            landTexture = (string) llParcelMediaQuery([PARCEL_MEDIA_COMMAND_TEXTURE]);&lt;br /&gt;
            llSetTexture(landTexture,ALL_SIDES);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now is only sit and watch your favorite Youtube videos!&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlDetectedGroup&amp;diff=423253</id>
		<title>LlDetectedGroup</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlDetectedGroup&amp;diff=423253"/>
		<updated>2009-07-05T23:54:07Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Function/group}}{{LSL_Function/detected|number|group}}{{LSL_Function&lt;br /&gt;
|func_id=39|func_sleep=0.0|func_energy=10.0&lt;br /&gt;
|sort=DetectedGroup|func=llDetectedGroup&lt;br /&gt;
|return_type=integer&lt;br /&gt;
|p1_type=integer|p1_name=number&lt;br /&gt;
|func_footnote=Returns {{LSLG|FALSE}} if &#039;&#039;&#039;number&#039;&#039;&#039; is out of range or if the {{LSLGC|Detected|detected}} event does not support this attribute.&lt;br /&gt;
|func_desc&lt;br /&gt;
|return_text=that is a {{HoverText|boolean|TRUE or FALSE}} representing if the {{LSLGC|Detected|detected}} object or avatar is in the same group that the prim containing the script is set to.&lt;br /&gt;
|spec&lt;br /&gt;
|caveats&lt;br /&gt;
|constants&lt;br /&gt;
|examples=&amp;lt;lsl&amp;gt;//Gives inventory only to agents with the same active group&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        integer number = 0;&lt;br /&gt;
        do&lt;br /&gt;
        {&lt;br /&gt;
            if (llDetectedGroup(number)) //same as llSameGroup(llDetectedKey(number)) (with llSameGroup, detected must be in the sim)&lt;br /&gt;
                llGiveInventory(llDetectedKey(number), llGetInventoryName(INVENTORY_OBJECT,0));&lt;br /&gt;
            else&lt;br /&gt;
                llSay(0, &amp;quot;Wrong active group!&amp;quot;);&lt;br /&gt;
        }while(total_number &amp;gt; ++number);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
|helpers&lt;br /&gt;
|also_functions=&lt;br /&gt;
{{LSL DefineRow||[[llSameGroup]]|}}&lt;br /&gt;
|also_events&lt;br /&gt;
|also_articles&lt;br /&gt;
|notes&lt;br /&gt;
|permission&lt;br /&gt;
|cat1=Group&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/The_touch_start_Event&amp;diff=399722</id>
		<title>LSL 101/The touch start Event</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/The_touch_start_Event&amp;diff=399722"/>
		<updated>2009-06-21T00:17:08Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Strings and Simple Output|next=Creating a Script}}&lt;br /&gt;
&lt;br /&gt;
Here&#039;s our sample program, with a second event handler added.  The touch_start event occurs whenever any avatar clicks on the object containing the script.  Note again that the name of the event must be spelled touch_start, with the underscore.  (The underscore doesn&#039;t show up in the title of this page just because the Wiki software displays underscores in titles as spaces.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
     state_entry()&lt;br /&gt;
     {&lt;br /&gt;
          // Let the object&#039;s owner know the script is working&lt;br /&gt;
          llOwnerSay( &amp;quot;Congratulations! Your script has started to execute.&amp;quot; );&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     touch_start( integer num_detected )&lt;br /&gt;
     {&lt;br /&gt;
          // Let the object&#039;s owner know the script is working&lt;br /&gt;
          llOwnerSay( &amp;quot;I&#039;ve been touched!&amp;quot; );&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;start&#039;&#039; part of the event name refers to the fact that this event is generated whenever a user presses the left mouse button while the cursor is over the object.  If for some reason you wanted your code to execute when the user lifted the button instead of pressing it, that event is named touch_end.&lt;br /&gt;
&lt;br /&gt;
If a user clicks on your object many times, the touch_start event handler code will generally get executed many times, once for each click.  But if multiple users click on your object at approximately the same time, SL may not invoke your code for each one separately.  Instead, it may combine two or more of the touches into one event.  In case your script really needs to respond separately to each touch, SL will tell you how many touches an execution of the touch_start event handler represents.  That&#039;s the purpose of the phrase &amp;quot;integer num_detected&amp;quot; between the parentheses following touch_start.  But before fully explaining how that works, we need to learn some other things, so we won&#039;t elaborate on that yet.&lt;br /&gt;
&lt;br /&gt;
Right now, let&#039;s look at the process for actually [[LSL 101\Creating a Script|creating a script]] in SL.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Strings_and_Simple_Output&amp;diff=382912</id>
		<title>LSL 101/Strings and Simple Output</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Strings_and_Simple_Output&amp;diff=382912"/>
		<updated>2009-06-04T22:11:37Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Comments, White-space and Formatting|next=Integers}}&lt;br /&gt;
&lt;br /&gt;
Here&#039;s our sample program, with a line added so that the script actually does something.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
     state_entry()&lt;br /&gt;
     {&lt;br /&gt;
          // Let the object&#039;s owner know the script is working&lt;br /&gt;
          llOwnerSay( &amp;quot;Congratulations! Your script has started to execute.&amp;quot; );&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line that starts with llOwnerSay is a &#039;&#039;&#039;statement&#039;&#039;&#039; that instructs the object containing the script to chat a text message that will only be seen by the object&#039;s owner.  Since you will usually be scripting objects you own, this will generally be you.  This is a convenient way to get information about what your script is doing, without spamming text chat to everyone around you. But if you have an occasion (and permission) to script someone else&#039;s object, you would want to use one of the other communication statements, which we&#039;ll discuss in due time.&lt;br /&gt;
&lt;br /&gt;
Take a look at the punctuation in this line.  Every statement in LSL &#039;&#039;must&#039;&#039; end with a semicolon.  This is probably the easiest punctuation mark to overlook, but if it isn&#039;t there, your script isn&#039;t acceptable.  Furthermore, the error message you get will probably puzzle you, because it will tell you the error is on the line &#039;&#039;following&#039;&#039; the missing semicolon, and it won&#039;t tell you that it is a semicolon that is missing.  So work especially hard at remembering your semicolons.&lt;br /&gt;
&lt;br /&gt;
The next set of punctuation marks to observe is the pair of double quote marks surrounding the text &amp;quot;Congratulations! Your script has started to execute.&amp;quot;.  Double quote marks always come in pairs, and they, together with whatever characters come between them, are called a &#039;&#039;&#039;string&#039;&#039;&#039;.  Strings can contain any printable characters (although a few require a special trick).  The most important use of strings is to display text in SL.  The actual content of a string does not have any effect on how your script runs, unless you specifically write code to examine the string and take different actions depending on what the content is.&lt;br /&gt;
&lt;br /&gt;
The final set of punctuation, the parentheses, are associated with the name llOwnerSay.  llOwnerSay is our first example of a &#039;&#039;&#039;built-in function&#039;&#039;&#039;.  Built-in functions always start with the lower case &amp;quot;ll&amp;quot; (for Linden Labs).  A built-in function will typically tell the Second Life server to do something (like display text or change the position of a prim) or make a query about the SL world (such as what avatars are nearby).  There are hundreds of different built-in functions.  Once you get the basics of scripting down, most of your learning time will be spent finding out which built-in functions do what you want to do, along with the nitty-gritty of how they work.  Fortunately, most scripts need only a handful of different functions, so you won&#039;t need to learn hundreds, or even tens, of built-in functions before you can write simple scripts.&lt;br /&gt;
&lt;br /&gt;
The general pattern for using a built-in function is &lt;br /&gt;
&lt;br /&gt;
    llXXX( &#039;&#039;parameter1&#039;&#039;, &#039;&#039;paramter2&#039;&#039;, ... )&lt;br /&gt;
&lt;br /&gt;
where llXXX refers to any built-in function and the number of parameters is different for different built-in functions.  For example, llOwnerSay always takes one parameter, and that parameter has to be a string.  Commas separate parameters, so if there is only one parameter, no comma is needed (or allowed).&lt;br /&gt;
&lt;br /&gt;
Strings are only one of seven different types of data that LSL can manipulate.  Another common type is [[LSL 101/Integers|integers]].&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/In_the_Beginning&amp;diff=382892</id>
		<title>LSL 101/In the Beginning</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/In_the_Beginning&amp;diff=382892"/>
		<updated>2009-06-04T21:15:30Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=A Gentle Introduction|next=Simple Script Skeleton}}&lt;br /&gt;
&lt;br /&gt;
This thread of &#039;&#039;A Gentle Introduction&#039;&#039; is written especially for the Second Life user that has some building experience, but little or no scripting (or other programming) experience.  It is divided into &amp;quot;lessons&amp;quot; that are intended to be read sequentially.  Most lessons will take the form of an  example script, followed by a discussion of anything that is newly introduced by that script.  If we&#039;ve written the lessons successfully and you read them sequentially, you should never come to a page with vocabulary or concepts that are unfamiliar but not explained in that lesson.&lt;br /&gt;
&lt;br /&gt;
On the other hand, we don&#039;t necessarily try to explain &#039;&#039;everything&#039;&#039; about a topic in the lesson it is first introduced.  If you&#039;re looking for the full details of any particular topic, see the section [[LSL 101/Language Topics in Focus|Language Topics in Focus]].  &lt;br /&gt;
&lt;br /&gt;
Our examples will be full scripts that you can copy into SL and run yourself.  You can make modifications and run those, to verify that your understanding matches what SL actually does.  One consequence of that though, is that in a few cases (especially in the beginning), the structure of LSL forces us to include something in the example that we&#039;re not ready to explain.  When this happens, we&#039;ll call it to your attention so you&#039;re not left wondering whether you&#039;ve missed something.&lt;br /&gt;
&lt;br /&gt;
As you read these pages, if you do come to a place where you feel we haven&#039;t adequately explained the example, or are making unwarranted assumptions about the target audience&#039;s background knowledge, please let us know.  On each Wiki page, there is a tab labeled &#039;&#039;discussion&#039;&#039;.  Click on that tab and tell us what you think.  Don&#039;t worry if you don&#039;t know the Wiki editing conventions; we&#039;ll figure out your intent.  If you have general comments that are relevant to more than one lesson, there is a [http://forums.secondlife.com/showthread.php?t=318943 forum discussion] that is a great place to post your thoughts.&lt;br /&gt;
&lt;br /&gt;
Finally if you are an experienced scripter who is reading these pages out of curiosity and comes across something you could improve, feel free to jump in and do it.  This is, after all, a Wiki.&lt;br /&gt;
&lt;br /&gt;
Though this series of lessons is designed to be read sequentially, you may sometimes have a desire to jump back and forth between lessons.  So here&#039;s a table of contents.&lt;br /&gt;
&lt;br /&gt;
* [[LSL 101/Simple Script Skeleton|Simple Script Skeleton]]&lt;br /&gt;
* [[LSL 101/Comments, White-space and Formatting|Comments, White-space and Formatting]]&lt;br /&gt;
* [[LSL 101/Strings and Simple Output|Strings and Simple Output]]&lt;br /&gt;
* [[LSL 101/Integers]]&lt;br /&gt;
* [[LSL 101/The touch_start Event|The touch_start Event]]&lt;br /&gt;
* [[LSL 101/Creating a Script|Creating a Script]]&lt;br /&gt;
* [[LSL 101/Compile Time Errors|Compile Time Errors]]&lt;br /&gt;
* [[LSL 101/Functions That Return a Value|Functions That Return a Value]]&lt;br /&gt;
* [[LSL 101/String Concatenation|String Concatenation]]&lt;br /&gt;
* [[LSL 101/Variables|Variables]]&lt;br /&gt;
* [[LSL 101/Global vs Local Variables|Global vs Local Variables]]&lt;br /&gt;
* [[LSL 101/Variable Initialization|Variable Initialization]]&lt;br /&gt;
* [[LSL 101/Event Handler Parameters|Event Handler Parameters]]&lt;br /&gt;
* [[LSL 101/|...]]&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Strings_and_Simple_Output&amp;diff=382882</id>
		<title>LSL 101/Strings and Simple Output</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Strings_and_Simple_Output&amp;diff=382882"/>
		<updated>2009-06-04T21:13:39Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Comments, White-space and Formatting|next=Integers}}&lt;br /&gt;
&lt;br /&gt;
Here&#039;s our sample program, with a line added so that the script actually does something.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
     state_entry()&lt;br /&gt;
     {&lt;br /&gt;
          // Let the object&#039;s owner know the script is working&lt;br /&gt;
          llOwnerSay( &amp;quot;Congratulations! Your script has started to execute.&amp;quot; );&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line that starts with llOwnerSay is a &#039;&#039;&#039;statement&#039;&#039;&#039; that instructs the object containing the script to chat a text message that will only be seen by the object&#039;s owner.  Since you will usually be scripting objects you own, this will generally be you.  This is a convenient way to get information about what your script is doing, without spamming text chat to everyone around you. But if you have an occasion (and permission) to script someone else&#039;s object, you would want to use one of the other communication statements, which we&#039;ll discuss in due time.&lt;br /&gt;
&lt;br /&gt;
Take a look at the punctuation in this line.  Every statement in LSL &#039;&#039;must&#039;&#039; end with a semicolon.  This is probably the easiest punctuation mark to overlook, but if it isn&#039;t there, your script isn&#039;t acceptable.  Furthermore, the error message you get will probably puzzle you, because it will tell you the error is on the line &#039;&#039;following&#039;&#039; the missing semicolon, and it won&#039;t tell you that it is a semicolon that is missing.  So work especially hard at remembering your semicolons.&lt;br /&gt;
&lt;br /&gt;
The next set of punctuation marks to observe is the pair of double quote marks surrounding the text &amp;quot;Congratulations! Your script has started to execute.&amp;quot;.  Double quote marks always come in pairs, and they, together with whatever characters come between them, are called a &#039;&#039;&#039;string&#039;&#039;&#039;.  Strings can contain any printable characters (although a few require a special trick).  The most important use of strings is to display text in SL.  The actual content of a string does not have any effect on how your script runs, unless you specifically write code to examine the string and take different actions depending on what the content is.&lt;br /&gt;
&lt;br /&gt;
The final set of punctuation, the parentheses, are associated with the name llOwnerSay.  llOwnerSay is our first example of a &#039;&#039;&#039;built-in function&#039;&#039;&#039;.  Built-in functions always start with the lower case &amp;quot;ll&amp;quot; (for Linden Labs).  A built-in function will typically tell the Second Life server to do something (like display text or change the position of a prim) or make a query about the SL world (such as what avatars are nearby).  There are hundreds of different built-in functions.  Once you get the basics of scripting down, most of your learning time will be spent finding out which built-in functions do what you want to do, along with the nitty-gritty of how they work.  Fortunately, most scripts need only a handful of different functions, so you won&#039;t need to learn hundreds, or even tens, of built-in functions before you can write simple scripts.&lt;br /&gt;
&lt;br /&gt;
The general pattern for using a built-in function is &lt;br /&gt;
&lt;br /&gt;
    llXXX( &#039;&#039;parameter1&#039;&#039;, &#039;&#039;paramter2&#039;&#039;, ... )&lt;br /&gt;
&lt;br /&gt;
where llXXX refers to any built-in function and the number of parameters is different for different built-in functions.  For example, llOwnerSay always takes one parameter, and that parameter has to be a string.  Commas separate parameters, so if there is only one parameter, no comma is needed (or allowed).&lt;br /&gt;
&lt;br /&gt;
Now that we know how to make something visible happen in SL, let&#039;s add a second [[LSL 101/The touch_start Event|event handler]].&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Integers&amp;diff=382872</id>
		<title>LSL 101/Integers</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Integers&amp;diff=382872"/>
		<updated>2009-06-04T21:12:58Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: New page: Category:LSL 101 {{NavNextPrev|prev=Strings and Simple Output|next=The touch_start Event}}  Move along.  There&amp;#039;s nothing to see here, yet.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Strings and Simple Output|next=The touch_start Event}}&lt;br /&gt;
&lt;br /&gt;
Move along.  There&#039;s nothing to see here, yet.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Variables&amp;diff=382322</id>
		<title>LSL 101/Variables</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Variables&amp;diff=382322"/>
		<updated>2009-06-04T04:16:38Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=String Concatenation|next=Global vs Local Variables}}&lt;br /&gt;
&lt;br /&gt;
In our previous example, each time the touch_start event handler is invoked we ask the server for the name of the region using &#039;&#039;llGetRegionName&#039;&#039;.  If we know the object with the script isn&#039;t going to be moving between regions, we might like to get the region name from the server just once, and then reuse the name each time the object is clicked on.  To do that, we need to use a &#039;&#039;&#039;variable&#039;&#039;&#039; to store the region name.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a script that asks for the sim&#039;s name when the script is initialized, stored the name in a variable we have named &#039;&#039;RegionName&#039;&#039;, and uses that as the source for the name each time it is needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;string RegionName;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
     state_entry()&lt;br /&gt;
     {&lt;br /&gt;
          // Store the name of the current sim for later use&lt;br /&gt;
          RegionName = llGetRegionName();&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     touch_start( integer num_detected )&lt;br /&gt;
     {&lt;br /&gt;
          // Announce the region where the script is running&lt;br /&gt;
          llOwnerSay( &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot; );&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line &lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string RegionName;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is called a &#039;&#039;&#039;variable declaration&#039;&#039;&#039;.  When this script is executed, the sim server sees the declaration and interprets it as a command to set aside a small chunk of this script&#039;s available memory capable of holding a string.  It then names that chunk of memory &#039;&#039;RegionName&#039;&#039;.  Henceforth, any time it sees the name &#039;&#039;RegionName&#039;&#039; in this script, it will know it is referring to this specific chunk of memory.&lt;br /&gt;
&lt;br /&gt;
Next, the state_entry event handler will be executed, resulting in the execution of the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; RegionName = llGetRegionName();&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will cause the string returned by &#039;&#039;llGetRegionName&#039;&#039; to be stored in that chunk of memory we have named &#039;&#039;RegionName&#039;&#039;.  (This is actually an oversimplification of what really happens, but conceptually, it&#039;s an appropriate description.)  The = sign is called the &#039;&#039;&#039;assignment&#039;&#039;&#039; operator, and the statement as a whole is called an &#039;&#039;&#039;assignment statement&#039;&#039;&#039;.  If you have need to say this line in English, you would say &amp;quot;RegionName is assigned the value returned by llGetRegionName&amp;quot; or &amp;quot;RegionName gets the value returned by llGetRegionName&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Having stored the region name in memory, each execution of the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; llOwnerSay( &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot; );&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will retrieve the region name from the script&#039;s memory instead of asking the sim each time.  Since reading from memory is faster than calling a built-in function, the script will use fewer server resources.&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth mentioning that variables in LSL (and other programming languages) are different than the variables you learn about in high school algebra.  In the context of an algebra problem, a variable represents a specific value, but what value is not known at the start of a problem.  You solve the problem in order to determine what the value is.  But even though it is called a variable, the value doesn&#039;t actually vary during the course of the problem.&lt;br /&gt;
&lt;br /&gt;
In LSL, we can easily determine what value is stored in a variable, but that value may vary during the execution of the script.  Each time an assignment statement for a variable is executed, the old value of the variable is replaced by the new value.  (Of course, if the old value and the new value are identical, no net change will have occurred.)&lt;br /&gt;
&lt;br /&gt;
Also, the assignment operator = doesn&#039;t mean the same thing as &#039;&#039;equals&#039;&#039; in algebra.  Equality is symmetric.  That is, if a = b, then b = a.  But in LSL, the left and right hand side of the assignment play different roles.  The right hand side can be any value, but the left hand side of the assignment has to be a variable, and refers to chunk of memory, not the value that is currently stored there. (The current value is irrelevant , since it overwritten by the assignment.) &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;lsl&amp;gt; llGetRegionName() = RegionName;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is not the same as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; RegionName = llGetRegionName();&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first of these is not even a grammatical LSL statement.  Even if it were grammatical, it wouldn&#039;t make any sense.  The second statement is meaningful, and replaces whatever value is currently stored in &#039;&#039;RegionName&#039;&#039; with the string returned by &#039;&#039;llGetRegionName&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There &#039;&#039;is&#039;&#039; an equality operator in LSL, but it is written as == instead of =.  We&#039;ll talk about it in more depth later.&lt;br /&gt;
&lt;br /&gt;
The variable &#039;&#039;RegionName&#039;&#039; in this example is called a &#039;&#039;&#039;global&#039;&#039;&#039; variable.  Global variables are are accessible to all event handlers in the script.  But not all variables are global.  In the next lesson, we&#039;ll consider [[LSL 101/Global vs Local Variables|&#039;&#039;&#039;local&#039;&#039;&#039;]] variables.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/In_the_Beginning&amp;diff=381993</id>
		<title>LSL 101/In the Beginning</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/In_the_Beginning&amp;diff=381993"/>
		<updated>2009-06-03T21:48:42Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=A Gentle Introduction|next=Simple Script Skeleton}}&lt;br /&gt;
&lt;br /&gt;
This thread of &#039;&#039;A Gentle Introduction&#039;&#039; is written especially for the Second Life user that has some building experience, but little or no scripting (or other programming) experience.  It is divided into &amp;quot;lessons&amp;quot; that are intended to be read sequentially.  Most lessons will take the form of an  example script, followed by a discussion of anything that is newly introduced by that script.  If we&#039;ve written the lessons successfully and you read them sequentially, you should never come to a page with vocabulary or concepts that are unfamiliar but not explained in that lesson.&lt;br /&gt;
&lt;br /&gt;
On the other hand, we don&#039;t necessarily try to explain &#039;&#039;everything&#039;&#039; about a topic in the lesson it is first introduced.  If you&#039;re looking for the full details of any particular topic, see the section [[LSL 101/Language Topics in Focus|Language Topics in Focus]].  &lt;br /&gt;
&lt;br /&gt;
Our examples will be full scripts that you can copy into SL and run yourself.  You can make modifications and run those, to verify that your understanding matches what SL actually does.  One consequence of that though, is that in a few cases (especially in the beginning), the structure of LSL forces us to include something in the example that we&#039;re not ready to explain.  When this happens, we&#039;ll call it to your attention so you&#039;re not left wondering whether you&#039;ve missed something.&lt;br /&gt;
&lt;br /&gt;
As you read these pages, if you do come to a place where you feel we haven&#039;t adequately explained the example, or are making unwarranted assumptions about the target audience&#039;s background knowledge, please let us know.  On each Wiki page, there is a tab labeled &#039;&#039;discussion&#039;&#039;.  Click on that tab and tell us what you think.  Don&#039;t worry if you don&#039;t know the Wiki editing conventions; we&#039;ll figure out your intent.  If you have general comments that are relevant to more than one lesson, there is a [http://forums.secondlife.com/showthread.php?t=318943 forum discussion] that is a great place to post your thoughts.&lt;br /&gt;
&lt;br /&gt;
Finally if you are an experienced scripter who is reading these pages out of curiosity and comes across something you could improve, feel free to jump in and do it.  This is, after all, a Wiki.&lt;br /&gt;
&lt;br /&gt;
Though this series of lessons is designed to be read sequentially, you may sometimes have a desire to jump back and forth between lessons.  So here&#039;s a table of contents.&lt;br /&gt;
&lt;br /&gt;
* [[LSL 101/Simple Script Skeleton|Simple Script Skeleton]]&lt;br /&gt;
* [[LSL 101/Comments, White-space and Formatting|Comments, White-space and Formatting]]&lt;br /&gt;
* [[LSL 101/Strings and Simple Output|Strings and Simple Output]]&lt;br /&gt;
* [[LSL 101/The touch_start Event|The touch_start Event]]&lt;br /&gt;
* [[LSL 101/Creating a Script|Creating a Script]]&lt;br /&gt;
* [[LSL 101/Compile Time Errors|Compile Time Errors]]&lt;br /&gt;
* [[LSL 101/Functions That Return a Value|Functions That Return a Value]]&lt;br /&gt;
* [[LSL 101/String Concatenation|String Concatenation]]&lt;br /&gt;
* [[LSL 101/Variables|Variables]]&lt;br /&gt;
* [[LSL 101/Global vs Local Variables|Global vs Local Variables]]&lt;br /&gt;
* [[LSL 101/Variable Initialization|Variable Initialization]]&lt;br /&gt;
* [[LSL 101/Event Handler Parameters|Event Handler Parameters]]&lt;br /&gt;
* [[LSL 101/|...]]&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/In_the_Beginning&amp;diff=381983</id>
		<title>LSL 101/In the Beginning</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/In_the_Beginning&amp;diff=381983"/>
		<updated>2009-06-03T21:47:54Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=A Gentle Introduction|next=Simple Script Skeleton}}&lt;br /&gt;
&lt;br /&gt;
This thread of &#039;&#039;A Gentle Introduction&#039;&#039; is written especially for the Second Life user that has some building experience, but little or no scripting (or other programming) experience.  It is divided into &amp;quot;lessons&amp;quot; that are intended to be read sequentially.  Most lessons will take the form of an  example script, followed by a discussion of anything that is newly introduced by that script.  If we&#039;ve written the lessons successfully and you read them sequentially, you should never come to a page with vocabulary or concepts that are unfamiliar but not explained in that lesson.&lt;br /&gt;
&lt;br /&gt;
On the other hand, we don&#039;t necessarily try to explain &#039;&#039;everything&#039;&#039; about a topic in the lesson it is first introduced.  If you&#039;re looking for the full details of any particular topic, see the section [[LSL 101/Language Topics in Focus|Language Topics in Focus]].  &lt;br /&gt;
&lt;br /&gt;
Our examples will be full scripts that you can copy into SL and run yourself.  You can make modifications and run those, to verify that your understanding matches what SL actually does.  One consequence of that though, is that in a few cases (especially in the beginning), the structure of LSL forces us to include something in the example that we&#039;re not ready to explain.  When this happens, we&#039;ll call it to your attention so you&#039;re not left wondering whether you&#039;ve missed something.&lt;br /&gt;
&lt;br /&gt;
As you read these pages, if you do come to a place where you feel we haven&#039;t adequately explained the example, or are making unwarranted assumptions about the target audience&#039;s background knowledge, please let us know.  On each Wiki page, there is a tab labeled &#039;&#039;discussion&#039;&#039;.  Click on that tab and tell us what you think.  Don&#039;t worry if you don&#039;t know the Wiki editing conventions; we&#039;ll figure out your intent.  If you have general comments that are relevant to more than one lesson, there is a [http://forums.secondlife.com/showthread.php?t=318943 forum discussion] that is a great place to post your thoughts.&lt;br /&gt;
&lt;br /&gt;
Finally if you are an experienced scripter who is reading these pages out of curiosity and comes across something you could improve, feel free to jump in and do it.  This is, after all, a Wiki.&lt;br /&gt;
&lt;br /&gt;
Though this series of lessons is designed to be read sequentially, you may sometimes have a desire to jump back and forth between lessons.  So here&#039;s a table of contents.&lt;br /&gt;
&lt;br /&gt;
* [[LSL 101/Simple Script Skeleton|Simple Script Skeleton]]&lt;br /&gt;
* [[LSL 101/Comments, White-space and Formatting|Comments, White-space and Formatting]]&lt;br /&gt;
* [[LSL 101/Strings and Simple Output|Simplest Output]]&lt;br /&gt;
* [[LSL 101/The touch_start Event|The touch_start Event]]&lt;br /&gt;
* [[LSL 101/Creating a Script|Creating a Script]]&lt;br /&gt;
* [[LSL 101/Compile Time Errors|Compile Time Errors]]&lt;br /&gt;
* [[LSL 101/Functions That Return a Value|Functions That Return a Value]]&lt;br /&gt;
* [[LSL 101/String Concatenation|String Concatenation]]&lt;br /&gt;
* [[LSL 101/Variables|Variables]]&lt;br /&gt;
* [[LSL 101/Global vs Local Variables|Global vs Local Variables]]&lt;br /&gt;
* [[LSL 101/Variable Initialization|Variable Initialization]]&lt;br /&gt;
* [[LSL 101/Event Handler Parameters|Event Handler Parameters]]&lt;br /&gt;
* [[LSL 101/|...]]&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/The_touch_start_Event&amp;diff=381973</id>
		<title>LSL 101/The touch start Event</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/The_touch_start_Event&amp;diff=381973"/>
		<updated>2009-06-03T21:47:15Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Strings and Simple Output|next=Creating a Script}}&lt;br /&gt;
&lt;br /&gt;
Here&#039;s our sample program, with a second event handler added.  The touch_start event occurs whenever any avatar clicks on the object containing the script.  Note again that the name of the event must be spelled touch_start, with the underscore.  (The underscore doesn&#039;t show up in the title of this page just because the Wiki software displays underscores in titles as spaces.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
     state_entry()&lt;br /&gt;
     {&lt;br /&gt;
          // Let the object&#039;s owner know the script is working&lt;br /&gt;
          llOwnerSay( &amp;quot;Congratulations! Your script has started to execute.&amp;quot; );&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     touch_start( integer num_detected )&lt;br /&gt;
     {&lt;br /&gt;
          // Let the object&#039;s owner know the script is working&lt;br /&gt;
          llOwnerSay( &amp;quot;I&#039;ve been touched!&amp;quot; );&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;start&#039;&#039; part of the event name refers to the fact that this event is generated whenever a user presses the left mouse button while the cursor is over the object.  If for some reason you wanted your code to execute when the user lifted the button instead of pressing it, that event is named touch_end.&lt;br /&gt;
&lt;br /&gt;
If a user clicks on your object many times, the touch_start event handler code will generally get executed many times, once for each click.  But if multiple users click on your object at approximately the same time, SL may not invoke your code for each one separately.  Instead, it may combine two or more of the touches into one event.  In case your script really needs to respond separately to each touch, SL will tell you how many touches an execution of the touch_start event handler represents.  That&#039;s the purpose of the phrase &amp;quot;integer num_detected&amp;quot; between the parentheses following touch_start.  But before fully explaining how that works, we need to learn some other things, so we won&#039;t elaborate on that yet.&lt;br /&gt;
&lt;br /&gt;
Rightnow, let&#039;s look at the process for actually [[LSL 101\Creating a Script|creating a script]] in SL.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Comments,_White-space_and_Formatting&amp;diff=381963</id>
		<title>LSL 101/Comments, White-space and Formatting</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Comments,_White-space_and_Formatting&amp;diff=381963"/>
		<updated>2009-06-03T21:46:33Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Simple Script Skeleton|next=Strings and Simple Output}}&lt;br /&gt;
Here&#039;s another valid LSL script.&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// This is a valid, but horribly formatted, script &lt;br /&gt;
default{state_entry(){}}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
The first line is called a &#039;&#039;&#039;comment&#039;&#039;&#039;.  Anything following // on a line is ignored by the computer.  Comments are intended solely for the human reader of the script.  Since a successful script will invariable be read by humans, it&#039;s just as important to make them understandable to humans as to the computer that is going to execute them.  In general, the most useful comments are those that explain the script on a higher level than the individual LSL statements.  An explanation of what a section of script is intended to do is much more helpful that a line-by-line translation of LSL commands into English.&lt;br /&gt;
&lt;br /&gt;
The second thing this script illustrates is that &#039;&#039;&#039;white space&#039;&#039;&#039; characters (blanks, tabs and separate lines) are, for the most part, entirely optional.  They can be added or removed without changing how the computer executes the script.  The major exceptions are 1) a new line always ends a comment and 2) you can&#039;t insert a space or tab in a name or number.  For example, you can&#039;t write&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
     // These are NOT valid LSL fragments&lt;br /&gt;
     state entry     // This would be interpreted as two separate names&lt;br /&gt;
     123 456         // ... and this as two separate numbers.&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A generous use of comments and white space can make a script much easier to understand.  When you first start writing scripts, you probably won&#039;t think that&#039;s very important.  But the first time you go back and try to read your &#039;&#039;own&#039;&#039; script after being away from it for a week or two, you&#039;ll start to appreciate how important good comments and formatting are.  And you don&#039;t save anything significant by being parsimonious.  The form of the script that is actually executed (called the &#039;&#039;&#039;compiled&#039;&#039;&#039; version) has all the comments and white space removed, so they don&#039;t cause the script to execute any slower, or take up any extra memory.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s [[LSL 101/Strings and Simple Output|continue]] the development of our simple example program.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Simplest_Output&amp;diff=381953</id>
		<title>LSL 101/Simplest Output</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Simplest_Output&amp;diff=381953"/>
		<updated>2009-06-03T21:45:24Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: LSL 101/Simplest Output moved to LSL 101/Strings and Simple Output: More descriptive title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[LSL 101/Strings and Simple Output]]&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Strings_and_Simple_Output&amp;diff=381943</id>
		<title>LSL 101/Strings and Simple Output</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Strings_and_Simple_Output&amp;diff=381943"/>
		<updated>2009-06-03T21:45:24Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: LSL 101/Simplest Output moved to LSL 101/Strings and Simple Output: More descriptive title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Comments, White-space and Formatting|next=The touch_start Event}}&lt;br /&gt;
&lt;br /&gt;
Here&#039;s our sample program, with a line added so that the script actually does something.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
     state_entry()&lt;br /&gt;
     {&lt;br /&gt;
          // Let the object&#039;s owner know the script is working&lt;br /&gt;
          llOwnerSay( &amp;quot;Congratulations! Your script has started to execute.&amp;quot; );&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line that starts with llOwnerSay is a &#039;&#039;&#039;statement&#039;&#039;&#039; that instructs the object containing the script to chat a text message that will only be seen by the object&#039;s owner.  Since you will usually be scripting objects you own, this will generally be you.  This is a convenient way to get information about what your script is doing, without spamming text chat to everyone around you. But if you have an occasion (and permission) to script someone else&#039;s object, you would want to use one of the other communication statements, which we&#039;ll discuss in due time.&lt;br /&gt;
&lt;br /&gt;
Take a look at the punctuation in this line.  Every statement in LSL &#039;&#039;must&#039;&#039; end with a semicolon.  This is probably the easiest punctuation mark to overlook, but if it isn&#039;t there, your script isn&#039;t acceptable.  Furthermore, the error message you get will probably puzzle you, because it will tell you the error is on the line &#039;&#039;following&#039;&#039; the missing semicolon, and it won&#039;t tell you that it is a semicolon that is missing.  So work especially hard at remembering your semicolons.&lt;br /&gt;
&lt;br /&gt;
The next set of punctuation marks to observe is the pair of double quote marks surrounding the text &amp;quot;Congratulations! Your script has started to execute.&amp;quot;.  Double quote marks always come in pairs, and they, together with whatever characters come between them, are called a &#039;&#039;&#039;string&#039;&#039;&#039;.  Strings can contain any printable characters (although a few require a special trick).  The most important use of strings is to display text in SL.  The actual content of a string does not have any effect on how your script runs, unless you specifically write code to examine the string and take different actions depending on what the content is.&lt;br /&gt;
&lt;br /&gt;
The final set of punctuation, the parentheses, are associated with the name llOwnerSay.  llOwnerSay is our first example of a &#039;&#039;&#039;built-in function&#039;&#039;&#039;.  Built-in functions always start with the lower case &amp;quot;ll&amp;quot; (for Linden Labs).  A built-in function will typically tell the Second Life server to do something (like display text or change the position of a prim) or make a query about the SL world (such as what avatars are nearby).  There are hundreds of different built-in functions.  Once you get the basics of scripting down, most of your learning time will be spent finding out which built-in functions do what you want to do, along with the nitty-gritty of how they work.  Fortunately, most scripts need only a handful of different functions, so you won&#039;t need to learn hundreds, or even tens, of built-in functions before you can write simple scripts.&lt;br /&gt;
&lt;br /&gt;
The general pattern for using a built-in function is &lt;br /&gt;
&lt;br /&gt;
    llXXX( &#039;&#039;parameter1&#039;&#039;, &#039;&#039;paramter2&#039;&#039;, ... )&lt;br /&gt;
&lt;br /&gt;
where llXXX refers to any built-in function and the number of parameters is different for different built-in functions.  For example, llOwnerSay always takes one parameter, and that parameter has to be a string.  Commas separate parameters, so if there is only one parameter, no comma is needed (or allowed).&lt;br /&gt;
&lt;br /&gt;
Now that we know how to make something visible happen in SL, let&#039;s add a second [[LSL 101/The touch_start Event|event handler]].&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Event_Handler_Parameters&amp;diff=381923</id>
		<title>LSL 101/Event Handler Parameters</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Event_Handler_Parameters&amp;diff=381923"/>
		<updated>2009-06-03T21:37:58Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Variable Initialization|next=}}&lt;br /&gt;
&lt;br /&gt;
When we introduced the [[LSL 101/The touch_start Event|touch_start event handler]], we put off explaining the meaning of what was between the parentheses in this line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; touch_start( integer num_detected )&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The time has come when we can easily explain this.  The phrase &#039;&#039;integer num_detected&#039;&#039; is a declaration of a local variable that has been created and initialized by the sim server.  The server initializes it with the number of distinct touches that have occurred since the last time the touch_start handler was called.&lt;br /&gt;
&lt;br /&gt;
Consider this script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer TotalTouches = 0;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
     touch_start( integer num_detected )&lt;br /&gt;
     {&lt;br /&gt;
          // Update the total number of touches&lt;br /&gt;
          TotalTouches = TotalTouches + num_detected;&lt;br /&gt;
&lt;br /&gt;
          // Announce the current total&lt;br /&gt;
          llOwnerSay( &amp;quot;I have been touched a total of &amp;quot; + (string)TotalTouches + &amp;quot; times.&amp;quot; );&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have a global variable &#039;&#039;TotalTouches&#039;&#039; which is accumulating the total number of times our object is touched.  Each time the touch_start event handler is called, the sim server initializes &#039;&#039;num_detected&#039;&#039; to be the number of times the object was touched since the previous execution of &#039;&#039;touch_start&#039;&#039;.  If you test this by yourself, chances are that &#039;&#039;TotalTouches &#039;&#039; will always be incrementing by one.  But if you get a bunch of your friends together and have them all touch the object as rapidly as they can, sometimes you will see &#039;&#039;TotalTouches&#039;&#039; incrementing by more than one. &lt;br /&gt;
&lt;br /&gt;
There are many event handlers (about 35 different ones in all) and most of them have one or more parameters.  The details will differ with the event, but the idea is always the same.  Each event handler handles one particular type of event and the parameters in the event handler provide the script with the specific details.&lt;br /&gt;
&lt;br /&gt;
On a side note, we see from this example that a script doesn&#039;t &#039;&#039;have&#039;&#039; to have a state_entry event handler.  A script has to have at least one event handler, but nothing needs to be do when the script starts up, it isn&#039;t necessary to put in an empty state_entry handler.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Event_Handler_Parameters&amp;diff=381053</id>
		<title>LSL 101/Event Handler Parameters</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Event_Handler_Parameters&amp;diff=381053"/>
		<updated>2009-06-03T05:26:12Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Variable Initialization|next=}}&lt;br /&gt;
&lt;br /&gt;
When we introduced the [[LSL 101/The touch_start Event|touch_start event handler]], we put off explaining the meaning of what was between the parentheses in this line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; touch_start( integer num_detected )&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The time has come when we can easily explain this.  The phrase &#039;&#039;integer num_detected&#039;&#039; is a declaration of a local variable that has been created and initialized by the sim server.  The server initializes it with the number of distinct touches that have occurred since the last time the touch_start handler was called.&lt;br /&gt;
&lt;br /&gt;
Consider this script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer TotalTouches = 0;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
     touch_start( integer num_detected )&lt;br /&gt;
     {&lt;br /&gt;
          // Update the total number of touches&lt;br /&gt;
          TotalTouches = TotalTouches + num_detected;&lt;br /&gt;
&lt;br /&gt;
          // Announce the current total&lt;br /&gt;
          llOwnerSay( &amp;quot;I have been touched a total of &amp;quot; + (string)TotalTouches + &amp;quot; times.&amp;quot; );&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Variable_Initialization&amp;diff=381033</id>
		<title>LSL 101/Variable Initialization</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Variable_Initialization&amp;diff=381033"/>
		<updated>2009-06-03T05:15:29Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Global vs Local Variables|next=Event Handler Parameters}}&lt;br /&gt;
&lt;br /&gt;
When a variable declaration is executed, the variable always gets &#039;&#039;some&#039;&#039; initial value, whether or not our script specifies.  This is called &#039;&#039;&#039;variable initialization&#039;&#039;&#039;, and it deserves a little discussion of its own.  So far, we have passed over this detail by always executing an assignment statement for the variable prior to using it.  But consider this example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;string RegionName;    // This is a global variable&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
     state_entry()&lt;br /&gt;
     {&lt;br /&gt;
          // Store the name of the current sim for later use&lt;br /&gt;
          RegionName = llGetRegionName();&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     touch_start( integer num_detected )&lt;br /&gt;
     {&lt;br /&gt;
          // Announce the region where the script is running&lt;br /&gt;
          string WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&lt;br /&gt;
          llOwnerSay( WelcomePhrase );&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only difference between the previous example and this one is that we have replaced the two lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase&lt;br /&gt;
 WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the single line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first version allocates the variable and initializes it with the string containing no characters (written as &amp;quot;&amp;quot;).  Then, it updates the variable with the string &amp;quot;Welcome to Ganymede.&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The second version both declares the variable and initializes it with the value &amp;quot;Welcome to Ganymede.&amp;quot; in the same statement.  The syntax for this is easy to remember because it is written as though the declaration and assignment statements were rolled into one.  But keep in mind that this is not simply another form of an assignment statement.  For example, the following code fragment is &#039;&#039;&#039;not&#039;&#039;&#039; legal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName;&lt;br /&gt;
 string WelcomePhrase = WelcomePhrase + &amp;quot;.&amp;quot;;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is not legal because the second statement is an attempt to declare a variable that already exists, and isn&#039;t allowed.&lt;br /&gt;
&lt;br /&gt;
Any declaration of a local variable can be followed by the assignment symbol and an initialization expression that follows the same form as an assignment statement.  As a matter of fact, providing an initial value is generally considered a good practice, and most example you see will probably do that.&lt;br /&gt;
&lt;br /&gt;
However, the rules for initializing a &#039;&#039;global&#039;&#039; variable are different.  Global variables can have a initializer, but it can only be a simple value.  It can&#039;t be the result of a built-in function and can&#039;t have any operators.  This, we could &#039;&#039;&#039;not&#039;&#039;&#039; change our global variable declaration to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;string RegionName = llGetRegionName();    // This is a global variable&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, we could do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;string RegionName = &amp;quot;Region not known&amp;quot;;    // This is a global variable&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initializing global variables to a unique value like this has an advantage over letting it be compiled with the empty string.  When testing your script, if the phrase &amp;quot;Region not known&amp;quot; appears in the output where you expected a region name, you&#039;ll immediately know that no assignment to that variable was ever executed.  If, on the other hand, the region name was simply missing (i.e. the empty string), it might be less obvious where things went wrong.&lt;br /&gt;
&lt;br /&gt;
Now that we&#039;re discussed local variables and initialization, we can explain [[LSL 101/Event Handler Parameters|event handler parameters]], which we put off explaining when they first appeared.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Variable_Initialization&amp;diff=381023</id>
		<title>LSL 101/Variable Initialization</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Variable_Initialization&amp;diff=381023"/>
		<updated>2009-06-03T04:57:19Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Global vs Local Variables|next=Event Handler Parameters}}&lt;br /&gt;
&lt;br /&gt;
When a variable declaration is executed, the variable always gets &#039;&#039;some&#039;&#039; initial value, whether or not our script specifies.  This is called &#039;&#039;&#039;variable initialization&#039;&#039;&#039;, and it deserves a little discussion of its own.  So far, we have passed over this detail by always executing an assignment statement for the variable prior to using it.  But consider this example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;string RegionName;    // This is a global variable&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
     state_entry()&lt;br /&gt;
     {&lt;br /&gt;
          // Store the name of the current sim for later use&lt;br /&gt;
          RegionName = llGetRegionName();&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     touch_start( integer num_detected )&lt;br /&gt;
     {&lt;br /&gt;
          // Announce the region where the script is running&lt;br /&gt;
          string WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&lt;br /&gt;
          llOwnerSay( WelcomePhrase );&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only difference between the previous example and this one is that we have replaced the two lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase&lt;br /&gt;
 WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the single line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first version allocates the variable and initializes it with the string containing no characters (written as &amp;quot;&amp;quot;).  Then, it updates the variable with the string &amp;quot;Welcome to Ganymede.&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The second version both declares the variable and initializes it with the value &amp;quot;Welcome to Ganymede.&amp;quot; in the same statement.  The syntax for this is easy to remember because it is written as though the declaration and assignment statements were rolled into one.  But keep in mind that this is not simply another form of an assignment statement.  For example, the following code fragment is &#039;&#039;&#039;not&#039;&#039;&#039; legal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName;&lt;br /&gt;
 string WelcomePhrase = WelcomePhrase + &amp;quot;.&amp;quot;;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is not legal because the second statement is an attempt to declare a variable that already exists, and isn&#039;t allowed.&lt;br /&gt;
&lt;br /&gt;
Any declaration of a local variable can be followed by the assignment symbol and an initialization expression that follows the same form as an assignment statement.  As a matter of fact, providing an initial value is generally considered a good practice, and most example you see will probably do that.&lt;br /&gt;
&lt;br /&gt;
However, the rules for initializing a &#039;&#039;global&#039;&#039; variable are different.  Global variables can have a initializer, but it can only be a simple value.  It can&#039;t be the result of a built-in function and can&#039;t have any operators.  This, we could &#039;&#039;&#039;not&#039;&#039;&#039; change our global variable declaration to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;string RegionName = llGetRegionName();    // This is a global variable&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the other hand, we could do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;string RegionName = &amp;quot;Region not known&amp;quot;;    // This is a global variable&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initializing global variables to a unique value like this has an advantage over letting it be compiled with the empty string.  When testing your script, if the phrase &amp;quot;Region not known&amp;quot; appears in the output where you expected a region name, you&#039;ll immediately know that no assignment to that variable was ever executed.  If, on the other hand, the region name was simply missing (i.e. the empty string), it might be less obvious where things went wrong.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Variable_Initialization&amp;diff=380873</id>
		<title>LSL 101/Variable Initialization</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Variable_Initialization&amp;diff=380873"/>
		<updated>2009-06-03T00:25:32Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Global vs Local Variables|next=Event Handler Parameters}}&lt;br /&gt;
&lt;br /&gt;
When a variable declaration is executed, the variable always gets &#039;&#039;some&#039;&#039; initial value, whether or not our script specifies.  This is called &#039;&#039;&#039;variable initialization&#039;&#039;&#039;, and it deserves a little discussion of its own.  So far, we have passed over this detail by always executing an assignment statement for the variable prior to using it.  But consider this example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;string RegionName;    // This is a global variable&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
     state_entry()&lt;br /&gt;
     {&lt;br /&gt;
          // Store the name of the current sim for later use&lt;br /&gt;
          RegionName = llGetRegionName();&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     touch_start( integer num_detected )&lt;br /&gt;
     {&lt;br /&gt;
          // Announce the region where the script is running&lt;br /&gt;
          string WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&lt;br /&gt;
          llOwnerSay( WelcomePhrase );&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only difference between the previous example and this one is that we have replaced the two lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase&lt;br /&gt;
 WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the single line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It looks as though we have combined the variable declaration and the assignment statement into one statement, and in effect, that is what we have done.  Any declaration of a local variable can be followed by the assignment symbol and an expression that follows the same rules as that for an assignment statement.  As a matter of fact, this is generally considered a good practice, and most example you see will probably do that.&lt;br /&gt;
&lt;br /&gt;
However, the rules for initializing a &#039;&#039;global&#039;&#039; variable are different.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Global_vs_Local_Variables&amp;diff=380853</id>
		<title>LSL 101/Global vs Local Variables</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Global_vs_Local_Variables&amp;diff=380853"/>
		<updated>2009-06-03T00:05:08Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Variables|next=Variable Initialization}}&lt;br /&gt;
&lt;br /&gt;
A variables whose declaration occurs before the word &#039;&#039;&#039;default&#039;&#039;&#039; is called a &#039;&#039;&#039;global&#039;&#039;&#039; variable.  Global variables are accessible to all event handlers in the script.  But consider this example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;string RegionName;    // This is a global variable&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
     state_entry()&lt;br /&gt;
     {&lt;br /&gt;
          // Store the name of the current sim for later use&lt;br /&gt;
          RegionName = llGetRegionName();&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     touch_start( integer num_detected )&lt;br /&gt;
     {&lt;br /&gt;
          // Announce the region where the script is running&lt;br /&gt;
          string WelcomePhrase;&lt;br /&gt;
          WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&lt;br /&gt;
          llOwnerSay( WelcomePhrase );&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only difference between this and the previous example is that we replaced the one line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; llOwnerSay( &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the three lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase;&lt;br /&gt;
 WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&lt;br /&gt;
 llOwnerSay( WelcomePhrase );&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This change doesn&#039;t change the result of the script.  But it does break up the one slightly complex line into smaller pieces.  In this case, the one line wasn&#039;t complex enough to cause a problem, but scripts that involve more computation can be much easier to read when the computation is broken up into smaller pieces.  To do this, variables with meaningful names can be used to hold the intermediate results.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk through the execution of the touch_start handler.  The first executable statement is the variable declaration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called a &#039;&#039;&#039;local&#039;&#039;&#039; variable because its use is going to be restricted to this event handler.  Just like the global variable &#039;&#039;RegionName&#039;&#039;, the declaration causes the sim server to reserve a chunk of memory capable of storing a string and to give that chunk of memory the name &#039;&#039;WelcomePhrase&#039;&#039;.  What is different is that this declaration is executed &amp;lt;u&amp;gt;each&amp;lt;/u&amp;gt; time the touch_start handler is executed, whereas the global declaration is only executed once.&lt;br /&gt;
&lt;br /&gt;
The next line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is straighforward.  It creates the string just as before, and then assigns the whole string to the variable &#039;&#039;WelcomePhrase&#039;&#039;.  The third line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; llOwnerSay( WelcomePhrase );&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
retrieves the value stored in the variable &#039;&#039;WelcomePhrase&#039;&#039; and passes it to &#039;&#039;llOwnerSay&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note that if we really wanted to, we could break things up into even smaller pieces.  Consider the following fragment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase;&lt;br /&gt;
 WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName;&lt;br /&gt;
 WelcomePhrase = WelcomePhrase + &amp;quot;.&amp;quot;;&lt;br /&gt;
 llOwnerSay( WelcomePhrase );&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This version breaks up the two string concatenations into two separate commands.  The first assignment statement&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
results in the variable &#039;&#039;WelcomePhrase&#039;&#039; holding the string &amp;quot;Welcome to Ganymede&amp;quot; (assuming that we&#039;re executing the script in Ganymede).&lt;br /&gt;
&lt;br /&gt;
The second assignment statement&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; WelcomePhrase = WelcomePhrase + &amp;quot;.&amp;quot;;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
takes the current value of &#039;&#039;WelcomePhrase&#039;&#039;, concatenates the &amp;quot;.&amp;quot; and stores the new result back in the the variable &#039;&#039;WelcomePhrase&#039;&#039;.  This process of replacing the current value of a variable with a new one is called &#039;&#039;&#039;updating&#039;&#039;&#039; the variable.&lt;br /&gt;
&lt;br /&gt;
Remember we said that memory was set aside for &#039;&#039;WelcomePhrase&#039;&#039; each time the touch_start handler is executed.  You might think that this would slowly use up the memory that is available to the script.  But this doesn&#039;t happen because at the end of the touch_start event handler, the server&amp;quot;un-reserves&amp;quot; the memory, allowing it to be used again when it is needed for some other purpose.&lt;br /&gt;
&lt;br /&gt;
It is preferable to use local variables instead of global variables any time a value doesn&#039;t need to be retained once the event handler completes.  (The reserving and un-reserving of local variables happens so efficiently that it is not a significant contribution to the work the sim server has to perform.)&lt;br /&gt;
&lt;br /&gt;
There are other variations on local variables that we will discuss as the need arises.  But first, let&#039;s talk about [[LSL 101/Variable Initialization|variable initialization]].&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Global_vs_Local_Variables&amp;diff=380272</id>
		<title>LSL 101/Global vs Local Variables</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Global_vs_Local_Variables&amp;diff=380272"/>
		<updated>2009-06-02T16:28:45Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Variables|next=Variable Initialization}}&lt;br /&gt;
&lt;br /&gt;
A variables whose declaration occurs before the word &#039;&#039;&#039;default&#039;&#039;&#039; is called a &#039;&#039;&#039;global&#039;&#039;&#039; variable.  Global variables are accessible to all event handlers in the script.  But consider this example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;string RegionName;    // This is a global variable&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
     state_entry()&lt;br /&gt;
     {&lt;br /&gt;
          // Store the name of the current sim for later use&lt;br /&gt;
          RegionName = llGetRegionName();&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     touch_start( integer num_detected )&lt;br /&gt;
     {&lt;br /&gt;
          // Announce the region where the script is running&lt;br /&gt;
          string WelcomePhrase;&lt;br /&gt;
          WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&lt;br /&gt;
          llOwnerSay( WelcomePhrase );&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only difference between this and the previous example is that we replaced the one line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; llOwnerSay( &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the three lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase;&lt;br /&gt;
 WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&lt;br /&gt;
 llOwnerSay( WelcomePhrase );&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This change doesn&#039;t change the result of the script.  But it does break up the one slightly complex line into smaller pieces.  In this case, the one line wasn&#039;t complex enough to cause a problem, but scripts that involve more computation can be much easier to read when the computation is broken up into smaller pieces.  To do this, variables with meaningful names can be used to hold the intermediate results.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk through the execution of the touch_start handler.  The first executable statement is the variable declaration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called a &#039;&#039;&#039;local&#039;&#039;&#039; variable because its use is going to be restricted to this event handler.  Just like the global variable &#039;&#039;RegionName&#039;&#039;, the declaration causes the sim server to reserve a chunk of memory capable of storing a string and to give that chunk of memory the name &#039;&#039;WelcomePhrase&#039;&#039;.  What is different is that this declaration is executed &amp;lt;u&amp;gt;each&amp;lt;/u&amp;gt; time the touch_start handler is executed, whereas the global declaration is only executed once.&lt;br /&gt;
&lt;br /&gt;
The next line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is straighforward.  It creates the string just as before, and then assigns the whole string to the variable &#039;&#039;WelcomePhrase&#039;&#039;.  The third line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; llOwnerSay( WelcomePhrase );&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
retrieves the value stored in the variable &#039;&#039;WelcomePhrase&#039;&#039; and passes it to &#039;&#039;llOwnerSay&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note that if we really wanted to, we could break things up into even smaller pieces.  Consider the following fragment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase;&lt;br /&gt;
 WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName;&lt;br /&gt;
 WelcomePhrase = WelcomePhrase + &amp;quot;.&amp;quot;;&lt;br /&gt;
 llOwnerSay( WelcomePhrase );&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This version breaks up the two string concatenations into two separate commands.  The first assignment statement&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
results in the variable &#039;&#039;WelcomePhrase&#039;&#039; holding the string &amp;quot;Welcome to Ganymede&amp;quot; (assuming that we&#039;re executing the script in Ganymede).&lt;br /&gt;
&lt;br /&gt;
The second assignment statement&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; WelcomePhrase = WelcomePhrase + &amp;quot;.&amp;quot;;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
takes the current value of &#039;&#039;WelcomePhrase&#039;&#039;, concatenates the &amp;quot;.&amp;quot; and stores the new result back in the the variable &#039;&#039;WelcomePhrase&#039;&#039;.  This process of replacing the current value of a variable with a new one is called &#039;&#039;&#039;updating&#039;&#039;&#039; the variable.&lt;br /&gt;
&lt;br /&gt;
Remember we said that memory was set aside for &#039;&#039;WelcomePhrase&#039;&#039; each time the touch_start handler is executed.  You might think that this would slowly use up the memory that is available to the script.  But this doesn&#039;t happen because at the end of the touch_start event handler, the server&amp;quot;un-reserves&amp;quot; the memory, allowing it to be used again when it is needed for some other purpose.&lt;br /&gt;
&lt;br /&gt;
It is preferable to use local variables instead of global variables any time a value doesn&#039;t need to be retained once the event handler completes.  (The reserving and un-reserving of local variables happens so efficiently that it is not a significant contribution to the work the sim server has to perform.)&lt;br /&gt;
&lt;br /&gt;
There are other variations on local variables that we will discuss as the need arises.  But now is a good time to talk about [[Event Handler Parameters|event handler parameters]], which are another form of local variables.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Language_Topics_in_Focus&amp;diff=379783</id>
		<title>LSL 101/Language Topics in Focus</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Language_Topics_in_Focus&amp;diff=379783"/>
		<updated>2009-06-01T22:59:50Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NavNextPrev|prev=A Gentle Introduction|next=Built-in Functions in Focus}}&lt;br /&gt;
[[Category:LSL 101]]&lt;br /&gt;
{{LSL Wikibook Index}}&lt;br /&gt;
This section contains in-depth discussions on various LSL language topics.  For discussion of the built-in library functions, see [[LSL 101/Built-in Functions in Focus|Built-in Functions in Focus]].&lt;br /&gt;
&lt;br /&gt;
* [[LSL 101/LSL in Focus: Types|Types]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Integers|Integers]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Floats|Floats]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Strings|Strings]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Keys|Keys]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Lists|Lists]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Vectors|Vectors]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Rotations|Rotations]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Operators|Operators]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Constants|Constants]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Variables|Variables]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Scopes|Scopes]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Events and Event Handlers|Events and Event Handlers]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: States|States]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Flow Control|Flow Control]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: User-defined functions|User-defined functions]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Errors|Errors]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Compile-time Errors|Compile-time Errors]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Run-time Errors|Run-time Errors]]&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/LSL_in_Focus:_Lists&amp;diff=379763</id>
		<title>LSL 101/LSL in Focus: Lists</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/LSL_in_Focus:_Lists&amp;diff=379763"/>
		<updated>2009-06-01T22:38:18Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NavNextPrev|prefix=LSL in Focus:_|prev=Keys|topic=Language Topics in Focus|next=Vectors}}&lt;br /&gt;
&lt;br /&gt;
For the time being at least, see the LSL Portal entry [[LSL List]].&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/LSL_in_Focus:_Types&amp;diff=379753</id>
		<title>LSL 101/LSL in Focus: Types</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/LSL_in_Focus:_Types&amp;diff=379753"/>
		<updated>2009-06-01T22:37:18Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NavNextPrev|prefix=LSL in Focus:_|prev=|topic=Language Topics in Focus|next=Integers}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Summary of Types=&lt;br /&gt;
In a scripting language, &#039;&#039;&#039;types&#039;&#039;&#039; are a way of categorizing the values that the language can manipulate.  In LSL, there are seven different types.  Each of these types has its own representation and its own set of operations and/or built-in functions for manipulating values of that type.  Here&#039;s a quick overview of each type and how it is used in LSL.&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus:Integers|Integers]]==&lt;br /&gt;
&lt;br /&gt;
Integers are (a subset of) the basic &amp;quot;whole&amp;quot; numbers -- positive, negative and zero -- of mathematics.  They are a very fundamental type in most computer languages.  In LSL, they are used in four distinct ways.&lt;br /&gt;
&lt;br /&gt;
* [[LSL 101/LSL in Focus:Integers#Signed Integers|Signed Integers]]&lt;br /&gt;
* [[LSL 101/LSL in Focus:Integers#Truth Values (Booleans)|Truth Values (Booleans)]]&lt;br /&gt;
* [[LSL 101/LSL in Focus:Integers#Enumerations|Enumerations]]&lt;br /&gt;
* [[LSL 101/LSL in Focus:Integers#Bit Vectors|Bit Vectors]]&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Floats|Floats]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Strings|Strings]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Keys|Keys]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Lists|Lists]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Vectors|Vectors]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Rotations|Rotations]]==&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/LSL_in_Focus:_Integers&amp;diff=379743</id>
		<title>LSL 101/LSL in Focus: Integers</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/LSL_in_Focus:_Integers&amp;diff=379743"/>
		<updated>2009-06-01T22:36:34Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NavNextPrev|prefix=LSL in Focus:_|prev=Types|topic=Language Topics in Focus|next=Floats}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Integers in LSL roughly correspond to integers in mathematics.  They can be written in either the familiar decimal (e.g. 20, 0, -1) or [[#Hexadecimal Notation|hexadecimal]] (e.g. 0x14, 0x0, 0xFFFFFFFF).&lt;br /&gt;
&lt;br /&gt;
Integers in LSL are used in four distinct ways:&lt;br /&gt;
* Signed integers&lt;br /&gt;
* Truth values (Booleans)&lt;br /&gt;
* Enumerations&lt;br /&gt;
* Bit vectors&lt;br /&gt;
&lt;br /&gt;
There are a three operators, namely = (assignment), == (test for equality) and != (test for inequality) that are common to all uses of integers.  Other than those, the four different uses of integers generally involve separate sets of operators.&lt;br /&gt;
&lt;br /&gt;
== Signed Integers ==&lt;br /&gt;
This is the use of integers that corresponds to the normal use in mathematics.  The only substantive difference is that in mathematics, there are infinitely many integers, while in LSL integers are limited to the range −2,147,483,648 to 2,147,483,647.  Also, in LSL, no commas or other separators are allowed when writing integers, so these numbers would be written −2147483648 and 2147483647.&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
LSL has the normal arithmetic operators +, -, * and / (for division).  The first three have the same meaning as what you used in grade school &#039;&#039;&#039;as long as the result is in the range −2147483648 to 2147483647&#039;&#039;&#039;.  If the result is outside that range, different rules apply. The typical scripter doesn&#039;t need to use numbers that are so big (or small), so there&#039;s nor reason to feel you need to learn the details of what happens when the limits are exceeded.  But there are instances where it is actually useful to allow numbers to exceed the limits. For the details of what happens in that case, see the Integer Overflow section, below.&lt;br /&gt;
&lt;br /&gt;
Division of integers in LSL is a variation on what you learned in elementary school. If the division results in a whole number, say 10/2, the answer is 5.  But 15/2 is neither 7.5 nor 7 with a remainder of 1.  Instead, it is exactly 7.  Any remainder is simply thrown away.  Alternatively, you can think of it as being rounded toward zero.  It&#039;s more accurate to say &amp;quot;rounded toward zero&amp;quot; than &amp;quot;rounded down&amp;quot;, because -15/2 is -7, not -8.  If you&#039;re scripting something where you really want 15 divided by 2 to be 7.5, don&#039;t despair.  You&#039;ll just need to use the &amp;quot;float&amp;quot; type instead of integers.&lt;br /&gt;
&lt;br /&gt;
Closely related to integer division is the remainder operator, written as %.  It gives you what would remain if you were to ask for integer division on the same numbers.  Here are some examples:&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer i;&lt;br /&gt;
 i = 15 % 2;     // i is assigned the value 1&lt;br /&gt;
 i = 15 % 4;     // i is assigned the value 3&lt;br /&gt;
 i = -15 % 4;    // i is assigned the value -3&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If an attempt is made to divide by 0 (using either / or %), a run-time error occurs and script execution halts.&lt;br /&gt;
&lt;br /&gt;
Each of the arithmetic operators also has a corresponding assignment type operation.  For example&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer x;&lt;br /&gt;
 integer y;&lt;br /&gt;
 x += y;    // Synonymous with x = x + y;&lt;br /&gt;
 x -= y;    // Synonymous with x = x - y;&lt;br /&gt;
 x *= y;    // Synonymous with x = x * y;&lt;br /&gt;
 x /= y;    // Synonymous with x = x / y;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, since incrementing or decrementing by 1 is quite common, is special unary operator for that. The operator is written ++ and is pronounced plus-plus. To increment the variable i by 1, we can write either ++i or i++.  So for example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer i = 0;&lt;br /&gt;
 i++;     // i now has the value of 1&lt;br /&gt;
 ++i;     // i now has the value of 2&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But the two operators are not identical, because i++ and ++i are expressions that can occur as part of a larger expression.  When used as part of a larger expression, i++ contributes its value to the expression &#039;&#039;before&#039;&#039; it is incremented.  For example, the fragment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer i = 0;&lt;br /&gt;
 if (i++ == 0)&lt;br /&gt;
    llSay( 0, &amp;quot;The value of i was 0 when the comparison was done&amp;quot; )&lt;br /&gt;
 else&lt;br /&gt;
    llSay( 0, &amp;quot;The value of i was 1 when the comparison was done&amp;quot; )&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
would chat &amp;quot;The value of i was 0 when the comparison was done&amp;quot; even though i ends up with the value of 1.  On the other hand, if we switch i++ to ++i, i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer i = 0;&lt;br /&gt;
 if (++i == 0)&lt;br /&gt;
    llSay( 0, &amp;quot;The value of i was 0 when the comparison was done&amp;quot; )&lt;br /&gt;
 else&lt;br /&gt;
    llSay( 0, &amp;quot;The value of i was 1 when the comparison was done&amp;quot; )&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the chat output would be &amp;quot;The value of i was 1 when the comparison was done&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The operator minus-minus (written --) works similarly.&lt;br /&gt;
&lt;br /&gt;
=== Comparison Operators ===&lt;br /&gt;
In addition to the arithmetic operators, there are also the normal integer comparison operators &amp;lt; (less than) and &amp;gt; (greater than).  For &amp;quot;less than or equal&amp;quot;, or &amp;quot;greater than or equal&amp;quot;, there are two-character operators &amp;lt;= and &amp;gt;=.  There can&#039;t be any space between the two characters of a two-character operator. &lt;br /&gt;
&lt;br /&gt;
The result of a comparison operator is either 0 (representing &#039;&#039;&#039;FALSE&#039;&#039;&#039;) or 1 (representing &#039;&#039;&#039;TRUE&#039;&#039;&#039;).  See [[#Truth Values (Booleans)|Truth Values (Booleans)]].&lt;br /&gt;
&lt;br /&gt;
=== Integer Overflow ===&lt;br /&gt;
* During script execution, integers wraps from 2147483647 to -2147483648 in the normal way&lt;br /&gt;
* The compiler treats integers outside the range -2147483648 to 2147483647 somewhat strangely.  No compile time warning or error is generated. (If the following explanation, doesn&#039;t make sense to you don&#039;t worry -- just know to avoid using numbers outside the valid range in your script.)  &lt;br /&gt;
** For an integer outside the range -2147483648 to 2147483647, the absolute value of the number is reduced to fall in the range 0 to 4294967295 (0xFFFFFFFF).  &lt;br /&gt;
** This number is then parsed as an unsigned 32 bit integer and cast to the corresponding signed integer.  &lt;br /&gt;
** If the value in the script had a negative sign, the sign of the internal representation is switched.&lt;br /&gt;
** The net effect is that very large positive numbers get mapped to -1 and very large negative numbers get mapped to 1.&lt;br /&gt;
&lt;br /&gt;
== Truth Values (Booleans) ==&lt;br /&gt;
There is not a special type for TRUE and FALSE in LSL.  Instead, TRUE is defined to be the integer 1 and FALSE is defined to be the integer 0.&lt;br /&gt;
&lt;br /&gt;
This has an interesting consequence in a conditional statement.  Consider the following example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer i = 3;     // 3 is neither TRUE nor FALSE&lt;br /&gt;
 if (i)&lt;br /&gt;
    llSay( 0, &amp;quot;i is treated as being true.&amp;quot; );&lt;br /&gt;
 else&lt;br /&gt;
    llSay( 0, &amp;quot;i is treated as being false.&amp;quot; );&lt;br /&gt;
 if (i == TRUE)&lt;br /&gt;
    llSay( 0, &amp;quot;i is equal to TRUE.&amp;quot; );&lt;br /&gt;
 else&lt;br /&gt;
    llSay( 0, &amp;quot;i is not equal to TRUE.&amp;quot; );&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When run, the output will be&lt;br /&gt;
&lt;br /&gt;
 i is treated as being true.&lt;br /&gt;
 i is not equal to TRUE.&lt;br /&gt;
&lt;br /&gt;
This is because the condition in the &#039;&#039;&#039;if&#039;&#039;&#039; statement can be any integer.  Any non-zero value will cause the &#039;&#039;true&#039;&#039; block or statement to be executed, while a zero value will cause the &#039;&#039;false&#039;&#039; block or statement to be executed.&lt;br /&gt;
&lt;br /&gt;
The same zero/non-zero distinction is made wherever a truth value is expected.  In what follows, we&#039;ll use the word &#039;&#039;&#039;true&#039;&#039;&#039; and &#039;&#039;&#039;false&#039;&#039;&#039; to mean non-zero versus zero, while &#039;&#039;&#039;TRUE&#039;&#039;&#039; and &#039;&#039;&#039;FALSE&#039;&#039;&#039; will mean one and zero.&lt;br /&gt;
&lt;br /&gt;
=== Truth Value Operators ===&lt;br /&gt;
&lt;br /&gt;
There are three truth value operators in LSL:&lt;br /&gt;
* ! (representing &#039;&#039;&#039;not&#039;&#039;&#039;)&lt;br /&gt;
* &amp;amp;&amp;amp; (representing &#039;&#039;&#039;and&#039;&#039;&#039;)&lt;br /&gt;
* || (representing &#039;&#039;&#039;or&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
The ! operator takes a single operand and evaluates to &#039;&#039;&#039;TRUE&#039;&#039;&#039; if the operand is false, and &#039;&#039;&#039;FALSE&#039;&#039;&#039; otherwise.  For example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer i;&lt;br /&gt;
 i = !(3 == 7);     // 3 == 7 is FALSE, so i gets the value TRUE&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;amp;&amp;amp; operator takes two operands and evaluates to &#039;&#039;&#039;TRUE&#039;&#039;&#039; if both its operands are true, and &#039;&#039;&#039;FALSE&#039;&#039;&#039; otherwise.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; i = (3 &amp;lt; 7) &amp;amp;&amp;amp; (3 &amp;gt; 7);     // 3 &amp;lt; 7 is TRUE, but (3 &amp;gt; 7) is FALSE, so i gets the value FALSE&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The || operator takes two operands and evaluates to &#039;&#039;&#039;TRUE&#039;&#039;&#039; if either one of its operands are true, and &#039;&#039;&#039;FALSE&#039;&#039;&#039; otherwise.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; i = (3 &amp;lt; 7) || (3 &amp;gt; 7);     // one of the operands (3 &amp;lt; 7) is TRUE, so i gets the value TRUE&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Like the binary arithmetic operators, &amp;amp;&amp;amp; and || have a corresponding assignment type operator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; integer x;&lt;br /&gt;
 integer y;&lt;br /&gt;
 x &amp;amp;&amp;amp;= y;    // Synonymous with x = x &amp;amp;&amp;amp; y;&lt;br /&gt;
 x ||= y;    // Synonymous with x = x || y;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Statements Requiring Truth Values ===&lt;br /&gt;
There are four statement types that require a truth value condition:&lt;br /&gt;
* if&lt;br /&gt;
* for&lt;br /&gt;
* while&lt;br /&gt;
* do-while&lt;br /&gt;
&lt;br /&gt;
== Enumerations ==&lt;br /&gt;
Many built-in functions have a parameter or return value that takes one of a fixed number of alternatives.  For example, [[llAttachToAvatar]] has a single parameter which specifies the attachment point.  The attachment point is specified to be an integer, but the specific integer corresponding to each attachment point is arbitrary. Since the numbers themselves have no significance, LSL defines names such as [[ATTACH_HEAD]], [[ATTACH_LFOOT]] and [[ATTACH_BELLY]], which are simply meaningful names for the arbitrary integers.  Integers used in this way are called &#039;&#039;&#039;enumerations&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Generally, no operators besides the ubiquitous =, == and != are used with enumerations because there is no expected relationship between the arbitrarily selected integer values.&lt;br /&gt;
&lt;br /&gt;
== Bit Vectors ==&lt;br /&gt;
&lt;br /&gt;
=== Bit Vector Operators ===&lt;br /&gt;
Analogous to the truth value operators, LSL defines three operators specifically for bit vectors:&lt;br /&gt;
&lt;br /&gt;
* ~ (bitwise not)&lt;br /&gt;
* &amp;amp; (bitwise and)&lt;br /&gt;
* | (bitwise or)&lt;br /&gt;
&lt;br /&gt;
In contract to the truth value operators, these operate independently on each bit position.&lt;br /&gt;
&lt;br /&gt;
== Other Uses of Integers ==&lt;br /&gt;
&lt;br /&gt;
Although the four uses described above cover all the ways that integers are used with LSL built-in functions, they are not really exhaustive of the ways integers &#039;&#039;can&#039;&#039; be used.  There are algorithms in mathematics and computer science that mix arithmetic and bit vector operations, along with bit shift operators  LSL supports this kind of computation with the bit shift operators inherited from C:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;&amp;lt; shift bits left&lt;br /&gt;
* &amp;gt;&amp;gt; shift bits right&lt;br /&gt;
&lt;br /&gt;
and their assignment analogs&lt;br /&gt;
&lt;br /&gt;
* &amp;gt;&amp;gt;=&lt;br /&gt;
* &amp;lt;&amp;lt;=&lt;br /&gt;
&lt;br /&gt;
Discussion of these algorithms is beyond the scope of this article, but see [http://graphics.stanford.edu/~seander/bithacks.html Bit Twiddling Hacks] for some examples.&lt;br /&gt;
&lt;br /&gt;
== Type conversions ==&lt;br /&gt;
=== Other types to integers ===&lt;br /&gt;
=== Integers to other types ===&lt;br /&gt;
&lt;br /&gt;
== Differences between Integers in LSL and in C ==&lt;br /&gt;
Much of LSL is patterned after the C programming language, and integers are no exception.  Programmers who already know C can immediately apply most of their understanding of integers to LSL.&lt;br /&gt;
&lt;br /&gt;
Differences to note are&lt;br /&gt;
* The type must be spelled &#039;&#039;integer&#039;&#039; instead of &#039;&#039;int&#039;&#039;.&lt;br /&gt;
* There are no size modifiers (short, long, ...).  All integers are 32 bits.&lt;br /&gt;
* There is no unsigned modifier.  All integers are signed.&lt;br /&gt;
* Comparison operators evaluate to an integer (1 or 0), as they did in C prior to C99.&lt;br /&gt;
* The &amp;amp;&amp;amp; and || operators are strict, i.e. both operands are always evaluated, even if the result can be determined after evaluating the left operand.&lt;br /&gt;
&lt;br /&gt;
== Hexadecimal Notation ==&lt;br /&gt;
There&#039;s actually not much use for hexadecimal notation in LSL.  If you do feel a need to use it, you probably already know how it works.  If not, you can consult {{Wikipedia|Hexadecimal notation|Wikipedia}}.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/LSL_in_Focus:_Types&amp;diff=379733</id>
		<title>LSL 101/LSL in Focus: Types</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/LSL_in_Focus:_Types&amp;diff=379733"/>
		<updated>2009-06-01T22:32:56Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NavNextPrev|prefix=LSL in Focus: |prev=|topic=Language Topics in Focus|next=Integers}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Summary of Types=&lt;br /&gt;
In a scripting language, &#039;&#039;&#039;types&#039;&#039;&#039; are a way of categorizing the values that the language can manipulate.  In LSL, there are seven different types.  Each of these types has its own representation and its own set of operations and/or built-in functions for manipulating values of that type.  Here&#039;s a quick overview of each type and how it is used in LSL.&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus:Integers|Integers]]==&lt;br /&gt;
&lt;br /&gt;
Integers are (a subset of) the basic &amp;quot;whole&amp;quot; numbers -- positive, negative and zero -- of mathematics.  They are a very fundamental type in most computer languages.  In LSL, they are used in four distinct ways.&lt;br /&gt;
&lt;br /&gt;
* [[LSL 101/LSL in Focus:Integers#Signed Integers|Signed Integers]]&lt;br /&gt;
* [[LSL 101/LSL in Focus:Integers#Truth Values (Booleans)|Truth Values (Booleans)]]&lt;br /&gt;
* [[LSL 101/LSL in Focus:Integers#Enumerations|Enumerations]]&lt;br /&gt;
* [[LSL 101/LSL in Focus:Integers#Bit Vectors|Bit Vectors]]&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Floats|Floats]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Strings|Strings]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Keys|Keys]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Lists|Lists]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Vectors|Vectors]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Rotations|Rotations]]==&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/LSL_in_Focus:_Types&amp;diff=379723</id>
		<title>LSL 101/LSL in Focus: Types</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/LSL_in_Focus:_Types&amp;diff=379723"/>
		<updated>2009-06-01T22:27:32Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NavNextPrev|prefix=LSL in Focus: |prev=|topic=Language Topics in Focus|next=Integers}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Summary of Types=&lt;br /&gt;
In a scripting language, &#039;&#039;&#039;types&#039;&#039;&#039; are a way of categorizing the values that the language can manipulate.  In LSL, there are seven different types.  Each of these types has its own representation and its own set of operations and/or built-in functions for manipulating values of that type.  Here&#039;s a quick overview of each type and how it is used in LSL.&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus:Integers|Integers]]==&lt;br /&gt;
&lt;br /&gt;
Integers are the basic &amp;quot;whole&amp;quot; numbers (positive, negative and zero) of mathematics.  They are a very fundamental type in most computer languages.  In LSL, they are used in four distinct ways.&lt;br /&gt;
&lt;br /&gt;
* [[LSL 101/LSL in Focus:Integers#Signed Integers|Signed Integers]]&lt;br /&gt;
* Truth Values (Booleans)&lt;br /&gt;
* Enumerations&lt;br /&gt;
* Bit Vectors&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Floats|Floats]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Strings|Strings]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Keys|Keys]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Lists|Lists]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Vectors|Vectors]]==&lt;br /&gt;
&lt;br /&gt;
==[[LSL 101/LSL in Focus: Rotations|Rotations]]==&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/LSL_in_Focus:_Types&amp;diff=379713</id>
		<title>LSL 101/LSL in Focus: Types</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/LSL_in_Focus:_Types&amp;diff=379713"/>
		<updated>2009-06-01T22:16:31Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: New page: {{NavNextPrev|prefix=LSL in Focus: |prev=|topic=Language Topics in Focus|next=Integers}}  __TOC__  =Summary of Types= In a scripting language, &amp;#039;&amp;#039;&amp;#039;types&amp;#039;&amp;#039;&amp;#039; are a way of categorizing the val...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NavNextPrev|prefix=LSL in Focus: |prev=|topic=Language Topics in Focus|next=Integers}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=Summary of Types=&lt;br /&gt;
In a scripting language, &#039;&#039;&#039;types&#039;&#039;&#039; are a way of categorizing the values that the language can manipulate.  In LSL, there are 7 different types.&lt;br /&gt;
&lt;br /&gt;
* [[LSL 101/LSL in Focus:Integers|Integers]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Floats|Floats]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Strings|Strings]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Keys|Keys]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Lists|Lists]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Vectors|Vectors]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Rotations|Rotations]]&lt;br /&gt;
&lt;br /&gt;
Each of these types has its own representation and its own set of operations and/or built-in functions for manipulating values of that type.  Here&#039;s a quick overview of how each types is used in LSL.&lt;br /&gt;
&lt;br /&gt;
==Integers==&lt;br /&gt;
&lt;br /&gt;
==Floats==&lt;br /&gt;
&lt;br /&gt;
==Strings==&lt;br /&gt;
&lt;br /&gt;
==Keys==&lt;br /&gt;
&lt;br /&gt;
==Lists==&lt;br /&gt;
&lt;br /&gt;
==Vectors==&lt;br /&gt;
&lt;br /&gt;
==Rotations==&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Putting_It_All_Together&amp;diff=379643</id>
		<title>LSL 101/Putting It All Together</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Putting_It_All_Together&amp;diff=379643"/>
		<updated>2009-06-01T19:46:58Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NavNextPrev|prev=Built-in Functions in Focus|next=}}&lt;br /&gt;
{{LSL Wikibook Index}}&lt;br /&gt;
&lt;br /&gt;
In this section, we&#039;ll look at some real projects.  Many of these will involve multiple cooperating scripts.  We&#039;ll discuss not just how the scripts work, but the thought process that went into their development, and alternative possible implementations.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Built-in_Functions_in_Focus&amp;diff=379633</id>
		<title>LSL 101/Built-in Functions in Focus</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Built-in_Functions_in_Focus&amp;diff=379633"/>
		<updated>2009-06-01T19:46:26Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NavNextPrev|prev=Language Topics in Focus|next=Putting It All Together}}&lt;br /&gt;
{{LSL Wikibook Index}}&lt;br /&gt;
&lt;br /&gt;
Before we start looking at any LSL Functions, it is imperative that we discuss how the LSL documentation is laid out. There are distinct sections for different types of information, as a new user the sections you will want to read are:&lt;br /&gt;
# Description - Contains a basic description&lt;br /&gt;
# Newbie Notes - Contains a description and examples intended for new users - very few articles have this section, we haven&#039;t found anyone to write them.&lt;br /&gt;
# Examples - Contains examples of how to use the function.&lt;br /&gt;
# Caveats - Contains a list of edge cases (where things may break) and what happens when things break. This is the fine print which if you don&#039;t read you will likely get a nasty surprise later.&lt;br /&gt;
# (Important) Issues - A list of LSL bugs (and feature requests) reported on JIRA. The list is likely incomplete but should give you a taste as to what might be wrong with the function.&lt;br /&gt;
# Notes - Much more detailed description of edge cases and how to use the function. Examples will show you how, but Notes will describe when, why and more of the how.&lt;br /&gt;
# See Also - Links to other articles, functions, events etc.&lt;br /&gt;
# Specification - For when Caveats isn&#039;t enough and Notes is too general.&lt;br /&gt;
&lt;br /&gt;
Caveats and Specification aren&#039;t always geared towards new users, the documentation also servers as reference and refresher material for advanced users. It&#039;s best to come back to these sections once you have an idea of what the function does. The layout is very much a balancing act of divergent interests.&lt;br /&gt;
&lt;br /&gt;
There are some other sections, Deep Notes for example contains everything that really isn&#039;t all that important to the functionality. Typically technical implementation notes, only useful when discussing changing the implementation.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Language_Topics_in_Focus&amp;diff=379623</id>
		<title>LSL 101/Language Topics in Focus</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Language_Topics_in_Focus&amp;diff=379623"/>
		<updated>2009-06-01T19:45:38Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NavNextPrev|prev=A Gentle Introduction|next=Built-in Functions in Focus}}&lt;br /&gt;
[[Category:LSL 101]]&lt;br /&gt;
{{LSL Wikibook Index}}&lt;br /&gt;
This section contains in-depth discussions on various LSL language topics.  For discussion of the built-in library functions, see [[LSL 101/Built-in Functions in Focus|Built-in Functions in Focus]].&lt;br /&gt;
&lt;br /&gt;
* [[LSL 101/LSL in Focus: Types|Types]]&lt;br /&gt;
** [[LSL 101/LSL in Focus:Integers|Integers]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Floats|Floats]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Strings|Strings]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Keys|Keys]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Lists|Lists]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Vectors|Vectors]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Rotations|Rotations]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Operators|Operators]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Constants|Constants]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Variables|Variables]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Scopes|Scopes]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Events and Event Handlers|Events and Event Handlers]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: States|States]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Flow Control|Flow Control]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: User-defined functions|User-defined functions]]&lt;br /&gt;
* [[LSL 101/LSL in Focus: Errors|Errors]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Compile-time Errors|Compile-time Errors]]&lt;br /&gt;
** [[LSL 101/LSL in Focus: Run-time Errors|Run-time Errors]]&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/In_the_Beginning&amp;diff=379613</id>
		<title>LSL 101/In the Beginning</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/In_the_Beginning&amp;diff=379613"/>
		<updated>2009-06-01T19:43:39Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=A Gentle Introduction|next=Simple Script Skeleton}}&lt;br /&gt;
&lt;br /&gt;
This thread of &#039;&#039;A Gentle Introduction&#039;&#039; is written especially for the Second Life user that has some building experience, but little or no scripting (or other programming) experience.  It is divided into &amp;quot;lessons&amp;quot; that are intended to be read sequentially.  Most lessons will take the form of an  example script, followed by a discussion of anything that is newly introduced by that script.  If we&#039;ve written the lessons successfully and you read them sequentially, you should never come to a page with vocabulary or concepts that are unfamiliar but not explained in that lesson.&lt;br /&gt;
&lt;br /&gt;
On the other hand, we don&#039;t necessarily try to explain &#039;&#039;everything&#039;&#039; about a topic in the lesson it is first introduced.  If you&#039;re looking for the full details of any particular topic, see the section [[LSL 101/Language Topics in Focus|Language Topics in Focus]].  &lt;br /&gt;
&lt;br /&gt;
Our examples will be full scripts that you can copy into SL and run yourself.  You can make modifications and run those, to verify that your understanding matches what SL actually does.  One consequence of that though, is that in a few cases (especially in the beginning), the structure of LSL forces us to include something in the example that we&#039;re not ready to explain.  When this happens, we&#039;ll call it to your attention so you&#039;re not left wondering whether you&#039;ve missed something.&lt;br /&gt;
&lt;br /&gt;
As you read these pages, if you do come to a place where you feel we haven&#039;t adequately explained the example, or are making unwarranted assumptions about the target audience&#039;s background knowledge, please let us know.  On each Wiki page, there is a tab labeled &#039;&#039;discussion&#039;&#039;.  Click on that tab and tell us what you think.  Don&#039;t worry if you don&#039;t know the Wiki editing conventions; we&#039;ll figure out your intent.  If you have general comments that are relevant to more than one lesson, there is a [http://forums.secondlife.com/showthread.php?t=318943 forum discussion] that is a great place to post your thoughts.&lt;br /&gt;
&lt;br /&gt;
Finally if you are an experienced scripter who is reading these pages out of curiosity and comes across something you could improve, feel free to jump in and do it.  This is, after all, a Wiki.&lt;br /&gt;
&lt;br /&gt;
Though this series of lessons is designed to be read sequentially, you may sometimes have a desire to jump back and forth between lessons.  So here&#039;s a table of contents.&lt;br /&gt;
&lt;br /&gt;
* [[LSL 101/Simple Script Skeleton|Simple Script Skeleton]]&lt;br /&gt;
* [[LSL 101/Comments, White-space and Formatting|Comments, White-space and Formatting]]&lt;br /&gt;
* [[LSL 101/Simplest Output|Simplest Output]]&lt;br /&gt;
* [[LSL 101/The touch_start Event|The touch_start Event]]&lt;br /&gt;
* [[LSL 101/Creating a Script|Creating a Script]]&lt;br /&gt;
* [[LSL 101/Compile Time Errors|Compile Time Errors]]&lt;br /&gt;
* [[LSL 101/Functions That Return a Value|Functions That Return a Value]]&lt;br /&gt;
* [[LSL 101/String Concatenation|String Concatenation]]&lt;br /&gt;
* [[LSL 101/Variables|Variables]]&lt;br /&gt;
* [[LSL 101/Global vs Local Variables|Global vs Local Variables]]&lt;br /&gt;
* [[LSL 101/Variable Initialization|Variable Initialization]]&lt;br /&gt;
* [[LSL 101/Event Handler Parameters|Event Handler Parameters]]&lt;br /&gt;
* [[LSL 101/|...]]&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/In_the_Beginning&amp;diff=379603</id>
		<title>LSL 101/In the Beginning</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/In_the_Beginning&amp;diff=379603"/>
		<updated>2009-06-01T19:39:18Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=A Gentle Introduction|next=Simple Script Skeleton}}&lt;br /&gt;
&lt;br /&gt;
This thread of &#039;&#039;A Gentle Introduction&#039;&#039; is written especially for the Second Life user that has some building experience, but little or no scripting (or other programming) experience.  It is divided into &amp;quot;lessons&amp;quot; that are intended to be read sequentially.  Most lessons will take the form of an  example script, followed by a discussion of anything that is newly introduced by that script.  If we&#039;ve written the lessons successfully and you read them sequentially, you should never come to a page with vocabulary or concepts that are unfamiliar but not explained in that lesson.&lt;br /&gt;
&lt;br /&gt;
On the other hand, we don&#039;t necessarily try to explain &#039;&#039;everything&#039;&#039; about a topic in the lesson it is first introduced.  If you&#039;re looking for the full details of any particular topic, see the section [[LSL 101/Language Topics in Focus|Language Topics in Focus]].  &lt;br /&gt;
&lt;br /&gt;
Our examples will be full scripts that you can copy into SL and run yourself.  You can make modifications and run those, to verify that your understanding matches what SL actually does.  One consequence of that though, is that in a few cases (especially in the beginning), the structure of LSL forces us to include something in the example that we&#039;re not ready to explain.  When this happens, we&#039;ll call it to your attention so you&#039;re not left wondering whether you&#039;ve missed something.&lt;br /&gt;
&lt;br /&gt;
As you read these pages, if you do come to a place where you feel we haven&#039;t adequately explained the example, or are making unwarranted assumptions about the target audience&#039;s background knowledge, please let us know.  On each Wiki page, there is a tab labeled &#039;&#039;discussion&#039;&#039;.  Click on that tab and tell us what you think.  Don&#039;t worry if you don&#039;t know the Wiki editing conventions; we&#039;ll figure out your intent.  If you have general comments that are relevant to more than one lesson, there is a [http://forums.secondlife.com/showthread.php?t=318943 forum discussion] that is a great place to post your thoughts.&lt;br /&gt;
&lt;br /&gt;
Finally if you are an experienced scripter who is reading these pages out of curiosity and comes across something you could improve, feel free to jump in and do it.  This is, after all, a Wiki.&lt;br /&gt;
&lt;br /&gt;
Though this series of lessons is designed to be read sequentially, you may sometimes have a desire to jump back and forth between lessons.  So here&#039;s a table of contents.&lt;br /&gt;
&lt;br /&gt;
* [[LSL 101/Simple Script Skeleton|Simple Script Skeleton]]&lt;br /&gt;
* [[LSL 101/Comments, White-space and Formatting|Comments, White-space and Formatting]]&lt;br /&gt;
* [[LSL 101/Simplest Output|Simplest Output]]&lt;br /&gt;
* [[LSL 101/The touch_start Event|The touch_start Event]]&lt;br /&gt;
* [[LSL 101/Creating a Script|Creating a Script]]&lt;br /&gt;
* [[LSL 101/Compile Time Errors|Compile Time Errors]]&lt;br /&gt;
* [[LSL 101/Functions That Return a Value|Functions That Return a Value]]&lt;br /&gt;
* [[LSL 101/String Concatenation|String Concatenation]]&lt;br /&gt;
* [[LSL 101/Variables|Variables]]&lt;br /&gt;
* [[LSL 101/Global vs Local Variables|Global vs Local Variables]]&lt;br /&gt;
* [[LSL 101Variable Initialization/Variable Initialization|LSL 101Variable Initialization/Variable Initialization]]&lt;br /&gt;
* [[LSL 101/Event Handler Parameters|Event Handler Parameters]]&lt;br /&gt;
* [[LSL 101/|LSL 101/]]&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/In_the_Beginning&amp;diff=379593</id>
		<title>LSL 101/In the Beginning</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/In_the_Beginning&amp;diff=379593"/>
		<updated>2009-06-01T19:31:11Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=A Gentle Introduction|next=Simple Script Skeleton}}&lt;br /&gt;
&lt;br /&gt;
This thread of &#039;&#039;A Gentle Introduction&#039;&#039; is written especially for the Second Life user that has some building experience, but little or no scripting (or other programming) experience.  It is divided into &amp;quot;lessons&amp;quot; that are ordered to be read sequentially.  Most lessons will take the form of an  example script, followed by a discussion of anything that is newly introduced by that script.  If we write the lessons successfully and you read them sequentially, you will never come to a page where there are unexplained assumptions.&lt;br /&gt;
&lt;br /&gt;
On the other hand, we don&#039;t try to explain everything about a topic in the lesson it is introduced.  if you&#039;re looking for the full details of any particular topic, see the section [[LSL 101/Language Topics in Focus|Language Topics in Focus]].  &lt;br /&gt;
&lt;br /&gt;
Our examples will be full scripts that you can copy into SL and run yourself.  You can make modifications and run those, to verify that your understanding matches what SL actually does.  One consequence of that though, is that in a few cases (especially in the beginning), the structure of LSL forces us to include something in the example that we&#039;re not ready to explain.  When this happens, we&#039;ll call it to your attention so you&#039;re not left wondering whether you&#039;ve missed something.&lt;br /&gt;
&lt;br /&gt;
As you read these pages, if you do come to a place where you feel we haven&#039;t adequately explained the example, or are making unwarranted assumptions about your background knowledge, please let us know.  On each Wiki page, there is a tab labeled &#039;&#039;discussion&#039;&#039;.  Click on that tab and tell us what you think.  Don&#039;t worry if you don&#039;t know the Wiki editing conventions; we&#039;ll figure it out.  If you have general comments that are relevant to more than one page, there is a [http://forums.secondlife.com/showthread.php?t=318943 forum discussion] that is a great place to post your thoughts.&lt;br /&gt;
&lt;br /&gt;
Finally if you are experienced scripter who is reading these pages out of curiosity, fell free to jump in and improve them.  This is, after all, a Wiki.&lt;br /&gt;
&lt;br /&gt;
Though this series of lessons is designed to be read sequentially, you may sometimes have a desire to jump back and forth between lessons.  So here&#039;s a table of contents.&lt;br /&gt;
&lt;br /&gt;
* [[LSL 101/Simple Script Skeleton|Simple Script Skeleton]]&lt;br /&gt;
* [[LSL 101/Comments, White-space and Formatting|Comments, White-space and Formatting]]&lt;br /&gt;
* [[LSL 101/Simplest Output|Simplest Output]]&lt;br /&gt;
* [[LSL 101/The touch_start Event|The touch_start Event]]&lt;br /&gt;
* [[LSL 101/Creating a Script|Creating a Script]]&lt;br /&gt;
* [[LSL 101/Compile Time Errors|Compile Time Errors]]&lt;br /&gt;
* [[LSL 101/Functions That Return a Value|Functions That Return a Value]]&lt;br /&gt;
* [[LSL 101/String Concatenation|String Concatenation]]&lt;br /&gt;
* [[LSL 101/Variables|Variables]]&lt;br /&gt;
* [[LSL 101/Global vs Local Variables|Global vs Local Variables]]&lt;br /&gt;
* [[LSL 101Variable Initialization/Variable Initialization|LSL 101Variable Initialization/Variable Initialization]]&lt;br /&gt;
* [[LSL 101/Event Handler Parameters|Event Handler Parameters]]&lt;br /&gt;
* [[LSL 101/|LSL 101/]]&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/In_the_Beginning&amp;diff=379583</id>
		<title>LSL 101/In the Beginning</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/In_the_Beginning&amp;diff=379583"/>
		<updated>2009-06-01T18:53:18Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: New page: {{NavNextPrev|prev=A Gentle Introduction|next=Simple Script Skeleton}}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NavNextPrev|prev=A Gentle Introduction|next=Simple Script Skeleton}}&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Simple_Script_Skeleton&amp;diff=379573</id>
		<title>LSL 101/Simple Script Skeleton</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Simple_Script_Skeleton&amp;diff=379573"/>
		<updated>2009-06-01T18:52:18Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NavNextPrev|prev=In the Beginning|next=Comments, White-space and Formatting}}&lt;br /&gt;
&lt;br /&gt;
Here is an example of the simplest possible valid LSL script.  It doesn&#039;t actually ask the computer to do anything but all scripts have, at minimum, this structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default &lt;br /&gt;
{&lt;br /&gt;
     state_entry() &lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at this, the first thing you might notice is that the ratio of punctuation to words is quite high.  This is a general characteristic of LSL.  Along with parenthesis and curly braces, there will be lots of semicolons, quotation marks and square brackets, and it all has to be done just right.  Fortunately, the rules for using punctuation are much simpler than for a natural language.  So even though you are likely to struggle a lot with punctuation at the beginning, that phase won&#039;t last long.&lt;br /&gt;
&lt;br /&gt;
In addition to the punctuation, there are two &amp;quot;names&amp;quot; in this example, &amp;quot;default&amp;quot; and &amp;quot;state_entry&amp;quot;.  In LSL, the underscore is not a punctuation mark, but one of the characters that can be used in names.  It&#039;s most often used to combine what might be multiple words in English into a single name, because LSL requires every name to be a single word.&lt;br /&gt;
&lt;br /&gt;
Based on the example, you might guess that there is a recurring pattern of the form&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
heading&lt;br /&gt;
{&lt;br /&gt;
     ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
in LSL, and you would be absolutely right.  Each one of these is called a &amp;lt;b&amp;gt;block&amp;lt;/b&amp;gt;, and a large part of an LSL script is made up of blocks within blocks (within blocks ...).  Since getting the punctuation just right is mandatory, it is a good idea to vertically align opening and closing curly braces with their heading, and indent everything in between.&lt;br /&gt;
&lt;br /&gt;
This is all grammar; what about the &amp;lt;u&amp;gt;meaing&amp;lt;/u&amp;gt; of the two blocks?  The outermost block, with the heading &amp;lt;b&amp;gt;default&amp;lt;/b&amp;gt; denotes something referred to as the &amp;lt;b&amp;gt;default state&amp;lt;/b&amp;gt;.  States are a unique aspect of LSL, and we&#039;ll cover them later. But it will be easier to understand just how they work when you know more about other aspects of LSL.  So far now, you can regard the outer block to be just grammatical structure that is required of all scripts.&lt;br /&gt;
&lt;br /&gt;
The inner block, headed by &amp;lt;b&amp;gt;state_entry()&amp;lt;/b&amp;gt;, is an &amp;lt;b&amp;gt;event handler&amp;lt;/b&amp;gt; block.  Unlike states, understanding events and event handlers is crucial from the very start.  In fact, if you happen to have had some prior experience with programming, it&#039;s &amp;lt;u&amp;gt;especially&amp;lt;/u&amp;gt; important that you grok events, because unlike a traditional computer program, events occurring outside of your script determine when the various parts of your script get executed.&lt;br /&gt;
&lt;br /&gt;
The state_entry event is a pretty simple one.  It occurs when the script first starts running.  Typically, this will be when you add a new script to a prim&#039;s inventory or save your changes after editing a script that is in a prim&#039;s inventory. When the sim server detects the state_entry event, it executes any commands (and only those commands) that occur between the { and } of the state_event handler block.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll be talking a lot more about events, but before we get any farther, let&#039;s take a quick look at [[LSL 101/Comments, White-space and Formatting|comments, white-space and formatting]].&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/A_Gentle_Introduction&amp;diff=379563</id>
		<title>LSL 101/A Gentle Introduction</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/A_Gentle_Introduction&amp;diff=379563"/>
		<updated>2009-06-01T18:50:09Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== A Gentle Introduction to Scripting in Second Life ==&lt;br /&gt;
&lt;br /&gt;
{{LSL Wikibook Index}}This section of &#039;&#039;&#039;LSL 101: The Wikibook&#039;&#039;&#039; is written for the SL user who has &#039;&#039;no experience with computer programming&#039;&#039;; or, for users with programming experience who would like a gentle introduction to LSL.&lt;br /&gt;
&lt;br /&gt;
This section assumes you have basic building skills, since scripting is just one aspect of building.  You should be able to create and edit a prim, then take it in and out of inventory.  You should be able to do the same with a notecard and know how to add it to a prim&#039;s inventory.&lt;br /&gt;
&lt;br /&gt;
If all of this sounds like you, welcome!&lt;br /&gt;
&lt;br /&gt;
Scripts are used to make SL objects &#039;&#039;do&#039;&#039; something.  They can detect things that happen (i.e., noticing a mouse click or the approach of an avatar); and, that script can then act in response (i.e., moving, changing appearance, greeting an avatar with a message, displaying a current stock quote).  Scripts are at work any time an object has any kind of &#039;&#039;behavior&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In SL, scripts are written in LSL (Linden Scripting Language), a simple but powerful programming language that was created for the SL environment.  (Here, &amp;quot;simple&amp;quot; is used to suggest that LSL is &#039;&#039;more limited&#039;&#039; than other programming languages; not that it is easier to learn.  Like any other language, learning LSL requires patience and practice.)&lt;br /&gt;
&lt;br /&gt;
When you learned to speak you discovered that you needed to know not only some words (vocabulary) but also the order in which to use them (grammar). It is the same with computer languages: you have to learn the words and you have to learn the order in which to use them.  When you learned to read and write you discovered that there is also punctuation - commas, full stops (periods, if you are American), brackets, etc. - which help to clarify how different words and phrases relate to each other.  The difference between computer languages and human languages is that with human languages people can generally understand your meaning even if your pronunciation or spelling is not completely correct or your grammar is slightly wrong. Computer languages are not like that. If your spelling, punctuation or structure is even slightly wrong the computer will report an error or, at best, not do what you expected it to do.  This can be &#039;&#039;very&#039;&#039; frustrating for beginners.&lt;br /&gt;
&lt;br /&gt;
I&#039;m sure, if you have ever attended a writing class, you were told that a story has a beginning, middle, and end.  This we can call the &#039;&#039;structure&#039;&#039; of a story.  In LSL the structure is very important and we will discuss that (and introduce you to some of the vocabulary, grammar and punctuation) in the next section.&lt;br /&gt;
&lt;br /&gt;
You can continue with [[LSL 101/In the Beginning|In the Beginning]] or [[LSL 101/The Structure of a Script|The Structure of a Script]].&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LSL_101/Global_vs_Local_Variables&amp;diff=379533</id>
		<title>LSL 101/Global vs Local Variables</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LSL_101/Global_vs_Local_Variables&amp;diff=379533"/>
		<updated>2009-06-01T18:43:16Z</updated>

		<summary type="html">&lt;p&gt;Omei Turnbull: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:LSL 101]]&lt;br /&gt;
{{NavNextPrev|prev=Variables|next=Variable Initialization}}&lt;br /&gt;
&lt;br /&gt;
A variables whose declaration occurs before the word &#039;&#039;&#039;default&#039;&#039;&#039; is called a &#039;&#039;&#039;global&#039;&#039;&#039; variable.  Global variables are accessible to all event handlers in the script.  But consider this example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;string RegionName;    // This is a global variable&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
     state_entry()&lt;br /&gt;
     {&lt;br /&gt;
          // Store the name of the current sim for later use&lt;br /&gt;
          RegionName = llGetRegionName();&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     touch_start( integer num_detected )&lt;br /&gt;
     {&lt;br /&gt;
          // Announce the region where the script is running&lt;br /&gt;
          string WelcomePhrase;&lt;br /&gt;
          WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&lt;br /&gt;
          llOwnerSay( WelcomePhrase );&lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only difference between this and the previous example is that we replaced the one line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; llOwnerSay( &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the three lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase;&lt;br /&gt;
 WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&lt;br /&gt;
 llOwnerSay( WelcomePhrase );&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This change doesn&#039;t change the result of the script.  But it does break up the one slightly complex line into smaller pieces.  In this case, the one line wasn&#039;t complex enough to cause a problem, but scripts that involve more computation can be much easier to read when the computation is broken up into smaller pieces.  To do this, variables with meaningful names can be used to hold the intermediate results.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk through the execution of the touch_start handler.  The first executable statement is the variable declaration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is called a &#039;&#039;&#039;local&#039;&#039;&#039; variable because its use is going to be restricted to this event handler.  Just like the global variable &#039;&#039;RegionName&#039;&#039;, the declaration causes the sim server to reserve a chunk of memory capable of storing a string and to give that chunk of memory the name &#039;&#039;WelcomePhrase&#039;&#039;.  What is different is that this declaration is executed &amp;lt;u&amp;gt;each&amp;lt;/u&amp;gt; time the touch_start handler is executed, whereas the global declaration is only executed once.&lt;br /&gt;
&lt;br /&gt;
The next line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName  + &amp;quot;.&amp;quot;;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is straighforward.  It creates the string just as before, and then assigns the whole string to the variable &#039;&#039;WelcomePhrase&#039;&#039;.  The third line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; llOwnerSay( WelcomePhrase );&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
retrieves the value stored in the variable &#039;&#039;WelcomePhrase&#039;&#039; and passes it to &#039;&#039;llOwnerSay&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note that if we really wanted to, we could break things up into even smaller pieces.  Consider the following fragment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; string WelcomePhrase;&lt;br /&gt;
 WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName;&lt;br /&gt;
 WelcomePhrase = WelcomePhrase + &amp;quot;.&amp;quot;;&lt;br /&gt;
 llOwnerSay( WelcomePhrase );&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This version breaks up the two string concatenations into two separate commands.  The first assignment statement&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; WelcomePhrase = &amp;quot;Welcome to &amp;quot; + RegionName;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
results in the variable &#039;&#039;WelcomePhrase&#039;&#039; holding the string &amp;quot;Welcome to Ganymede&amp;quot; (assuming that we&#039;re executing the script in Ganymede).&lt;br /&gt;
&lt;br /&gt;
The second assignment statement&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; WelcomePhrase = WelcomePhrase + &amp;quot;.&amp;quot;;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
takes the current value of &#039;&#039;WelcomePhrase&#039;&#039;, concatenates the &amp;quot;.&amp;quot; and stores the new result back in the the variable &#039;&#039;WelcomePhrase&#039;&#039;.  This process of replacing the current value of a variable with a new one is called &#039;&#039;&#039;updating&#039;&#039;&#039; the variable.&lt;br /&gt;
&lt;br /&gt;
Remember we said that memory was set aside for &#039;&#039;WelcomePhrase&#039;&#039; each time the touch_start handler is executed.  You might think that this would slowly use up the memory that is available to the script.  But this doesn&#039;t happen because at the end of the touch_start event handler, the sim &amp;quot;un-reserves&amp;quot; the memory, allowing it to be used again when it is needed for some other purpose.&lt;br /&gt;
&lt;br /&gt;
It is preferable to use local variables instead of global variables any time a value doesn&#039;t need to be retained once the event handler completes.  (The reserving and un-reserving of local variables happens so efficiently that it is not a significant contribution to the work the sim server has to perform.)&lt;br /&gt;
&lt;br /&gt;
There are other variations on local variables that we will discuss as the need arises.  But now is a good time to talk about [[Event Handler Parameters|event handler parameters]], which are another form of local variables.&lt;/div&gt;</summary>
		<author><name>Omei Turnbull</name></author>
	</entry>
</feed>