Jump to content

Search the Community

Showing results for tags 'Templates'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome
    • Announcements / News
    • Introductions & Off-Topic Discussion
    • Help & Feedback
  • 0 A.D.
    • General Discussion
    • Gameplay Discussion
    • Game Development & Technical Discussion
    • Art Development
    • Game Modification
    • Project Governance
    • Testing

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







First Name

Last Name

Skype ID

Found 3 results

  1. Hi people. Is it possible to add two upgrades for a building (tower in this case)? I tried the following: <Upgrade> <Tower> <Entity>structures/{civ}_stone_tower</Entity> <Tooltip></Tooltip> <Cost> <wood>50</wood> <stone>50</stone> </Cost> <Time>10</Time> </Tower> </Upgrade> <Upgrade> <Tower> <Entity>structures/{civ}_wooden_tower</Entity> <Tooltip></Tooltip> <Cost> <wood>50</wood> <stone>50</stone> </Cost> <Time>10</Time> </Tower> </Upgrade> I didn't work, only one appears. Am I doing something wrong?
  2. I was looking for a simple method to query all templates and found jsawk quite capable. It is a command line tool and works on JSON files. I've exported the templates (6MB) and made a smaller file (10kB) to test it. Jsawk needs SpiderMonkey's jsshell, you'll get it here at Mozilla, or may have it somewhere in the build folder after compiling. For simplicity I've put jsshell, jsawk and the templates JSON in the same folder. > ./jsawk -j ./js -i templates.A18.json.small -a 'return this.length'10-j tells jsawk where jsshell is and -i the input file, the command returns the number of templates in the small file. Each template has an attribute 'name' which is the name of the template. > ./jsawk -j ./js -i templates.A18.json.small 'return this.name' -a 'return this.join("\n")'structures/athen_fortressskirmish/structures/iber_wall_longunits/mace_mechanical_siege_lithobolos_packedunits/gaul_support_female_citizenunits/pers_ship_biremestructures/iber_wall_shortunits/ptol_ship_quinqueremeunits/gaul_cavalry_swordsman_eunits/athen_hero_periclesunits/sele_ship_biremeIn 'return this.name' this refers to the template, which is a JS object. In the command -a, this refers to the full result set. One can run any JS expression in these commands and use the shell for sorting. Of course you can pipe a result like this into a csv file and continue with Excel or Calc. > ./jsawk -j ./js -i templates.A18.json.small 'return [this.Identity.Civ, this.name, this.Armour.Crush]' -a 'return this.join("\n")' | sortathen,structures/athen_fortress,2athen,units/athen_hero_pericles,25gaul,units/gaul_cavalry_swordsman_e,6gaul,units/gaul_support_female_citizen,15iber,structures/iber_wall_short,3.0mace,units/mace_mechanical_siege_lithobolos_packed,1pers,units/pers_ship_bireme,5ptol,units/ptol_ship_quinquereme,5sele,units/sele_ship_bireme,5skirm,skirmish/structures/iber_wall_long,3.0Jsawk supports JSONquery to filter results: > ./jsawk -j ./js -i templates.A18.json.small -q '.*[?Armour.Crush > 10]' 'return this.name'["units/gaul_support_female_citizen","units/athen_hero_pericles"]At first the syntax appears a bit, well, awkward, but it supports full automation. All the other tools I've checked are somewhat limited. Have fun!
  3. Currently, unit template files have a translatable field called Tooltip. This field, as far as I’ve seen, may contain the following information: • Unit classes (recently prefixed by ‘Classes:’). • Units that this unit counters (prefixed by ‘Counters:’). • Units that counter this unit (prefixed by ‘Countered by:’). • Unit description. In the XML, these are differenciated by line breaks. What would you think about providing separated fields for each one of these? • DisplayClasses (as opposed to the class names used in the game logic) • Counters • CounteredBy • Description Pros would be: • Easier to keep consistency between tooltips. • Ability to use a different font or text style on different elements. • Ability to reorder the elements in the interface easily, without changing all XML files, nor affecting translations. • Ability to show a different combination of these bits of information in different contexts. • Easier for translator, as they would only need to translate the "Prefix: <data>" strings once, and the rest of the strings will have a decreased size. And I honestly cannot think of cons here. Also, if you agree, should I let you do this yourselves in master, or should I do this myself in my i18n branch? Or should I maybe write a patch against master only for this?
  • Create New...