<?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=Zidan+Foxdale</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=Zidan+Foxdale"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/wiki/Special:Contributions/Zidan_Foxdale"/>
	<updated>2026-06-08T17:40:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlAtan2&amp;diff=1142154</id>
		<title>LlAtan2</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlAtan2&amp;diff=1142154"/>
		<updated>2011-05-03T18:14:09Z</updated>

		<summary type="html">&lt;p&gt;Zidan Foxdale: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function&lt;br /&gt;
|func_id=3|func_sleep=0.0|func_energy=10.0&lt;br /&gt;
|func=llAtan2|sort=Atan2&lt;br /&gt;
|p1_type=float|p1_name=y|p1_desc&lt;br /&gt;
|p2_type=float|p2_name=x|p2_desc&lt;br /&gt;
|return_type=float&lt;br /&gt;
|return_text=that is the {{wikipedia|Atan2|arctangent2}} of &#039;&#039;&#039;y&#039;&#039;&#039;, &#039;&#039;&#039;x&#039;&#039;&#039;.&lt;br /&gt;
|func_footnote=Similar to the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;{{wikipedia|Inverse_trigonometric_functions|arctangent}}&amp;lt;/span&amp;gt;(&#039;&#039;&#039;y&#039;&#039;&#039;/&#039;&#039;&#039;x&#039;&#039;&#039;) except it utilizes the signs of &#039;&#039;&#039;x&#039;&#039;&#039; &amp;amp; &#039;&#039;&#039;y&#039;&#039;&#039; to determine the quadrant and avoids  division by zero. Returns zero if &#039;&#039;&#039;x&#039;&#039;&#039; and &#039;&#039;&#039;y&#039;&#039;&#039; are zero, returns &#039;&#039;&#039;PI/2&#039;&#039;&#039; if &#039;&#039;&#039;x&#039;&#039;&#039; is zero and &#039;&#039;&#039;y&#039;&#039;&#039;  is positive, returns &#039;&#039;&#039;-PI/2&#039;&#039;&#039; if &#039;&#039;&#039;x&#039;&#039;&#039; is zero and &#039;&#039;&#039;y&#039;&#039;&#039; is negative.&amp;lt;br /&amp;gt;&lt;br /&gt;
The returned value is in the range {{Interval|gte=-[[PI]]|gteh=-PI|lte=PI|center=return}}{{Interval/Footnote}}.&lt;br /&gt;
|spec&lt;br /&gt;
|caveats&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;
    float num1 = llFrand(100.0);&lt;br /&gt;
    float num2 = llFrand(100.0);&lt;br /&gt;
&lt;br /&gt;
    llOwnerSay(&amp;quot;y = &amp;quot; + (string)num1);&lt;br /&gt;
    llOwnerSay(&amp;quot;x = &amp;quot; + (string)num2);&lt;br /&gt;
&lt;br /&gt;
    llOwnerSay(&amp;quot;The arctangent of y divided by x is &amp;quot; + (string)llAtan2(num1, num2));&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&amp;lt;lsl&amp;gt;//Function with input of a vector determining the position of a target and returning&lt;br /&gt;
//a string with the literal compass-direction of that target towards your position&lt;br /&gt;
//by Ramana Sweetwater 2009/01, any use allowed license :-)&lt;br /&gt;
//corrected by Patrick Muggins&lt;br /&gt;
&lt;br /&gt;
string compass (vector target) &lt;br /&gt;
{&lt;br /&gt;
    vector source = llGetPos();&lt;br /&gt;
    list DIRS =[&amp;quot;W&amp;quot;,&amp;quot;NW&amp;quot;,&amp;quot;N&amp;quot;,&amp;quot;NE&amp;quot;,&amp;quot;E&amp;quot;,&amp;quot;SE&amp;quot;,&amp;quot;S&amp;quot;,&amp;quot;SW&amp;quot;,&amp;quot;W&amp;quot;];&lt;br /&gt;
    integer index = llCeil(3.5 - (4 * llAtan2(target.y - source.y, target.x - source.x) / PI));&lt;br /&gt;
    return llList2String(DIRS, index);&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
[[/Compass QA]]&lt;br /&gt;
|helpers&lt;br /&gt;
|also_functions=&lt;br /&gt;
{{LSL DefineRow|[[llSin]]|[[llAsin]]|sine &amp;amp; inverse Sine}}&lt;br /&gt;
{{LSL DefineRow|[[llCos]]|[[llAcos]]|cosine &amp;amp; inverse cosine}}&lt;br /&gt;
{{LSL DefineRow|[[llTan]]||tangent}}&lt;br /&gt;
|also_articles=&lt;br /&gt;
{{LSL DefineRow||{{wikipedia|Atan2}}|}}&lt;br /&gt;
{{LSL DefineRow||{{wikipedia|Inverse_trigonometric_function}}|}}&lt;br /&gt;
|notes&lt;br /&gt;
|cat1=Math/Trigonometry&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Zidan Foxdale</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Microsoft_Windows_Builds&amp;diff=1065193</id>
		<title>Microsoft Windows Builds</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Microsoft_Windows_Builds&amp;diff=1065193"/>
		<updated>2010-10-18T19:14:29Z</updated>

		<summary type="html">&lt;p&gt;Zidan Foxdale: /* Fmod */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{multi-lang}}&lt;br /&gt;
{{CompileNav}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Windows, there are several options on build (compile) environment of the Second Life.&lt;br /&gt;
&lt;br /&gt;
This page explains how you can compile the Viewer on Microsoft Windows.&lt;br /&gt;
&lt;br /&gt;
Currently, only 32 bit binary is tested.  There seems to be several trials to produce 64 bit Windows .EXE of the Viewer.  If you did, please write your experience on [[Talk:Microsoft Windows Builds|the discussion page]] (regardless it was successful or not!)&lt;br /&gt;
&lt;br /&gt;
== Choosing and preparing a compiler ==&lt;br /&gt;
&lt;br /&gt;
=== Linden-supported compilers ===&lt;br /&gt;
&lt;br /&gt;
Supported compiler: &#039;&#039;&#039;Visual Studio .NET 2005 Professional&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You need to setup the compiler and Microsoft Development tools as follows:&lt;br /&gt;
* Setup [[Microsoft Visual Studio]]&lt;br /&gt;
&lt;br /&gt;
=== Community experimental compilers ===&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have Visual Studio .NET 2005 Professional, you may wish to try one of the following alternatives.&lt;br /&gt;
&lt;br /&gt;
* Visual C++ 2005 Express ([[Microsoft Visual Studio|instructions]], but the screenshots for [[Compiling the Viewer (MSVS2008)|VS2008]] are worth a glance too)&lt;br /&gt;
* Visual Studio 2008 ([[Compiling the Viewer (MSVS2008)|instructions]])&lt;br /&gt;
* Visual C++ 2008 Express ([[Compiling the Viewer (MSVS2008)|instructions]])&lt;br /&gt;
&lt;br /&gt;
{{Warning|Boost support with Visual Studio 2008 is problematic as of this writing.  Check {{jira|VWR-9541}} before continuing on this path.}}&lt;br /&gt;
&lt;br /&gt;
NOTE: Make sure you install to paths without spaces in it.&lt;br /&gt;
&lt;br /&gt;
== Getting other development tools ==&lt;br /&gt;
&lt;br /&gt;
You will need to install the following tools to compile the Viewer:&lt;br /&gt;
* &#039;&#039;&#039;UniCode NSIS&#039;&#039;&#039;([http://www.scratchpaper.com/home/downloads download Unicode NSIS])&lt;br /&gt;
**  This is the package installer used to build Setup.exe. &amp;lt;b&amp;gt;Note&amp;lt;/b&amp;gt;: As of this writing the file is downloaded with an *.exec extension that needs renamed *.exe.--[[User:Nicky Perian|Nicky Perian]] 16:22, 30 March 2010 (UTC)&lt;br /&gt;
* &#039;&#039;&#039;CMake&#039;&#039;&#039; ([http://www.cmake.org/HTML/Download.html download CMake])&lt;br /&gt;
**  As of this writing, the latest version is 2.6.2.  &amp;lt;b&amp;gt;Note&amp;lt;/b&amp;gt;: There are many known issues with CMake 2.6.0 and 2.6.1 in conjunction with building the Second Life Viewer.  CMake 2.4.8 is supported for compiling the 1.21 version of the Second Life Viewer, but 2.6.2 is likely to become the new minimum requirement in the near future.&lt;br /&gt;
* &#039;&#039;&#039;Cygwin&#039;&#039;&#039; ([http://www.cygwin.com/ download Cygwin])&lt;br /&gt;
** When you run the cygwin setup utility make sure you have selected to install &#039;&#039;&#039;patchutils&#039;&#039;&#039;, &#039;&#039;&#039;flex&#039;&#039;&#039;, &#039;&#039;&#039;bison&#039;&#039;&#039;, and &#039;&#039;&#039;zlib-devel&#039;&#039;&#039;(all located under &amp;quot;devel&amp;quot;), &#039;&#039;&#039;openssh&#039;&#039;&#039; (located under &amp;quot;Net&amp;quot;), which are not part of the default install. (If you missed one of these, the easiest thing to do is to re-run the entire installation.)&lt;br /&gt;
* &#039;&#039;&#039;Python&#039;&#039;&#039; (download either [http://www.python.org/download/ Python.org Standard Python] or  [http://www.activestate.com/Products/ActivePython/?mp=1 ActivePython]&lt;br /&gt;
** 2.4.3 is the minimum required version.&lt;br /&gt;
**  If you are using a version of Python newer than v2.5, you may need to change the Python.cmake file. See the [[Talk:CMake#CMake_and_Python_2.6|CMake discussion]] for details (this change was necessary as of 1.21-r99587 source branch). )  &lt;br /&gt;
* &#039;&#039;&#039;The Windows Platform SDK&#039;&#039;&#039;&lt;br /&gt;
** Get the latest version (as of 23 March 2010) here: [http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=c17ba869-9671-4330-a63e-1fd44e0e2505&amp;amp;displayLang=en Windows SDK for Windows Server 2008 and .NET Framework 3.5 SP1] (If you use the web installer, you can choose only the &amp;quot;Development Tools&amp;quot; and cut the download size significantly.) &lt;br /&gt;
* &#039;&#039;&#039;DirectX 9.0 SDK&#039;&#039;&#039;&lt;br /&gt;
** Get the latest version (as of 29 Oct 2008) here: [http://www.microsoft.com/downloads/details.aspx?FamilyID=ea4894b5-e98d-44f6-842d-e32147237638&amp;amp;DisplayLang=en DirectX 9.0 SDK (August 2008)]&lt;br /&gt;
&lt;br /&gt;
Verify that Cygwin, CMake, and Python are in the windows &amp;quot;PATH&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; use the Cygwin version of CMake or Python. The Build will fail. (CMake specifically excludes the Cygwin version of Python, in the &amp;lt;code&amp;gt;&#039;Python.cmake&#039;&amp;lt;/code&amp;gt; file)&lt;br /&gt;
&lt;br /&gt;
== Downloading Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can download the Viewer source code on the [[source downloads]] page.  You can also use a [[version control repository]].  If you&#039;re just starting out, it&#039;s probably best to get the latest Release version, rather than a Release Candidate, because the Release Candidates get updated quite often.  But if you would rather work with the latest code, go for the [[version control repository]] &amp;quot;trunk&amp;quot;. Don&#039;t forget to also download the artwork and library bundles relevant to the repository branch you&#039;re using as explained in [[Version_control_repository#Artwork_and_Library_Bundles|Artwork and Library Bundles]].&lt;br /&gt;
&lt;br /&gt;
If you&#039;re downloading from the [[source downloads]] page, there are three packages to get: the source package, the artwork package, and the library package.   In versions 1.20 and earlier, Linden packaged the library binaries in the Libs package. For 1.21 and beyond, the CMake develop.py script now downloads &#039;&#039;&#039;most&#039;&#039;&#039; of the libraries that were previously in the libs zip file.  This saves developers who are tracking trunk from constantly downloading them every update and only downloads updated libraries.   As of this writing, there are some pieces packages that still require downloading, so be sure to grab the library and artwork bundles from the [[source downloads]] page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&lt;br /&gt;
* If the directory path you keep the SL source in has a space in it, the batch file that copies message_template.msg will fail. So, if you unzip or checkout the source tree into, e.g., &amp;quot;C:\Projects\Dir with space in name\Etc\linden&amp;quot;, it won&#039;t work!&lt;br /&gt;
* You should also avoid using non-ASCII (national) characters in the paths, although some localized versions of the tool puts some as a default...&lt;br /&gt;
* Unzip or checkout your source tree into a directory that has as short full pathname as possible, since long paths cause some unexpected trouble during the build.&lt;br /&gt;
&lt;br /&gt;
In other words, the easiest way to get this working is to get &#039;&#039;&#039;source&#039;&#039;&#039;, &#039;&#039;&#039;artwork&#039;&#039;&#039;, and &#039;&#039;&#039;libs&#039;&#039;&#039; from the [[source downloads]] page and unpack them all into the same directory/folder, which ideally would be a folder in (or near) the root directory with a short name like &#039;&#039;&#039;sl_1_21_6&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installing libraries ==&lt;br /&gt;
&lt;br /&gt;
SL Viewer depends on some third party libraries.  Some of them are open source, some others are not.&lt;br /&gt;
&lt;br /&gt;
=== Open source libraries ===&lt;br /&gt;
&lt;br /&gt;
As of Viewer version 1.21, all open source libraries are automatically downloaded as part of the build script invoked by develop.py, unless you choose to configure a standalone build.&lt;br /&gt;
&lt;br /&gt;
=== Proprietary libraries ===&lt;br /&gt;
&lt;br /&gt;
Linden Lab does not provide proprietary libraries.  You will need to follow the instructions here under to acquire and copy them to your source tree.&lt;br /&gt;
&lt;br /&gt;
It&#039;s probably a good idea to build an empty directory tree for those files, copy the relevant proprietary files there and, once done, copy the whole to your source tree (like &#039;&#039;XCOPY OLIB SL_1_16_0_5 /S&#039;&#039;). The reason is that these steps are cumbersome and will have to be repeated for each new release (at least if you keep the source for each release in its own folder).  If you do not want to do this, you can just as well copy the files directly into the linden source paths.&lt;br /&gt;
&lt;br /&gt;
 rem OLIBS.CMD to build a folder tree for 3rd party libraries and includes&lt;br /&gt;
 md olibs&lt;br /&gt;
 md olibs\linden\&lt;br /&gt;
 md olibs\linden\libraries&lt;br /&gt;
 md olibs\linden\libraries\include&lt;br /&gt;
 md olibs\linden\libraries\i686-win32&lt;br /&gt;
 md olibs\linden\libraries\i686-win32\lib_release&lt;br /&gt;
 md olibs\linden\libraries\i686-win32\lib_debug&lt;br /&gt;
 md olibs\linden\libraries\i686-win32\include&lt;br /&gt;
 md olibs\linden\libraries\i686-win32\include\GL&lt;br /&gt;
 md olibs\linden\libraries\i686-win32\include\quicktime&lt;br /&gt;
 md olibs\linden\indra&lt;br /&gt;
 md olibs\linden\indra\newview&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Fmod ====&lt;br /&gt;
* Download &amp;amp; extract [http://www.fmod.org/files/fmod3/fmodapi375win.zip FMOD3.75 API for Windows]. (later versions, like FMOD Ex, are incompatible).&lt;br /&gt;
* Copy &amp;quot;fmodapi375win\api\inc\fmod.h&amp;quot; to &amp;quot;linden\libraries\include&amp;quot;&lt;br /&gt;
* Copy &amp;quot;fmodapi375win\api\inc\fmod_errors.h&amp;quot; to &amp;quot;linden\libraries\include&amp;quot;&lt;br /&gt;
* Copy &amp;quot;fmodapi375win\api\inc\fmoddyn.h&amp;quot; to &amp;quot;linden\libraries\include&amp;quot;&lt;br /&gt;
* Copy &amp;quot;fmodapi375win\api\lib\fmodvc.lib&amp;quot; to &amp;quot;linden\libraries\i686-win32\lib_release&amp;quot; and to &amp;quot;linden\libraries\i686-win32\lib_debug&amp;quot;&lt;br /&gt;
(If using cmake, copy &amp;quot;fmodapi375win\api\lib\fmodvc.lib&amp;quot; to &amp;quot;linden\libraries\i686-win32\lib\release&amp;quot; and to &amp;quot;linden\libraries\i686-win32\lib\debug&amp;quot;)&lt;br /&gt;
* Copy &amp;quot;fmodapi375win\api\fmod.dll&amp;quot; to &amp;quot;linden\libraries\i686-win32\lib\release&amp;quot; an &amp;quot;linden\libraries\i686-win32\lib\debug&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Quicktime ====&lt;br /&gt;
&lt;br /&gt;
Currently - as of version 1.21 - CMake requires Quicktime to be installed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This download requires a registration at the Apple Quicktime website and take a bit of time.  You can avoid using QuickTime if you want, see [[Compiling_older_Viewers_(1.20_and_earlier_with_MSVS)#QuickTime_removal|this]] for details.  Remember that your Viewer &#039;&#039;&#039;can&#039;t play in-world movies&#039;&#039;&#039; if you do so.&lt;br /&gt;
* Download &amp;amp; install the [http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wo/11.1.17.2.1.3.3.1.0.1.1.0.3.11.3.3.1#main Quicktime SDK for Windows]&lt;br /&gt;
* Copy &amp;quot;QuicktimeSDK\Libraries\QTMLClient.lib&amp;quot; to &amp;quot;linden\libraries\i686-win32\lib_release&amp;quot; and to  &amp;quot;linden\libraries\i686-win32\lib_debug&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
(If using CMake, copy &amp;quot;QuicktimeSDK\Libraries\QTMLClient.lib&amp;quot; to &amp;quot;linden\libraries\i686-win32\lib\release&amp;quot; and to &amp;quot;linden\libraries\i686-win32\lib\debug&amp;quot; instead)&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of &amp;quot;QuicktimeSDK\CIncludes&amp;quot; into &amp;quot;linden\libraries\i686-win32\include\quicktime&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Building the Viewer ==&lt;br /&gt;
&lt;br /&gt;
At this point, you should be ready to use [[CMake]] to build the Visual Studio solution for the project. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: CMake is only supported for Viewer versions 1.21 and beyond. &lt;br /&gt;
&lt;br /&gt;
Before you first run a build, you&#039;ll need to configure things. It is recommended that you use the &amp;lt;code&amp;gt;develop.py&amp;lt;/code&amp;gt; script that will create a default configuration for you.&lt;br /&gt;
&lt;br /&gt;
You must make sure that cmake is registered in the Windows environment or you will get strange errors from develop.py. To ensure everything is correct, right click My Computer -&amp;gt; Properties -&amp;gt; Advanced -&amp;gt; Environment Variables -&amp;gt; Inside System Variables, choose PATH (case insensitive) and click Edit. Now in the value field, go to the end of the value and add a semicolon (;), and then the folder containing the CMake binaries (example: C:\Program Files\CMake 2.8\bin). This might already have been set by the CMake installer.&lt;br /&gt;
&lt;br /&gt;
From the command line, navigate to the indra folder of your source tree and run:&lt;br /&gt;
&lt;br /&gt;
 python develop.py&lt;br /&gt;
&lt;br /&gt;
CMake will pick the most recent version of Visual Studio we support. If you want to specify the version of Visual Studio to use.&lt;br /&gt;
&lt;br /&gt;
* VisualStudio 2005:&lt;br /&gt;
&lt;br /&gt;
 python develop.py -G VC80&lt;br /&gt;
&lt;br /&gt;
* VisualStudio 2008:&lt;br /&gt;
&lt;br /&gt;
 python develop.py -G VC90&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; The above commands will configure a &amp;quot;non-standalone&amp;quot; version of the source code tree. This means that the required third party library packages (as built by Linden Lab) will be downloaded during the CMake process.&lt;br /&gt;
&lt;br /&gt;
=== Finding your build directory ===&lt;br /&gt;
&lt;br /&gt;
In the CMake world, we keep source and object files separate. The &amp;lt;code&amp;gt;develop.py&amp;lt;/code&amp;gt; script did create and populate a build directory for you. It is in one of the following locations:&lt;br /&gt;
* VS 2005: &amp;lt;code&amp;gt;&#039;indra/build-vc80&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
* VS 2008: &amp;lt;code&amp;gt;&#039;indra/build-vc90&#039;&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Compiling ===&lt;br /&gt;
&lt;br /&gt;
To start a build, do one of the following:&lt;br /&gt;
*  Run &amp;lt;code&amp;gt;python develop.py build&amp;lt;/code&amp;gt; from the indra directory.&lt;br /&gt;
** &#039;&#039;&#039;NOTE FOR VS 2008 USERS:&#039;&#039;&#039; This command will not work, since it will only look for VS 2005.  Instead, run the command &amp;lt;code&amp;gt;python develop.py -G VC90 build&amp;lt;/code&amp;gt;&lt;br /&gt;
*  Load the Visual Studio solution into your IDE.  For MSVS VC++:&lt;br /&gt;
** Use &amp;quot;File -&amp;gt; Open -&amp;gt; Project/Solution&amp;quot;, and open the linden/indra/build-VC80/SecondLife.sln solution file&lt;br /&gt;
*** &#039;&#039;&#039;NOTE FOR VS 2008 USERS:&#039;&#039;&#039; Even though a build-VC90 was created in the above steps, developer.py places the VS 2008 solution/project files in the indra directory.  Don&#039;t move them to build-VC90 - the paths in the project files are relative to the indra directory.&lt;br /&gt;
** In the MSVS toolbar, just to the right of the triangular &amp;quot;Start Debugging&amp;quot; arrow, is a text box whose tooltip is &amp;quot;Solution Configurations&amp;quot;.  Select RelWithDebugInfo.&lt;br /&gt;
** If ALL_BUILD is not set as your StartUp Project (the StartUp Project is displayed in bold font), right-click on ALL_BUILD and choose &amp;quot;Set as StartUp Project&amp;quot;.&lt;br /&gt;
** Right-click on ALL_BUILD and choose &amp;quot;Properties&amp;quot;.  In &amp;quot;Configuration Properties -&amp;gt; Debugging&amp;quot;, find &amp;quot;Working Directory&amp;quot; and navigate to &amp;quot;linden\indra\newview&amp;quot;.&lt;br /&gt;
** (For Snowglobe 1.x) In the Solution Explorer pane, right-click on the project named &amp;quot;prepare&amp;quot; and select Project Only -&amp;gt; Build Only prepare.  This downloads and installs precompiled libraries and only needs to be done when the source tree is clean or if libraries in the list included in the source tree get updated.  Running this when not required is brief and causes no harm.&lt;br /&gt;
** Build -&amp;gt; Build Solution (F7)&lt;br /&gt;
** Debug -&amp;gt; &amp;quot;Start Debugging&amp;quot; or &amp;quot;Start without debugging&amp;quot;.&lt;br /&gt;
** MSVC might not be able to find the executable.  If not, point it to &amp;quot;linden\indra\build-VC80\newview\relwithdebinfo\secondlife-bin.exe&amp;quot;, and try again.&lt;br /&gt;
** You may see an error due to not being able to find fmod.dll.  If so, find a copy (remember, you copied this in a step above) and copy it into &amp;quot;indra\build-VC80\newview\relwithdebinfo&amp;quot;.  Try again.&lt;br /&gt;
** You may see an error due to not finding llkdu.dll.  If so, find it in the normal installed version (make sure it&#039;s the same version as your source) and copy it into &amp;quot;indra\build-VC80\newview\relwithdebinfo&amp;quot;.  Try again.&lt;br /&gt;
** Good luck!&lt;br /&gt;
&lt;br /&gt;
=== Where&#039;s the built Viewer? ===&lt;br /&gt;
&lt;br /&gt;
On Windows, the built Viewer ought to run from VS2005.&lt;br /&gt;
&lt;br /&gt;
To run outside MS VS, see Discussion tab:&lt;br /&gt;
[[Talk:Microsoft_Windows_Builds#Running_Viewer_outside_of_MS_VC]]&lt;br /&gt;
&lt;br /&gt;
=== Build instructions for 1.20 and earlier ===&lt;br /&gt;
&lt;br /&gt;
See [[Compiling older Viewers (1.20 and earlier with MSVS)]] if you&#039;d like to compile a version of the Viewer older than 1.20.&lt;br /&gt;
&lt;br /&gt;
== What to do if it doesn&#039;t work for you ==&lt;br /&gt;
&lt;br /&gt;
* Ask for help on [[IRC]] (irc.freenode.net #opensl)&lt;br /&gt;
* Find someone on the [[OpenSource-Dev|OpenSource-Dev mailing list]]&lt;br /&gt;
* Fix it: [[Modifying CMake Files‎]] (and please, submit a patch!)&lt;br /&gt;
&lt;br /&gt;
Please also see the (user contributed) instructions at [[User:Michelle2_Zenovka/cmake]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Compiling viewer]]&lt;/div&gt;</summary>
		<author><name>Zidan Foxdale</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Microsoft_Windows_Builds&amp;diff=1064212</id>
		<title>Microsoft Windows Builds</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Microsoft_Windows_Builds&amp;diff=1064212"/>
		<updated>2010-10-16T02:23:44Z</updated>

		<summary type="html">&lt;p&gt;Zidan Foxdale: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{multi-lang}}&lt;br /&gt;
{{CompileNav}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Windows, there are several options on build (compile) environment of the Second Life.&lt;br /&gt;
&lt;br /&gt;
This page explains how you can compile the Viewer on Microsoft Windows.&lt;br /&gt;
&lt;br /&gt;
Currently, only 32 bit binary is tested.  There seems to be several trials to produce 64 bit Windows .EXE of the Viewer.  If you did, please write your experience on [[Talk:Microsoft Windows Builds|the discussion page]] (regardless it was successful or not!)&lt;br /&gt;
&lt;br /&gt;
== Choosing and preparing a compiler ==&lt;br /&gt;
&lt;br /&gt;
=== Linden-supported compilers ===&lt;br /&gt;
&lt;br /&gt;
Supported compiler: &#039;&#039;&#039;Visual Studio .NET 2005 Professional&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You need to setup the compiler and Microsoft Development tools as follows:&lt;br /&gt;
* Setup [[Microsoft Visual Studio]]&lt;br /&gt;
&lt;br /&gt;
=== Community experimental compilers ===&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have Visual Studio .NET 2005 Professional, you may wish to try one of the following alternatives.&lt;br /&gt;
&lt;br /&gt;
* Visual C++ 2005 Express ([[Microsoft Visual Studio|instructions]], but the screenshots for [[Compiling the Viewer (MSVS2008)|VS2008]] are worth a glance too)&lt;br /&gt;
* Visual Studio 2008 ([[Compiling the Viewer (MSVS2008)|instructions]])&lt;br /&gt;
* Visual C++ 2008 Express ([[Compiling the Viewer (MSVS2008)|instructions]])&lt;br /&gt;
&lt;br /&gt;
{{Warning|Boost support with Visual Studio 2008 is problematic as of this writing.  Check {{jira|VWR-9541}} before continuing on this path.}}&lt;br /&gt;
&lt;br /&gt;
NOTE: Make sure you install to paths without spaces in it.&lt;br /&gt;
&lt;br /&gt;
== Getting other development tools ==&lt;br /&gt;
&lt;br /&gt;
You will need to install the following tools to compile the Viewer:&lt;br /&gt;
* &#039;&#039;&#039;UniCode NSIS&#039;&#039;&#039;([http://www.scratchpaper.com/home/downloads download Unicode NSIS])&lt;br /&gt;
**  This is the package installer used to build Setup.exe. &amp;lt;b&amp;gt;Note&amp;lt;/b&amp;gt;: As of this writing the file is downloaded with an *.exec extension that needs renamed *.exe.--[[User:Nicky Perian|Nicky Perian]] 16:22, 30 March 2010 (UTC)&lt;br /&gt;
* &#039;&#039;&#039;CMake&#039;&#039;&#039; ([http://www.cmake.org/HTML/Download.html download CMake])&lt;br /&gt;
**  As of this writing, the latest version is 2.6.2.  &amp;lt;b&amp;gt;Note&amp;lt;/b&amp;gt;: There are many known issues with CMake 2.6.0 and 2.6.1 in conjunction with building the Second Life Viewer.  CMake 2.4.8 is supported for compiling the 1.21 version of the Second Life Viewer, but 2.6.2 is likely to become the new minimum requirement in the near future.&lt;br /&gt;
* &#039;&#039;&#039;Cygwin&#039;&#039;&#039; ([http://www.cygwin.com/ download Cygwin])&lt;br /&gt;
** When you run the cygwin setup utility make sure you have selected to install &#039;&#039;&#039;patchutils&#039;&#039;&#039;, &#039;&#039;&#039;flex&#039;&#039;&#039;, &#039;&#039;&#039;bison&#039;&#039;&#039;, and &#039;&#039;&#039;zlib-devel&#039;&#039;&#039;(all located under &amp;quot;devel&amp;quot;), &#039;&#039;&#039;openssh&#039;&#039;&#039; (located under &amp;quot;Net&amp;quot;), which are not part of the default install. (If you missed one of these, the easiest thing to do is to re-run the entire installation.)&lt;br /&gt;
* &#039;&#039;&#039;Python&#039;&#039;&#039; (download either [http://www.python.org/download/ Python.org Standard Python] or  [http://www.activestate.com/Products/ActivePython/?mp=1 ActivePython]&lt;br /&gt;
** 2.4.3 is the minimum required version.&lt;br /&gt;
**  If you are using a version of Python newer than v2.5, you may need to change the Python.cmake file. See the [[Talk:CMake#CMake_and_Python_2.6|CMake discussion]] for details (this change was necessary as of 1.21-r99587 source branch). )  &lt;br /&gt;
* &#039;&#039;&#039;The Windows Platform SDK&#039;&#039;&#039;&lt;br /&gt;
** Get the latest version (as of 23 March 2010) here: [http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=c17ba869-9671-4330-a63e-1fd44e0e2505&amp;amp;displayLang=en Windows SDK for Windows Server 2008 and .NET Framework 3.5 SP1] (If you use the web installer, you can choose only the &amp;quot;Development Tools&amp;quot; and cut the download size significantly.) &lt;br /&gt;
* &#039;&#039;&#039;DirectX 9.0 SDK&#039;&#039;&#039;&lt;br /&gt;
** Get the latest version (as of 29 Oct 2008) here: [http://www.microsoft.com/downloads/details.aspx?FamilyID=ea4894b5-e98d-44f6-842d-e32147237638&amp;amp;DisplayLang=en DirectX 9.0 SDK (August 2008)]&lt;br /&gt;
&lt;br /&gt;
Verify that Cygwin, CMake, and Python are in the windows &amp;quot;PATH&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; use the Cygwin version of CMake or Python. The Build will fail. (CMake specifically excludes the Cygwin version of Python, in the &amp;lt;code&amp;gt;&#039;Python.cmake&#039;&amp;lt;/code&amp;gt; file)&lt;br /&gt;
&lt;br /&gt;
== Downloading Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can download the Viewer source code on the [[source downloads]] page.  You can also use a [[version control repository]].  If you&#039;re just starting out, it&#039;s probably best to get the latest Release version, rather than a Release Candidate, because the Release Candidates get updated quite often.  But if you would rather work with the latest code, go for the [[version control repository]] &amp;quot;trunk&amp;quot;. Don&#039;t forget to also download the artwork and library bundles relevant to the repository branch you&#039;re using as explained in [[Version_control_repository#Artwork_and_Library_Bundles|Artwork and Library Bundles]].&lt;br /&gt;
&lt;br /&gt;
If you&#039;re downloading from the [[source downloads]] page, there are three packages to get: the source package, the artwork package, and the library package.   In versions 1.20 and earlier, Linden packaged the library binaries in the Libs package. For 1.21 and beyond, the CMake develop.py script now downloads &#039;&#039;&#039;most&#039;&#039;&#039; of the libraries that were previously in the libs zip file.  This saves developers who are tracking trunk from constantly downloading them every update and only downloads updated libraries.   As of this writing, there are some pieces packages that still require downloading, so be sure to grab the library and artwork bundles from the [[source downloads]] page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&lt;br /&gt;
* If the directory path you keep the SL source in has a space in it, the batch file that copies message_template.msg will fail. So, if you unzip or checkout the source tree into, e.g., &amp;quot;C:\Projects\Dir with space in name\Etc\linden&amp;quot;, it won&#039;t work!&lt;br /&gt;
* You should also avoid using non-ASCII (national) characters in the paths, although some localized versions of the tool puts some as a default...&lt;br /&gt;
* Unzip or checkout your source tree into a directory that has as short full pathname as possible, since long paths cause some unexpected trouble during the build.&lt;br /&gt;
&lt;br /&gt;
In other words, the easiest way to get this working is to get &#039;&#039;&#039;source&#039;&#039;&#039;, &#039;&#039;&#039;artwork&#039;&#039;&#039;, and &#039;&#039;&#039;libs&#039;&#039;&#039; from the [[source downloads]] page and unpack them all into the same directory/folder, which ideally would be a folder in (or near) the root directory with a short name like &#039;&#039;&#039;sl_1_21_6&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installing libraries ==&lt;br /&gt;
&lt;br /&gt;
SL Viewer depends on some third party libraries.  Some of them are open source, some others are not.&lt;br /&gt;
&lt;br /&gt;
=== Open source libraries ===&lt;br /&gt;
&lt;br /&gt;
As of Viewer version 1.21, all open source libraries are automatically downloaded as part of the build script invoked by develop.py, unless you choose to configure a standalone build.&lt;br /&gt;
&lt;br /&gt;
=== Proprietary libraries ===&lt;br /&gt;
&lt;br /&gt;
Linden Lab does not provide proprietary libraries.  You will need to follow the instructions here under to acquire and copy them to your source tree.&lt;br /&gt;
&lt;br /&gt;
It&#039;s probably a good idea to build an empty directory tree for those files, copy the relevant proprietary files there and, once done, copy the whole to your source tree (like &#039;&#039;XCOPY OLIB SL_1_16_0_5 /S&#039;&#039;). The reason is that these steps are cumbersome and will have to be repeated for each new release (at least if you keep the source for each release in its own folder).  If you do not want to do this, you can just as well copy the files directly into the linden source paths.&lt;br /&gt;
&lt;br /&gt;
 rem OLIBS.CMD to build a folder tree for 3rd party libraries and includes&lt;br /&gt;
 md olibs&lt;br /&gt;
 md olibs\linden\&lt;br /&gt;
 md olibs\linden\libraries&lt;br /&gt;
 md olibs\linden\libraries\include&lt;br /&gt;
 md olibs\linden\libraries\i686-win32&lt;br /&gt;
 md olibs\linden\libraries\i686-win32\lib_release&lt;br /&gt;
 md olibs\linden\libraries\i686-win32\lib_debug&lt;br /&gt;
 md olibs\linden\libraries\i686-win32\include&lt;br /&gt;
 md olibs\linden\libraries\i686-win32\include\GL&lt;br /&gt;
 md olibs\linden\libraries\i686-win32\include\quicktime&lt;br /&gt;
 md olibs\linden\indra&lt;br /&gt;
 md olibs\linden\indra\newview&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Fmod ====&lt;br /&gt;
* Download &amp;amp; extract [http://www.fmod.org/files/fmod3/fmodapi375win.zip FMOD3.75 API for Windows]. (later versions, like FMOD Ex, are incompatible).&lt;br /&gt;
* Copy &amp;quot;fmodapi375win\api\inc\fmod.h&amp;quot; to &amp;quot;linden\libraries\include&amp;quot;&lt;br /&gt;
* Copy &amp;quot;fmodapi375win\api\inc\fmod_errors.h&amp;quot; to &amp;quot;linden\libraries\include&amp;quot;&lt;br /&gt;
* Copy &amp;quot;fmodapi375win\api\inc\fmoddyn.h&amp;quot; to &amp;quot;linden\libraries\include&amp;quot;&lt;br /&gt;
* Copy &amp;quot;fmodapi375win\api\lib\fmodvc.lib&amp;quot; to &amp;quot;linden\libraries\i686-win32\lib_release&amp;quot; and to &amp;quot;linden\libraries\i686-win32\lib_debug&amp;quot;&lt;br /&gt;
(If using cmake, copy &amp;quot;fmodapi375win\api\lib\fmodvc.lib&amp;quot; to &amp;quot;linden\libraries\i686-win32\lib\release&amp;quot; and to &amp;quot;linden\libraries\i686-win32\lib\debug&amp;quot;)&lt;br /&gt;
* Copy &amp;quot;fmodapi375win\api\fmod.dll&amp;quot; to &amp;quot;linden\indra\newview&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Quicktime ====&lt;br /&gt;
&lt;br /&gt;
Currently - as of version 1.21 - CMake requires Quicktime to be installed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This download requires a registration at the Apple Quicktime website and take a bit of time.  You can avoid using QuickTime if you want, see [[Compiling_older_Viewers_(1.20_and_earlier_with_MSVS)#QuickTime_removal|this]] for details.  Remember that your Viewer &#039;&#039;&#039;can&#039;t play in-world movies&#039;&#039;&#039; if you do so.&lt;br /&gt;
* Download &amp;amp; install the [http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wo/11.1.17.2.1.3.3.1.0.1.1.0.3.11.3.3.1#main Quicktime SDK for Windows]&lt;br /&gt;
* Copy &amp;quot;QuicktimeSDK\Libraries\QTMLClient.lib&amp;quot; to &amp;quot;linden\libraries\i686-win32\lib_release&amp;quot; and to  &amp;quot;linden\libraries\i686-win32\lib_debug&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
(If using CMake, copy &amp;quot;QuicktimeSDK\Libraries\QTMLClient.lib&amp;quot; to &amp;quot;linden\libraries\i686-win32\lib\release&amp;quot; and to &amp;quot;linden\libraries\i686-win32\lib\debug&amp;quot; instead)&lt;br /&gt;
&lt;br /&gt;
* Copy the contents of &amp;quot;QuicktimeSDK\CIncludes&amp;quot; into &amp;quot;linden\libraries\i686-win32\include\quicktime&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Building the Viewer ==&lt;br /&gt;
&lt;br /&gt;
At this point, you should be ready to use [[CMake]] to build the Visual Studio solution for the project. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: CMake is only supported for Viewer versions 1.21 and beyond. &lt;br /&gt;
&lt;br /&gt;
Before you first run a build, you&#039;ll need to configure things. It is recommended that you use the &amp;lt;code&amp;gt;develop.py&amp;lt;/code&amp;gt; script that will create a default configuration for you.&lt;br /&gt;
&lt;br /&gt;
You must make sure that cmake is registered in the Windows environment or you will get strange errors from develop.py. To ensure everything is correct, right click My Computer -&amp;gt; Properties -&amp;gt; Advanced -&amp;gt; Environment Variables -&amp;gt; Inside System Variables, choose PATH (case insensitive) and click Edit. Now in the value field, go to the end of the value and add a semicolon (;), and then the folder containing the CMake binaries (example: C:\Program Files\CMake 2.8\bin). This might already have been set by the CMake installer.&lt;br /&gt;
&lt;br /&gt;
From the command line, navigate to the indra folder of your source tree and run:&lt;br /&gt;
&lt;br /&gt;
 python develop.py&lt;br /&gt;
&lt;br /&gt;
CMake will pick the most recent version of Visual Studio we support. If you want to specify the version of Visual Studio to use.&lt;br /&gt;
&lt;br /&gt;
* VisualStudio 2005:&lt;br /&gt;
&lt;br /&gt;
 python develop.py -G VC80&lt;br /&gt;
&lt;br /&gt;
* VisualStudio 2008:&lt;br /&gt;
&lt;br /&gt;
 python develop.py -G VC90&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; The above commands will configure a &amp;quot;non-standalone&amp;quot; version of the source code tree. This means that the required third party library packages (as built by Linden Lab) will be downloaded during the CMake process.&lt;br /&gt;
&lt;br /&gt;
=== Finding your build directory ===&lt;br /&gt;
&lt;br /&gt;
In the CMake world, we keep source and object files separate. The &amp;lt;code&amp;gt;develop.py&amp;lt;/code&amp;gt; script did create and populate a build directory for you. It is in one of the following locations:&lt;br /&gt;
* VS 2005: &amp;lt;code&amp;gt;&#039;indra/build-vc80&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
* VS 2008: &amp;lt;code&amp;gt;&#039;indra/build-vc90&#039;&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== Compiling ===&lt;br /&gt;
&lt;br /&gt;
To start a build, do one of the following:&lt;br /&gt;
*  Run &amp;lt;code&amp;gt;python develop.py build&amp;lt;/code&amp;gt; from the indra directory.&lt;br /&gt;
** &#039;&#039;&#039;NOTE FOR VS 2008 USERS:&#039;&#039;&#039; This command will not work, since it will only look for VS 2005.  Instead, run the command &amp;lt;code&amp;gt;python develop.py -G VC90 build&amp;lt;/code&amp;gt;&lt;br /&gt;
*  Load the Visual Studio solution into your IDE.  For MSVS VC++:&lt;br /&gt;
** Use &amp;quot;File -&amp;gt; Open -&amp;gt; Project/Solution&amp;quot;, and open the linden/indra/build-VC80/SecondLife.sln solution file&lt;br /&gt;
*** &#039;&#039;&#039;NOTE FOR VS 2008 USERS:&#039;&#039;&#039; Even though a build-VC90 was created in the above steps, developer.py places the VS 2008 solution/project files in the indra directory.  Don&#039;t move them to build-VC90 - the paths in the project files are relative to the indra directory.&lt;br /&gt;
** In the MSVS toolbar, just to the right of the triangular &amp;quot;Start Debugging&amp;quot; arrow, is a text box whose tooltip is &amp;quot;Solution Configurations&amp;quot;.  Select RelWithDebugInfo.&lt;br /&gt;
** If ALL_BUILD is not set as your StartUp Project (the StartUp Project is displayed in bold font), right-click on ALL_BUILD and choose &amp;quot;Set as StartUp Project&amp;quot;.&lt;br /&gt;
** Right-click on ALL_BUILD and choose &amp;quot;Properties&amp;quot;.  In &amp;quot;Configuration Properties -&amp;gt; Debugging&amp;quot;, find &amp;quot;Working Directory&amp;quot; and navigate to &amp;quot;linden\indra\newview&amp;quot;.&lt;br /&gt;
** (For Snowglobe 1.x) In the Solution Explorer pane, right-click on the project named &amp;quot;prepare&amp;quot; and select Project Only -&amp;gt; Build Only prepare.  This downloads and installs precompiled libraries and only needs to be done when the source tree is clean or if libraries in the list included in the source tree get updated.  Running this when not required is brief and causes no harm.&lt;br /&gt;
** Build -&amp;gt; Build Solution (F7)&lt;br /&gt;
** Debug -&amp;gt; &amp;quot;Start Debugging&amp;quot; or &amp;quot;Start without debugging&amp;quot;.&lt;br /&gt;
** MSVC might not be able to find the executable.  If not, point it to &amp;quot;linden\indra\build-VC80\newview\relwithdebinfo\secondlife-bin.exe&amp;quot;, and try again.&lt;br /&gt;
** You may see an error due to not being able to find fmod.dll.  If so, find a copy (remember, you copied this in a step above) and copy it into &amp;quot;indra\build-VC80\newview\relwithdebinfo&amp;quot;.  Try again.&lt;br /&gt;
** You may see an error due to not finding llkdu.dll.  If so, find it in the normal installed version (make sure it&#039;s the same version as your source) and copy it into &amp;quot;indra\build-VC80\newview\relwithdebinfo&amp;quot;.  Try again.&lt;br /&gt;
** Good luck!&lt;br /&gt;
&lt;br /&gt;
=== Where&#039;s the built Viewer? ===&lt;br /&gt;
&lt;br /&gt;
On Windows, the built Viewer ought to run from VS2005.&lt;br /&gt;
&lt;br /&gt;
To run outside MS VS, see Discussion tab:&lt;br /&gt;
[[Talk:Microsoft_Windows_Builds#Running_Viewer_outside_of_MS_VC]]&lt;br /&gt;
&lt;br /&gt;
=== Build instructions for 1.20 and earlier ===&lt;br /&gt;
&lt;br /&gt;
See [[Compiling older Viewers (1.20 and earlier with MSVS)]] if you&#039;d like to compile a version of the Viewer older than 1.20.&lt;br /&gt;
&lt;br /&gt;
== What to do if it doesn&#039;t work for you ==&lt;br /&gt;
&lt;br /&gt;
* Ask for help on [[IRC]] (irc.freenode.net #opensl)&lt;br /&gt;
* Find someone on the [[OpenSource-Dev|OpenSource-Dev mailing list]]&lt;br /&gt;
* Fix it: [[Modifying CMake Files‎]] (and please, submit a patch!)&lt;br /&gt;
&lt;br /&gt;
Please also see the (user contributed) instructions at [[User:Michelle2_Zenovka/cmake]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Compiling viewer]]&lt;/div&gt;</summary>
		<author><name>Zidan Foxdale</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=If&amp;diff=1051772</id>
		<title>If</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=If&amp;diff=1051772"/>
		<updated>2010-10-04T22:10:44Z</updated>

		<summary type="html">&lt;p&gt;Zidan Foxdale: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#vardefine:p__desc|&lt;br /&gt;
}}{{#vardefine:p_condition_desc|If this executes as true then &#039;&#039;&#039;branch&#039;&#039;&#039; is executed.&lt;br /&gt;
}}{{#vardefine:p_condition_d_desc| If this executes as true then &#039;&#039;&#039;branch_true&#039;&#039;&#039; is executed otherwise &#039;&#039;&#039;branch_false&#039;&#039;&#039; is executed. 	&lt;br /&gt;
}}{{#vardefine:p_branch_desc|Can be either a single statement, a block statement, or a null statement.&lt;br /&gt;
}}{{LSL_Conditional&lt;br /&gt;
|statement=if&lt;br /&gt;
|p1_name=condition&lt;br /&gt;
|p2_name=branch&lt;br /&gt;
|statement_header&lt;br /&gt;
|statement_desc&lt;br /&gt;
|statement_title=if ( {{LSL Param|condition}} ) {{LSL Param|branch}}&lt;br /&gt;
|extras=&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
== if ( {{LSL Param|condition_d|condition}} ) {{LSL Param|branch|branch_true}} else {{LSL Param|branch|branch_false}} ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em;&amp;quot;&amp;gt;&lt;br /&gt;
{{{!}}&lt;br /&gt;
{{LSL DefineRow||condition|{{#var:p_condition_d_desc}}}}&lt;br /&gt;
{{LSL DefineRow||branch_true|{{#var:p_branch_desc}}}}&lt;br /&gt;
{{LSL DefineRow||branch_false|{{#var:p_branch_desc}}}}&lt;br /&gt;
{{!}}}&lt;br /&gt;
&lt;br /&gt;
There seems to be no limit anymore (or very high &amp;gt; 120) for else-if chains.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|spec=Operators in LSL do NOT [http://en.wikipedia.org/wiki/Short-circuit_evaluation short circuit]. For example:&lt;br /&gt;
{{{!}} style=&amp;quot;border-width: 0px;border-spacing: 0px;&amp;quot;&lt;br /&gt;
{{!}}&amp;lt;lsl&amp;gt;// A simple method to say if the method was called.&lt;br /&gt;
integer test()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;Test method called!&amp;quot;);&lt;br /&gt;
    return TRUE;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (FALSE &amp;amp;&amp;amp; test())&lt;br /&gt;
        { // If short-circuit optimized then the test() should never be called.&lt;br /&gt;
          // Will never get here.&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
{{!}}}&lt;br /&gt;
In a short-circuited language if the left-hand side of a logical AND (&amp;amp;&amp;amp;) is FALSE the right-hand side is never tested since the entire test would always return a FALSE output no matter what the value of the right-hand side. Since LSL is not short circuited, both the left and the right-hand sides are tested all the time.&lt;br /&gt;
This can be simulated by using a nested if structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (FALSE)&lt;br /&gt;
        {&lt;br /&gt;
            if (test())&lt;br /&gt;
            {&lt;br /&gt;
              // Will never get here.&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
|examples=Simple inline if statement:&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == 1) c = b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simple block if statement:&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == 1)&lt;br /&gt;
{&lt;br /&gt;
    // Do something here.&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Complex if/else block (only one line of text will be said by this example)&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == &amp;quot;Loren&amp;quot;) {&lt;br /&gt;
    llSay(0, &amp;quot;Lorem ipsum sic amet!&amp;quot;);&lt;br /&gt;
} else if (a == &amp;quot;Bob&amp;quot;) {&lt;br /&gt;
    llSay(0, &amp;quot;Babble dabble rabble rouse.&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
    llSay(0, &amp;quot;Gobbledygook?  or English?&amp;quot;);&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compounded if statement:&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == 1 &amp;amp;&amp;amp; b == c)&lt;br /&gt;
{&lt;br /&gt;
    // more here.&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nested if statements:&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == 1)&lt;br /&gt;
{&lt;br /&gt;
    if (b == c)&lt;br /&gt;
    {&lt;br /&gt;
        // more here.&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch out for misplaced semicolons.  They can, and will, cause strange things to happen.&lt;br /&gt;
For instance: If you place a semicolon between an if statement and a code block, the if statement will not control the execution of the block.&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == &amp;quot;Loren&amp;quot;);&lt;br /&gt;
{&lt;br /&gt;
    llSay(0, &amp;quot;Lorem ipsum sic amet!&amp;quot;);&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code will execute in the following order:&lt;br /&gt;
&lt;br /&gt;
# The line &amp;lt;code&amp;gt;if (a == &amp;quot;Loren&amp;quot;);&amp;lt;/code&amp;gt; will execute; the semicolon will tell LSL that this is a simple inline if statement.&lt;br /&gt;
# Next it meets the start of the code block and will execute the contents, in this case saying &amp;quot;Lorem ipsum sic amet!&amp;quot;, no matter what the outcome of the above if statement.&lt;br /&gt;
&lt;br /&gt;
Another problem happens when someone forgets to use the curly braces.&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == &amp;quot;Loren&amp;quot;)&lt;br /&gt;
    llSay(0, &amp;quot;Lorem ipsum sic amet!&amp;quot;);&lt;br /&gt;
    llSay(0, &amp;quot;I don&#039;t know what it means either...&amp;quot;);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The assumption is that because the indentation makes it &amp;quot;look&amp;quot; like both llSay commands are controlled by the if statement, that they are.  In fact, if &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; was equal to &amp;quot;Joe&amp;quot; then all that would be said is &amp;quot;I don&#039;t know what it means either...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
There is common error to mistake  == operator for =, due to  ignorance or simply mistyping, e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; &lt;br /&gt;
if (av_id = llGetOwner())&lt;br /&gt;
         llSay(0,&amp;quot;It&#039;s my owner!&amp;quot;);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will send message regardles what value of va_id was , because it equal to if(llGetOwner()).&lt;br /&gt;
 &lt;br /&gt;
There is trick , invented by C programmers ages ago how to avoid this bug  -  to make habit to put constant or other expression to which you cannot assign value(e.g. function call or  result of some operation) in front of comparison - that will save you from mistake. It&#039;s very nasty error to make and hard to debug in big code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; &lt;br /&gt;
if(llGetOwner() == av_id)&lt;br /&gt;
          llSay(0,&amp;quot;It&#039;s my owner!&amp;quot;);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case mistake will result in compile error.&lt;br /&gt;
&lt;br /&gt;
|helpers&lt;br /&gt;
|also_header&lt;br /&gt;
|also_functions&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_articles&lt;br /&gt;
|also_footer&lt;br /&gt;
|notes&lt;br /&gt;
|mode&lt;br /&gt;
|deprecated&lt;br /&gt;
|cat1=Conditional&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Zidan Foxdale</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=If&amp;diff=1051762</id>
		<title>If</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=If&amp;diff=1051762"/>
		<updated>2010-10-04T22:09:09Z</updated>

		<summary type="html">&lt;p&gt;Zidan Foxdale: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#vardefine:p__desc|&lt;br /&gt;
}}{{#vardefine:p_condition_desc|If this executes as true then &#039;&#039;&#039;branch&#039;&#039;&#039; is executed.&lt;br /&gt;
}}{{#vardefine:p_condition_d_desc| If this executes as true then &#039;&#039;&#039;branch_true&#039;&#039;&#039; is executed otherwise &#039;&#039;&#039;branch_false&#039;&#039;&#039; is executed. 	&lt;br /&gt;
}}{{#vardefine:p_branch_desc|Can be either a single statement, a block statement, or a null statement.&lt;br /&gt;
}}{{LSL_Conditional&lt;br /&gt;
|statement=if&lt;br /&gt;
|p1_name=condition&lt;br /&gt;
|p2_name=branch&lt;br /&gt;
|statement_header&lt;br /&gt;
|statement_desc&lt;br /&gt;
|statement_title=if ( {{LSL Param|condition}} ) {{LSL Param|branch}}&lt;br /&gt;
|extras=&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
== if ( {{LSL Param|condition_d|condition}} ) {{LSL Param|branch|branch_true}} else {{LSL Param|branch|branch_false}} ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em;&amp;quot;&amp;gt;&lt;br /&gt;
{{{!}}&lt;br /&gt;
{{LSL DefineRow||condition|{{#var:p_condition_d_desc}}}}&lt;br /&gt;
{{LSL DefineRow||branch_true|{{#var:p_branch_desc}}}}&lt;br /&gt;
{{LSL DefineRow||branch_false|{{#var:p_branch_desc}}}}&lt;br /&gt;
{{!}}}&lt;br /&gt;
&lt;br /&gt;
There seems to be no limit anymore (or very high &amp;gt; 120) for else-if chains.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|spec=Operators in LSL do NOT [http://en.wikipedia.org/wiki/Short-circuit_evaluation short circuit]. For example:&lt;br /&gt;
{{{!}} style=&amp;quot;border-width: 0px;border-spacing: 0px;&amp;quot;&lt;br /&gt;
{{!}}&amp;lt;lsl&amp;gt;// A simple method to say if the method was called.&lt;br /&gt;
integer test()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;Test method called!&amp;quot;);&lt;br /&gt;
    return TRUE;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (FALSE &amp;amp;&amp;amp; test())&lt;br /&gt;
        { // If short-circuit optimized then the test() should never be called.&lt;br /&gt;
          // Will never get here.&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
{{!}}}&lt;br /&gt;
In a short-circuited language if the left-hand side of a logical AND (&amp;amp;&amp;amp;) is FALSE the right-hand side is never tested since the entire test would always return a FALSE output no matter what the value of the right-hand side. Since LSL is not short circuited, both the left and the right-hand sides are tested all the time.&lt;br /&gt;
This can be simulated by using a nested if structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (FALSE)&lt;br /&gt;
        {&lt;br /&gt;
            if (test())&lt;br /&gt;
            {&lt;br /&gt;
              // Will never get here.&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
|examples=Simple inline if statement:&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == 1) c = b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simple block if statement:&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == 1)&lt;br /&gt;
{&lt;br /&gt;
    // Do something here.&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Complex if/else block (only one line of text will be said by this example)&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == &amp;quot;Loren&amp;quot;) {&lt;br /&gt;
    llSay(0, &amp;quot;Lorem ipsum sic amet!&amp;quot;);&lt;br /&gt;
} else if (a == &amp;quot;Bob&amp;quot;) {&lt;br /&gt;
    llSay(0, &amp;quot;Babble dabble rabble rouse.&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
    llSay(0, &amp;quot;Gobbledygook?  or English?&amp;quot;);&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compounded if statement:&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == 1 &amp;amp;&amp;amp; b == c)&lt;br /&gt;
{&lt;br /&gt;
    // more here.&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nested if statements:&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == 1)&lt;br /&gt;
{&lt;br /&gt;
    if (b == c)&lt;br /&gt;
    {&lt;br /&gt;
        // more here.&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch out for misplaced semicolons.  They can, and will, cause strange things to happen.&lt;br /&gt;
For instance: If you place a semicolon between an if statement and a code block, the if statement will not control the execution of the block.&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == &amp;quot;Loren&amp;quot;);&lt;br /&gt;
{&lt;br /&gt;
    llSay(0, &amp;quot;Lorem ipsum sic amet!&amp;quot;);&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code will execute in the following order:&lt;br /&gt;
&lt;br /&gt;
# The line &amp;lt;code&amp;gt;if (a == &amp;quot;Loren&amp;quot;);&amp;lt;/code&amp;gt; will execute; the semicolon will tell LSL that this is a simple inline if statement.&lt;br /&gt;
# Next it meets the start of the code block and will execute the contents, in this case saying &amp;quot;Lorem ipsum sic amet!&amp;quot;, no matter what the outcome of the above if statement.&lt;br /&gt;
&lt;br /&gt;
Another problem happens when someone forgets to use the curly braces.&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == &amp;quot;Loren&amp;quot;)&lt;br /&gt;
    llSay(0, &amp;quot;Lorem ipsum sic amet!&amp;quot;);&lt;br /&gt;
    llSay(0, &amp;quot;I don&#039;t know what it means either...&amp;quot;);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The assumption is that because the indentation makes it &amp;quot;look&amp;quot; like both llSay commands are controlled by the if statement, that they are.  In fact, if &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; was equal to &amp;quot;Joe&amp;quot; then all that would be said is &amp;quot;I don&#039;t know what it means either...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
There is common error to mistake  == operator for =, due to  ignorance or simply mistyping, e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; &lt;br /&gt;
if (av_id = llGetOwner())&lt;br /&gt;
         llSay(&amp;quot;It&#039;s my owner!&amp;quot;);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
will send message regardles what value of va_id was , because it equal to if(llGetOwner()).&lt;br /&gt;
 &lt;br /&gt;
There is trick , invented by C programmers ages ago how to avoid this bug  -  to make habit to put constant or other expression to which you cannot assign value(e.g. function call or  result of some operation) in front of comparison - that will save you from mistake. It&#039;s very nasty error to make and hard to debug in big code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; &lt;br /&gt;
if(llGetOwner() == av_id)&lt;br /&gt;
          llSay(&amp;quot;It&#039;s my owner!&amp;quot;);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case mistake will result in compile error.&lt;br /&gt;
&lt;br /&gt;
|helpers&lt;br /&gt;
|also_header&lt;br /&gt;
|also_functions&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_articles&lt;br /&gt;
|also_footer&lt;br /&gt;
|notes&lt;br /&gt;
|mode&lt;br /&gt;
|deprecated&lt;br /&gt;
|cat1=Conditional&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Zidan Foxdale</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=If&amp;diff=1051752</id>
		<title>If</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=If&amp;diff=1051752"/>
		<updated>2010-10-04T22:08:25Z</updated>

		<summary type="html">&lt;p&gt;Zidan Foxdale: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#vardefine:p__desc|&lt;br /&gt;
}}{{#vardefine:p_condition_desc|If this executes as true then &#039;&#039;&#039;branch&#039;&#039;&#039; is executed.&lt;br /&gt;
}}{{#vardefine:p_condition_d_desc| If this executes as true then &#039;&#039;&#039;branch_true&#039;&#039;&#039; is executed otherwise &#039;&#039;&#039;branch_false&#039;&#039;&#039; is executed. 	&lt;br /&gt;
}}{{#vardefine:p_branch_desc|Can be either a single statement, a block statement, or a null statement.&lt;br /&gt;
}}{{LSL_Conditional&lt;br /&gt;
|statement=if&lt;br /&gt;
|p1_name=condition&lt;br /&gt;
|p2_name=branch&lt;br /&gt;
|statement_header&lt;br /&gt;
|statement_desc&lt;br /&gt;
|statement_title=if ( {{LSL Param|condition}} ) {{LSL Param|branch}}&lt;br /&gt;
|extras=&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
== if ( {{LSL Param|condition_d|condition}} ) {{LSL Param|branch|branch_true}} else {{LSL Param|branch|branch_false}} ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em;&amp;quot;&amp;gt;&lt;br /&gt;
{{{!}}&lt;br /&gt;
{{LSL DefineRow||condition|{{#var:p_condition_d_desc}}}}&lt;br /&gt;
{{LSL DefineRow||branch_true|{{#var:p_branch_desc}}}}&lt;br /&gt;
{{LSL DefineRow||branch_false|{{#var:p_branch_desc}}}}&lt;br /&gt;
{{!}}}&lt;br /&gt;
&lt;br /&gt;
There seems to be no limit anymore (or very high &amp;gt; 120) for else-if chains.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|spec=Operators in LSL do NOT [http://en.wikipedia.org/wiki/Short-circuit_evaluation short circuit]. For example:&lt;br /&gt;
{{{!}} style=&amp;quot;border-width: 0px;border-spacing: 0px;&amp;quot;&lt;br /&gt;
{{!}}&amp;lt;lsl&amp;gt;// A simple method to say if the method was called.&lt;br /&gt;
integer test()&lt;br /&gt;
{&lt;br /&gt;
    llOwnerSay(&amp;quot;Test method called!&amp;quot;);&lt;br /&gt;
    return TRUE;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (FALSE &amp;amp;&amp;amp; test())&lt;br /&gt;
        { // If short-circuit optimized then the test() should never be called.&lt;br /&gt;
          // Will never get here.&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
{{!}}}&lt;br /&gt;
In a short-circuited language if the left-hand side of a logical AND (&amp;amp;&amp;amp;) is FALSE the right-hand side is never tested since the entire test would always return a FALSE output no matter what the value of the right-hand side. Since LSL is not short circuited, both the left and the right-hand sides are tested all the time.&lt;br /&gt;
This can be simulated by using a nested if structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        if (FALSE)&lt;br /&gt;
        {&lt;br /&gt;
            if (test())&lt;br /&gt;
            {&lt;br /&gt;
              // Will never get here.&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
|examples=Simple inline if statement:&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == 1) c = b;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simple block if statement:&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == 1)&lt;br /&gt;
{&lt;br /&gt;
    // Do something here.&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Complex if/else block (only one line of text will be said by this example)&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == &amp;quot;Loren&amp;quot;) {&lt;br /&gt;
    llSay(0, &amp;quot;Lorem ipsum sic amet!&amp;quot;);&lt;br /&gt;
} else if (a == &amp;quot;Bob&amp;quot;) {&lt;br /&gt;
    llSay(0, &amp;quot;Babble dabble rabble rouse.&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
    llSay(0, &amp;quot;Gobbledygook?  or English?&amp;quot;);&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compounded if statement:&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == 1 &amp;amp;&amp;amp; b == c)&lt;br /&gt;
{&lt;br /&gt;
    // more here.&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nested if statements:&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == 1)&lt;br /&gt;
{&lt;br /&gt;
    if (b == c)&lt;br /&gt;
    {&lt;br /&gt;
        // more here.&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch out for misplaced semicolons.  They can, and will, cause strange things to happen.&lt;br /&gt;
For instance: If you place a semicolon between an if statement and a code block, the if statement will not control the execution of the block.&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == &amp;quot;Loren&amp;quot;);&lt;br /&gt;
{&lt;br /&gt;
    llSay(0, &amp;quot;Lorem ipsum sic amet!&amp;quot;);&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code will execute in the following order:&lt;br /&gt;
&lt;br /&gt;
# The line &amp;lt;code&amp;gt;if (a == &amp;quot;Loren&amp;quot;);&amp;lt;/code&amp;gt; will execute; the semicolon will tell LSL that this is a simple inline if statement.&lt;br /&gt;
# Next it meets the start of the code block and will execute the contents, in this case saying &amp;quot;Lorem ipsum sic amet!&amp;quot;, no matter what the outcome of the above if statement.&lt;br /&gt;
&lt;br /&gt;
Another problem happens when someone forgets to use the curly braces.&lt;br /&gt;
&amp;lt;lsl&amp;gt;if (a == &amp;quot;Loren&amp;quot;)&lt;br /&gt;
    llSay(0, &amp;quot;Lorem ipsum sic amet!&amp;quot;);&lt;br /&gt;
    llSay(0, &amp;quot;I don&#039;t know what it means either...&amp;quot;);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The assumption is that because the indentation makes it &amp;quot;look&amp;quot; like both llSay commands are controlled by the if statement, that they are.  In fact, if &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; was equal to &amp;quot;Joe&amp;quot; then all that would be said is &amp;quot;I don&#039;t know what it means either...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
There is common error to mistake  == operator for =, due to  ignorance or simply mistyping, e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; &lt;br /&gt;
if (av_id = llGetOwner())&lt;br /&gt;
         llSay(&amp;quot;It&#039;s my owner!&amp;quot;);&amp;lt;lsl&amp;gt;&lt;br /&gt;
will send message regardles what value of va_id was , because it equal to if(llGetOwner()).&lt;br /&gt;
 &lt;br /&gt;
There is trick , invented by C programmers ages ago how to avoid this bug  -  to make habit to put constant or other expression to which you cannot assign value(e.g. function call or  result of some operation) in front of comparison - that will save you from mistake. It&#039;s very nasty error to make and hard to debug in big code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt; &lt;br /&gt;
if(llGetOwner() == av_id)&lt;br /&gt;
          llSay(&amp;quot;It&#039;s my owner!&amp;quot;);&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case mistake will result in compile error.&lt;br /&gt;
&lt;br /&gt;
|helpers&lt;br /&gt;
|also_header&lt;br /&gt;
|also_functions&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_articles&lt;br /&gt;
|also_footer&lt;br /&gt;
|notes&lt;br /&gt;
|mode&lt;br /&gt;
|deprecated&lt;br /&gt;
|cat1=Conditional&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Zidan Foxdale</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlSetInventoryName&amp;diff=944612</id>
		<title>LlSetInventoryName</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlSetInventoryName&amp;diff=944612"/>
		<updated>2010-06-20T14:11:12Z</updated>

		<summary type="html">&lt;p&gt;Zidan Foxdale: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Function/inventory|old}}{{LSL_Function&lt;br /&gt;
|mode=request&lt;br /&gt;
|func_id=???&lt;br /&gt;
|func_sleep=0.0&lt;br /&gt;
|func_energy=10.0&lt;br /&gt;
|func=llSetInventoryName&lt;br /&gt;
|p1_type=string|p1_name=old|p1_desc&lt;br /&gt;
|p2_type=string|p2_name=new|p2_desc=desired inventory name&lt;br /&gt;
|func_desc=Tries to renames the inventory object &#039;&#039;&#039;old&#039;&#039;&#039; to &#039;&#039;&#039;new&#039;&#039;&#039;.  Useful for vendors wishing to hand out customized versions of objects.&lt;br /&gt;
|func_footnote&lt;br /&gt;
|spec&lt;br /&gt;
|caveats&lt;br /&gt;
|constants&lt;br /&gt;
|examples=&lt;br /&gt;
|helpers&lt;br /&gt;
|also_events=&lt;br /&gt;
|also_functions=&lt;br /&gt;
{{LSL DefineRow||[[llGetInventoryName]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llGetInventoryDesc]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llSetInventoryDesc]]|}}&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_articles&lt;br /&gt;
|notes&lt;br /&gt;
|comments=&lt;br /&gt;
Possibly should use key, not names source. And it should work as copy/rename/give function. In case of collision  - either add number to it&#039;s name or return error (should be a flag parameter). --[[User:Zidan Foxdale|Zidan Foxdale]] 14:00, 20 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
A few things that came to mind:&lt;br /&gt;
*What happens with a name collision?&lt;br /&gt;
*When used in a vendor it would be more useful to change the name of the item when giving, this would avoid the name collision problem (and having to change the name back after giving it).&lt;br /&gt;
*A better name for this function would be llRenameInventory (for which there is at least one JIRA).&lt;br /&gt;
P.S. I changed the syntax, using inventory numbering to access items is hazardous, names are less prone to change.&lt;br /&gt;
-- &#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; 19:03, 21 March 2009 (UTC)&lt;br /&gt;
|cat1&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Zidan Foxdale</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlSetInventoryName&amp;diff=944602</id>
		<title>LlSetInventoryName</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlSetInventoryName&amp;diff=944602"/>
		<updated>2010-06-20T14:00:24Z</updated>

		<summary type="html">&lt;p&gt;Zidan Foxdale: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Function/inventory|old}}{{LSL_Function&lt;br /&gt;
|mode=request&lt;br /&gt;
|func_id=???&lt;br /&gt;
|func_sleep=0.0&lt;br /&gt;
|func_energy=10.0&lt;br /&gt;
|func=llSetInventoryName&lt;br /&gt;
|p1_type=string|p1_name=old|p1_desc&lt;br /&gt;
|p2_type=string|p2_name=new|p2_desc=desired inventory name&lt;br /&gt;
|func_desc=Tries to renames the inventory object &#039;&#039;&#039;old&#039;&#039;&#039; to &#039;&#039;&#039;new&#039;&#039;&#039;.  Useful for vendors wishing to hand out customized versions of objects.&lt;br /&gt;
|func_footnote&lt;br /&gt;
|spec&lt;br /&gt;
|caveats&lt;br /&gt;
|constants&lt;br /&gt;
|examples=&lt;br /&gt;
|helpers&lt;br /&gt;
|also_events=&lt;br /&gt;
|also_functions=&lt;br /&gt;
{{LSL DefineRow||[[llGetInventoryName]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llGetInventoryDesc]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llSetInventoryDesc]]|}}&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_articles&lt;br /&gt;
|notes&lt;br /&gt;
|comments=&lt;br /&gt;
A few things that came to mind:&lt;br /&gt;
*What happens with a name collision?&lt;br /&gt;
*When used in a vendor it would be more useful to change the name of the item when giving, this would avoid the name collision problem (and having to change the name back after giving it).&lt;br /&gt;
*A better name for this function would be llRenameInventory (for which there is at least one JIRA).&lt;br /&gt;
P.S. I changed the syntax, using inventory numbering to access items is hazardous, names are less prone to change.&lt;br /&gt;
-- &#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; 19:03, 21 March 2009 (UTC)&lt;br /&gt;
Possibly should use key, not names source. And it should work as copy/rename/give function. In case of collision  - either add number to it&#039;s name or return error (should be a flag parameter). --[[User:Zidan Foxdale|Zidan Foxdale]] 14:00, 20 June 2010 (UTC)&lt;br /&gt;
|cat1&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Zidan Foxdale</name></author>
	</entry>
</feed>