Hi all,

I have encounter a bug when trying to add some nasal script to an AI
model (on both FGFS 1.0.0 OSG from CVS and official plib release). It is
look like if I write a nasal snippet like this: "if(foo > 7)", the AI
model (called from an AI scenario) is not loaded.

I provide an attachment with a test case, put the file 'Jeep.xml' into
your FGFS 'data/AI/Aircraft/jeep/Models/' folder and 'KSFO_testcase.xml'
into the folder 'data/AI/'.
Normally you should see this 2 lines in your
console when you launch FGFS with my KSFO_testcase scenario:
hello jeep
5 is superior to 3.

Now you have to edit the file data/AI/Aircraft/jeep/Models/Jeep.xml on
line 289 and suppress the comments. The line 289 should look like this:
if(foo < 7.0) { print("7 is superior to 5."); }
If you now launch FGFS with KSFO_testcase scenario again, the jeep is
not loaded and with the  start option '--log-level=warn' you will see
this message in the console: 'AIBase: Could not load model
AI/Aircraft/jeep/Models/Jeep.xml'.

If someone could fix this, it would be great :-) (I could not do it
myself, I have not enough C++ skills.)

Cheers,

DavidB21.



<PropertyList>
 <path>jeep.ac</path>
	<offsets>
		<z-m>-0.1</z-m>
	</offsets>

 <animation>
  <type>translate</type>
  <object-name>fwheel.L</object-name>
  <object-name>fwheel2.L</object-name>
  <property>gear/gear[0]/compression-norm</property>
  <interpolation>
   <entry>
    <ind>0.0</ind>
    <dep>0</dep>
   </entry>
   <entry>
    <ind>1.00</ind>
    <dep>0.25</dep>
   </entry>
  </interpolation>
  <axis>
   <x>0</x>
   <y>0</y>
   <z>1</z>
  </axis>
 </animation>
 <animation>
  <type>translate</type>
  <object-name>fwheel.R</object-name>
  <object-name>fwheel2.R</object-name>
  <property>gear/gear[1]/compression-norm</property>
  <interpolation>
   <entry>
    <ind>0.0</ind>
    <dep>0</dep>
   </entry>
   <entry>
    <ind>1.00</ind>
    <dep>0.25</dep>
   </entry>
  </interpolation>
  <axis>
   <x>0</x>
   <y>0</y>
   <z>1</z>
  </axis>
 </animation>
 <animation>
  <type>translate</type>
  <object-name>rwheel.L</object-name>
  <object-name>rwheel2.L</object-name>
  <property>gear/gear[2]/compression-norm</property>
  <interpolation>
   <entry>
    <ind>0.0</ind>
    <dep>0</dep>
   </entry>
   <entry>
    <ind>1.00</ind>
    <dep>0.25</dep>
   </entry>
  </interpolation>
  <axis>
   <x>0</x>
   <y>0</y>
   <z>1</z>
  </axis>
 </animation>
 <animation>
  <type>translate</type>
  <object-name>rwheel.R</object-name>
  <object-name>rwheel2.R</object-name>
  <property>gear/gear[3]/compression-norm</property>
  <interpolation>
   <entry>
    <ind>0.0</ind>
    <dep>0</dep>
   </entry>
   <entry>
    <ind>1.00</ind>
    <dep>0.25</dep>
   </entry>
  </interpolation>
  <axis>
   <x>0</x>
   <y>0</y>
   <z>1</z>
  </axis>
 </animation>
 <animation>
  <type>rotate</type>
  <object-name>fwheel.L</object-name>
  <object-name>fwheel2.L</object-name>
  <property>surface-positions/right-aileron-pos-norm</property>
  <factor>-25</factor>
  <center>
   <x-m>0.554</x-m>
   <y-m>-0.439</y-m>
   <z-m>0.408</z-m>
  </center>
  <axis>
   <x>0.0</x>
   <y>0.0</y>
   <z>1.0</z>
  </axis>
 </animation>
 <animation>
  <type>rotate</type>
  <object-name>fwheel.R</object-name>
  <object-name>fwheel2.R</object-name>
  <property>surface-positions/right-aileron-pos-norm</property>
  <factor>-25</factor>
  <center>
   <x-m>0.554</x-m>
   <y-m>0.439</y-m>
   <z-m>0.408</z-m>
  </center>
  <axis>
   <x>0.0</x>
   <y>0.0</y>
   <z>1.0</z>
  </axis>
 </animation>

 <animation>
  <type>spin</type>
  <object-name>fwheel.L</object-name>
  <object-name>fwheel2.L</object-name>
  <property>gear/gear[1]/rollspeed-ms</property>
  <factor>-5</factor>
  <center>
   <x-m>0.554</x-m>
   <y-m>-0.439</y-m>
   <z-m>0.408</z-m>
  </center>
  <axis>
   <x>0.0</x>
   <y>1.0</y>
   <z>0.0</z>
  </axis>
 </animation>
 <animation>
  <type>spin</type>
  <object-name>fwheel.R</object-name>
  <object-name>fwheel2.R</object-name>
  <property>gear/gear[1]/rollspeed-ms</property>
  <factor>-5</factor>
  <center>
   <x-m>0.554</x-m>
   <y-m>0.439</y-m>
   <z-m>0.408</z-m>
  </center>
  <axis>
   <x>0.0</x>
   <y>1.0</y>
   <z>0.0</z>
  </axis>
 </animation>
 <animation>
  <type>spin</type>
  <object-name>rwheel.L</object-name>
  <object-name>rwheel2.L</object-name>
  <property>gear/gear[2]/rollspeed-ms</property>
  <factor>-5</factor>
  <center>
   <x-m>2.696</x-m>
   <y-m>-0.746</y-m>
   <z-m>0.408</z-m>
  </center>
  <axis>
   <x>0.0</x>
   <y>1.0</y>
   <z>0.0</z>
  </axis>
 </animation>
 <animation>
  <type>spin</type>
  <object-name>rwheel.R</object-name>
  <object-name>rwheel2.R</object-name>
  <property>gear/gear[3]/rollspeed-ms</property>
  <factor>-5</factor>
  <center>
   <x-m>2.696</x-m>
   <y-m>-0.746</y-m>
   <z-m>0.408</z-m>
  </center>
  <axis>
   <x>0.0</x>
   <y>1.0</y>
   <z>0.0</z>
  </axis>
 </animation>
 <animation>
  <type>rotate</type>
  <object-name>steerwheel</object-name>
  <property>controls/flight/aileron</property>
  <factor>-100</factor>
  <center>
   <x-m>1.467</x-m>
   <y-m>-0.331</y-m>
   <z-m>1.008</z-m>
  </center>
  <axis>
   <x1-m>1.185</x1-m>
   <y1-m>-0.331</y1-m>
   <z1-m>0.713</z1-m>
   <x2-m>1.750</x2-m>
   <y2-m>-0.331</y2-m>
   <z2-m>1.303</z2-m>
  </axis>
 </animation>

 <animation>
  <type>rotate</type>
  <object-name>screen</object-name>
  <object-name>wiper.L</object-name>
  <object-name>wiper.R</object-name>
  <property>controls/gear//screen</property>
  <factor>-108</factor>
  <center>
   <x-m>1.167</x-m>
   <y-m>0.0</y-m>
   <z-m>0.992</z-m>
  </center>
  <axis>
   <x>0.0</x>
   <y>1.0</y>
   <z>0.0</z>
  </axis>
 </animation>


    <model> 
      <path>AI/Aircraft/jeep/Models/pilot.xml</path>
	  <name>pilot</name>
      <offsets> 
        <x-m>2.1</x-m>
        <y-m>-0.32</y-m>
        <z-m>0.9</z-m>
        <pitch-deg>14</pitch-deg>
      </offsets>
    </model>
 <animation>
  <type>select</type>
  <object-name>roof1</object-name>
  <object-name>roof2</object-name>
  <condition>
   <equals>
    <property>controls/gear/roof</property>
    <value>0</value>
   </equals>
  </condition>
 </animation>
	<model> 
      <path>AI/Aircraft/jeep/Models/roof.ac</path>
			<name>softroof</name>
      <offsets> 
        <x-m>0.0</x-m>
        <y-m>0.0</y-m>
        <z-m>0.0</z-m>
      </offsets>
    </model>
 <animation>
  <type>select</type>
  <object-name>softroof</object-name>
  <condition>
   <equals>
    <property>controls/gear/roof</property>
    <value>1</value>
   </equals>
  </condition>
 </animation>
	<model> 
      <path>AI/Aircraft/jeep/Models/transparent.xml</path>
      <offsets> 
        <x-m>0.0</x-m>
        <y-m>0.0</y-m>
        <z-m>0.0</z-m>
      </offsets>
    </model>
	<!-- Nasal code -->
	<nasal>
		<load>
			var init = func() {
				print("hello jeep.");
				var foo = 5.0;
				if(foo > 3.0) { print("5 is superior to 3."); }
				# <!-- if(foo < 7.0) { print("7 is superior to 5."); } -->
			}
			setlistener("/sim/signals/fdm-initialized", init);
		</load>
		<unload></unload>
	</nasal>
</PropertyList>
 
<?xml version="1.0"?>
<PropertyList>
	<scenario>
		<description>
			Willys Jeep at KSFO (near runway 28R) for debug purpose only.
		</description>
		<entry>
			<type>static</type>
			<name>jeep1</name>
			<heading type="double">204</heading>
			<pitch type="double">0</pitch>
			<roll type="double">0</roll>
			<model type="string">AI/Aircraft/jeep/Models/Jeep.xml</model>
			<latitude type="double">37.61455651</latitude>
			<longitude type="double">-122.3586214</longitude>
			<altitude type="double">-1.547424446</altitude>
		</entry>
	</scenario>
</PropertyList>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to