Juergen

Add-Ons Title in P3Dv4

Recommended Posts

Hi,

I was looking at my add-ons in P3Dv4 and noticed, that some of the add-ons have the correct title and some say <no name provided. So I looked at the add-on.xml, but can't see a difference:

Here is add-on OMDB which shows <no name provided> in the Title column:

<SimBase.Document Type="AddOnXml" version="4,0" id="add-on">
  <AddOn.Name>Dubbai International Airport OMDB</AddOn.Name>
  <AddOn.Description>by Robert Catherall</AddOn.Description>
  <AddOn.Component>
    <Name>Dubbai International Airport OMDB</Name>
    <Category>Scenery</Category>
    <Path>C:\Addon Scenery\AVSIM\Dubbai\Scenery</Path>
  </AddOn.Component>
  <AddOn.Component>
    <Category>Texture</Category>
    <Path>C:\Addon Scenery\AVSIM\Dubbai\Texture</Path>
  </AddOn.Component>
</SimBase.Document>

Here is add-on FlyTampa-Las Vegas which shows <FlyTampa-Las Vegas> in the Title column:

<?xml version="1.0" encoding="utf-8"?>
<SimBase.Document Type="AddOnXml" version="4,0" id="add-on">
    <AddOn.Name>FlyTampa-Las Vegas</AddOn.Name>
    <AddOn.Description>Las Vegas McCarran Intl Airport for Prepar3D 4
    </AddOn.Description>
    <AddOn.Component>
        <Category>Scripts</Category>
        <Path>C:\Addon Scenery\FlyTampa\LasVegas\scripts</Path>
    </AddOn.Component>
    <AddOn.Component>
        <Category>Effects</Category>
        <Path>C:\Addon Scenery\FlyTampa\LasVegas\effects</Path>
    </AddOn.Component>
    <AddOn.Component>
        <Category>Scenery</Category>
        <Path>C:\Addon Scenery\FlyTampa\LasVegas\scenery</Path>
        <Name>FlyTampa-Las Vegas</Name>
    </AddOn.Component>
    <AddOn.Component>
        <Category>Texture</Category>
        <Path>C:\Addon Scenery\FlyTampa\LasVegas\texture</Path>
        <Type>WORLD</Type>
    </AddOn.Component>
    <AddOn.Component>
        <Category>Texture</Category>
        <Path>C:\Addon Scenery\FlyTampa\LasVegas\scripts\texture</Path>

Everything seems to be working O.k, so it's just a formality.

If anyone can spot the error/difference would appreciate some feedback

 

H

 

 

Share this post


Link to post
Help AVSIM continue to serve you!
Please donate today!

The first one doesn't have the <?xml.... line at the very beginning.

Share this post


Link to post

Ed,

I tried   <?xml version="1.0"?> that did NOT work, So I tried  <?xml version="1.0" encoding="utf-8"?> that did not work either.

Thanks for help

Share this post


Link to post

Ed,

I finally figured it out: I went to the P3D manual and there is a example add on.xml file (https://www.prepar3d.com/SDKv4/sdk/add-ons/add-on_packages.html).

I took that file and modified my file so that it works. Here is the version that works for OMDB:

<SimBase.Document Type="AddOnXml" version="4,0" id="add-on">
  <AddOn.Name>OMDB</AddOn.Name>
  <AddOn.Description>Dubbai International Airport</AddOn.Description>
  <AddOn.Component>
   <Category>Scenery</Category>
   <Path>C:\Addon Scenery\AVSIM\Dubbai\scenery</Path>
  </AddOn.Component>
  <AddOn.Component>
    <Category>Texture</Category>
    <Path>C:\Addon Scenery\AVSIM\Dubbai\texture</Path>
  </AddOn.Component>
  </SimBase.Document>

Also I had another name on the add on.xml, like add on.xml_OMDB. The underscore OMDB does NOT work.

Thanks for response

Share this post


Link to post
Posted (edited)

Your first example displays the title just fine for me. Properly encoded as ASCII there is no issue. Be mindful of text file encoding. If you add an encoding declaration in an XML file (like you did with ...encoding="utf-8", then the file must be encoded in UTF-8.) If you don't then it must be either UTF-8 or ASCII.

The specification is quite clear about naming conventions. A reference file can only be called "add-on.xml"

It is not advisable to split the scenery definition in two separate components. Just add the top folder of the scenery as category "scenery" like you always did with the scenery.cfg. If you add the "texture" part separately, that denotes a global definition of those texture files, which can lead to conflicts if there is another texture file with the same name on the lookup path.

<SimBase.Document Type="AddOnXml" version="4,0" id="add-on">
  <AddOn.Name>Dubbai International Airport OMDB</AddOn.Name>
  <AddOn.Description>by Robert Catherall</AddOn.Description>
  <AddOn.Component>
    <Category>Scenery</Category>
    <Path>C:\Addon Scenery\AVSIM\Dubbai</Path>
    <Name>Dubbai International Airport OMDB</Name>
  </AddOn.Component>
</SimBase.Document>

Also, please note that an add-on.xml can contain any number of addon definitions. You don't have to create separate XML files for every single airport, aircraft, texture replacement, shader replacement, effects folder etc.

Best regards

Edited by Lorby_SI

Share this post


Link to post

Hi Oliver,

Thank you for the detailed explanation. The reason for having a add on.xml per airport is to make the troubleshooting easier. All I have to do is remove the add on.xml from the folder if something does not work properly.

I know this is not the place to explain the programming of an XML file, but I have 2 questions:

1. If the scenery folder contains sub folders "scenery" and "texture", I do NOT need to list the "texture" folder separate in the add on.xml? (global definition)?

2. How can I prevent the loading of a <AddOn.Component>? Enclose in "<AddOn.Component>"??

Thanks for help

Share this post


Link to post
Posted (edited)
10 minutes ago, Juergen said:

Hi Oliver,

Thank you for the detailed explanation. The reason for having a add on.xml per airport is to make the troubleshooting easier. All I have to do is remove the add on.xml from the folder if something does not work properly.

I know this is not the place to explain the programming of an XML file, but I have 2 questions:

1. If the scenery folder contains sub folders "scenery" and "texture", I do NOT need to list the "texture" folder separate in the add on.xml? (global definition)?

2. How can I prevent the loading of a <AddOn.Component>? Enclose in "<AddOn.Component>"??

Thanks for help

Hello Jürgen,

1. Correct. Just add scenery like you always did by targeting the top folder (the "Scenery Area" per the spec, the one that contains both \scenery and \texture) - see my example above. 

2. Sorry, I don't really understand that question. But if I may suggest… to save you all the trouble of writing XML files manually, I created a tool that does it for you. The "Prepar3D V4 Addon Organizer" (or "P4AO" for short), can be found as a free download on the Lorby-SI website. It manages all types of addons with an emphasis on scenery (because of the layering).

Edit: about 2. If you are trying to disable an existing AddonComponent, like with the "Active" tag in the scenery.cfg - you can't. The spec doesn't allow that, you have to disable the whole addon package (in P3D go to Options->Add-ons).

Edit 2: be very careful with XML files. They are not just any other text file, they are code constructs adhering to the rules of the W3C spec (https://www.w3.org/TR/xml/). You can't just write into them whatever you like - you MUST stick to the rules. Otherwise the files become unusable. And that includes proper text encoding too!

Best regards

Edited by Lorby_SI

Share this post


Link to post

Oliver,

Does your tool also work with 3rd party airports e.g. FlyTampa Las Vegas or Aerosoft Mega Airport Frankfurt?

Thanks

Share this post


Link to post
Posted (edited)
43 minutes ago, Juergen said:

Oliver,

Does your tool also work with 3rd party airports e.g. FlyTampa Las Vegas or Aerosoft Mega Airport Frankfurt?

Thanks

Hello Jürgen,

you mean legacy products, that were not made for P3D V4? Yes it does. I made a thread about how to add legacy content to P3D V4 in my support forum here. 

Other than that, you can move scenery from the scenery.cfg to an add-on.xml (and back) with just a few mouse clicks. Just be aware that if you do that with addons that come with their own installer or configuration tool, this exercise is futile - the installer will always put them back where they were when you receive an update. It is equally futile to try moving ORBX scenery to an add-on.xml, the "FTX Central" app will always put everything back in the scenery.cfg. 

I suggest that you take a look at the P4AO documentation first - it is a separate download, so you can read it before trying the tool itself.

Best regards

Edited by Lorby_SI

Share this post


Link to post

This isn't very helpful but was just bugging me, Dubai only has one "b" in it.

Share this post


Link to post

Hi Oliver,

I will certainly take a look at the Lorby_Si documentation and try the tool myself and thank  you for the many helpful tips.

I actually performed some of these futile add_ons already (FlyTampa Tampa and Las Vegas, Aerosoft Mega Airport EDDF and EGLL as well as Airport LSZH and EDDN). However, I will see what happens when updates are available; btw these airports are all made for P3Dv4.

And itsjase, I will correct my misspelled DUBAI airport. Thanks

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now