Skip to content

🐞 Tetracube import issues #504

@Zyra915

Description

@Zyra915

Check for existing bug reports before submitting.

  • I searched for existing Bug Reports and found no similar reports.

Expected Behavior

When importing a statblock from tetracube, the value for ac is not filled in. In addition, due to stats being imported as strings, not numbers, the modifiers are not calculated when viewing the statblock. For my simple example monster, the imported statblock should be the following:
image:
name: Obsidian Golem
source: TetraCube
type: humanoid
subtype: ""
size: medium
alignment: any alignment
hp: "22"
hit_dice: 5d8
ac: 10
speed: 30 ft.
stats:

  • 20
  • 10
  • 10
  • 10
  • 10
  • 10
    damage_immunities: ""
    damage_resistances: ""
    damage_vulnerabilities: ""
    condition_immunities: ""
    saves: []
    skillsaves: []
    senses: passive Perception 10
    languages: "—"
    cr: "1"
    legendary_description:
    legendary_actions:
    mythic_description:
    mythic_actions:
    lair_description:
    lair_actions:
    lair_description_end:
    regional_description:
    regional_actions:
    regional_description_end:

(when manually fixed, the statblock appears like this:
Image
)

Current behaviour

The armor class and stats are not automatically imported properly. For the same monster, the following statblock is produced:
image:
name: Obsidian Golem
source: TetraCube
type: humanoid
subtype: ""
size: medium
alignment: any alignment
hp: "22"
hit_dice: 5d8
ac: ""
speed: 30 ft.
stats:

  • "20"
  • "10"
  • "10"
  • "10"
  • "10"
  • "10"
    damage_immunities: ""
    damage_resistances: ""
    damage_vulnerabilities: ""
    condition_immunities: ""
    saves: []
    skillsaves: []
    senses: passive Perception 10
    languages: "—"
    cr: "1"
    legendary_description:
    legendary_actions:
    mythic_description:
    mythic_actions:
    lair_description:
    lair_actions:
    lair_description_end:
    regional_description:
    regional_actions:
    regional_description_end:
Image

(Also, as a note, I don't know if it's necessary to include "legendary_description" and everything after it if the monster is not legendary, mythic, has a lair, or has regional effects. I'm not making this a large issue because I'm not sure if it's required in the rest of the code)

Reproduction

  1. Launch Obsidian
  2. Move to the Settings -> Community Plugins -> Fantasy Statblocks tab
  3. Import a statblock from Tetracube, using any created .monster file created from https://tetra-cube.com/dnd/dnd-statblock.html
  4. Either edit the monster or attempt to place it in a note
    4a (Editing monster). Scroll down to the list of monsters, searching the name of the monster you imported. Then, select the edit option and view the code provided.
    4b (Place monster into a note). Use the following code snippet:
monster: [INSERT MONSTER NAME HERE]

and view the result.

Which Operating Systems are you using?

  • Android
  • iPhone/iPad
  • Linux
  • macOS
  • Windows

Obsidian Version Check

1.9.14

Plugin Version

4.10.2

Confirmation

  • I have disabled all other plugins and the issue still persists.

Possible solution

In the file "fantasy-statblocks/src/importers/TetraCubeImport.ts", line 251:
ac: (monster.ac ?? [])[0]?.ac ?? "",
does not work. This is due to how .monster files store armor class. For the example file provided, the armor is stored as
"armorName":"none",
"shieldBonus":0,
"natArmorBonus":3,
"otherArmorDesc":"10",

The logic may have to be placed into a separate function, and called in line 251.

In addition, to solve the issue regarding ability scores and modifiers, lines 223 to 228 read:

str: this.monster.strPoints,
dex: this.monster.dexPoints,
con: this.monster.conPoints,
int: this.monster.intPoints,
wis: this.monster.wisPoints,
cha: this.monster.chaPoints

Instead, they could read:

str: Number(monster.strPoints ?? 10),
dex: Number(monster.dexPoints ?? 10),
con: Number(monster.conPoints ?? 10),
int: Number(monster.intPoints ?? 10),
wis: Number(monster.wisPoints ?? 10),
cha: Number(monster.chaPoints ?? 10)

I am unfamiliar with the syntax, so this is my guess as to how this could work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions