<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - Some Plugins]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=698</link>
		<description><![CDATA[The most recent posts in Some Plugins.]]></description>
		<lastBuildDate>Fri, 09 Aug 2013 15:57:13 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4554#p4554</link>
			<description><![CDATA[<p>hi,ok<br />I prefer the method using the point to access the attribute<br />Thanks com3D!</p>]]></description>
			<author><![CDATA[dummy@example.com (marval)]]></author>
			<pubDate>Fri, 09 Aug 2013 15:57:13 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4554#p4554</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4542#p4542</link>
			<description><![CDATA[<p>Basically these examples are quiet similar. There&#039;s an infinity of ways to achieve the same goal.<br />In the first example, we could have also done:<br /></p><div class="codebox"><pre><code>players = { {getObject(&quot;player1&quot;), -0.4}, {getObject(&quot;player2&quot;), -2} } -- table structure is {object, speed}

which is exactly the same.

With the getClone example, after having created the cloneList, we could have done exactly as in the first example:

object = getObject(&quot;object&quot;)
cloneList = {}

for j=1, 3 do
    table.insert(cloneList, #cloneList + 1, getClone(object)) 
end

player = {
objs = {cloneList[1], cloneList[2]}, 
speed = {-0.4, -2},
}</code></pre></div><p>In fact it is the complexity and versatility that dictates the best solution.<br />With experience you will easily find it.<br />Don&#039;t try to rigidly replicate some piece of code. Understand the logic and translate it into some code that makes sense for you (clear and customizable).</p>]]></description>
			<author><![CDATA[dummy@example.com (com3D)]]></author>
			<pubDate>Thu, 08 Aug 2013 17:40:46 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4542#p4542</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4541#p4541</link>
			<description><![CDATA[<p>ok,thanks</p><p>in your first example the objects and speed parameter list were created inside the player list,using commas at the end and you must use the point access to each parameter</p><p>player = {<br />objs = {getObject(&quot;player1&quot;), getObject(&quot;player2&quot;)}, <br />speed = {-0.4, -2},<br />}</p><p>for j=1, #player.objs do<br />&nbsp; &nbsp; &nbsp; &nbsp; translate(player.objs[j], {0,player.speed[j],0}, &quot;local&quot;) <br />&nbsp; &nbsp; &nbsp; &nbsp; if player.speed[j] &gt; 3 then player.speed[j] = 3 end<br />&nbsp; &nbsp; end</p><p>which is quite different from the getClone example<br />is there any difference between choosing to use one of these methods?</p>]]></description>
			<author><![CDATA[dummy@example.com (marval)]]></author>
			<pubDate>Thu, 08 Aug 2013 17:17:18 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4541#p4541</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4540#p4540</link>
			<description><![CDATA[<p>A table is identified by its name. If you declare it more than once, you simply update its content.</p><p>So if life is sharable between enemie &amp; turrets, you just have to declare it once before using it. You can declare it anywhere as long as it is before using its content.</p><p>If life is a different parameter for enemies &amp; turrets or if the number of parameters is different (for example number of turrets and number of enemies are not necessarily the same), then you should create a new table for each set of parameters. Again, you can declare this set anywhere before using its content.</p><p>What links tables is not the way they are coded but the way they are used :</p><div class="codebox"><pre><code>rotate(cloneList[j], {0, 0, 1}, rotationSpeedList [j], &quot;local&quot;) -- use rotationSpeedList parameters with clones
rotate(turretList[j], {0, 0, 1}, rotationSpeedList [j], &quot;local&quot;) -- use rotationSpeedList parameters with turrets</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (com3D)]]></author>
			<pubDate>Thu, 08 Aug 2013 14:15:42 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4540#p4540</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4538#p4538</link>
			<description><![CDATA[<p>if i have a enemy cloneList and a turret cloneList and both with a parameter with <br />the same name : life</p><p>enemy = getObject(&quot;enemy&quot;)<br />enemyCloneList = {}<br /><strong>life</strong> = {100,100,100}<br />for j=1, 3 do<br />&nbsp; &nbsp; table.insert(enemyCloneList, #enemyCloneList + 1, getClone(enemy)) <br />end</p><p>turret = getObject(&quot;turret&quot;)<br />turretCloneList = {}<br /><strong>life</strong> = {100,100,100}<br />for k=1, 3 do<br />&nbsp; &nbsp; table.insert(turretCloneList, #turretCloneList + 1, getClone(turret)) <br />end</p><p>is this parameter with the same name associated with the &quot;correct&quot; corresponding cloneList just for being right below it?</p>]]></description>
			<author><![CDATA[dummy@example.com (marval)]]></author>
			<pubDate>Thu, 08 Aug 2013 13:28:23 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4538#p4538</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4535#p4535</link>
			<description><![CDATA[<p>Yes, outside.<br />You can add any lists of parameters as you want. Just create a new table. For example :</p><div class="codebox"><pre><code>object = getObject(&quot;object&quot;)
cloneList = {}
rotationSpeedList = {0.4, 0.3, 1}
translationSpeedList = { {1, 0.1, 0.1}, {2, 0.3, 3}, {3, 2, 1} }

for j=1, 3 do
    table.insert(cloneList, #cloneList + 1, getClone(object)) 
end

   for j=1, #cloneList do 
       rotate(cloneList[j], {0, 0, 1}, rotationSpeedList [j], &quot;local&quot;)
       translate(cloneList[j], {translationSpeedList[j][1], translationSpeedList[j][2], translationSpeedList[j][3]}, &quot;local&quot;)
   end</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (com3D)]]></author>
			<pubDate>Thu, 08 Aug 2013 13:00:59 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4535#p4535</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4533#p4533</link>
			<description><![CDATA[<p>hi,<br />outside the cloneList?<br />if there are other lists just put the variables outside and below the corresponding list?</p>]]></description>
			<author><![CDATA[dummy@example.com (marval)]]></author>
			<pubDate>Thu, 08 Aug 2013 12:16:40 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4533#p4533</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4530#p4530</link>
			<description><![CDATA[<p>You just have to create the speed table :</p><div class="codebox"><pre><code>object = getObject(&quot;object&quot;)
cloneList = {}
speedList = {0.4, 0.3, 1}
  
for j=1, 3 do
    table.insert(cloneList, #cloneList + 1, getClone(object)) 
end

   for j=1, #cloneList do 
       rotate(cloneList[j], {0, 0, 1}, speedList[j], &quot;local&quot;)
   end</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (com3D)]]></author>
			<pubDate>Thu, 08 Aug 2013 05:23:18 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4530#p4530</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4529#p4529</link>
			<description><![CDATA[<p>hi,<br />in this case,using getClone example,where to set the speed variable table for each clone?</p><p>object = getObject(&quot;object&quot;)<br />cloneList = {}<br />&nbsp; <br />for j=1, 3 do<br />&nbsp; &nbsp; table.insert(cloneList, #cloneList + 1, getClone(object)) <br />end</p><p>&nbsp; &nbsp;for j=1, #cloneList do <br />&nbsp; &nbsp; &nbsp; &nbsp;rotate(cloneList[j], {0, 0, 1}, 1, &quot;local&quot;)<br />&nbsp; &nbsp;end</p>]]></description>
			<author><![CDATA[dummy@example.com (marval)]]></author>
			<pubDate>Thu, 08 Aug 2013 02:45:42 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4529#p4529</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4492#p4492</link>
			<description><![CDATA[<p>sorry<br />I forgot the commas<br />it worked <br />Now I&#039;ll test with some of the functions<br />thanks</p>]]></description>
			<author><![CDATA[dummy@example.com (marval)]]></author>
			<pubDate>Tue, 30 Jul 2013 13:06:54 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4492#p4492</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4491#p4491</link>
			<description><![CDATA[<p>OK, add a comma (,) at the end of the objs line. Speed is the second value of the player table (player={objs, speed}).</p><div class="codebox"><pre><code>      objs = {getObject(&quot;ball1&quot;),getObject(&quot;ball2&quot;),getObject(&quot;ball3&quot;)},
      speed = {-0.4, -2 ,3}</code></pre></div><p>And if you comment speed then remove the comma as there&#039;s only one value (objs)&nbsp; in the player table.</p><div class="codebox"><pre><code>      objs = {getObject(&quot;ball1&quot;),getObject(&quot;ball2&quot;),getObject(&quot;ball3&quot;)}
      --speed = {-0.4, -2, 3}</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (com3D)]]></author>
			<pubDate>Tue, 30 Jul 2013 12:21:56 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4491#p4491</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4490#p4490</link>
			<description><![CDATA[<p>let me explain better<br />the balls were spinning before including the speed property table<br />but stopped running after adding it<br />and for testing I disabled it and it worked again</p>]]></description>
			<author><![CDATA[dummy@example.com (marval)]]></author>
			<pubDate>Tue, 30 Jul 2013 11:55:31 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4490#p4490</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4488#p4488</link>
			<description><![CDATA[<div class="quotebox"><cite>heartseed wrote:</cite><blockquote><p>what if you put a space between , and 3 ?</p></blockquote></div><p>Spaces, tabulations, returns... are not relevant in lua, you can use them as much as you want to organise your code. <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[dummy@example.com (com3D)]]></author>
			<pubDate>Tue, 30 Jul 2013 05:58:15 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4488#p4488</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4487#p4487</link>
			<description><![CDATA[<div class="quotebox"><cite>marval wrote:</cite><blockquote><p>but the 3 balls only rotates when I turn off the speed property</p></blockquote></div><p>Turning off the speed property has not effect, as you don&#039;t use this variable in your script</p><div class="quotebox"><cite>marval wrote:</cite><blockquote><p>&nbsp; &nbsp;&nbsp; &nbsp; rotate(ball.objs[j], {0, 0, -1}, 1)</p></blockquote></div><p>The balls rotate because that&#039;s what you ask them to do!<br />You used the &quot;rotate&quot; function. If you want to translate them then you can use the &quot;translate&quot; function for example.</p><p>You will find the function that suits your needs <a href="http://wiki.maratis3d.org/index.php?title=Lua_functions_list">here</a>.&nbsp; <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[dummy@example.com (com3D)]]></author>
			<pubDate>Tue, 30 Jul 2013 05:48:41 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4487#p4487</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some Plugins]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4486#p4486</link>
			<description><![CDATA[<p>I can&#039;t test this, and honestly I have no idea as Im more an artist too ( learning as I go with coding), but what if you put a space between , and 3 ?</p><p>Were you getting any errors with it uncommented ? I thought I&#039;d weight in on this, having no idea how long com3d might be offline, etc.</p><p>cu<br />nl</p>]]></description>
			<author><![CDATA[dummy@example.com (VeganDev)]]></author>
			<pubDate>Tue, 30 Jul 2013 05:19:39 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4486#p4486</guid>
		</item>
	</channel>
</rss>
