1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FSX Manually adding scenery to the library in Code

Discussion in 'Tools programming' started by FrostySoftware, 4/7/09.

  1. FrostySoftware

    FrostySoftware

    Joined:
    30/6/09
    Messages:
    29
    Country:
    england
    Hello,

    I am writing an installer for some scenery that I have created and I need to know how to manually add scenery to the library in code when the scenery is installing so the user doesn't have to add it manually.

    I simply need to know the method of manually adding scenery to the library (ie, not using the Add Scenery... in FSX settings) and I will be able to code up the function.


    Thanks in advance,

    Steve
  2. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    25,794
    Country:
    wales
    I think you would need to modify the user's scenery.cfg file to add an entry for your scenery. As it is a text file that would not be terribly difficult. However there is an issue that many users would not want that file changed. The other way would be to add your scenery into Addon Scenery. That should always be activated so you would not need to modify scenery.cfg. Maybe give users an option?
  3. FrostySoftware

    FrostySoftware

    Joined:
    30/6/09
    Messages:
    29
    Country:
    england
    Thanks for the reply :).

    The will give the user the option for the installer to add it or for them to do it. The scener.cfg file is an ini file in terms of layout so it will be very easy to add another entry on the end.

    I tried adding my scenery location but it didn't seem to regster it in the scenery library in FSX...

    Any ideas?


    Steve
  4. beatle

    beatle

    Joined:
    28/9/06
    Messages:
    324
    Country:
    us-virginia
    Which scenery.cfg file are you modifying? Don't change the one in the flight sim execution directory, that's the default config file and is only used to rebuild the user specific config file if it doesn't exist. You want to modify the one that is somewhere under c:\Users\USERALIAS\...
  5. FrostySoftware

    FrostySoftware

    Joined:
    30/6/09
    Messages:
    29
    Country:
    england
    Ahh that was my problem :)

    Thanks :D
  6. Golf-HotelDelta

    Golf-HotelDelta

    Joined:
    20/12/04
    Messages:
    9,985
    Country:
    unitedkingdom
    You also need to be careful with gaps in both areas and layers in the existing cfg.
  7. BobSmall

    BobSmall

    Joined:
    16/7/09
    Messages:
    8
    Country:
    australia
    Solution to "Cannot add scenery"

    It seems that quite a few people are having problems installing additional scenery with FSX and 64-bit versions of Vista and/or Windows 7

    In my case I was trying to add Ants Aussie Airports. The folder was correctly named and located under the Addon Scenery folder, and contained the correct Scenery and Texture folders and files. But no matter what I tried, nothing worked. In the Add Area dialog, pressing the OK button just blanked out the directory name and did nothing.

    So the only solution was to edit the scenery.cfg file.

    Under Windows 7 there are two FSX file locations for "user data"
    1) C:\ProgramData\Microsoft\FSX
    2) C:\Users\Robert\AppData\Roaming\Microsoft\FSX
    In this case the the scenery.cfg file is in the first location

    Save a copy!!!
    And then edit it. The last bit of the file looked like this

    [Area.137]
    Title=FTXAA_HOLGERMESH
    Local=ORBX\FTX_AU\FTXAA_HOLGERMESH
    Layer=137
    Active=TRUE
    Required=FALSE

    [Area.138]
    Title=OZx_AUS
    Local=OZx\OZx_AUS
    Layer=138
    Active=TRUE
    Required=FALSE

    I just added another section like this, making sure that the new section had the next available area and layer numbers. The last entry will have the highest area number. Use that number+1 for both area and layer. Because the layer number for the added area will be the highest in the file, it will appear at the top of the list. It is a lot easier to simply put the new entry at the top, and then let the Add Scenery widget adjust all the layer numbers later.

    [Area.137]
    Title=FTXAA_HOLGERMESH
    Local=ORBX\FTX_AU\FTXAA_HOLGERMESH
    Layer=137
    Active=TRUE
    Required=FALSE

    [Area.138]
    Title=OZx_AUS
    Local=OZx\OZx_AUS
    Layer=138
    Active=TRUE
    Required=FALSE

    [Area.139]
    Title=Ants Aussie Airports
    Local=Addon Scenery\Ants Aussie Airports
    Layer=139
    Active=TRUE
    Required=FALSE

    Saved.
    Fired up FSX and into Settings > Scenery library and there it was. Sitting at the top of the list. I then moved it down to its correct position.

    So, a very satisfied flyer.

    No idea why the FSX widget wouldn't do its job. It's only a simple edit of a text file.

    Hope this helps.
  8. signmanbob

    signmanbob

    Joined:
    30/10/09
    Messages:
    2
    Country:
    us-alabama
    Hello,
    I am also having this same problem with FSX and Windows7 64bit.
    BluePrint Simulations doesn't automatically activate their airport scenery and want the user to do that manually.
    I did what you said here, but didn't see the scenery in the library list like you did, so I clicked on "Add Scenery" and typed "BluePrint Simulations\KMEM" in the path box and "KMEM" in the title box.
    This worked and the scenery is now activated in the library and works in FSX, but the title is blank in the library and if I want to see what scenery it is, I have to click on "Edit".
    When I looked at the Scenery.cfg file in the Roaming\Microsoft\FSX folder, I didn't see any of my sceneries, which already work from being automatically activated by the installation, listed.
    Are these actually in this or another folder? I would like to be able to see the titles in the scenery library.

    Thank you,
    Bob
  9. BobSmall

    BobSmall

    Joined:
    16/7/09
    Messages:
    8
    Country:
    australia
    [FSX] Adding scenery with Win7 64-bit

    I'm now writing my own "Scenery Library" tool specifically for FSX and Win7 64-bit.

    The only problem I am having is how to programatically locate the "scenery.cfg" file.

    On my install it is in C:\ProgramData\Microsoft\FSX but it would seem that it could also be in C:\Users\<username>\AppData\Roaming\Microsoft\FSX or even somewhere else.

    So, how does FSX find it?

    Is there a call to SHGetFolderPath()? If so, what is the CSLID?

    I note that some vendors (for example ORBX) do modify the scenery.cfg file as part of the installation, while others (eg Ants Aussie Airports) do not modify the file, and ask the user to add them using the scenery library
  10. hcornea

    hcornea Resource contributor

    Joined:
    20/4/07
    Messages:
    2,388
    Country:
    australia
    Did you try the steps outlined here?

    http://aussiex.org/forum/index.php?showtopic=4426

    Win7 is a bit obtuse when it comes to adding scenery entries.
  11. lordofwings

    lordofwings

    Joined:
    5/11/06
    Messages:
    559
    Country:
    panama
    Those steps work and are the only way to add scenery in Windows 7 64 bit. In fact I noticed that even FS2004 on Win7 64-bit has the same problem, I believe it has something to do with the Win7 video driver model. Unfortunately ACES nor MS are here to fix this annoying bug.
  12. mwgfx

    mwgfx

    Joined:
    11/5/10
    Messages:
    1
    Country:
    unitedkingdom
    csidl_common_appdata (should be all capitals but the forum converts it to lowercase)
  13. toprob

    toprob

    Joined:
    27/6/04
    Messages:
    631
    This is an old thread, I know, but recently active, so I'll carry on here.

    I am trying to code an automatic scenery.cfg entry, using NSIS, but I just need to check on the 'rules' of scenery.cfg.

    My understanding is that Area numbers need to be sequential, but Layer numbers needn't be?
  14. NoNewMessages

    NoNewMessages

    Joined:
    15/6/10
    Messages:
    107
    Country:
    unitedstates
    True. Area numbers are just the order that the entries have been added to the file. Layer numbers dictate priority of display and are just a field in the area number entry.

Share This Page