-
-
Notifications
You must be signed in to change notification settings - Fork 90
Description
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:

)
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:
(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
- Launch Obsidian
- Move to the Settings -> Community Plugins -> Fantasy Statblocks tab
- Import a statblock from Tetracube, using any created .monster file created from https://tetra-cube.com/dnd/dnd-statblock.html
- 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.