Jump to content
Sign in to follow this  
captain420

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

Recommended Posts

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

ASUS ROG Maximus Hero XII ▪︎ Intel i9-10900K ▪︎ NVIDIA RTX 3090 FE ▪︎ 64GB Corsair Vengeance RGB Pro ▪︎ Windows 10 Pro (21H1) ▪︎ Samsung 970 EVO Pro 1TB NVME SSD (OS Drive) ▪︎ Samsung 860 EVO 2TB SATA SSD ▪︎ Seagate 4TB SATA HDD ▪︎ Corsair RMx 850W PSU

Share this post


Link to post
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

LORBY-SI

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?


ASUS ROG Maximus Hero XII ▪︎ Intel i9-10900K ▪︎ NVIDIA RTX 3090 FE ▪︎ 64GB Corsair Vengeance RGB Pro ▪︎ Windows 10 Pro (21H1) ▪︎ Samsung 970 EVO Pro 1TB NVME SSD (OS Drive) ▪︎ Samsung 860 EVO 2TB SATA SSD ▪︎ Seagate 4TB SATA HDD ▪︎ Corsair RMx 850W PSU

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


LORBY-SI

Share this post


Link to post

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


ASUS ROG Maximus Hero XII ▪︎ Intel i9-10900K ▪︎ NVIDIA RTX 3090 FE ▪︎ 64GB Corsair Vengeance RGB Pro ▪︎ Windows 10 Pro (21H1) ▪︎ Samsung 970 EVO Pro 1TB NVME SSD (OS Drive) ▪︎ Samsung 860 EVO 2TB SATA SSD ▪︎ Seagate 4TB SATA HDD ▪︎ Corsair RMx 850W PSU

Share this post


Link to post
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

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.


ASUS ROG Maximus Hero XII ▪︎ Intel i9-10900K ▪︎ NVIDIA RTX 3090 FE ▪︎ 64GB Corsair Vengeance RGB Pro ▪︎ Windows 10 Pro (21H1) ▪︎ Samsung 970 EVO Pro 1TB NVME SSD (OS Drive) ▪︎ Samsung 860 EVO 2TB SATA SSD ▪︎ Seagate 4TB SATA HDD ▪︎ Corsair RMx 850W PSU

Share this post


Link to post

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

Dan Downs KCRP

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>

 

 


Dan Downs KCRP

Share this post


Link to post

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


ASUS ROG Maximus Hero XII ▪︎ Intel i9-10900K ▪︎ NVIDIA RTX 3090 FE ▪︎ 64GB Corsair Vengeance RGB Pro ▪︎ Windows 10 Pro (21H1) ▪︎ Samsung 970 EVO Pro 1TB NVME SSD (OS Drive) ▪︎ Samsung 860 EVO 2TB SATA SSD ▪︎ Seagate 4TB SATA HDD ▪︎ Corsair RMx 850W PSU

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
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

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.


Dan Downs KCRP

Share this post


Link to post
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

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.


Dan Downs KCRP

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  
  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...