Sign in to follow this  
captain420

How to create add-on.xml for scenery with 2 seperate folders?

Recommended Posts

Posted (edited)

I'm trying to create add-on.xml for all my P3D Sceneries, but I'm stuck on sceneries that have 2 folders? For example this RKSI scenery folder structure looks like this

RKSI 

RKSI_TERRAIN

Of course the RKSI_TERRAIN folder should be placed under RKSI folder, but how do i specify this in the add-on.xml file? This is what I have now:

	<SimBase.Document Type="AddOnXml" version="4,0" id="add-on">
    <AddOn.Name>RKSI</AddOn.Name>
    <AddOn.Description>RKSI</AddOn.Description>
	    <AddOn.Component>
        <Category>Scenery</Category>
        <Path>E:\P3D Addons\Scenery\Overland\RKSI</Path>
        <Name>RKSI Main</Name>
    </AddOn.Component>
	        <AddOn.Component>
        <Category>Scenery</Category>
        <Path>E:\P3D Addons\Scenery\Overland\RKSI\RKSI-Terrain</Path>
        <Name>RKSI Terrain</Name>
    </AddOn.Component>
	</SimBase.Document>

Is this right? Or am I missing something?

 

Edited by captain420

Share this post


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

Just now, captain420 said:

I'm trying to create add-on.xml for all my P3D Sceneries, but I'm stuck on sceneries that have 2 folders? For example this RKSI scenery folder structure looks like this

RKSI 

RKSI_TERRAIN

Of course the RKSI_TERRAIN folder should be placed under RKSI folder, but how do i specify this in the add-on.xml file? This is what I have now:

 


	<SimBase.Document Type="AddOnXml" version="4,0" id="add-on">
    <AddOn.Name>RKSI</AddOn.Name>
    <AddOn.Description>RKSI</AddOn.Description>
	    <AddOn.Component>
        <Category>Scenery</Category>
        <Path>E:\P3D Addons\Scenery\Overland\RKSI\RKSI</Path>
        <Name>RKSI Main</Name>
    </AddOn.Component>
	        <AddOn.Component>
        <Category>Scenery</Category>
        <Path>E:\P3D Addons\Scenery\Overland\RKSI\RKSI-Terrain</Path>
        <Name>RKSI Terrain</Name>
    </AddOn.Component>
	</SimBase.Document>

 

Is this right? Or am I missing something?

 

The scenery defintion is incomplete. You need to add the appropriate "<Layer>" tags, to arrange your sceneries in the correct sequence - just like in the scenery.cfg.

Best regards

  • Like 1

Share this post


Link to post

	<SimBase.Document Type="AddOnXml" version="4,0" id="add-on">
    <AddOn.Name>Taxi2Gate - VHHH</AddOn.Name>
    <AddOn.Description>Taxi2Gate - VHHH</AddOn.Description>
	    <AddOn.Component>
        <Category>Scenery</Category>
        <Path>E:\P3D Addons\Scenery\Taxi2Gate\VHHH-T2G\VHHH</Path>
        <Name>VHHH</Name>
        <Layer>1</Layer>
    </AddOn.Component>
	        <AddOn.Component>
        <Category>Scenery</Category>
        <Path>E:\P3D Addons\Scenery\Taxi2Gate\VHHH-T2G\VHHH-TERRAIN</Path>
        <Name>VHHH Terrain</Name>
        <Layer>2</Layer>
    </AddOn.Component>
	</SimBase.Document>

Like this?

Share this post


Link to post
Just now, captain420 said:

 


	<SimBase.Document Type="AddOnXml" version="4,0" id="add-on">
    <AddOn.Name>Taxi2Gate - VHHH</AddOn.Name>
    <AddOn.Description>Taxi2Gate - VHHH</AddOn.Description>
	    <AddOn.Component>
        <Category>Scenery</Category>
        <Path>E:\P3D Addons\Scenery\Taxi2Gate\VHHH-T2G\VHHH</Path>
        <Name>VHHH</Name>
        <Layer>1</Layer>
    </AddOn.Component>
	        <AddOn.Component>
        <Category>Scenery</Category>
        <Path>E:\P3D Addons\Scenery\Taxi2Gate\VHHH-T2G\VHHH-TERRAIN</Path>
        <Name>VHHH Terrain</Name>
        <Layer>2</Layer>
    </AddOn.Component>
	</SimBase.Document>

 

Like this?

No.

Be mindful that layering works in conjunction with the scenery.cfg. While you can use any layer number you like, you will have to deal with situations, where external scenery is layered inside the scenery.cfg range.

In this example, you would place your new sceneries at the very bottom of your whole scenery library. You will see, when you open the scenery library dialog in P3D.

Seriously, you should not try to do this manually. This will not end well.

Best regards

Share this post


Link to post

What do you suggest I do for sceneries that don't use the add-on.xml method then?

Share this post


Link to post
Posted (edited)
5 minutes ago, captain420 said:

What do you suggest I do for sceneries that don't use the add-on.xml method then?

What do you mean? There is only one scenery layering logic in the simulator. It doesn't matter if it is in the scenery.cfg or in an external XML, the simulator will mash all of them together and arrange them according to their layer numbers. Trying to manually keep track of the layering between the scenery.cfg and the external definitons will be quite the effort. Especially when adding those BGL files that need to go into the base layers of the sim. 

That is what I wrote the P4AO tool for. It will not only handle the XML files for sceneries and any other content, but it also integrates external scenery areas with the scenery.cfg. You can move them up and down the scenery library layer order with simple mouse clicks. 

Btw. you will find the specification for all of this in the "Learning Center.chm" file in the main P3D directory. Go to "SDK->Add-ons" and check the documentation there. Every parameter, tag and file is explained.

Best regards

Edited by Lorby_SI

Share this post


Link to post

Thanks, I guess for the time being, I won't touch any addons that have 2 seperate scenery folders.

Share this post


Link to post
Posted (edited)

Oliver has much more experience here than I; however, the Layer tag is not required.  The solution to multiple folders is easy, in any and all add-on.xml files the last component read is highest in priority, first read is lowest.  In this case where the terrain folder should be a lower priority then put it first in the file.  This works for me.

A caveat here, if you start using layer numbers then I suspect that layer number should always be used.  This is the reason I don't use them.  I could be wrong, but as long as my add-ons work as intended I can't be too wrong.

I would answer your question like this:

 

Edited by downscc
  • Like 1

Share this post


Link to post
2 hours ago, captain420 said:

	<SimBase.Document Type="AddOnXml" version="4,0" id="add-on">
    <AddOn.Name>RKSI</AddOn.Name>
    <AddOn.Description>RKSI</AddOn.Description>
   	<AddOn.Component>
        <Category>Scenery</Category>
        <Path>E:\P3D Addons\Scenery\Overland\RKSI\RKSI-Terrain</Path>
        <Name>RKSI Terrain</Name>
    </AddOn.Component>
	<AddOn.Component>
        <Category>Scenery</Category>
        <Path>E:\P3D Addons\Scenery\Overland\RKSI</Path>
        <Name>RKSI Main</Name>
    </AddOn.Component>
	</SimBase.Document>

 

 

Share this post


Link to post

Thanks Dan, I will give it a try and see how it works.

Share this post


Link to post
5 minutes ago, downscc said:

Oliver has much more experience here than I; however, the Layer tag is not required.  The solution to multiple folders is easy, in any and all add-on.xml files the last component read is highest in priority, first read is lowest.  In this case where the terrain folder should be a lower priority then put it first in the file.  This works for me.

A caveat here, if you start using layer numbers then I suspect that layer number should always be used.  This is the reason I don't use them.  I could be wrong, but as long as my add-ons work as intended I can't be too wrong.

You are right, this is what i do. It just going to add new entries on the top of the scenery.cfg, no need for layers, but the order is important.

2 hours ago, captain420 said:

 


	<SimBase.Document Type="AddOnXml" version="4,0" id="add-on">
    <AddOn.Name>Taxi2Gate - VHHH</AddOn.Name>
    <AddOn.Description>Taxi2Gate - VHHH</AddOn.Description>
	    <AddOn.Component>
        <Category>Scenery</Category>
        <Path>E:\P3D Addons\Scenery\Taxi2Gate\VHHH-T2G\VHHH</Path>
        <Name>VHHH</Name>
        <Layer>1</Layer>
    </AddOn.Component>
	        <AddOn.Component>
        <Category>Scenery</Category>
        <Path>E:\P3D Addons\Scenery\Taxi2Gate\VHHH-T2G\VHHH-TERRAIN</Path>
        <Name>VHHH Terrain</Name>
        <Layer>2</Layer>
    </AddOn.Component>
	</SimBase.Document>

 

Like this?

It's ok like this, without layer lines. In Addon.xml, the order should be - first the terrain, then airport, and then landclass / elevation in case of T2Gate. 

You can also use AddonOrganizer developed by Oliver, it's a great tool

 

Share this post


Link to post
Posted (edited)
13 minutes ago, downscc said:

A caveat here, if you start using layer numbers then I suspect that layer number should always be used.  This is the reason I don't use them.  I could be wrong, but as long as my add-ons work as intended I can't be too wrong.

The issue is that for some situations layer numbers are required, for example for elevation correction files that need to reside at layer 2, for mesh products or AI traffic flightplan BGLs that should be between default scenery and addons, for scenery areas (from different developers) that still need to be in a certain sequence to avoid issues - etc.. Which is why I always use them- which is easy, because my tool does it for me. I just nudge the sceneries up and down, and the tool will apply correct layer numbers to all external add-on.xmls and all internal scenery.cfg entries automatically.

Sorry, but I probably will never understand why anyone would want to do this manually. Relying on pure luck that the load sequence of files will work out sure is not for me.

Mind you, this is personal preference - the spec says, that layer numbers are not required in add-on.xmls.

Best regards

Edited by Lorby_SI

Share this post


Link to post
3 minutes ago, Lorby_SI said:

Sorry, but I probably will never understand why anyone would want to do this manually. Relying on pure luck that the load sequence of files will work out sure is not for me.

haha... control freak?  Actually, there's reasoning that goes "that if A always works as expected then one may rely on A working as expected."  I've been doing this the same way since before you created your fantastic tool (which I still find useful for the make runways task), since version P3Dv4.0.  I don't think it has much to do with luck.  I noted that the order of add-on.xml files is also the same first is lowest, so if I want a Layer 2, that is in an addon document folder named aaAddons to ensure it is the first folder containing an add-on.xml file read by P3D. Works great even with the elevation stubs.

Share this post


Link to post
Posted (edited)
31 minutes ago, downscc said:

haha... control freak?  Actually, there's reasoning that goes "that if A always works as expected then one may rely on A working as expected."  I've been doing this the same way since before you created your fantastic tool (which I still find useful for the make runways task), since version P3Dv4.0.  I don't think it has much to do with luck.  I noted that the order of add-on.xml files is also the same first is lowest, so if I want a Layer 2, that is in an addon document folder named aaAddons to ensure it is the first folder containing an add-on.xml file read by P3D. Works great even with the elevation stubs.

Control freak? Definitely. I have been writing code since 1982. Many a decade in professional software development for a very (very) large company have taught me many things - especially scepticism.

But the truth is, that I just don't have the nerve or the time to deal with mere configuration files on that low a level. I have a hard time even just flying for two hours every week, I am certainly not going to waste any time on configuration. Not when there is a quicker way.

"that if A always works as expected then one may rely on A working as expected"
Except that A itself is based on a moving, evolving platform. Nothing in IT remains a constant. The only thing that you may rely on is the spec, nothing else matters. I am leaning more towards what 30 years ago was called "chaos theory". And as far as complex computer systems are concerned: "If A works as expected, consider yourself lucky".

Besides, I can accept halfway if one does this for one or two handful of files. But handling 1000 scenery entries manually? No thank you. I even had a customer who had 10000 (ten thousand) sceneries linked to the sim. Considering that there are 25000-something airports in the sim, and that there is a lot of non-airport scenery too, this isn't even all that much.

On another note: instead of controlling the loading sequence with the alphabet, you should consider using the second add-on.xml method, with the P3D command line tools (as per the specification). That one always gives consistent, reliable results.
(LearningCenter->SDK->Add-ons->Add-on Configuration Files)

Best regards

Edited by Lorby_SI

Share this post


Link to post
29 minutes ago, Lorby_SI said:

Except that A itself is based on a moving, evolving platform. Nothing in IT remains a constant.

True, being quite an old fart myself and computer dates back to the Heathkit H89 and assembly using CP/M 80.  Programmer I'm not......no way.  I am a communications engineer, radio communications specifically. I stretched my abilities creating my LogEdit logbook editor but I'm proud of it because I've had one bug report in over two years. We have opposite conditions, and I appreciate your approach given the lack of time you have.  On the other hand, I'm retired and flight simulation is about all I do.  I'm very lazy by nature and like using tools, but for some reason I am very OCD about my addons and I prefer to create the add-on.xml files myself primarily because by doing so I had to learn how they work, study the SDK you referenced, and come up with an installation strategy that works for me.  This means I will use an add-on deverloper's installer and then review how they did it (they use four of the three recommended practices LOL) and modify what they do so all of mine are done the same way.  I have over 100 separate addon entrys but only a dozen or so add-on.xml files because I will group them by developer.  Using a consistent method ensures that I don't spend much time on this particular task.   I spend most of my non-flying time split between fixing developer's sloppy parking and customizing GSX to my liking and flight planning.

By the way Oliver, I do always recommend your tool to newbies.  It's just easier to do that than to try to get most of them to read the SDK.... so many seem to dislike reading.

Share this post


Link to post

Hello Dan,

I envy you, I really do. Unfortunately retirement is still a little way off for me. I'm still hoping for a built-in management GUI in P3D that makes all of this (and P4AO) superfluous.

Best regards

 

 

Share this post


Link to post

I do wish that -- at some point -- all of the developers would install outside the sim structure.

Of course the problem is, for example, elevation stubs.  Those have to be in a certain place (/scenery/world/scenery) unless there is some new way to avoid that.

Share this post


Link to post
Posted (edited)
7 hours ago, Mace said:

Of course the problem is, for example, elevation stubs.  Those have to be in a certain place (/scenery/world/scenery) unless there is some new way to avoid tha

This is not correct. You just save all of them into a separate external folder, then you can link them either as scenery component with Layer 2 or you make it the first XML file that is loaded (like Dan explained).

P3D doesn't have hard coded content folders any more (like FSX did). Every(!) type of content (Aircraft, scenery, textures, shaders, sounds, EXE file, DLL files etc.) is linked to P3D with the .cfg files in \Program Data\ and can be expanded with external XML files. 

The only real "problems" that I know of are programmatic gauges that expect their assets to be in a certain place. So you may be missing sounds if the aircraft is installed externally. And the autogen definition, terrain, (?) XML files, which TMBK are still unique.

When looking at the developers, please bear in mind that many users are plonking content into the sim that wasn't even made for P3D.

I also wish that all content developers would at least use the content error log to make sure that their products are bug free. The content error log in my sim has exceeded 1000 entries by now (it stops writing them to the log after #999) although I am only using "P3D V4 compatible" products.
LearningCenter->SDK->Addons->Add-on Instructions for developers->Add-On Content Error Reporting

Best regards

Edited by Lorby_SI

Share this post


Link to post

Oliver have you brought it to the attention of these developers so that they're aware and perhaps can correct these errors?

Share this post


Link to post
Posted (edited)
22 minutes ago, captain420 said:

Oliver have you brought it to the attention of these developers so that they're aware and perhaps can correct these errors?

Hello Aaron,

I would never see the end of it, there are issues with just so many addons, except the more professional ones (A2A, PMDG etc.). You can try it yourself, go to the P3D Settings and activate the content error reporting. Every time you start the sim it will list all content errors it can find to a file that you will find in "\Documents\Prepar3D V4 Files"

The fun part is, that when users ask about the Content Error Log, even experienced simmers tell them to ignore it. 

Best regards

Edited by Lorby_SI

Share this post


Link to post
12 hours ago, Lorby_SI said:

...I have been writing code since 1982. Many a decade in professional software development for a very (very) large company have taught me many things - especially scepticism.

I second that. See Murphy's Laws of Programming

  • Like 1

Share this post


Link to post
11 hours ago, Lorby_SI said:

This is not correct. You just save all of them into a separate external folder, then you can link them either as scenery component with Layer 2 or you make it the first XML file that is loaded (like Dan explained).

P3D doesn't have hard coded content folders any more (like FSX did). Every(!) type of content (Aircraft, scenery, textures, shaders, sounds, EXE file, DLL files etc.) is linked to P3D with the .cfg files in \Program Data\ and can be expanded with external XML files. 

The only real "problems" that I know of are programmatic gauges that expect their assets to be in a certain place. So you may be missing sounds if the aircraft is installed externally. And the autogen definition, terrain, (?) XML files, which TMBK are still unique.

When looking at the developers, please bear in mind that many users are plonking content into the sim that wasn't even made for P3D.

I also wish that all content developers would at least use the content error log to make sure that their products are bug free. The content error log in my sim has exceeded 1000 entries by now (it stops writing them to the log after #999) although I am only using "P3D V4 compatible" products.
LearningCenter->SDK->Addons->Add-on Instructions for developers->Add-On Content Error Reporting

Best regards

 

Ok -- thanks for this information.  I was asking the question if there was a new way to handle elevation stubs, not trying to be "correct" or "incorrect".  I knew in FSX we had to place them there.  This is good info, as now I can get my stub files out of the P3D structure with no worries.  

The older gauges with hard-coded locations is...yes.. a problem I have run into with a few older add-ons.

Share this post


Link to post
12 hours ago, Lorby_SI said:

The fun part is, that when users ask about the Content Error Log, even experienced simmers tell them to ignore it. 

It is just SO much easier than having to deal with thousands of ridiculous errors. What frustrates me is you might have to wade through hundreds of simple non fatal syntax errors to try and find one that is actually causing the problem. Suggesting to the dev that they fix all their syntax errors gets one of those "you've got to be kidding" responses.

Much easier to tell the newbie to ignore them.

Vic

Share this post


Link to post
Posted (edited)
36 minutes ago, vgbaron said:

It is just SO much easier than having to deal with thousands of ridiculous errors. What frustrates me is you might have to wade through hundreds of simple non fatal syntax errors to try and find one that is actually causing the problem. Suggesting to the dev that they fix all their syntax errors gets one of those "you've got to be kidding" responses.

Much easier to tell the newbie to ignore them.

Vic

Hello Vic,

but - we don't know that they are non-fatal, we just assume that they are, because their effect isn't immediately obvious. My point being, if all of those issues were harmless, then why did Lockheed include them in the error log in the first place? They could simply ignore them.

A syntax error in a gauge is probably processed 18 times a second by the sim, and who knows how many exceptions a missing sound file, an incorrect runway type, a missing texture etc. etc. are causing. Get enough of them together in one place, and you will notice (but maybe not realize it). Processing an error is a "significant" operation for any software.

I wouldn't be this word not allowed about it, if this was about a handful of issues. But we are talking about hundreds here. In "certified P3D V4 compatible" addons no less. 

It just doesn't make sense to start tweaking and hunting for the next 0.5 FPS instead of dealing with the obvious first. 

Best regards

Edited by Lorby_SI

Share this post


Link to post
5 hours ago, Mace said:

 

Ok -- thanks for this information.  I was asking the question if there was a new way to handle elevation stubs, not trying to be "correct" or "incorrect".  I knew in FSX we had to place them there.  This is good info, as now I can get my stub files out of the P3D structure with no worries.  

The older gauges with hard-coded locations is...yes.. a problem I have run into with a few older add-ons.

Would this apply to the sound gauge for RealAir Lancair Legacy v2? So it's not possible to install that via add-on.xml method?

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
Sign in to follow this