[XML + Python] Spawn A Civ 2020-26-05 2020-05-26

[XML + Python] Spawn A Civ

  1. Hutma
    I have only changed a little bit the code of this modcomp to make it work better. It was made by The_J and I thank him for his work on it.
    Here is a thread about the discussion regarding the changes:
    https://forums.civfanatics.com/forums/civ4-mod-components.180/

    Here is the original thread where The_J published this modcomp:
    https://forums.civfanatics.com/threads/simple-python-things.319186/

    Here is the original modcomp download page:
    https://forums.civfanatics.com/resources/xml-python-spawn-a-civ.13487/

    What follow is from this page:
    This modcomp allows you to spawn a civ dynamically triggered by technologies during the game :).

    Explanation from my readme:



    Credits:
    cool3a2 for the huns civ, and all the artists who have contributed to the civ:
    - Ekmek for the animated LH
    - Bakuel for unit art, GeoModder and Walter Hawkwood for citystyle
    - strategyonly for the files the flag and the button are based on and for finding that horrible bug
    - Aranor for the units the tarkan is based on
    - Terror666 for the units' sounds

    Also credits go to alpha civ for helping me with some basic and essential python things, and to EmperorFool and davidlallen, who have commented on my approaches for reading the xml file via python (which i didn't use in the end...).


    Re-uploaded on November, 15th, 3:20 forum time.
    - added the tag "SpawnChance" to the XML, so that there's also a chance, that the civ will not spawn. Every value between 0 and 100 is valid. Values under 0 will be treated like 0, values over 100 will be treated like 100.
    - added the tags "StartX" and "StartY" to the XML. You can add here a X and a Y coordinate for the first city (only for the first). Attention: There's no check for a valid position. If you want to place a city in water or on a peak, the function will do this. It's only checked, if there's already a city, then the new city will not be placed. Other units on the plot will be moved to a near plot.

    Re-uploaded on December, 5th, 4:54 PM forum time.
    - Added TechPercent tag, so that a civ can also start with less techs than the civ, which causes the spawn. Every value between 0 and 100 is valid. Values under 0 will be treated like 0, values over 100 will be treated like 100. For example, if you have 15 techs, and the TechPercent is 33, the new civ will 5 techs, which are at the most left in the tech tree. It will not happen, that a civ has an advanced tech, but not an basic tech.

    Re-Uploaded on April, 9th, 6:39 AM Forum time.
    - added 2 tags, to allow also to add a unit only to the capital and to define the number of it.

    Re-Uploaded on May, 5th, 2012, 11:18 AM Forum time.
    - Added tags to spawn a civ by year (incl. optional month) or turn.
    - Added a tag to spawn a civ only by tech research of the human player
    If you put multiple options in (tech, human tech, turn and year), then whatever happens first will trigger the civ.

    Here is my part ;)
    Re-Uploaded on May, 26th, 2020, 1:50 AM Forum time.
    - Changed a bit the code to make it work again.
    - Updated the readme.txt

    Credits:
    - Ifgr without whom I would have given up on reworking this mod.
    - The_J, creator of this modcomp.