rpgtex/DND-5e-LaTeX-Template

DndMonsterBasics: custom entries

pepper-jk opened this issue · 5 comments

The stat blocks for the Mounts in Arcadia there is a Temporary Hit Points stat. I created some mounts for the new system, but was not able to add that stat, as it is currently unsupported.

feh_1413435_000001_19648

As this is not applicable to most monster stat blocks, I would suggest adding the option for custom entries in the section DndMonsterBasics instead of adding a Temporary HP stat.

In general, this project tries to support just the core books and does not generally open the flood gates to 3PP/homebrew. The easy way to implement this is to use the same or similar description environment called used by DndMonsterBasics. You can find it and examples in dndmonster.sty.

% A description variant used to list creature attributes.
\newlist {__dnd_monster_attributes} {description} {1}
\setlist [__dnd_monster_attributes]
  {
    before   = \color {titlered},
    font     = \DndFontStatBlockBody,
    labelsep = \l__dnd_space_dim,
    nosep,
  }

So you could use it yourself (EDIT: see revised version below)

\ExplSyntaxOn
      \begin {__dnd_monster_attributes}
        \item [\armorclassname] \l__armor_class_tl
        \item [Temporary Hit Points] 4 times the rider's character level or challenge rating
        \item [\hitpointsname]  \l__hit_points_tl
        \item [\speedname]      \l__speed_tl
      \end {__dnd_monster_attributes}
\ExplSyntaxOff

Or make a similar one of your own.

Can this be done in the .tex file or do I need to modify dndmonster.sty?

When I use it in the .tex file, it ignores spaces, when rendering and it does not make automatic line breaks for the temp HP.

Oops, you are right. \ExplSyntaxOn allows colons and underscores in names and requires spaces to be explicitly set with ~ or \ . It won't matter if it is in the preamble or a separate .sty file of your own. I would not recommend patching dndmonster.sty.

In your case, it might be better to use your own version for mounts. Place the following in the preamble or a separate .sty file. I am writing off the top of my head, so if it doesn't work out of the box, it should only need some minor tweeking

\ExplSyntaxOn
\newlist {CustomBasics} {description} {1}
\setlist [CustomBasics]
  {
    before   = \color {titlered},
    font     = \DndFontStatBlockBody,
    labelsep = \l__dnd_space_dim,
    nosep,
  }
\ExplSyntaxOff

It then can be used with your example:

      \begin {CustomBasics}
        \item[Armor Class] 11 + PB
        \item[Temporary Hit Points] 4 times the rider's character level or challenge rating
        \item[\hitpointsname]  \DndDice{3d8+3}
        \item[Speed] 40 ft.
      \end {CustomBasics}

I would not recommend patching dndmonster.sty.

Yes, I wouldn't have liked it either. I just wanted to make sure I did not make a mistake.

I am writing off the top of my head, so if it doesn't work out of the box, it should only need some minor tweeking

I'll try it again and let you know. Thanks for the help.

Adding the definition into the preamble worked like a charm.

I added \DndMonsterLine before and after the basic block though and used \armorclassname and \speedname like you did in your previous example:

\DndMonsterLine
\begin {CustomBasics}
  \item[\armorclassname] 9 + PB
  \item[Temporary Hit Points] 4 times the rider's character level or challenge rating
  \item[\hitpointsname]  \DndDice{2d10 + 4}
  \item[\speedname] 50 ft.
\end {CustomBasics}
\DndMonsterLine

Also the stats changed, as I did not copy the warhorse, but used the camel as a base in this example.

But as you can see, it looks just like the original formatting:
feh_1565550_000002_25805

Thanks again.