<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Keltic Games &#187; list</title>
	<atom:link href="http://www.kelticgames.com/index.php/tag/list/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kelticgames.com</link>
	<description></description>
	<lastBuildDate>Wed, 27 May 2009 15:20:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Second Life Simple Data Storage</title>
		<link>http://www.kelticgames.com/index.php/2008/04/24/second-life-simple-data-storage/</link>
		<comments>http://www.kelticgames.com/index.php/2008/04/24/second-life-simple-data-storage/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 13:37:10 +0000</pubDate>
		<dc:creator>Keltic</dc:creator>
				<category><![CDATA[Second Life]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[description]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[prim]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[sl]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://www.kelticgames.com/index.php/2008/04/24/second-life-simple-data-storage/</guid>
		<description><![CDATA[In creating scripts for Second Life, I&#8217;ve tried to keep the scripts as portable and re-usable as possible. At the most basic level, this means creating a separation of code and data. For scripts that are used in a limited number of prims, this can be as simple as setting customizable variables at the top [...]]]></description>
			<content:encoded><![CDATA[<p>In creating scripts for Second Life, I&#8217;ve tried to keep the scripts as portable and re-usable as possible. At the most basic level, this means creating a separation of code and data. For scripts that are used in a limited number of prims, this can be as simple as setting customizable variables at the top of the script. For scripts that are going to be used in many prims, this system requires maintaining a unique copy of each script in each prim. If your base script is updated to fix a bug or add a feature, you&#8217;ll need to update each script by hand or overwrite the script in prim and reset the custom variables. Both options are prone to error.</p>
<p>For scripts used in many prims, storing the data for those variables in the prim&#8217;s description field can be an effective solution. This allows you to replace the script without impacting the custom data in each prim. The description field is limited to 127 characters, so this method is only useful with short length data. Also, since the description field can be publicly viewed in prim properties, this method should not be used to store private or sensitive data. On the plus side, this data can be updated dynamically using llSetObjectDesc().</p>
<p>When storing the value of a single variable in the description field, use this code to retrieve the value. If the type is anything other than a string, simply prefix the function with the data type. In this case, the variable type is a vector.</p>
<p><code>vector myVector; //declare variable type<br />
myVector = (vector)llGetObjectDesc(); //read the description, a string by default, and convert to a vector</code></p>
<p>If you need to store multiple values, format the data in the description field as a list, such as &#8220;Someplace;&lt;72,89,25&gt;&#8221;, read the data and parse it. This example uses the semi-colon as a delimiter.</p>
<p><code>list description;<br />
string locationName;<br />
vector locationTarget;</code></p>
<p><code>description = llParseString2List(llGetObjectDesc(), [";"], [""] );<br />
locationName = llList2String(description, 0);<br />
locationTarget = (vector)llList2String(description, 1);</code></p>
<p>I have found this method to be very effective and efficient for scripts that contain a limited amount of custom data. To store larger amounts of data, you&#8217;ll need to use a notecard or data store external to the prim.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kelticgames.com/index.php/2008/04/24/second-life-simple-data-storage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
