<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - SQLite3 plugin]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=930&amp;type=atom"/>
	<updated>2014-02-05T14:58:14Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=930</id>
		<entry>
			<title type="html"><![CDATA[Re: SQLite3 plugin]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6330#p6330"/>
			<content type="html"><![CDATA[<p>I haven&#039;t written the classes yet, so I don&#039;t have any sample code to show. I think I&#039;ll hold off on posting any further about this until I have some tangible results.</p><p>Thanks for your help, Anael.</p>]]></content>
			<author>
				<name><![CDATA[sunnystormy]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2708</uri>
			</author>
			<updated>2014-02-05T14:58:14Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6330#p6330</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQLite3 plugin]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6326#p6326"/>
			<content type="html"><![CDATA[<p>what does your data looks like ?<br />and how do you get the data ?</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2014-02-05T10:44:19Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6326#p6326</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQLite3 plugin]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6323#p6323"/>
			<content type="html"><![CDATA[<p>Ah, okay. Seems like I&#039;d have to get a little creative. <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>For my purposes, it looks like I&#039;d have to enumerate through the collection of strings on the C++ side, push those strings into Lua, and at that point they can be enumerated into a table or something like that? I&#039;m kind of half-guessing here... &gt;_&gt;</p><p>Thank you for letting me know.</p>]]></content>
			<author>
				<name><![CDATA[sunnystormy]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2708</uri>
			</author>
			<updated>2014-02-05T01:05:27Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6323#p6323</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQLite3 plugin]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6322#p6322"/>
			<content type="html"><![CDATA[<p>Yes pushFloatArray require a float array.<br />There is no string array method implemented, you have the choice between :</p><p>pushIntArray(const int * values, unsigned int valuesNumber);<br />pushFloatArray(const float * values, unsigned int valuesNumber);<br />pushString(const char * string);<br />pushBoolean(bool value);<br />pushInteger(int value);<br />pushFloat(float value);<br />void pushPointer(void* value);</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2014-02-05T00:23:05Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6322#p6322</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQLite3 plugin]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6321#p6321"/>
			<content type="html"><![CDATA[<p>Cool, but, I&#039;m a little confused. : / ...in that instance, because you&#039;re pushing a &quot;float&quot; array, isn&#039;t the method expecting the values inside the collection to be floats? What about other types of arrays (like one containing strings)?</p>]]></content>
			<author>
				<name><![CDATA[sunnystormy]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2708</uri>
			</author>
			<updated>2014-02-04T22:11:10Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6321#p6321</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQLite3 plugin]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6320#p6320"/>
			<content type="html"><![CDATA[<p>A simple way is to create a function and send the array to the script context :</p><p>In your c++ plugin :</p><div class="codebox"><pre><code>float myArray[100];

int getMyArray(void)
{
    MEngine * engine = MEngine::getInstance();
    MScriptContext * script = engine-&gt;getScriptContext();
    script-&gt;pushFloatArray(myArray, 100);
    return 1;
}

void StartPlugin(void)
{
    MEngine * engine = MEngine::getInstance();
    MScriptContext* script = engine-&gt;getScriptContext();

    script-&gt;addFunction(&quot;getMyArray&quot;, getMyArray);
}</code></pre></div><p>In lua :</p><div class="codebox"><pre><code>myArray = getMyArray()</code></pre></div>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2014-02-04T21:46:16Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6320#p6320</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[SQLite3 plugin]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6316#p6316"/>
			<content type="html"><![CDATA[<p>So, I thought it&#039;d be a cool idea to have a robust persistent store with a simple Lua interface integrated within Maratis.</p><p>I&#039;d like to learn more about pushing C++ values into Lua so that Maratis can access them and vice versa. How would this work for collections (arrays, hashtables, etc.)? I think figuring this out would help streamline games where you have to worry about a player&#039;s inventory, or related mechanics.</p><p>If there&#039;s some Maratis documentation that covers this specifically, please let me know. I&#039;d love to learn more about it.</p><p>Thanks.</p>]]></content>
			<author>
				<name><![CDATA[sunnystormy]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2708</uri>
			</author>
			<updated>2014-02-04T16:44:05Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6316#p6316</id>
		</entry>
</feed>
