<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - access to the "Follow behavior" attributes]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=288&amp;type=atom"/>
	<updated>2012-02-01T06:41:45Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=288</id>
		<entry>
			<title type="html"><![CDATA[Re: access to the "Follow behavior" attributes]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=1362#p1362"/>
			<content type="html"><![CDATA[<p>Ok, thanks <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></content>
			<author>
				<name><![CDATA[Alinor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=64</uri>
			</author>
			<updated>2012-02-01T06:41:45Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=1362#p1362</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: access to the "Follow behavior" attributes]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=1359#p1359"/>
			<content type="html"><![CDATA[<p>Hi,<br />yes, you don&#039;t have access to the MBFollow class from the SDK,<br />the generic system to access to behavior variables is this :</p><div class="codebox"><pre><code>MVariable variable = behavior-&gt;getVariable(0); // first variable (&quot;target&quot;)
MString * target = (MString *)variable.getPointer();

behavior-&gt;getVariable(1); // &quot;delay&quot;
float * delay = (float *)variable.getPointer();
...</code></pre></div><p>if you are not sure of the variable id, name or data type, you can scan the variables :</p><p>variables number :<br />unsigned int nbVar = behavior-&gt;getVariablesNumber();</p><p>name :<br />variable.getName();</p><p>type :<br />variable.getType();<br />(can be M_VARIABLE_BOOL, M_VARIABLE_INT, M_VARIABLE_VEC2, M_VARIABLE_VEC3...)</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2012-01-31T19:12:07Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=1359#p1359</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[access to the "Follow behavior" attributes]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=1358#p1358"/>
			<content type="html"><![CDATA[<p>Hi, I have an another question about SDK, I try to attach a Follow behavior to a 3d Entity :</p><div class="codebox"><pre><code>MBehaviorManager * bManager = MEngine::getInstance()-&gt;getBehaviorManager();
MBehaviorCreator * bCreator = bManager-&gt;getBehaviorByName(&quot;Follow&quot;);
MBehavior * behavior = bCreator-&gt;getNewBehavior(object);
object-&gt;addBehavior(behavior);</code></pre></div><p>it work, but how can I change the &quot;delay&quot;, &quot;offset&quot; ... attributes of &quot;behavior&quot; ?<br />I try to convert &quot;behavior&quot; with an expression like &quot;(Follow *) behavior&quot; but it doesn&#039;t work ...</p>]]></content>
			<author>
				<name><![CDATA[Alinor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=64</uri>
			</author>
			<updated>2012-01-31T18:15:18Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=1358#p1358</id>
		</entry>
</feed>
