dungeon-sheets
dungeon-sheets copied to clipboard
Assorted changes and a couple of fixes to the fancy sheets
Hi, I just found dungeon-sheets and I like it very much! I had been writing my character sheets by hand in latex using MSavage's style, but that isn't very automated.
I hope to contribute a little bit with a couple of ideas that are focused on the features pages. I think basically the patches speak for themselves, and for now I'd mainly like to get some reactions as to whether these patches are actually wanted, and perhaps what other / further directions to take with this.
I can also supply an example of the type of layout that I'm trying to achieve. I'm keeping a small wishlist of my own, with items like:
- Ranger: Add feature options for Favored Enemy and Natural Explorer.
- XP: Add Milestone option.
- Allow handwritten boxes for rations, torches, arrows, bullets.
- Add versatile damage automatically
- Darkvision is always listed as source: race, but it can also be given by a (sub)class
I should add that I can code only a little bit, but I tested the changes on all the example sheets.
Anyway, I really hope to hear whether this type of work is appreciated!
Hi, I just found dungeon-sheets and I like it very much! I had been writing my character sheets by hand in latex using MSavage's style, but that isn't very automated.
Hi there, @PJBrs ! About this part, did you try using MSavage from Dungeonsheets? I've contributed to this part, let me know of any issues I can help.
Regards, Mauricio
Hi @bw-mutley!
Thanks! I think most of the more structural changes apply to the features pages, hardly any to MSavaga's style. I've tested both though.
If you have any suggestions though for continuing this PR, please let me know. In the meantime, I've added one more substantial change that renders the monster blocks more in keeping with the RPGTex D&D style. Problem is, my repo now is one long list of assorted changes, including spelling fixes, small additions, small enhancements and substantial formatting changes that affect how everything looks...
I'm force-updating the PR now, and then I'll see whether I can sort it better. In the meantime, any suggestion at all would be appreciated!
So, I sorted all my patches. The first five patches are trivial spelling and whitespace fixes. The next four add some equipment and offer very small corrections:
- Ice Knife: put the material components in the right place
- Armor: Add shield weight
- Equipment: Add plural of book
- Add potion of greater healing to equipment catalogue
The "Fix" pdfbookmarks patch does not fully work, but as far as I can tell, it's less error-prone than the current behaviour.
The next five patches all represent small enhancements:
- Start page number of feature pages at 4
- Distinguish between racial and class darkvision
- Proficiencies: Harmonize capitalization and punction in MSavage.tex
- Add 3rd and 5th level spells for Drow Magic feat
- Add spellcasting details to latex spellbook form
All the remaining patches offer rather substantial changes that I personally like, and I hope for some feedback on them.
These two patches sort spells by name and level and add headings for each spell level in the features pages:
- Sort spells by name and level
- Add subheaders for spell level in the pdf
These two patches sort feats by origin and level (character feats, class feats, background feats and racial feats) and add associated headers in the feature pages:
- List feats in the order that they're added
- Separate headers for Character, Class, Racial and Background Feats
I tried to write these trying not to be invasive and ended up doing quite a lot of pattern matching in latex. Could have done them simpler.
The final two patches all concern relatively minor aesthetic changes that I liked:
- MSavagetemplate: set XP to milestone if -1 <-- This enables users to have Milestone XP on their character sheet by entering -1 XP in their character .py-file.
- Use all RPGtex options for monster formatting <-- This is actually quite substantial and tries to make monster box formatting to be more true to RPG-tex.
Basically, I'm looking for comments on all of these, regarding:
- Which of these changes, if any, are wanted at all?
- For those changes that are wanted, how should they be implemented?
- How should I go about these patches anyway?
Problem is, my repo now is one long list of assorted changes, including spelling fixes, small additions, small enhancements and substantial formatting changes that affect how everything looks...
exactly how my local files are at the moment. I've made several additions and corrections too, but can't keep track of everything in commits like you did - seens like I have a lot to learn on how to keep with people here. To properly contribute again, I will - at some point - have to dowload the master branch again. I've seen many issues in my local files which were probably fixed.
Hi, @PJBrs.
Apologies for the slow response. My day job got unexpectedly chaotic. Thank you for all the hard work and for organizing these commit in a useful way. I will take a closer look when things calm down a little bit and I get my feet back underneath me.
Hi @canismarko , take your time! By now it should be clear that I couldn't help myself anyway :-)
I think, given all patches I now added, the majority should be sufficiently palatable, but others also represent design choices that you might disagree with, and then there's the matter of whether my implementations are agreeable, aside from their effects.
I hope things will calm down soon!
@canismarko I noticed you triggered some tests. The latex ones fail because of the changes I made. The below patch adapts the tests to my other patches (and makes them pass). I'll look into the other failing tests another time.
--- a/tests/test_make_sheets.py
+++ b/tests/test_make_sheets.py
@@ -235,7 +235,7 @@ class TexCreatorTestCase(unittest.TestCase):
def test_create_features_tex(self):
char = self.new_character()
tex = make_sheets.create_features_content(character=char, content_suffix="tex")
- self.assertIn(r"\section*{Features}", tex)
+ self.assertIn(r"\section*{Class Features}", tex)
self.assertIn(r"\subsection*{Martial Arts}", tex)
def test_create_magic_items_tex(self):
@@ -248,7 +248,8 @@ class TexCreatorTestCase(unittest.TestCase):
char = self.new_character()
tex = make_sheets.create_spellbook_content(character=char, content_suffix="tex")
self.assertIn(r"\section*{Spells}", tex)
- self.assertIn(r"\section*{Invisibility}", tex)
+ self.assertIn(r"\subsection*{2nd-Level Spells}", tex)
+ self.assertIn(r"\subsubsection*{Invisibility}", tex)
def test_create_infusions_tex(self):
char = self.new_character()
I added the test I posted previously in the comments. Also, I reordered the new patches a bit to leave the DND-monster formatting at the end. I tested all monsters I could, made many formatting fixes as well, only remaining thing is to add bulleted lists.
And I wrote one more patch to enable DND-tables throughout, after I conjured up a regex that translated docutil's supertabular table header to a dndtable header. Next step is probably to see if I can improve any table I find.
Rewrote the monster formatting patch. I think it now is on par with, or better than regular latex.
I don't think I really have anything else to add anymore.
I didn't test all tables, but, in any case, the dndtables are less wide than the regular ones, so any text overflow will have been present anyway, and might be prevented now.
If necessary, I can upload some example character sheets... Would that help?
I did notice some potential enhancements, such as putting lair actions of dragons in a separate heading, just like aboleth, as well as formatting the breath weapons a bit more (\emph{breath weapon}). All that would be rather easy.
And one bug, perhaps, I can't seem to add certain monsters as companions, e.g.:
UserWarning: Companion 'Will-o'-Wisp' not found. Please add it to monsters.py
EDIT
Let's let this sit here for a while, while I test more... Just force-updated because I clobbered one of my previous fixes. ;'-)
EDIT 2 - 13 feb
Fixed a small bug in the dndtable header regex.
@canismarko @bw-mutley I think I really have no other patches to add right now. I have put a character sheet online to demonstrate the effects of all the patches in this PR together, note the feat and spell headings, the dndtables with text wrapping in cells, and the monster box formatting (I've given this character, a druid, a sizeable amount of companions).
@canismarko How might I make this PR easier to review? I can, for instance, make separate PRs for different groups of patches, for instance as follows:
- Spelling fixes / bug fixes
- MSavage style sheet enhancements
- Other small enhancements
- Monster formatting
- DNDtables
- Spellbook headings per spell level
- Separated headings for character, class, racial, and background feats
@bw-mutley Perhaps you'd be interested to take a look at the various patches that deal specifically with the MSavage style sheet?
Finally, I tried to run the dungeonsheets tests, which complain about some missing html pages, but the latex tests complete fine:
$ pytest3 tests
============================================================================================== test session starts ==============================================================================================
platform linux -- Python 3.9.16, pytest-7.2.1, pluggy-1.0.0
rootdir: /home/pj/Src/dungeon-sheets/dungeon-sheets
plugins: cov-3.0.0
collected 125 items
tests/test_character.py ........................ [ 19%]
tests/test_content_registry.py ..... [ 23%]
tests/test_dice.py ...... [ 28%]
tests/test_encounter.py .. [ 29%]
tests/test_epub.py ... [ 32%]
tests/test_equipment_reader.py . [ 32%]
tests/test_features.py ....... [ 38%]
tests/test_html.py .s......... [ 47%]
tests/test_latex.py .s......... [ 56%]
tests/test_magic_items.py .. [ 57%]
tests/test_make_sheets.py ...FFF.FFF........... [ 74%]
tests/test_monsters.py .... [ 77%]
tests/test_multiclass.py .... [ 80%]
tests/test_random_tables.py .. [ 82%]
tests/test_readers.py ......... [ 89%]
tests/test_spells.py .... [ 92%]
tests/test_stats.py ...... [ 97%]
tests/test_weapon.py ... [100%]
[snip!]
============================================================================================ short test summary info ============================================================================================
FAILED tests/test_make_sheets.py::EpubOutputTestCase::test_character_file_created - jinja2.exceptions.TemplateNotFound: preamble.html
FAILED tests/test_make_sheets.py::EpubOutputTestCase::test_character_html_content - jinja2.exceptions.TemplateNotFound: preamble.html
FAILED tests/test_make_sheets.py::EpubOutputTestCase::test_gm_file_created - jinja2.exceptions.TemplateNotFound: preamble.html
FAILED tests/test_make_sheets.py::HtmlCreatorTestCase::test_create_extra_gm_content - jinja2.exceptions.TemplateNotFound: extra_gm_content.html
FAILED tests/test_make_sheets.py::HtmlCreatorTestCase::test_create_monsters_html - jinja2.exceptions.TemplateNotFound: monsters_template.html
FAILED tests/test_make_sheets.py::HtmlCreatorTestCase::test_create_party_summary_html - jinja2.exceptions.TemplateNotFound: party_summary_template.html
============================================================================= 6 failed, 117 passed, 2 skipped, 5 warnings in 38.05s =============================================================================
Hi there, @PJBrs , sorry for the late reply.
Perhaps you'd be interested to take a look at the various patches that deal specifically with the MSavage style sheet?
Thanks for the contribution. I will fork your branch and try to do it this week.
@bw-mutley Great!
Let me know if you need the MSavage style sheet changes in a separate branch...
@bw-mutley Great!
Let me know if you need the MSavage style sheet changes in a separate branch...
Hi there, PJ! Only now I could have some spare time to work on it. I've made a small comment about the sorcerer -> sorceror change, please take a look. About the MSavagesheet: I will need some more time since I've changed my PC and ended missing some tex files needed.
Hi @bw-mutley I thought sorceror was the correct spelling, but indeed, not only the PHB but also standard dictionaries prefer sorcer_er_. I wonder whether we should revert or reverse that spelling patch ;)
Hi @bw-mutley I thought sorceror was the correct spelling, but indeed, not only the PHB but also standard dictionaries prefer sorcer_er_. I wonder whether we should revert or reverse that spelling patch ;)
I suppose it is up to @canismarko to decide. But my suggestion is to push a PR fixing all 'sorceror' ocurrences into 'sorcerer'.
I stashed that sorcer_er_ spelling fix for now.
Unfortunately, I had some uncommitted local changes that have now been added to this PR, one to make more tables nice and beautiful, and a compile fix for Monster Slayer Ranger subclass... Sorry!
@canismarko Like I said, let me know if you want me to separate this PR into smaller, topically consistent PRs...
I noticed there has been some activity in this repo again, and I bumped into some small bits while making a new character, and I decided to reorganise this pull request. Hopefully, the different patches, and how they fit together, make more sense now.
Everything after Latex feature pages is potentially rather invasive. I hope at least some of these are ripe for cherry-picking.
Sorry I haven't gotten to this in so long. It is a lot to look through all at once. Perhaps it would be better in a few different PRs? The spelling mistakes and stuff like that I can easily take. New content is great too.
I noticed there's a couple commits that change the order that features and spells. Maybe this should be a command line option? I can see why someone might want spells in level order, but I also can see why someone might want them in alpha order. I originally put them in alpha order because that's how I look them up when I want to know what they do.
Would it still be useful to you if it were --spell-order=level
and --feature-order=natural
or something like that?
I can make a couple of separate pull requests, starting with three relatively un-invasive ones. A first one could simply be the spelling fixes and the four obvious bug fixes:
- Features: Sorceror: Fix "Favored by the Gods
- Features: Ranger: Fix HuntersSense feat, fixes Monster Slayer subclass compile
- Spells: Ice Knife: put the material components in the right place
- Examples: Paladin: great-weapon master --> great-weapon fighting
- Assorted spelling and whitespace fixes
I could make a second one with miscellaneous small additions:
- Equipment: Add potion of greater healing
- Equipment: Add plural of book
- Armor: Add shield weight
And I could make a third one that only does some text formatting changes:
- Formatting: Spells: Prestidigitation: Fix bullet list
- Formatting: Monsters: Assorted formatting fixes
- Formatting: Beautify tables
It would seem to me that these are the changes that ought to be relatively trivial to review :) I'd like to see that you make of these patches first, and then I can see how to submit the more invasive enhancements. To be sure, I can try to make that commandline option! And I'm not entirely happy with how I implemented ordering feats anyway.
So, how does that sound?
That sounds wonderful, thank you for your patience. It will be great to finally get this all merged in.
Hi @canismarko - I've just created three separate pull requests. They all apply to master, so I don't think it matters at all in which order you pull them. They are 11 patches in total. Hope this helps!
Hi @canismarko , I rebased my entire local tree and force pushed it over here. Incidentally, I also noticed that there have been quite some updates in MSavage's dndtemplate itself, which required some additional work on our side (see https://github.com/canismarko/dungeon-sheets/pull/147/commits/e2ba58eb9bb5b25bb75c9bc311e942952e1bce5a).
I'd like to propose the following three steps:
- See what you make of my open pull request here - https://github.com/canismarko/dungeon-sheets/pull/155
- Open a bug report about image positioning in the MSavage latex template
- Open an additional pull request with the two patches that enhance how features are applied)
- Open an additional pull request for the now seven patches that touch upon the MSavage latex template
How does that sound?
@bw-mutley, if possible, I'd really like you to check those seven patches for the MSavage latex template. If you need it, I have a local ~/texmf tree that includes the dndtemplate and the rpgtex latex format; I could package that for you, if needs be.
@bw-mutley, if possible, I'd really like you to check those seven patches for the MSavage latex template. If you need it, I have a local ~/texmf tree that includes the dndtemplate and the rpgtex latex format; I could package that for you, if needs be.
Hi there, @PJBrs ! Thanks for the awesome contribution. I've already read that and approve both the idea and implementation, just didn't test it yet. If you already tested, I am ok with that. If you want me to test, I will ask for you to wait until the weekend.
Hi @bw-mutley that's nice to hear! I wouldn't like to clobber this repo with pull requests, but I did prepare a separate branch with only MSavage latex template fixes. And it would be nice, I think, for you to test it a little bit. I read in my other pulll request that you had some trouble with git. I suggest some, if not all, of the following:
git clone https://github.com/canismarko/dungeon-sheets/
cd dungeon-sheets/
git remote add pjbrs https://github.com/PJBrs/dungeon-sheets
git fetch pjbrs
git checkout -B pjbrs/MSavage-latex-template
This will get you a clean repo with only my changes to MSavage's latex template. With testing, it might be easier for @canismarko to decide to pull these changes. I've made a character sheet that displays the working of the seven patches that specifically affect MSavage's latex template. Compare pictures to see differences.
Character without MSavage latex template patches:
Character with MSavage latex template patches:
Here's the source (remove .txt from the filename): llaewin.py.txt
hi there, PJ! Thanks for your instructions, I've followed and proceeded with tests here. But I think I'm still missing something, because I wasn't able to reproduce the sheets you've posted. Most noticiable difference is the attributes fields, which is shown with the bonuses in the larger space in your example but not in mine. Checking further, I found the template in my local files are not the same as you have in your branch here:
https://github.com/PJBrs/dungeon-sheets/blob/MSavage-latex-template/dungeonsheets/forms/MSavage_template.tex
Could you help me to figure what is wrong in our process? BTW, reading the MSavage_template.tex above I would guess it wouldn't reproduce the ones you have posted.
Hi @bw-mutley, thanks for your tests!
I think two things. First, are you on the latest version of MSavage's dndtemplate? Some of my changes are specifically focused on dealing with recent changes on his side, and they also switched the locations of the attributes and the modifiers.
With regard to my instructions, I think I made a small mistake in the last command. Best to start over as follows:
git clone https://github.com/canismarko/dungeon-sheets/
cd dungeon-sheets/
git remote add pjbrs https://github.com/PJBrs/dungeon-sheets
git fetch pjbrs
git checkout pjbrs/MSavage-latex-template
Verify with
git branch
or
git log
The last commit you should see is MSavage latex template: set XP to milestone if -1
If all else fails, I can send you a tarball with that branch, let me know.
P.S., My patches also touch other files than MSavage_template.tex .
P.S., My patches also touch other files than MSavage_template.tex .
Indeed, I should have suspected this to be the case after reading your PR in his repo! I will update with the results as soon as I can test it properly.
@bw-mutley Small heads up: I needed to add one more patch. I just noticed that MSavage's dndtemplate now treats proficiencies a bit differently, which caused the proficiency markers to disappear. My last patch makes them appear again.
You can get that patch with:
git fetch pjbrs
git checkout pjbrs/MSavage-latex-template
But while doing this...
- I found a better way that actually makes full use of half-proficiency and full-proficiency markers.
- I noticed that the remarkable athlete feat also, more or less, results in half proficiency, but then I noticed that it actually isn't added to initiative, whereas the feat text suggests that you can add half your proficiency bonus to any check that includes dex, str, or wis, which would include initiative as well, since that is a dex check.
@canismarko, should I open a bug report that remarkable athlete is only implemented for skill checks, but not for initiative?
So, I'm not pushing that better option now. Or maybe I should. Grmm... OK, decided to push it. Last patch is now MSavage latex template: Make full use of proficiency markers.
@bw-mutley ... and I found one final formatting issue in the MSavage latex sheet, so please do one more
git fetch pjbrs
git checkout pjbrs/MSavage-latex-template
Last patch now is MSavage latex template: Prevent spurious newlines.
I promise that I won't add anything else to my MSavage-latex-template branch. It got a little out of hand after I discovered how much MSavage's dndtemplate had progressed, and the extent to which dungeonsheets hadn't kept up with that.
In any case, that branch now is 10 patches ahead of canismarko/dungeon-sheets:master, and only touches code that is used in the MSavage latex template. As a check, I just built all examples against it, everything compiles, and also looks fabulous ;-)
Plan: @bw-mutley to test my MSavage-latex-template branch, and if he approves, I'm turning it into a pull request.
P.S., I found one remaining tiny issue, but it can wait after testing. It's too small to clobber things further.
And a picture of the final result! (This is what testing should produce now.)
Hi there, PJ! I will try to check this up carefully in the weekend.
===UPDATE=== Hi there, @PJBrs ! I've downloaded the latest MSavage repository, including your latest patch, and unfortunately, I couldn't make it work right now as is. Reason is, since my last instalation before this one, I've made some changes in the package and in my system as well, so I will have to build my own fix to make it run locally and I am affraid it will take longer than I thought.
I really want to come back and contribute to this project, but I won't be able to actually do so until next month and I don't want to hinder your contributions neither. So, I suggest you and @canismarko move on without my check, at least for now.