ttrpg-convert-cli icon indicating copy to clipboard operation
ttrpg-convert-cli copied to clipboard

✨ Add support for custom properties (homebrew)

Open Stackclash opened this issue 1 year ago • 5 comments

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": []
	}
]

Hamund's Herbalism Handbook

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"
}

Hamund's Herbalism Handbook

Stackclash avatar Feb 24 '24 05:02 Stackclash

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 avatar Feb 25 '24 12:02 ebullient

@ebullient the properties for "Location" and "Requires Preparation". image

"customProperties": {
	"lcn": "Mountain",
	"prep": "Yes"
}

The lcn and prep keys.

Stackclash avatar Feb 26 '24 18:02 Stackclash

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?

ebullient avatar Feb 26 '24 19:02 ebullient

I'm imagining something along the lines of the following in the item template:

Location: {resource.custom.lcn}
Requires Preparation: {resource.custom.prep}

Stackclash avatar Feb 26 '24 19:02 Stackclash

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.

image

image

Basically this one '''item''' explodes to 46 items on the site

image See video: https://github.com/ebullient/ttrpg-convert-cli/assets/52298102/9a0a3e25-8329-413e-aeee-f88c3a14693b

revilowaldow avatar Apr 10 '24 20:04 revilowaldow