Tabulate.py

From OHRRPGCE-Wiki
Jump to: navigation, search

tabulate.py is a tool based on the nohrio library that can import and export items, heroes, enemies, attacks and textboxes as crude .cvs (comma-separated value) spreadsheet files. This is for advanced users; the output is not pretty. It can currently be used with Alectormancy and post-Alectormancy nightly builds up to Jan 2013, but lacks the ability to import hero data in RPGs edited with nightlies from 2013 onwards.

Direct requests for help at TMC.

Download[edit]

tabulate.py is available in the 3rdparty/ folder of the rpgbatch fork of nohrio. (It will require a rewrite to switch to mainline nohrio).

[1]

Start by either installing nohrio from that git fork ("python setup.py install") or copying tabulate.py to the root of the directory next to the nohrio/ folder.

Windows build:

http://tmc.castleparadox.com/ohr/tabulate.zip (4.1 MB)

(Out of date: compatible with Alectormancy but not recent nightlies.)

Readme Contents[edit]

A crude tool to import/export certain OHRRPGCE data lumps from/to csv files/spreadsheets. Tested with Libre Office
and KSpreadsheet.
Public Domain license.

Instructions:

* Upgrade your RPG file using Custom. Alectormancy and nightlies up to Jan 2013 are currently supported.
* Backup your game! This is not exactly thoroughly tested.
* Unlump your RPG file (using the unlump tool, Custom, or even nohrio!)
* Optionally edit the script to change the exported data fields
* Export data, eg.
   tabulate.py --type items --export vikings.rpgdir items.csv
* Import the csv file into your favourite spreadsheet editor (you could import it directly into a different RPG file,
  but it would be so much simpler to just copy the lump)

You now have a spreadsheet with one row per record, column names in the first row, and one column per data field. You
can delete columns, rearrange columns, add new columns with blank headers, and change the number of rows. When
importing, the script ignores columns with blank names, and leaves unchanged any data fields for which the column is
missing. Column names must be unchanged to be recognised, but they can be in any order.

* Read the relevant file format documentation page on the wiki:

Items: http://rpg.hamsterrepublic.com/ohrrpgce/ITM
Heroes: http://rpg.hamsterrepublic.com/ohrrpgce/DT0
Enemies: http://rpg.hamsterrepublic.com/ohrrpgce/DT1
Attacks: http://rpg.hamsterrepublic.com/ohrrpgce/DT6
Textboxes: http://rpg.hamsterrepublic.com/ohrrpgce/SAY

Importing hero data is not supported in nightlies since December 21, 2012. (If you really wanted to, you would have to
delete the heroes.reld lump.)

You'll need these to make sense of the contents of each cell. The data fields will be in the same order in the
spreadsheet and on the wiki. For example, for items, "oobuse" is "When used out of battle", and a value of 6 in a cell
in this column means attack 5. If you use a string which is longer than supported by the field, then it'll silently be
cut short while importing. You'll always see fields for 64 elements, regardless of the number actually enabled in the
game. Bitset fields are exported as a single column. Each bitfield cell contains the numbers of the set bits (ignoring
obsolete or unused bits) comma separated, or in some cases names of the set bits instead. Examples of bit names are
'rename on add', 'Bob' (the name of a hero) or 'hero 3' (if the hero name is blank).

* Make changes
* Export the spreadsheet as a csv file. Make sure it's in the same format as originally exported: comma delimiters,
  quotes around strings if required.
* Before importing (into any unlumped RPG), make sure it has been upgraded to the latest file format, and there are at
  least as many records (items, heroes, etc) already in the game as there are in the spreadsheet: nohrio can not create
   new records.


See Also[edit]