<?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>The Park is Vast &#187; Scripting</title>
	<atom:link href="http://theparkisvast.com/VastPark/nerdy/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://theparkisvast.com</link>
	<description></description>
	<lastBuildDate>Wed, 11 Aug 2010 11:46:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>VastPark Developer Introduction &#8211; v1.3 Framework</title>
		<link>http://theparkisvast.com/2010/07/30/vastpark-developer-introduction-v1-3-framework/</link>
		<comments>http://theparkisvast.com/2010/07/30/vastpark-developer-introduction-v1-3-framework/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 00:02:42 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
				<category><![CDATA[IMML]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[VastPark General]]></category>

	<!-- AutoMeta Start -->
	<category>talk</category>
	<category>audio</category>
	<category>shown</category>
	<category>primer</category>
	<category>remotely</category>
	<category>offered</category>
	<category>audience</category>
	<category>planning</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=284</guid>
		<description><![CDATA[I recently gave a talk to a team of developers interested in working with the platform who are planning to build some new exciting products on top of it. One of the audience offered to record the session remotely so the audio is a little scratchy, but I think it&#8217;s come across ok. The talk [...]]]></description>
			<content:encoded><![CDATA[<p>I recently gave a talk to a team of developers interested in working with the platform who are planning to build some new exciting products on top of it. </p>
<p>One of the audience offered to record the session remotely so the audio is a little scratchy, but I think it&#8217;s come across ok.</p>
<p>The talk covers:</p>
<ul>
<li>IMML</li>
<li>VastScript</li>
<li>Network enabled elements</li>
<li>HTML interop</li>
<li>Video</li>
<li>Audio</li>
<li>Textures</li>
<li>User Profiles</li>
<li>Plugins</li>
</ul>
<p><object width="640" height="424"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=13720857&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=FF7700&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=13720857&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=FF7700&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="640" height="424"></embed></object></p>
<p>Hopefully this is a useful primer if you are interested in developing with VastPark or are curious to know a little more about the way the system functions.</p>
<p>Download the PDF shown in the video here: <a href="http://theparkisvast.com/wp-content/plugins/download-monitor/download.php?id=7">VastPark Developer Introduction - Framework v1.3</a></p>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2010/07/30/vastpark-developer-introduction-v1-3-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flocking algorithm in VastPark</title>
		<link>http://theparkisvast.com/2010/04/13/flocking-algorithm-in-vastpark/</link>
		<comments>http://theparkisvast.com/2010/04/13/flocking-algorithm-in-vastpark/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 03:47:26 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
				<category><![CDATA[IMML]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Boids]]></category>
		<category><![CDATA[Flocking]]></category>

	<!-- AutoMeta Start -->
	<category>flocking</category>
	<category>boids</category>
	<category>boids</category>
	<category>implement</category>
	<category>algorithm</category>
	<category>rule</category>
	<category>enjoy</category>
	<category>cool</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=236</guid>
		<description><![CDATA[Many months ago during May of 09, after meeting Ian Hughes at FCVW, I came across an interesting post on his blog discussing an implementation of the flocking algorithm in Unity. I&#8217;d not heard of the term flocking or boids, so proceeded to get stuck into some research, which lead me to Conrad Parker&#8217;s page [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://theparkisvast.com/wp-content/uploads/2010/04/flocking.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2010/04/flocking.jpg" alt="" title="flocking" width="242" height="150" class="alignright size-full wp-image-255" /></a></td>
<p>Many months ago during May of 09, after meeting Ian Hughes at <a href="http://www.ndu.edu/IRMC/fedconsortium.html">FCVW</a>, I came across an <a href="http://www.feedingedge.co.uk/blog/2009/05/11/flocking-brilliant-fill-in-own-joke-here/">interesting post</a> on his blog discussing an implementation of the <a href="http://www.red3d.com/cwr/boids/">flocking algorithm</a> in Unity. </p>
<p>I&#8217;d not heard of the term flocking or boids, so proceeded to get stuck into some research, which lead me to Conrad Parker&#8217;s page on <a href="http://www.vergenet.net/~conrad/boids/pseudocode.html">Boids Pseudocode</a> as well as many others who had implemented the algorithm, I figured it would be a fun little plugin to write for VastPark so gave it a try.</p>
<h4>Implementing the algorithm</h4>
<p>Thinking about what was required, I came up with the following as the plan for the plugin:</p>
<ul>
<li>Any IPositionalElement (Model, Primitive, Sound, Camera, Light, etc) would be supported</li>
<li>Implement Rule 1 &#8211; &#8220;Boids try to fly towards the centre of mass of neighbouring boids&#8221;</li>
<li>Implement Rule 2 &#8211; &#8220;Boids try to keep a small distance away from other objects (including other boids)&#8221;</li>
<li>Implement Rule 3 &#8211; &#8220;Boids try to match velocity with near boids&#8221;</li>
<li>For bonus points I&#8217;d implement &#8220;Tendency towards a particular place&#8221;, &#8220;Limiting the speed&#8221;, &#8220;Bounding the position&#8221;, &#8220;Perching&#8221; and &#8220;Scattering the flock&#8221;</li>
</ul>
<p>In terms of the plugin this translates into these properties:</p>
<ul>
<li>SmallDistance</li>
<li>MaxVelocity</li>
<li>MinVelocity</li>
<li>EnableBounds</li>
<li>MaxBounds</li>
<li>MinBounds</li>
<li>EnablePerching</li>
<li>MinPerchTime</li>
<li>MaxPerchTime</li>
<li>PerceivedCentre (get only)</li>
</ul>
<p>The following callbacks:</p>
<ul>
<li>ElementPerched</li>
<li>ElementLeftPerch</li>
</ul>
<p>The following methods:</p>
<ul>
<li>SetPointOfInterest</li>
<li>AddPlaceToAvoid</li>
<li>AddPerch</li>
<li>Scatter</li>
</ul>
<p>The class diagrams look like this:<br />
<a href="http://theparkisvast.com/wp-content/uploads/2010/04/flocking-plugin-class-diagram.png" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2010/04/flocking-plugin-class-diagram.png" alt="" title="flocking-plugin-class-diagram" width="619" height="523" class="aligncenter size-full wp-image-243" /></a></p>
<h4>How does it work?</h4>
<p>Put quite simply, the plugin works like this:</p>
<ul>
<li><em>AddElement(ImmlElement element)</em> creates a boid instance for the positional element passed</li>
<li>The plugin Update method (called once each update by the VastPark framework) proceeds to calculate the rules, one at a time for each boid to work out the new velocity and position for the element it represents</li>
<li>Scatter requests made during runtime are dealt with during the next update</li>
</ul>
<h4>Downloads</h4>
<p>Here is some sample IMML and the source code to the plugin, enjoy! Let me know if you decide to implement any of the other rules or do something cool with it <img src='http://theparkisvast.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Sample IMML: <a href='http://theparkisvast.com/wp-content/uploads/2010/04/flocking.imml'>flocking.imml</a><br />
Source code to plugin: <a href='http://theparkisvast.com/wp-content/uploads/2010/04/Plugin.Flocking.zip'>Plugin.Flocking.zip</a></p>
<p><strong>Note:</strong> The source code will probably complain about some missing references. Install the Player from <a href="http://www.vastpark.com">www.vastpark.com</a> and link against the relevant binaries included with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2010/04/13/flocking-algorithm-in-vastpark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drag and Drop Sample</title>
		<link>http://theparkisvast.com/2010/02/20/drag-and-drop-sample/</link>
		<comments>http://theparkisvast.com/2010/02/20/drag-and-drop-sample/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 20:56:14 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
				<category><![CDATA[IMML]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[0.98 release]]></category>

	<!-- AutoMeta Start -->
	<category>tostring</category>
	<category>updateuri</category>
	<category>metaforikadapter</category>
	<category>writeline</category>
	<category>item</category>
	<category>drag</category>
	<category>controller</category>
	<category>pages</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=177</guid>
		<description><![CDATA[One of the major features of the 0.98 release is the inclusion of drag and drop. Basically, this allows you to drag an Item into the 3D space where the IMML can decide to do something with it. To try drag and drop out for yourself, first download (right-click, save as) and open in the [...]]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td>
<img src="http://theparkisvast.com/wp-content/uploads/2010/02/mouse-cursor.png" alt="" title="mouse-cursor" width="48" height="48" class="alignleft size-full wp-image-226" />
</td>
<td>
One of the major features of the <a href="http://theparkisvast.com/2010/02/17/vastpark-platform-0-98-released/">0.98 release</a> is the inclusion of drag and drop. Basically, this allows you to drag an Item into the 3D space where the IMML can decide to do something with it.
</td>
</tr>
</table>
<p>To try drag and drop out for yourself, first download <a href="http://theparkisvast.com/wp-content/plugins/download-monitor/download.php?id=5">generic-drag-drop-sample.imml</a> (right-click, save as) and open in the Player.</p>
<p>Next, you&#8217;ll need to expand the Items list. Do so by clicking on this icon:</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2010/02/player-items-button.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2010/02/player-items-button.jpg" alt="" title="player-items-button" width="232" height="42" class="aligncenter size-full wp-image-162" /></a></p>
<p>By default you are presented with the list of Items of type <em>Video</em> and <em>Document</em> that the currently logged in account has access to (these can be further restricted by the <a href="http://vastpark.org/wiki/vp/VastPark_Server#ACL">hosting server&#8217;s group ACL</a>). </p>
<p>In this case as we are opening the file directly, it will default to showing the most recently published Items without filtering and should look similar to this:</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2010/02/drag-drop-1.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2010/02/drag-drop-1-300x178.jpg" alt="" title="drag-drop-1" width="300" height="178" class="aligncenter size-medium wp-image-173" /></a></p>
<p>Click to select one of the items from the list (in my example, I&#8217;ve chosen &#8220;VastPark Logo&#8221;) and drag it onto the 3D view. The large rectangle in the centre of the screen will change colour to blue indicating it is a drop target.</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2010/02/drag-drop-2.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2010/02/drag-drop-2-300x178.jpg" alt="" title="drag-drop-2" width="300" height="178" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Next, drop the Item onto the blue rectangle, which will cause it to change colour to green. Shortly the VastPark logo will appear on it.</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2010/02/drag-drop-3.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2010/02/drag-drop-3-300x178.jpg" alt="" title="drag-drop-3" width="300" height="178" class="aligncenter size-medium wp-image-175" /></a></p>
<h4>How does this work?</h4>
<p>Behind the scenes is a plugin (called MetaforikAdapter) which currently supports adapting Items of type &#8220;Document&#8221; and &#8220;Video&#8221; to a Model or Primitive element. The code to do this is quite simple. </p>
<p>First, reference the Plugin:<br />
<pre class="php">&lt;Plugin Enabled=<span style="color: #ff0000;">&quot;True&quot;</span> Source=<span style="color: #ff0000;">&quot;http://id.vastpark.com/VastParkWS/get.vpws?name=MetaforikAdapter&amp;amp;publisher=craigomatic&amp;amp;domain=vastpark&amp;amp;context=park&quot;</span> Name=<span style="color: #ff0000;">&quot;MetaforikAdapter&quot;</span>&gt;
    &lt;Element Name=<span style="color: #ff0000;">&quot;InvalidRequestHandler&quot;</span> /&gt;
    &lt;Parameter <a href="http://www.php.net/key"><span style="color: #000066;">Key</span></a>=<span style="color: #ff0000;">&quot;InvalidRequestEvent&quot;</span> Value=<span style="color: #ff0000;">&quot;InvalidRequestHandler&quot;</span> /&gt;    
  &lt;/Plugin&gt;   
  
  &lt;Script Name=<span style="color: #ff0000;">&quot;InvalidRequestHandler&quot;</span>&gt;
    <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>obj, args<span style="color: #66cc66;">&#41;</span>
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'invalid request'</span><span style="color: #66cc66;">&#41;</span>          
    <a href="http://www.php.net/end"><span style="color: #000066;">end</span></a>
  <span style="color: #000000; font-weight: bold;">&lt;/Script&gt;</span></pre><br />
Next, handle the appropriate events on the elements you want to be able to drop on. Alternatively, this can be at the document level:<br />
<pre class="php">&lt;Trigger Event=<span style="color: #ff0000;">&quot;DragDrop&quot;</span> Target=<span style="color: #ff0000;">&quot;OnDragDrop&quot;</span> /&gt;
&lt;Trigger Event=<span style="color: #ff0000;">&quot;DragEnter&quot;</span> Target=<span style="color: #ff0000;">&quot;OnDragEnter&quot;</span> /&gt;
&lt;Trigger Event=<span style="color: #ff0000;">&quot;DragLeave&quot;</span> Target=<span style="color: #ff0000;">&quot;OnDragLeave&quot;</span> /&gt;</pre></p>
<p>In you script for the drop, pass the Item along with the element you want to adapt it to into the load method on the plugin. You may choose to inspect the Item before the drop to give user feedback as is done in the sample IMML.<br />
<pre class="php">&lt;Script Name=<span style="color: #ff0000;">&quot;OnDragDrop&quot;</span>&gt;
    <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>obj, args<span style="color: #66cc66;">&#41;</span>            
      --args.data contains the Item which was dragged in
      
      --load returns a controller object
      c = metaforikadapter:load<span style="color: #66cc66;">&#40;</span>args.data, obj<span style="color: #66cc66;">&#41;</span>      
    
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'item name: '</span>..c.item.name<span style="color: #66cc66;">&#41;</span>
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'id: '</span>..c.id<span style="color: #66cc66;">&#41;</span>
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'is first: '</span>..tostring<span style="color: #66cc66;">&#40;</span>c.isfirst<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'is last: '</span>..tostring<span style="color: #66cc66;">&#40;</span>c.islast<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'total pages: '</span>..tostring<span style="color: #66cc66;">&#40;</span>c.pages<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'current page: '</span>..tostring<span style="color: #66cc66;">&#40;</span>c.currentpage<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <a href="http://www.php.net/end"><span style="color: #000066;">end</span></a>
<span style="color: #000000; font-weight: bold;">&lt;/Script&gt;</span>
  
&lt;Script Name=<span style="color: #ff0000;">&quot;OnDragEnter&quot;</span>&gt;
    <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>obj, args<span style="color: #66cc66;">&#41;</span>
        scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'drag enter on: '</span>..obj.name..<span style="color: #ff0000;">' of type: '</span>..args.data.assets<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>.type<span style="color: #66cc66;">&#41;</span>     
    <a href="http://www.php.net/end"><span style="color: #000066;">end</span></a>
<span style="color: #000000; font-weight: bold;">&lt;/Script&gt;</span>
  
&lt;Script Name=<span style="color: #ff0000;">&quot;OnDragLeave&quot;</span>&gt;
    <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>obj, args<span style="color: #66cc66;">&#41;</span>
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'drag leave on: '</span>..obj.name<span style="color: #66cc66;">&#41;</span>
    <a href="http://www.php.net/end"><span style="color: #000066;">end</span></a>
<span style="color: #000000; font-weight: bold;">&lt;/Script&gt;</span></pre></p>
<h4>Working with elements other than Document or Video</h4>
<p>One thing to be aware of is that you don&#8217;t necessarily have to use the MetaforikAdapter plugin to benefit from drag and drop. If you want to allow for models or sounds to be dropped in, you can use the item.updateuri as the source for the element and add it into the scene, like this:<br />
<pre class="php">&lt;Script Name=<span style="color: #ff0000;">&quot;OnDragDrop&quot;</span>&gt;
    <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>obj, args<span style="color: #66cc66;">&#41;</span>    
      item = args.data
      <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>item.assets<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>.type == <span style="color: #ff0000;">'Model'</span><span style="color: #66cc66;">&#41;</span> then       
          m = model<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
          m.source = args.data.updateuri
      
          scene:add<span style="color: #66cc66;">&#40;</span>m<span style="color: #66cc66;">&#41;</span>     
      <a href="http://www.php.net/end"><span style="color: #000066;">end</span></a>
    <a href="http://www.php.net/end"><span style="color: #000066;">end</span></a>
<span style="color: #000000; font-weight: bold;">&lt;/Script&gt;</span></pre></p>
<h4>Final Note</h4>
<p>That&#8217;s really all there is to it, you may want to craft different UI depending on the state of the controller properties in the MetaforikAdapter plugin sample, ie: to handle a multi-page document differently to a video or single page document, or in the model example to only allow certain users to drop models into a specific region of your space. </p>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2010/02/20/drag-and-drop-sample/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated IMML for Stock Market Ticker</title>
		<link>http://theparkisvast.com/2010/02/17/updated-imml-for-stock-market-ticker/</link>
		<comments>http://theparkisvast.com/2010/02/17/updated-imml-for-stock-market-ticker/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 03:56:28 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
				<category><![CDATA[IMML]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[stock market]]></category>
		<category><![CDATA[Yahoo]]></category>

	<!-- AutoMeta Start -->
	<category>define</category>
	<category>tooltip</category>
	<category>tooltipid</category>
	<category>tooltipplugin</category>
	<category>lines</category>
	<category>settext</category>
	<category>lasttradeprim</category>
	<category>mouse</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=208</guid>
		<description><![CDATA[I&#8217;ve made some adjustments to the stock ticker built as part of my building a stock ticker in vastpark post to take advantage of the new Tooltip Plugin and the Define element in IMML. Rather than going all out, I&#8217;ve simply added a tip that shows the volume for the current day when the mouse [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made some adjustments to the stock ticker built as part of my <a href="http://theparkisvast.com/2009/01/12/building-a-stock-market-ticker-in-vastpark/">building a stock ticker in vastpark post</a> to take advantage of the new Tooltip Plugin and the Define element in IMML. Rather than going all out, I&#8217;ve simply added a tip that shows the volume for the current day when the mouse is over one of the green bars and a Define that lets you more easily choose which stocks should be displayed.</p>
<p>If you haven&#8217;t already read the original article and are interested in how it works, be sure to <a href="http://theparkisvast.com/2009/01/12/building-a-stock-market-ticker-in-vastpark/">have a read</a> before continuing.</p>
<h4>Define Element</h4>
<p>The Define element is a declarative way of expressing a variable in IMML. It&#8217;s equivalent to doing element:set(&#8216;variableName&#8217;, variableValue) but doesn&#8217;t require interpretation via the scripting engine which results in much better performance. It&#8217;s also a much nicer way to store global variables as they can be placed in more a easily identifiable location in the IMML rather than being buried within a script.</p>
<p>My Define in the sample looks similar to this (truncated for brevity):<br />
<pre class="php">&lt;!--Use any Yahoo stock codes in the below <a href="http://www.php.net/define"><span style="color: #000066;">define</span></a> to control the stocks being generated and updated--&gt;
 &lt;Define <a href="http://www.php.net/key"><span style="color: #000066;">Key</span></a>=<span style="color: #ff0000;">&quot;stocks&quot;</span> Value=<span style="color: #ff0000;">&quot;IPL.AX,VIL.AX,FMG.AX,RIO.AX,BHP.AX,BOQ.AX&quot;</span> /&gt;</pre></p>
<p>To change the ticker to show different stocks, replace any of the entries in the Value of the Define with the appropriate <a href="http://finance.yahoo.com/lookup">Yahoo ticker code</a> for the relevant stock.</p>
<h4>Tooltip Plugin</h4>
<p>Note: To use the Tooltip plugin, you&#8217;ll need to be running either the most recent Player snapshot or version 0.98+ as it uses the <em>Handle</em> property that was added recently to the IRenderEngine interface. </p>
<p>The tooltip concept has been around for quite a while and is used by just about every modern desktop application. Ever wondered what that big red button does and hovered your mouse to find out? If yes, you&#8217;ve seen a tooltip. This plugin extends the concept to allow developers to associate a tip with an element in world. </p>
<p>To do so is quite simple, the following functions are provided with the plugin:<br />
<pre class="php">int Add<span style="color: #66cc66;">&#40;</span>string text, ImmlElement element<span style="color: #66cc66;">&#41;</span>
void Remove<span style="color: #66cc66;">&#40;</span>int id<span style="color: #66cc66;">&#41;</span>
void SetText<span style="color: #66cc66;">&#40;</span>int id, string text<span style="color: #66cc66;">&#41;</span></pre></p>
<p>To make use of these, I&#8217;ve added 2 lines to <em>_updateStock</em> in the UpdateStocks script:<br />
<pre class="php">--update the volume tooltip	
id = lastTradeVisual:get<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'tooltipId'</span><span style="color: #66cc66;">&#41;</span>
tooltipplugin:settext<span style="color: #66cc66;">&#40;</span>id, <span style="color: #ff0000;">'Volume: '</span>..volume<span style="color: #66cc66;">&#41;</span></pre></p>
<p>&#8230;and 3 lines to <em>_generateStock</em> in the GenerateStocks script:<br />
<pre class="php">--store a <a href="http://www.php.net/define"><span style="color: #000066;">define</span></a> value on the last trade to represent volume <span style="color: #b1b100;">for</span> the tooltip
lastTradePrim:set<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'volume'</span>, volume<span style="color: #66cc66;">&#41;</span>
id = tooltipplugin:add<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Volume: '</span>..volume, lastTradePrim<span style="color: #66cc66;">&#41;</span>
lastTradePrim:set<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'tooltipId'</span>, id<span style="color: #66cc66;">&#41;</span></pre></p>
<p>The end result still looks similar to before, but we now get tooltips when hovering:</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2010/02/stock-ticker-with-tooltip.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2010/02/stock-ticker-with-tooltip-300x162.jpg" alt="" title="stock-ticker-with-tooltip" width="300" height="162" class="aligncenter size-medium wp-image-210" /></a></p>
<p>Download the updated IMML here:  <a href="http://theparkisvast.com/wp-content/plugins/download-monitor/download.php?id=6">stock-ticker.imml</a></p>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2010/02/17/updated-imml-for-stock-market-ticker/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dem bones, dem bones, dem&#8230;digital bones</title>
		<link>http://theparkisvast.com/2009/09/01/scriptable-bones-in-vastpark/</link>
		<comments>http://theparkisvast.com/2009/09/01/scriptable-bones-in-vastpark/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 22:35:00 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/theparki/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[Content]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Scripting]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=129</guid>
		<description><![CDATA[The creative department have been craving bones for a very long time in VastPark and we&#8217;ve finally added support for them, both in scripting and via plugin. Here&#8217;s a teaser: Vastpark Facial Expressions Demo from VastPark on Vimeo.]]></description>
			<content:encoded><![CDATA[<p>The creative department have been craving bones for a very long time in VastPark and we&#8217;ve finally added support for them, both in scripting and via plugin.</p>
<p>Here&#8217;s a teaser:</p>
<p><object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6175536&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=6175536&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>
<p><a href="http://vimeo.com/6175536">Vastpark Facial Expressions Demo</a> from <a href="http://vimeo.com/vastpark">VastPark</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2009/09/01/scriptable-bones-in-vastpark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VastPark Masterclass 2</title>
		<link>http://theparkisvast.com/2009/03/23/vastpark-masterclass-2/</link>
		<comments>http://theparkisvast.com/2009/03/23/vastpark-masterclass-2/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 23:28:19 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/theparki/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[Content]]></category>
		<category><![CDATA[IMML]]></category>
		<category><![CDATA[Scripting]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=95</guid>
		<description><![CDATA[Some video from the second masterclass I spoke at. Adrian Shepherd also features first up with some info on the content pipeline. Was quite unprepared for this one, so definitely isn&#8217;t my best work Virtual Worlds Down Under &#8211; Part 4 of 4 &#8211; Masterclass 2 from VastPark on Vimeo.]]></description>
			<content:encoded><![CDATA[<p>Some video from the second masterclass I spoke at. Adrian Shepherd also features first up with some info on the content pipeline. Was quite unprepared for this one, so definitely isn&#8217;t my best work <img src='http://theparkisvast.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><object width="400" height="220"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=3756330&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=3756330&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="220"></embed></object><br /><a href="http://vimeo.com/3756330">Virtual Worlds Down Under &#8211; Part 4 of 4 &#8211; Masterclass 2</a> from <a href="http://vimeo.com/vastpark">VastPark</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2009/03/23/vastpark-masterclass-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
