<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - Access to files outside the games .npk]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=662</link>
		<description><![CDATA[The most recent posts in Access to files outside the games .npk.]]></description>
		<lastBuildDate>Sat, 11 May 2013 08:57:04 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Access to files outside the games .npk]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4133#p4133</link>
			<description><![CDATA[<p>I&#039;ll try to add a function to get the game directory from script.</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sat, 11 May 2013 08:57:04 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4133#p4133</guid>
		</item>
		<item>
			<title><![CDATA[Re: Access to files outside the games .npk]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4132#p4132</link>
			<description><![CDATA[<p>==&gt; -- NB: The text file must be located in the same directory as binaries, ie :<br />That would explain why it couldn&#039;t find the file <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><p>Thanks for your advice <img src="http://forum.maratis3d.com/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p><p>Sponk</p>]]></description>
			<author><![CDATA[dummy@example.com (Sponk)]]></author>
			<pubDate>Sat, 11 May 2013 08:30:22 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4132#p4132</guid>
		</item>
		<item>
			<title><![CDATA[Re: Access to files outside the games .npk]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4129#p4129</link>
			<description><![CDATA[<p>Here is a complete example with a few tips on file locations:</p><p>function settingsFromFile()</p><p>-- NB: The text file must be located in the same directory as binaries, ie :<br />-- &nbsp; &nbsp; &nbsp; &nbsp; &quot;/Maratis/Bin&quot; for unpublished projects<br />--&nbsp; &nbsp; &nbsp; &nbsp; &quot;/MyProject/published&quot; for published projects</p><p>&nbsp; &nbsp; file = io.open(&quot;Settings.txt&quot;, &quot;r&quot;) -- open file in read (&quot;r&quot;) mode</p><p>&nbsp; &nbsp; if file then -- catch IO errors</p><p>&nbsp; &nbsp; &nbsp; &nbsp; settings = {} -- create an array containing all file&#039;s lines (each one is a parameter)<br />&nbsp; &nbsp; &nbsp; &nbsp; for line in file:lines() do table.insert(settings, line) end</p><p>&nbsp; &nbsp; &nbsp; &nbsp; -- Set parameters<br />&nbsp; &nbsp; &nbsp; &nbsp; force = settings[1]</p><p>&nbsp; &nbsp; &nbsp; &nbsp; file:close() -- close file</p><p>&nbsp; &nbsp; end</p><p>end</p><p>settingsFromFile()</p><p>-- scene update<br />if onKeyDown(&quot;B&quot;) then addCentralForce(Player, {0, 0, force}, &quot;local&quot;) end</p>]]></description>
			<author><![CDATA[dummy@example.com (com3D)]]></author>
			<pubDate>Fri, 10 May 2013 11:36:24 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4129#p4129</guid>
		</item>
		<item>
			<title><![CDATA[Re: Access to files outside the games .npk]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4128#p4128</link>
			<description><![CDATA[<p>I guess you can use &quot;file = io.open(filename, &quot;r&quot;)&quot; to read a file,<br />as for the path I&#039;m not sure as I never tested it, it&#039;s a standard lua library that handle it and not Maratis.</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Fri, 10 May 2013 09:27:48 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4128#p4128</guid>
		</item>
		<item>
			<title><![CDATA[Access to files outside the games .npk]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4127#p4127</link>
			<description><![CDATA[<p>Hello community,</p><p>I want to read a configuration file from outside the npk via lua into my game.</p><p>First: Is that possible?<br />Second: How do have to do that?</p><p>Sponk</p>]]></description>
			<author><![CDATA[dummy@example.com (Sponk)]]></author>
			<pubDate>Thu, 09 May 2013 16:10:53 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4127#p4127</guid>
		</item>
	</channel>
</rss>
