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

help - saving to xml

Discussion in 'Tools programming' started by VADS, 8/1/07.

  1. VADS

    VADS

    Joined:
    12/12/06
    Messages:
    177
    Country:
    southafrica
    need urgent help

    1. how does a tool save data to the xml file eg. if i have a menu item adding code for a helipad how is this data transfered to the xml file?
    2. is there any source code that one can look at to get ideas on how to make the elements such as the editing window and code
    i'm a non programmer learning to program and tend to teach myself most that i know, further assitance through examples or in forum help would be greately appreciated as im intending at through learning to code to produce a clone of afcad yet with greater features

    planned features

    save project to xml
    compile xml direct within program
    import bgl files
    add & Modify AI traffic (sea and air)
    add & modify Road Traffic - once info can be found or is released
    add living objects

    add objects and airport parts via graphical window
    directly add 3dmax/gmax created objects into editing window - if maxscript would allow this to be a possiblity
    loading of google earth .kml files for adding objects (should load .kml then enter lon/lat data directly into xml file )

    many more features could be looked at if i can manage to get this right
    regards
    Vads
    Virtual Aerospace Design SA
  2. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    23,295
    Country:
    wales
    Well I guess everyone does it the same way I do. Each scenery element is a class in programming terms. So a Helipad is represented by a single class. The properties (things which describe the object) are those needed to describe it such as latitude, longitude, altitude and so on. There is a method (sub routine) which uses a series of commmands to turn those properties into a piece of xml. This is usually stored as a string. When all the xml string bits are collected together in a file (and it is checked to make sure that it is valid) it is then passed to BGLComp which makes the Bgl.

    If you are looking to create program of a type like AFCAd then be aware that it is a very complex undertaking if you are new to programming, Especially if you plan to get information from the default files in the same way that AFCAD does.

    You might want to look at my scenery design engine. The source code is not available but it is a library which can be used with other prorgams. One use for it is to form the basis for an AFCAd type program.

Share This Page