obsidian-dice-roller icon indicating copy to clipboard operation
obsidian-dice-roller copied to clipboard

Feature request: AND, OR, and NOT conditions for tag dice

Open wychwitch opened this issue 2 years ago • 5 comments

I hope this is feasible! I was brainstorming about ways to use dice tables, and realized it would be fantastic if there was a way to use AND OR and NOT operators with tag dice!

I'd imagine it could work something like this: dice: #tag1 AND #tag2 NOT #tag3|link

Which would return a link to a file that has tag 1 and 2, but not tag 3.

My specific use case was be to be able grab an npc in a specific location (dice: #dnd/npc AND #dnd/location/town)

Using parenthesis might need to be required for more complicated use cases such as dice: (#tag1 OR tag2) AND #tag3 NOT #tag4|link, but I'm not sure if anyone but me would even need something on that level 😅

Thanks again in advance!! If its not feasible I completely understand

wychwitch avatar Nov 18 '21 04:11 wychwitch

This will be difficult, unfortunately, due to the way the tag rolling works. I'll think about a way to implement it.

valentine195 avatar Nov 18 '21 18:11 valentine195

This will be difficult, unfortunately, due to the way the tag rolling works. I'll think about a way to implement it.

That totally makes sense! I had a feeling it might not mesh well with the current implementation. Thank you for considering though!!

wychwitch avatar Nov 18 '21 19:11 wychwitch

I just want to let you know that I just rewrote the backend lexical parser and will be working on this issue in the coming days.

valentine195 avatar Jan 17 '22 16:01 valentine195

Thank you!!! I'm real excited!!

wychwitch avatar Jan 18 '22 16:01 wychwitch

ALSO I just realized, but maybe a fallback option would be nice for this too? In case the tag combination doesn't return anything. However this might need its own issue lmao

wychwitch avatar Jan 18 '22 16:01 wychwitch