<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - dofile error]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=973</link>
		<description><![CDATA[The most recent posts in dofile error.]]></description>
		<lastBuildDate>Fri, 11 Apr 2014 06:19:21 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: dofile error]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6698#p6698</link>
			<description><![CDATA[<p>This might be a bug or something. This happened with another lua file, but when I moved it to the same folder as the main lua file, it worked.</p>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Fri, 11 Apr 2014 06:19:21 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6698#p6698</guid>
		</item>
		<item>
			<title><![CDATA[Re: dofile error]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6687#p6687</link>
			<description><![CDATA[<p>Yes, it is like Example 1.</p>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Sun, 06 Apr 2014 19:43:06 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6687#p6687</guid>
		</item>
		<item>
			<title><![CDATA[Re: dofile error]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6686#p6686</link>
			<description><![CDATA[<p>Where is located the script calling dofile(&quot;other/Motion.lua&quot;) ?</p><p>ex 1 :<br />/scripts/main.lua -&gt; call dofile(&quot;other/Motion.lua&quot;)<br />/scripts/other/Motion.lua</p><p>ex 2 :<br />/scripts/something/main.lua -&gt; call dofile(&quot;../other/Motion.lua&quot;)<br />/scripts/other/Motion.lua</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sun, 06 Apr 2014 09:48:45 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6686#p6686</guid>
		</item>
		<item>
			<title><![CDATA[Re: dofile error]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6685#p6685</link>
			<description><![CDATA[<p>It&#039;s not that. I changed that already</p>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Sun, 06 Apr 2014 01:03:00 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6685#p6685</guid>
		</item>
		<item>
			<title><![CDATA[Re: dofile error]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6684#p6684</link>
			<description><![CDATA[<p>Maybe it&#039;s because your Move() function expects 5 arguments and only 3 are passed.</p>]]></description>
			<author><![CDATA[dummy@example.com (com3D)]]></author>
			<pubDate>Sat, 05 Apr 2014 06:04:54 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6684#p6684</guid>
		</item>
		<item>
			<title><![CDATA[dofile error]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6683#p6683</link>
			<description><![CDATA[<p>I am trying to call a function from a lua script located dofile(&quot;other/Motion.lua&quot;)</p><p>When I try to run the Move() function (located in the Motion.lua file) I get an error:</p><div class="codebox"><pre><code>[string &quot;dofile&lt;&quot;other/Motion.lua&quot;&gt;...]:17 attempt to call global &#039;Move&#039; &lt;a nil value&gt;</code></pre></div><p>What could be causing this? all of the arguments are in the Motion.lua file. </p><p>The function in the Motion.lua file:</p><div class="codebox"><pre><code>function Move(move_object,move_direction,move_btn,move_animation,idle_animation)
    if isKeyPressed(move_btn) then
        changeAnimation(move_object,move_animation)
        translate(move_object,move_direction,&quot;local&quot;)
        playSound(move_sound)
        setAnimationSpeed(move_object, move_animation_speed)
        
    end    
    
    if onKeyDown(move_btn) then
        playSound(move_sound)
    end
    
    if onKeyUp(move_btn) then
        changeAnimation(move_object,idle_animation)
        setAnimationSpeed(move_object, idle_animation_speed)
        stopSound(move_sound)
    end
    
end</code></pre></div><p>How I use it in the main file:</p><div class="codebox"><pre><code>box = getObject(&quot;Box&quot;) -- in the main scene
function onSceneUpdate()
Move(box,move_forward,move_btn_U)
    Move(box,move_backward,move_btn_D)
    Move(box,move_left,move_btn_L)
    Move(box,move_right,move_btn_R)
    
    --Jump Box
    Jump(box,jump_up,jump_btn)
    
    --Spin Box
    Spin(box,spin_left,spin_btn_L)
    Spin(box,spin_right,spin_btn_R)
end</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Fri, 04 Apr 2014 22:41:29 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6683#p6683</guid>
		</item>
	</channel>
</rss>
