Difference between revisions of "Ability/Script"

From Wildermyth Wiki
m
Line 10: Line 10:


aspect_directory = 'assets/data/aspects'
aspect_directory = 'assets/data/aspects'
theme_directory = 'assets/data/themes'
text_file = 'assets/text/aspects/aspects.properties'
text_file = 'assets/text/aspects/aspects.properties'


Line 79: Line 78:
for deck in decks:
for deck in decks:
   decks[deck] = sorted(decks[deck], key=lambda d: aspectNames[d['id']])  
   decks[deck] = sorted(decks[deck], key=lambda d: aspectNames[d['id']])  
 
 
# make dictionary of theme links
'''
themes = {}
themefiles = glob(theme_directory + '/*')
for file in themefiles:
  with open(file) as f:
    data = json.load(f)
    theme = data['id']
    for piece in data['pieces']:
      'themePiece_' + theme
     
    for entry in data:
      for deck in decks:
        if entry.get('info', {}).get('abilityDeckUsage') == deck:
          decks[deck] += [entry]
'''
# wiki blurb for each deck
# wiki blurb for each deck



Revision as of 08:34, 5 March 2022

This is a Python script to generate the Ability tables. Copy the code in the box below into a text file named abilityTable.py (or whatever you want) inside the Wildermyth directory. Then run it by calling python abilityTable.py from the command line. It will create a text file named abilityTable.txt with the appropriate wiki-formatted content.