<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - How to save user data (e.g. progress/option)?]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=893&amp;type=atom"/>
	<updated>2013-12-14T09:24:59Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=893</id>
		<entry>
			<title type="html"><![CDATA[Re: How to save user data (e.g. progress/option)?]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6082#p6082"/>
			<content type="html"><![CDATA[<p>yes, there is no ready-made solution yet,<br />it is not ideal, but when you distribute your game the file will be relative to the player.</p><p>We will work on a better solution for the future.</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2013-12-14T09:24:59Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6082#p6082</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[How to save user data (e.g. progress/option)?]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6080#p6080"/>
			<content type="html"><![CDATA[<p>I cann&#039;t find lua-function to work with player data. Are they exists?<br />Surely this data may be stored as lua-script<br /></p><div class="codebox"><pre><code>// pseudo-code

function SaveData()
    file = io.open(&quot;player_data.lua&quot;, &quot;w+&quot;)
    file:write(&quot;player_data_vars={}&quot;)
    for key,value in pairs(player_data_vars) do
        file:write(&quot;player_data_vars[&lt;&lt;key&gt;&gt;]=&lt;&lt;value&gt;&gt;&quot;)
    end
    file:flush()
    file:close() 
end

function LoadData()
    dofile(&quot;player_data_vars.lua&quot;)
end</code></pre></div><p> </p><p>But this code create stand-alone lua-file with platform-depends place (in Windows7 used exe-same folder). <br />Perhaps, I wrong and place not depended.</p><p>Wait yours remarks <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[Aikon]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2730</uri>
			</author>
			<updated>2013-12-14T07:18:47Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6080#p6080</id>
		</entry>
</feed>
