Open dustinlacewell opened 6 years ago
I like this, but for clearer text I would prefer to have the same markup for dice and tables (and ranges, and choices) eg just []. If someone names their table 3d6 or 4--7 etc I think that is an acceptable risk to not have to remember extra prefix, and I think there is a (partial?) dwim function already?
The function is called decide-dwim-insert. There is also an old dwim branch where I attempted to improve on that. One part was to make a function that could find all die-rolls in region and replace them with rolled numbers. I thought of using that in combination with things like yasnippets to automatically insert a template and then roll random numbers. But with some markup like that suggested in this issue that function could be even more powerful, as long as some markup is chosen that does not conflict too much with for instance how yasnippet snippets are defined. I think [2d6] and [tablename] would work for instance. I would not want double brackets because that would look like links to org-mode. Maybe it is possible to come up with a syntax and a helper function that can solve decide-table, decide-dwim-insert and decide-replace-in-region?
It would be nice if die syntax could include multiple modifiers and comments that serve to label them.
Right now if I try to roll
1d10+5+2
I get
[1d10+5] -> (7) +5 = 12
instead of
[1d10+5+2] -> (7) +5 +2 = 14
Obviously I could have rolled 1d10+7 and gotten the desired result, but some users will prefer parsing each modifier separately and letting the computer handle the addition.
It would also be nice if comments could be added to the die roll, so each modifier could be labeled. For instance, something like
1d10+5stat+2skill
would output
[1d10+5+2] -> (7) +5stat +2skill = 14
The last comment probably should be its own issue?
I have thought about adding some more dice-syntax like in other die-rollers, for things like "keep the N lowest", and I also want to add some feature to roll buckets of dice ("roll 45d6 and count how many 5+"). But adding things like that in ways that I have seen other tools do might conflict with allowing labels in the spec.
And if allowing 1d10+5+2 it would be nice to also allow 1d10+1d6+2 and things like that. Would require a major rewrite of how to parse and roll dice, and how to present the results.
The last comment probably should be its own issue?
Possibly, but I was afraid of spamming. Should I create a new issue or is this a low priority?
I think it can be good to have a few small feature requests like that open for discussion and in case someone wants to implement them. Not very high priority for me.
This would be a pretty backwards incompatible change but I think that we should not interpolate "naked" dice and table references and should introduce some kind of syntax. This would allow those string to appear inside of table entries. I'm thinking something similar to roll20 syntax would suffice:
[[ 1d20+5 ]]
t[table-name]
What this does, I think, is make it clearer in a table entry, what is actually going to be interpolated and what is just plain text. Sometimes I want to say "1d6" in a table entry without actually replacing it with a roll.