GithubHelp home page GithubHelp logo

abhishekms1047 / cardizer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from snickercop/cardizer

0.0 1.0 0.0 1.35 MB

A collection of python scripts for creating images and xml for custom card games (for use in software such as Cockatrice)

License: GNU General Public License v3.0

Python 100.00%

cardizer's Introduction

Cardizer

Cardizer is a collection of python scripts for converting spreadsheets of card name/rulestext data into images, for prototyping in tabletop simulators such as Cockatrice.

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Prerequisites

You'll need PIL to run most of this.

pip install pil

Compatability with Pillow hasn't been tested yet, but try changing the import statement in card.py and give it a shot!

XML Input Format

This script is ideal for converting spreadsheets of information into card-sized images with text on them. You can use XML data if you have it already, but if you don't, follow this tutorial. (Haven't tried with Google Sheets or OpenOffice yet, but there should be a way...)

It doesn't matter what your xml looks like, as long as it conforms to the following criteria.

  1. The root tag has elements containing card data as direct children--one element per card (note that it doesn't matter what the tag is actually called)
  2. The card carrying elements each have one name element and one text element

The following is an example of valid cardizer input xml:

<card-data>
	<record>
		<name>Bear</name>
		<text>Creature, 2 mana, 2/2</text>
    <artist>John Doe</artist>
	</record>
	<record>
		<name>Orc</name>
		<text>Creature, 3 mana, 2/2</text>
    <artist>Jane Doe</artist>
	</record>
</card-data>

Note that the presence of the artist tag is not a problem--the system will just skip over it.

Execution

To make your cards (images), simply run python xmlparse.py [name of xml file]. A feature to make cards automatically go to a destination folder is in the works, but in the meantime you can either A) figure it out yourself or B) suffer from extreme folder clutter.

Cockatrizer Script

To reformat your xml for use in Cockatrice, run python cockatrize.py and enter the filename of the xml output by xmlparser (should be called [name of original xml file]-cardized.xml). Put the resulting xml in the custom sets folder, move your images to the custom images folder (both can be accessed in the "Card Database" dropdown), and restart Cockatrice.

cardizer's People

Contributors

snickercop avatar abhishekms1047 avatar zyjeng11 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.