ttrpg-convert-cli
ttrpg-convert-cli copied to clipboard
✨ Add support for custom properties (homebrew)
I have a homebrew that has a couple of custom properties for items. I would like to include these in the template.
"itemProperty": [
{
"name": "Herb",
"source": "HHbH",
"page": 5,
"abbreviation": "Hrb",
"template": "{@b Location:} {{item.customProperties.lcn}} {@b Requires Preparation:} {{item.customProperties.prep}}",
"entries": []
}
]
Here is an example of an item with these properties:
{
"name": "Sentry Bush",
"source": "HHbH",
"page": 30,
"type": "Herb",
"rarity": "common",
"value": 100,
"property": [
"Hrb"
],
"entries": [
{
"type": "entries",
"name": "Description:",
"entries": [
"A scraggly brush found only on high altitudes, its bitter twigs produce an incredibly potent stimulant that when brewed into a tea, can completely replace one's need to sleep. Due to its inaccessible location, but widely sought-after use, mountain clans are often found carrying them in their caravan to trade to people that need to stay awake for long periods of time."
]
},
{
"type": "entries",
"name": "Effect:",
"entries": [
"After preparing this herb, you gain all the benefits of 8 hours of sleep (or the equivalent form of dormancy for your race). You still need to rest for at least 8 hours in order to benefit from a long rest."
]
}
],
"customProperties": {
"lcn": "Mountain",
"prep": "Yes"
},
"foundryType": "consumable"
}
Item properties are absolutely already taken into account provided they are in the right format in _meta. The Herbalism Handbook works properly, IIRC.
The meta for that handbook does not include a description. This shows in rules/item-properties.md:
### Herb
_Source: Hamund's Herbalism Handbook p. 5_
And items are linked to it:
# Aboleth Stalk
*Herb, rare, Herb*
- **Properties**: [Herb](rules/item-properties.md#Herb)
- **Cost**: 500 gp
What is missing?
@ebullient the properties for "Location" and "Requires Preparation".
"customProperties": {
"lcn": "Mountain",
"prep": "Yes"
}
The lcn and prep keys.
ok. A different kind of custom properties. ;)
Herb is, in and of itself, a custom Item property (at a macro level), so I didn't see the detail that you meant.
Always item template usage?
I'm imagining something along the lines of the following in the item template:
Location: {resource.custom.lcn}
Requires Preparation: {resource.custom.prep}
Always item template usage?
Not necessarily, if you wanted a stress test try https://github.com/TheGiddyLimit/homebrew/blob/master/magicvariant/aeyana%3B%20Gemstones.json
Which includes customProperties mixed with itemEntry and variant generation.
Clock the hasRefs flag.
Basically this one '''item''' explodes to 46 items on the site
See video:
https://github.com/ebullient/ttrpg-convert-cli/assets/52298102/9a0a3e25-8329-413e-aeee-f88c3a14693b