Changes between Version 1 and Version 2 of Unit_Summary_Table_Generator


Ignore:
Timestamp:
2011-09-06 17:15:48 (21 months ago)
Author:
quantumstate
Comment:

Updated script to print entire page (rather than just the tables), added movement speed, ships, siege and female citizens

Legend:

Unmodified
Added
Removed
Modified
  • Unit_Summary_Table_Generator

    v1 v2  
    3838 
    3939def printUnit(fileName, basePath): 
    40         general = ["GenericName", "SpecificName", "Vision > Range", "Health > Max"] 
     40        general = ["GenericName", "SpecificName", "Vision > Range", "Health > Max", "WalkSpeed"] 
    4141        cost = ["Cost > * > food", "Cost > * > wood", "Cost > * > metal", "Cost > * > stone"] 
    4242        attackRanged = ["Attack > Ranged > Pierce", "Attack > Ranged > Hack", "Attack > Ranged > Crush", "Attack > Ranged > MaxRange"] 
     
    8282        return outString 
    8383 
     84header = "||'''Common Name'''||'''Specific Name'''||'''Line of Sight'''||'''Health'''||'''Speed'''||'''Cost'''||'''Attack'''||'''Armour'''||\n" 
     85 
    8486f = open('unit_summary_table', 'w') 
    8587 
    86 f.write("= Unit Summary Table =\n\n") 
     88f.write("= Unit Summary Table =\n\nA more detailed description of the units is avail on the [wiki:Manual_Units units page].\n\nThe following abbreviations are used in this page\n\n  F = [wiki:Manual_Terminology#Food food], W = [wiki:Manual_Terminology#Wood wood], M = [wiki:Manual_Terminology#Metal metal], S = stone, H = Hack, P = Pierce, C = Crush\n\n") 
    8789 
    8890f.write("== Hellene Units ==\n") 
    89 f.write("||'''Common Name'''||'''Specific Name'''||'''Line of Sight'''||'''Health'''||'''Cost'''||'''Attack'''||'''Armour'''||\n") 
     91f.write(header) 
    9092 
     93f.write(printUnit("units/hele_support_female_citizen.xml", basePath).encode("utf-8")+"\n") 
    9194f.write(printUnit("units/hele_infantry_spearman_a.xml", basePath).encode("utf-8")+"\n") 
    9295f.write(printUnit("units/hele_infantry_javelinist_a.xml", basePath).encode("utf-8")+"\n") 
     
    98101f.write(printUnit("units/hele_champion_ranged_polis.xml", basePath).encode("utf-8")+"\n") 
    99102f.write(printUnit("units/hele_champion_cavalry_mace.xml", basePath).encode("utf-8")+"\n") 
     103f.write(printUnit("units/hele_mechanical_siege_lithobolos.xml", basePath).encode("utf-8")+"\n") 
     104f.write(printUnit("units/hele_mechanical_siege_oxybeles.xml", basePath).encode("utf-8")+"\n") 
     105f.write(printUnit("units/hele_mechanical_siege_tower.xml", basePath).encode("utf-8")+"\n") 
     106f.write(printUnit("units/hele_ship_fishing.xml", basePath).encode("utf-8")+"\n") 
     107f.write(printUnit("units/hele_ship_merchant.xml", basePath).encode("utf-8")+"\n") 
     108f.write(printUnit("units/hele_ship_bireme.xml", basePath).encode("utf-8")+"\n") 
     109f.write(printUnit("units/hele_ship_trireme.xml", basePath).encode("utf-8")+"\n") 
    100110 
    101111f.write("\n== Carthaginian Units =="+"\n") 
    102 f.write("||'''Common Name'''||'''Specific Name'''||'''Line of Sight'''||'''Health'''||'''Cost'''||'''Attack'''||'''Armour'''||"+"\n") 
     112f.write(header) 
    103113 
     114f.write(printUnit("units/cart_support_female_citizen.xml", basePath).encode("utf-8")+"\n") 
    104115f.write(printUnit("units/cart_infantry_spearman_a.xml", basePath).encode("utf-8")+"\n") 
    105116f.write(printUnit("units/cart_infantry_swordsman_a.xml", basePath).encode("utf-8")+"\n") 
     
    112123f.write(printUnit("units/cart_champion_infantry.xml", basePath).encode("utf-8")+"\n") 
    113124f.write(printUnit("units/cart_champion_cavalry.xml", basePath).encode("utf-8")+"\n") 
     125f.write(printUnit("units/cart_ship_fishing.xml", basePath).encode("utf-8")+"\n") 
     126f.write(printUnit("units/cart_ship_merchant.xml", basePath).encode("utf-8")+"\n") 
     127f.write(printUnit("units/cart_ship_bireme.xml", basePath).encode("utf-8")+"\n") 
     128f.write(printUnit("units/cart_ship_trireme.xml", basePath).encode("utf-8")+"\n") 
     129f.write(printUnit("units/cart_ship_quinquereme.xml", basePath).encode("utf-8")+"\n") 
    114130 
    115131f.write("\n== Celtic Units =="+"\n") 
    116 f.write("||'''Common Name'''||'''Specific Name'''||'''Line of Sight'''||'''Health'''||'''Cost'''||'''Attack'''||'''Armour'''||"+"\n") 
     132f.write(header) 
    117133 
     134f.write(printUnit("units/celt_support_female_citizen.xml", basePath).encode("utf-8")+"\n") 
    118135f.write(printUnit("units/celt_infantry_spearman_a.xml", basePath).encode("utf-8")+"\n") 
    119136f.write(printUnit("units/celt_infantry_javelinist_a.xml", basePath).encode("utf-8")+"\n") 
     
    125142f.write(printUnit("units/celt_champion_cavalry_brit.xml", basePath).encode("utf-8")+"\n") 
    126143f.write(printUnit("units/celt_champion_cavalry_gaul.xml", basePath).encode("utf-8")+"\n") 
     144f.write(printUnit("units/celt_mechanical_siege_ram.xml", basePath).encode("utf-8")+"\n") 
     145f.write(printUnit("units/celt_ship_fishing.xml", basePath).encode("utf-8")+"\n") 
     146f.write(printUnit("units/celt_ship_merchant.xml", basePath).encode("utf-8")+"\n") 
     147f.write(printUnit("units/celt_ship_trireme.xml", basePath).encode("utf-8")+"\n") 
     148 
    127149 
    128150f.write("\n== Iberian Units =="+"\n") 
    129 f.write("||'''Common Name'''||'''Specific Name'''||'''Line of Sight'''||'''Health'''||'''Cost'''||'''Attack'''||'''Armour'''||"+"\n") 
     151f.write(header) 
    130152 
     153f.write(printUnit("units/iber_support_female_citizen.xml", basePath).encode("utf-8")+"\n") 
    131154f.write(printUnit("units/iber_infantry_spearman_a.xml", basePath).encode("utf-8")+"\n") 
    132155f.write(printUnit("units/iber_infantry_swordsman_a.xml", basePath).encode("utf-8")+"\n") 
     
    136159f.write(printUnit("units/iber_champion_infantry.xml", basePath).encode("utf-8")+"\n") 
    137160f.write(printUnit("units/iber_champion_cavalry.xml", basePath).encode("utf-8")+"\n") 
     161f.write(printUnit("units/iber_mechanical_siege_ram.xml", basePath).encode("utf-8")+"\n") 
     162f.write(printUnit("units/iber_ship_fishing.xml", basePath).encode("utf-8")+"\n") 
     163f.write(printUnit("units/iber_ship_merchant.xml", basePath).encode("utf-8")+"\n") 
     164 
     165f.write("\n\nThis page was generated using this [wiki:Unit_Summary_Table_Generator unit summary table generator script]."+"\n") 
    138166 
    139167}}}