<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - Some Plugins]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=698&amp;type=atom"/>
	<updated>2013-08-09T15:57:13Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=698</id>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4554#p4554"/>
			<content type="html"><![CDATA[<p>hi,ok<br />I prefer the method using the point to access the attribute<br />Thanks com3D!</p>]]></content>
			<author>
				<name><![CDATA[marval]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2397</uri>
			</author>
			<updated>2013-08-09T15:57:13Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4554#p4554</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4542#p4542"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[com3D]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=1488</uri>
			</author>
			<updated>2013-08-08T17:40:46Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4542#p4542</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4541#p4541"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[marval]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2397</uri>
			</author>
			<updated>2013-08-08T17:17:18Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4541#p4541</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4540#p4540"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[com3D]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=1488</uri>
			</author>
			<updated>2013-08-08T14:15:42Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4540#p4540</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4538#p4538"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[marval]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2397</uri>
			</author>
			<updated>2013-08-08T13:28:23Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4538#p4538</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4535#p4535"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[com3D]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=1488</uri>
			</author>
			<updated>2013-08-08T13:00:59Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4535#p4535</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4533#p4533"/>
			<content type="html"><![CDATA[<p>hi,<br />outside the cloneList?<br />if there are other lists just put the variables outside and below the corresponding list?</p>]]></content>
			<author>
				<name><![CDATA[marval]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2397</uri>
			</author>
			<updated>2013-08-08T12:16:40Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4533#p4533</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4530#p4530"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[com3D]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=1488</uri>
			</author>
			<updated>2013-08-08T05:23:18Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4530#p4530</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4529#p4529"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[marval]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2397</uri>
			</author>
			<updated>2013-08-08T02:45:42Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4529#p4529</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4492#p4492"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[marval]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2397</uri>
			</author>
			<updated>2013-07-30T13:06:54Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4492#p4492</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4491#p4491"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[com3D]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=1488</uri>
			</author>
			<updated>2013-07-30T12:21:56Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4491#p4491</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4490#p4490"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[marval]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2397</uri>
			</author>
			<updated>2013-07-30T11:55:31Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4490#p4490</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4488#p4488"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[com3D]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=1488</uri>
			</author>
			<updated>2013-07-30T05:58:15Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4488#p4488</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4487#p4487"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[com3D]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=1488</uri>
			</author>
			<updated>2013-07-30T05:48:41Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4487#p4487</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Some Plugins]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4486#p4486"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[VeganDev]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=18</uri>
			</author>
			<updated>2013-07-30T05:19:39Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4486#p4486</id>
		</entry>
</feed>
