Spellbook Generator Prototype

Creating game materials? Monsters, spells, classes, adventures? This is the place!
User avatar
borgar
Posts: 145
Joined: Thu Apr 20, 2017 4:58 am
Location: Oslo, Norway

Re: Spellbook Generator Prototype

Post by borgar »

I was actually answering (late) to Pholus original entry.
I am very sorry to use such odd programming choices, but you go with what you know
Python has an actually syntax, not sure what I'd call what perl has.
User avatar
borgar
Posts: 145
Joined: Thu Apr 20, 2017 4:58 am
Location: Oslo, Norway

Re: Spellbook Generator Prototype

Post by borgar »

Couldn't resists playing around with this so here is an example of a simple template based conversion. I stripped the spell info for a single spell (Magic Missile) into a YAML file and created a "text" and "latex" converter templates.

The included script (spell_to_text.pl) uses the text template (spell_txt.templ) so you'll have to edit the script to use (spell_latex.tmpl).

Though I assume you already have a script to create the latex files already and haven't manually edited the 926 files.

I remember doing something similar close to 25 years ago (back when I played 1/2 ed AD&D). The scripting went fine but I could never force myself to type all the spell information into data files.

The perl script requires YAML and Template modules (from CPAN).
Attachments
yaml_template.zip
(1.77 KiB) Downloaded 253 times
Pholus
Posts: 33
Joined: Tue Mar 06, 2018 8:31 pm

Re: Spellbook Generator Prototype

Post by Pholus »

This looks intriguing! When I have a bit more time next week I'll check it out.

The beauty of Basic Fantasy is that you don't have to type all the spells in -- they're already in editable documents! So it was pretty easy making all the little latex mini pages. My plan was to try to hit on something that could run platform agnostically and then reformat my latex spells into whatever the end format was.

But being able to hand my non-expert players a short sheet or pack of cards with their powers enumerated and described exactly? Priceless.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 61 guests