Howto:Adding Bombable to FlightGear Aircraft: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 514: Line 514:
OK, this is typical.  There is a typo or stray character on the .xml file . . . or something.
OK, this is typical.  There is a typo or stray character on the .xml file . . . or something.


After a few minutes of trying different things, I discover I'ave
After a few minutes of trying different things, I discover I've made a typo:


Best/easiest way to test XML files is load them in Internet Explorer. It will parse the XML file and display any errors it finds. (If you don't have access to IE there are other XML parsers available.)
* In \Aircraft\F-15E\Models\F-15E_StrikeEagle-set.xml is this line:
  <PropertyList include="F-15E_StrikeEagle-bombableinclude.xml">
* But I've saved the file as
  FGDATA/Aircraft/F-15E/F-15-StrikeEagle-bombableinclude.xml


I right-click on F-15_StrikeEagle-bombableinclude.xml and choose "Open with Internet Explorer".  It turns out there is a stray character on line 3.  I delete it, save the file, and try again:
OK, that one little "E" made all the difference.  I change the filename to match what's in the -set.xml file and try again.


* Bombable (ver. 4.4) loaded . . .
And finally--success!
* loading scenario "f-15-demo"
* No error messages!


I open the map (Equipment/Map) and check "Traffic"I see "Jones" and "Cooper" each flying their separate ways.
===Testing/parsing XML files===
One final tip: XML files are extremely persnicketyJust one wrong character can make an entire file fail to load.


Success!
The best/easiest way to test XML files is load them in Internet ExplorerIt will parse the XML file and display any errors it finds(If you don't have access to IE there are other XML parsers available.) This is far easier and faster than starting and re-starting FG repeatedly, and IE gives better, more informative error messages as well.
 
But wait . . . they are not turning, attacking, or anythingI see no messages saying that the F-15E has been initialized.
 
Obviously the -bombableinclude.xml code has not executed at all.
 
I open FGDATA\Aircraft\F-15E\Models\F-15E_StrikeEagle.xml and have a look.
 
Here is the problem:
 
  <?xml version="1.0"?>
   
<PropertyList include="F-15E_StrikeEagle-bombableinclude.xml">
<path>Aircraft/F-15E/Models/f-15E.ac</path>
<animation>
    <type>shader</type>
    <shader>chrome</shader>
    <texture>Aircraft/Generic/Effects/glass_shader.png</texture>
    <object-name>CanopyGlass</object-name>
<object-name>FrontGlass</object-name>
 
   
  </animation>
<animation>
    <type>noshadow</type>
    <object-name>Cockpit</object-name>
   
  </animation>
<!--
 
<nasal>
    <load>
      var livery_update = aircraft.livery_update.new("Aircraft/F-15E/Models/Liveries", 10);
    </load>
  <unload>
      livery_update.stop();
    </unload>
  </nasal>
 
Success!


==Where your aircraft files are==
==Where your aircraft files are==
482

edits

Navigation menu