javalent / fantasy-statblocks

Create Dungeons and Dragons style statblocks for Obsidian.md
MIT License
360 stars 69 forks source link

Feature Request: Pathfinder 1e Layout and Bestiary Import #55

Closed monyarm closed 1 year ago

monyarm commented 2 years ago

For Bestiary Importing, the FoundryVTT Json format wouldn't be a bad idea https://lavaeolous.github.io/Foundry-PF1-StatBlock-Converter/index.html

While for the layout, aonprd is the official online source for pathfinder rules, so you can go with that. https://aonprd.com/MonsterDisplay.aspx?ItemName=Flumph

kagrith commented 2 years ago

Bump! PFSRD should easily be imported.

valentine195 commented 2 years ago

I'm open to adding additional bundled layouts if someone were to create one and create a pull request :)

kagrith commented 2 years ago

I'd love to contribute but I haven't written code in a real hot minute.

What all would you need?

On Thu., Jun. 9, 2022, 19:58 Jeremy Valentine, @.***> wrote:

I'm open to adding additional bundled layouts if someone were to create one and create a pull request :)

— Reply to this email directly, view it on GitHub https://github.com/valentine195/obsidian-5e-statblocks/issues/55#issuecomment-1151766077, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACIBQWFSXRP6MMMVGMOQGQDVOKHLJANCNFSM5VZGN2QA . You are receiving this because you commented.Message ID: @.***>

sigrunixia commented 1 year ago

@kagrith @monyarm This is a very belated reply, My apologies.

To answer that question, the information for the pathfinder monsters would need to be in .json format. It would also need to be pre-keyed, hp: 20 (2d12) is already filled out.

You can use this file on the 5e-SRD as a guide.

Is this a project either one of you are willing to take on?

djbrock commented 1 year ago

I've been playing with this recently. I've used this GitHub to get a local copy of Archives of Nethys https://github.com/c0d3rman/PathfinderMonsterDatabase and then written some python to output the YAML expected by the format given here https://github.com/valentine195/fantasy-statblocks/discussions/41#discussioncomment-3073626 with some modifications to fit the info available from the database scrape.

It works for creating notes with the stat blocks, and they render OK, but I've not got having them import into the bestiary via front matter working yet.

image

sigrunixia commented 1 year ago

@djbrock If you are willing, the Obsidian TTRPGShare would love the Statblock in Note versions of those.

Secondly, you don't need to have monsters in the frontmatter to import them in the bestiary if they are per note, which is my recommendation if you are going to have them be in a note. All you need to do is have this in your frontmatter: statblock: inline

If that is in the frontmatter of the note, then Parse for Creatures will add the first statblock it finds per note to the bestiary in the parse area (folders) you specify it to look for. That should help you not have to worry about it getting the right frontmatter. :)

I've been steering people away from putting their statblock data in frontmatter only. There are major changes coming to how frontmatter and metadata is going to be handled within Obsidian, and may as well get you future proofed now. Also, a lot more goes wrong with the Frontmatter storage as different addons can currently alter frontmatter differently. In code block form, only Statblocks can touch it directly, but dataview and other javascript plugins can still access it due to API.

djbrock commented 1 year ago

Happy to share the code used to produce the notes. If you’re thinking of having the notes themselves in TTRPGShare then I think that would be OK since it’s all freely available from Archives of Nethys anyway. Might be worth getting someone who knows more about what the OGL permits to comment.

I’m defining statblock: inline in the front matter of the note that contains the monster definition. That note renders the monster OK. However, f I try to put it into another note with

monster: Aasimar
layout: Pathfinder 1e EN Layout Mod

it doesn’t render. The Fantasy Statblock options say that it’s managing 0 home-brew creatures. I have parse front matter for creatures set, and I’ve also triggered parsing manually. I’ve got debug messages on but don’t see anything. I’ve tried specifying just the bestiary directory and leaving it as the root.

I’ve attached a test note and the monster it tries to reference - am I doing something dumb in the format? I’ve attached an example monster, a note that tries to reference it, and the JSON for the format.

 

On 14 Apr 2023, at 20:57, LittleMaelstrom @.***> wrote:

@djbrock https://github.com/djbrock If you are willing, the Obsidian TTRPGShare https://github.com/ObsidianTTRPGProject/ObsidianTTRPGShare/tree/main/Pathfinder would love the Statblock in Note versions of those.

Secondly, you don't need to have monsters in the frontmatter to import them in the bestiary if they are per note, which is my recommendation if you are going to have them be in a note. All you need to do is have this in your frontmatter: statblock: inline

If that is in the frontmatter of the note, then Parse for Creatures will add the first statblock it finds per note to the bestiary in the parse area (folders) you specify it to look for. That should help you not have to worry about it getting the right frontmatter. :)

I've been steering people away from putting their statblock data in frontmatter only. There are major changes coming to how frontmatter and metadata is going to be handled within Obsidian, and may as well get you future proofed now. Also, a lot more goes wrong with the Frontmatter storage as different addons can currently alter frontmatter differently. In code block form, only Statblocks can touch it directly, but dataview and other javascript plugins can still access it due to API.

— Reply to this email directly, view it on GitHub https://github.com/valentine195/fantasy-statblocks/issues/55#issuecomment-1509160254, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACARVT4JQQTC6QI63ZSAMZLXBGT2DANCNFSM5VZGN2QA. You are receiving this because you were mentioned.

sigrunixia commented 1 year ago

The TTRPG Share is registered with Paizo as one of their Community Registration for Community Use page, so we're good there. For Paizo, the rule is no hosting entire books, and no adventures.


Regarding the statblock, It does not seem like the email took the attachments.

djbrock commented 1 year ago

Missing attachments - JSON renamed as txt to workaround GitHub filtering.

Test Standalone Assimar.md Aasimar.md Pathfinder 1e EN Layout Mod.txt

sigrunixia commented 1 year ago

The issue was two-fold.

  1. The quotations in the name prevented the Bestiary from properly reading and storing it.
  2. Statblock: true was still in the code block, and so the plugin was not sure which action to take.
  3. Added source: in the code block, to force the source into the Bestiary

Here is the corrected code block. You'll need to run parse for creatures again.

layout: Basic Pathfinder 1e Layout
source: "Pathfinder RPG Bestiary"
Monster_CR: 1/2
name: Aasimar
Monster_XP: 200
race: Aasimar
class: cleric 1
alignment: NG
size: Medium
type: outsider
subtype: (native)
INI: +0
perception: +5
senses: darkvision
AC: 15, touch 10, flat-footed 15 (armor +5)
HP: 11
HP_extra: 
HD: 1d8+3
saves: Fort +4, Ref +0, Will +5
resist: acid 5, cold 5, electricity 5
speed: 30 ft., base_other 20 ft. in armor ft.
melee: heavy mace -1 (1d8-1)
ranged: light crossbow +0 (1d8/19-20)
pf1e_stats: 8, 10, 14, 13, 17, 14
BAB: 0
CMB: -1
CMD: 9
feats: Turn Undead
skills: Diplomacy +8, Heal +7, Knowledge (religion) +5, Perception +5
racial_modifiers:
- Diplomacy 2
- Perception 2
languages: Celestial, Common, Draconic
ecology:
  - name: Environment
    desc: any land
  - name: Organisation
    desc: solitary, pair, or team (3-6)
  - name: Treasure
    desc: NPC Gear (scale mail, heavy mace, light crossbow with 10 bolts, other treasure)
spells_prepared:
  - name:
    desc: (CL 1)
  - name: 1st
    desc: bless, command (DC14), protection from evil
  - name: 0 (at-will)
    desc: detect magic, guidance, stabilize
spell-like_abilities:
  - name:
    desc: (CL 1)
  - name: 1/day
    desc: daylight
sources: "_Pathfinder RPG Bestiary pg.7_"
desc_short: This supernaturally beautiful woman looks human, yet emanates a strange sense of calm and benevolence.
desc_long: "Aasimars are humans with a significant amount of celestial or other good outsider blood in their ancestry. Aasimars are not always good, but it is a natural tendency for them, and they gravitate to good faiths or organizations associated with celestials. Aasimar heritage can hide for generations, only to appear suddenly in the child of two apparently human parents. Most societies interpret aasimar births as good omens. Aasimars look mostly human except for some minor physical trait that reveals their unusual heritage. Typical aasimar features are hair that shines like metal, unusual eye or skin color, or even glowing golden halos."

I also started making some updates to the Layout. It's an old one, so it can use a good sprucing and cleaning. It can be so much more elegant.

Basic Pathfinder 1e Layout.txt

Missing attachments - JSON renamed as txt to workaround GitHub filtering.

Test Standalone Assimar.md Aasimar.md Pathfinder 1e EN Layout Mod.txt

djbrock commented 1 year ago

Thanks for that. However, there is something odd happening:

  1. Made the changes you suggested with quotations, statblock parameter, and source parameter. Didn't fix.
  2. Created a new vault with just the plugin, my layout, my aasimar code, and a note to use the aasimar, and the suggested changes. Didn't fix
  3. Created a new vault with just the plugin, your layout, your code, and a note to use the aasimar. Worked straight away.
  4. Copied your monster code into my new vault. Worked after some combination of operations - I think it was a reload that did it.
  5. Pasted my code back in - couldn't get it to break rendering again even after reloads, re-parses, etc.
  6. Edited my code to change AC. Change showed up on the aasimar note but not on the test note that used the aasimar.

So there is some kind of caching going on that seems resistant to attempts to re-parse, reload, or even restart the app, once it has successfully pulled in a statblock. I'm wondering if something similar is happening with my broken vault where the changes I'm making to the YAML aren't making it through to where the test note tries to render the monster.

If I go back to the vault containing your layout and code, and edit the monster, the change is immediately reflected in the note that uses it. That seems to indicate that something either about the layout I'm using or the differences between your YAML monster and mine is breaking things somehow.

So, I'll switch to your layout and make some changes to the code that batch-creates monster notes from the database to incorporate your comments about simple YAML. I'll then test that with a clean vault.

sigrunixia commented 1 year ago

Its probably the layout and by extension the Yaml, but the YAML is the side effect. The original layout was made early in the days of Statblocks, and I am not surprised if there is tomfoolery with it.

djbrock commented 1 year ago

Modified my code so it created the vault structure so all I had to do was add the fantasy-statblocks plugin. Deleted the vault after each test. It was JUST the Archives of Nethys line in the sources block with the URL that was causing the rendering issue. That's been plaguing me for almost an entire week!

With the 'got rid of the line break by scalar' comment - is that the change to desc_long to quote it? It needs to support blank lines between paragraphs to format correctly. I might just omit the long description entirely to save space.

Images will be an issue as Archives of Nethys doesn't have them. Looks like d20pfsrd doesn't either. So I don't have a source to pull them from.

I'll do a bit more testing, put my conversion code onto GitHub, and create a folder with the resulting converted monsters to be used for a pull request for TTRPGShare. Thanks again for the help.

sigrunixia commented 1 year ago

For line breaks you could do \n in property blocks or backslash n and below in trait blocks.

  - name: “”
     desc: 
  - name: “”
     desc: “long desc here”

The above codeblock is my preference due to readability and error management.

However, we also do encourage considering what needs to be in a statblock and what is better off in the note the statblock is in. The more data inside the statblock and bestiary, the heavier it gets, the longer the render time.

As far as images, that is one of the protected things for Paizo. We won’t be able to share those. If you are sleuthy with Github its easy enough to find the icons for yourself from a popular official source, but distributing rights of images sadly dont belong to the community, only select partners.

sigrunixia commented 1 year ago

Labeling this as beginner friendly and priority medium, because we now have the files in statblock form over on the Obsidian TTRPGShare But would need someone to compile a data.json that clearly differentiates between pf1e Monsters and dnd5e SRD monsters.

sigrunixia commented 1 year ago

As we're still supporting ongoing bestiary work in the https://github.com/Obsidian-TTRPG-Community/Pathfinder-1E-SRD-Markdown, this issue will be taken over by that repository.

Closing this thread.