Keep variable or min/max functions
Denubis opened this issue · 2 comments
In Shadowrun 3, there's the idea of a complimentary test where a second skill adds min(roll successes/2,original successes) to the original roll.
I've tried to start that process with the expression !5d6c[?>4];5d6k[$1]c[?>4]
where the second roll uses the keep operator to limit the number of dice returned to the successes of the prior. The error returned suggests that keep doesn't take complicated expression results: Warning: Unexpected character at 14 - end of command was ignored "[$1]c[?>4]"
Scalar division works without a problem: !5d6e6sc[>=4];$1/2
but it seems like implementing max/min will take a rather fiddly set of if statements. Does this seem like a reasonable feature request or should I try to implement it with ifs?
Hi Denubis!
Yes, the k operator only accepts a simple number as parameter. I will change that one day for sure.
About, the min/max functions, there is an old branch where I wrote the max function node.
Originally, my goal was to manage commands like this:
!max(repeat(2d100,10))
Get the highest value from 10 rolls. I may have to improve a bit the syntax to allow max(instruction 1, instruction 2)
I have to adapt it to all changes I made in DiceParser since.
Final answer:
1- I may add min/max function soon, but I don't know when. I may do it this week-end but as I want function to be really generic it may require a long test campaign to validate it.
2- I'm not sure if I well-understood your system, but getting the min from two instructions is very easy: 1d100;1d100;$1i:[>$2]{$2}{$1};"Final value: $3 details [$1 - $2]"
Oh, thanks. That'd be great in the readme.
The example you gave of 2 above is deeply appreciated. Thanks!