<?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>Amasan - Common sense 2.0 &#187; lsl</title>
	<atom:link href="http://amasan.co.uk/blog/tag/lsl/feed/" rel="self" type="application/rss+xml" />
	<link>http://amasan.co.uk/blog</link>
	<description>Commentary on Digital Media and Usability</description>
	<lastBuildDate>Fri, 03 Sep 2010 13:32:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>LSL tests: recursive function</title>
		<link>http://amasan.co.uk/blog/2008/06/lsl-tests-recursive-function/</link>
		<comments>http://amasan.co.uk/blog/2008/06/lsl-tests-recursive-function/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 14:56:34 +0000</pubDate>
		<dc:creator>Sander</dc:creator>
				<category><![CDATA[lsl]]></category>
		<category><![CDATA[secondlife]]></category>

		<guid isPermaLink="false">http://blog.amasan.co.uk/2008/06/18/lsl-tests-recursive-function/</guid>
		<description><![CDATA[It&#8217;s good practice to make code easy to maintain, so sometimes you&#8217;ll want to use less code using recursive functions. In order to find out how to this works in Second Life I created this small recusive example: integer i = 0; integer top = 0; integer Monkeys() { &#160;&#160;&#160; llOwnerSay(&#34;monkeys&#34;); &#160;&#160;&#160; i++; &#160;&#160;&#160; if [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s good practice to make code easy to maintain, so sometimes you&#8217;ll want to use less code using recursive functions. In order to find out how to this works in Second Life I created this small recusive example:</p>
<blockquote><p><font face="Courier New">integer i = 0;       <br />integer top = 0;        <br />integer Monkeys()        <br />{        <br />&#160;&#160;&#160; llOwnerSay(&quot;monkeys&quot;);        <br />&#160;&#160;&#160; i++;        <br />&#160;&#160;&#160; if (i &lt;= top)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return Monkeys();        <br />&#160;&#160;&#160; else        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return i;        <br />}        <br />default        <br />{        <br />&#160;&#160;&#160; state_entry()        <br />&#160;&#160;&#160; {        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; llSay(0, &quot;Hello, Avatar!&quot;);        <br />&#160;&#160;&#160; }        <br />&#160;&#160;&#160; touch_start(integer total_number)        <br />&#160;&#160;&#160; {        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; i = 0;        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; top = Monkeys();        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; llOwnerSay((string)top);        <br />&#160;&#160;&#160; }        <br />}</font></p>
</blockquote>
<p>This script says monkeys an increasing amount of times every time you touch it by calling itself if and keeping track of the total amount of times the function is called. First time there will be 1 monkey, next time 2 monkeys etc. Find more products at our shop in <a href="http://slurl.com/secondlife/Serena%20Monterey/76/173/436">Badmoon</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://amasan.co.uk/blog/2008/06/lsl-tests-recursive-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LSL tests: walking states</title>
		<link>http://amasan.co.uk/blog/2008/06/lsl-tests-walking-states/</link>
		<comments>http://amasan.co.uk/blog/2008/06/lsl-tests-walking-states/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 14:45:00 +0000</pubDate>
		<dc:creator>Sander</dc:creator>
				<category><![CDATA[lsl]]></category>
		<category><![CDATA[secondlife]]></category>

		<guid isPermaLink="false">http://blog.amasan.co.uk/2008/06/17/lsl-tests-walking-states/</guid>
		<description><![CDATA[I had to create a simple script to turn a neon sign on and off. I decided to have both versions of the sign in a single texture and changing the offset with a script. Instead of using a timer and using llSetTimeout() instead I opted to pause the script for a small amount of [...]]]></description>
			<content:encoded><![CDATA[<p>I had to create a simple script to turn a neon sign on and off. I decided to have both versions of the sign in a single texture and changing the offset with a script. Instead of using a timer and using <font face="Courier New">llSetTimeout()</font> instead I opted to pause the script for a small amount of time. The script does not respond when it&#8217;s sleeping which should be less laggy then the timeout. All i do then at the start of a state is offsetting the texture to show the on/off alternatively.</p>
<blockquote><p><font face="Courier New">default       <br />{        <br />&#160;&#160;&#160; state_entry()        <br />&#160;&#160;&#160; {        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; llOffsetTexture(0.0,0.25,ALL_SIDES);        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; llSleep(1.37);        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; state off;        <br />&#160;&#160;&#160; }        <br />} </font></p>
<p><font face="Courier New">state off       <br />{        <br />&#160;&#160;&#160; state_entry()        <br />&#160;&#160;&#160; {        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; llOffsetTexture(0.0,0.75,ALL_SIDES);        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; llSleep(.723);        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; state default;        <br />&#160;&#160;&#160; }        <br />}</font></p>
</blockquote>
<p>Hope this is of use to you. See the result in our Higher / Lower game at <a href="http://slurl.com/secondlife/Serena%20Monterey/76/173/436">Badmoon</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://amasan.co.uk/blog/2008/06/lsl-tests-walking-states/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
