1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Documentation (XML schema+code)

Discussion in 'Civ4Col - Medieval: Conquests' started by Nightinggale, Jun 11, 2015.

  1. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    We need to document what we are doing because no documentation might work for a single modder, but I can't remember what Kailric was thinking when he wrote the piece of code I'm looking at and Lib.Spi't don't know what I was thinking when I added a certain XML tag.

    I started some XML documentation on the wiki, but I don't think it works. I'm not updating it and the nobody else ever added anything to it. We need something else and I just came up with a new idea.

    I have been thinking of copying the concept Archid made for FTTW (link). He gave me a template for it (though he added the menu afterwards, that looks cool). I can write a perl script to generate html pages like that.

    Here is what I just came up with:
    1. I write a perl script to make an html page for each XML file present in the schema files.
    2. All the non-autogenerated text is read from txt files. Everybody should have write access to those files.
    3. Default values are read from the DLL source
    I will handle step 1 and 3 (though I don't know how to do 3 right now)

    Step 2 on the other hand is a different matter. It is a never ending task of adding text and we should all contribute to it. I think it should be a new git repository, which we all gain write access to. It can then have the DLL source as a submodule, meaning everybody can read from it, but only DLL modders can write to it (to reduce risk of code breaking mistakes).

    Here comes the most interesting thing about the whole idea (which is the current breakthrough).
    If a string is missing, the script will add blue text (or some other color with this special meaning). The text it adds will be some autogenerated tag name unique to the issue at hand. Say it handles unit info and then it misses text for bFound, then it generates the string UnitInfo_bFound.

    In the txt files (any of them, though unit.txt makes sense), we can add the line
    Code:
    UnitInfo_bFound = The unit can found new cities
    The next time the script is executed, it detects that the line is present in one of the files and inserts that line instead of the name of the string. This way we can slowly, yet steadily add all the strings and the people adding the strings don't have to be master programmers. Also the time spend looking up info for the html based system is close to none. Figuring out what a tag does is a different story, but we can't really avoid that.

    I think this is the best approach we can use to documenting the XML interface.
     

Share This Page