Code Monkey home page Code Monkey logo

Comments (5)

obiwankennedy avatar obiwankennedy commented on June 21, 2024

Hello, I didn't test anything but by looking at your command, you aren't using the same compare method in your ifs. The first one is a i:[>=$2] (on final value of $1) where the others are comparing the threshold with each dice value

from diceparser.

PXL-C avatar PXL-C commented on June 21, 2024

Thx for your answer.
Unfortunately, the error seems to be yet there. :'(
!macro add ([0-99]+)p([0-99]+) "1d10+\1;$1i:[=1]{-3}{$1};\2;\2+7;\2-7;$1i:[>=$4]{\"Critical success $2\"}{i[>=$3]{\"Success $2\"}{i[<$5]{\"Critical fail $2\"}{\"Fail $2\"}}}" True

Warning: Unexpected character at 50 - end of command was ignored "Critical success $2"}{i[>=$3]{"Success $2"}{i[<$5]{"Critical fail $2"}{"Fail $2"}}}""

No valid value at index: $4

from diceparser.

obiwankennedy avatar obiwankennedy commented on June 21, 2024
!macro add ([0-99]+)p([0-99]+) 1d10+\1;$1i:[=1]{-3}{$1};\2;\2+7;\2-7;$1i:[>=$4]{"Critical success $2"}{i:[>=$3]{"Success $2"}{i:[<$5]{"Critical fail $2"}{"Fail $2"}}} True

It is better to use the Switch operator instead of ifs. See the documentation: https://invent.kde.org/rolisteam/rolisteam-diceparser/-/blob/master/HelpMe.md#switch-case-s

from diceparser.

PXL-C avatar PXL-C commented on June 21, 2024

Hello Obiwan & folks,

So, I tried the Switch/Case operator in many ways without successful full results.
Here is the last macro used:
!macro add ([0-9]+)a([0-9]+) \1;1d[-3..10]R[=-2|=-1|=0|=1];$1+$2;\2;$4+7;$4-7;$3S[>=$5]{"Critical success $3"}[>=$4]{"Success $3"}[<=$6]{"Critical fail $3"}[<$4]{"Fail $3"} true
I don't found how to have a successful macro with the following constraints:

The "\1" is the attribute + skill value
The "\2" is the value to success
Critical success with margin of success at 7+
Critical fail with margin of faillure at 7-
We roll 1d10 which has the "1" face replaced by a "-3" face

Could I have any help to find what I missed, pls?
Thx in advance.

from diceparser.

obiwankennedy avatar obiwankennedy commented on June 21, 2024

The command is fine, There was some forgotten code on the Switch/case operator side. I just implemented it. It will be deploy soon.

from diceparser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.