<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - dofile error]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=973&amp;type=atom"/>
	<updated>2014-04-11T06:19:21Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=973</id>
		<entry>
			<title type="html"><![CDATA[Re: dofile error]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6698#p6698"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2014-04-11T06:19:21Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6698#p6698</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: dofile error]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6687#p6687"/>
			<content type="html"><![CDATA[<p>Yes, it is like Example 1.</p>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2014-04-06T19:43:06Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6687#p6687</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: dofile error]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6686#p6686"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2014-04-06T09:48:45Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6686#p6686</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: dofile error]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6685#p6685"/>
			<content type="html"><![CDATA[<p>It&#039;s not that. I changed that already</p>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2014-04-06T01:03:00Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6685#p6685</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: dofile error]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6684#p6684"/>
			<content type="html"><![CDATA[<p>Maybe it&#039;s because your Move() function expects 5 arguments and only 3 are passed.</p>]]></content>
			<author>
				<name><![CDATA[com3D]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=1488</uri>
			</author>
			<updated>2014-04-05T06:04:54Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6684#p6684</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[dofile error]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6683#p6683"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2014-04-04T22:41:29Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6683#p6683</id>
		</entry>
</feed>
