I am trying to put together a D&D character sheet in obsidian using the dataview plugin. It is going well but I have run into the fact some stats which I want to display (e.g. AC) are a function of Ability Modifiers (e.g. Con of +3) which themselves are a function of the character’s Ability Scores (e.g. Con of 16).

As far as I can see, dataview lets you define variables (properties) in the front matter of a page and then reference them on different pages, but I cant seem to find a way to define one of these variable as a function of other variables.

I have tried this kind of thing with no success:

---

con: 16

conmod: floor((number(this.con) - 10)/2)

ac: 10 + this.conmod

---

`=ac`

This video was super helpful but only got me so far… Any advice? Maybe this is just a limitation of dataview.

  • SkinList@lemmy.worldOP
    link
    fedilink
    arrow-up
    1
    ·
    1 month ago

    I have made some progress! I found this video which shows off the Numerals plugin. This plugin allows variables to be functions of other variables as shown in the video. Reading through the plugin documentation it also looks like there is a way to make these variables into page properties using some kind of @[variablename] notation but I haven’t been able to get this working yet…