#Looks like your system managed to find a

1 messages · Page 1 of 1 (latest)

pine yarrow
#

LMK if I'm a derp and pulled the wrong data; I didn't actually implement this code - I've just started to support the system over the years

wild tiger
#

I don't know much about the FFG system. Should 2i be a valid roll equation?

pine yarrow
#

yup, that's two difficulty dice

worthy spear
#

Usually when you define a new die type it should still have the d in the middle of the terms, unless the system is overriding stuff relatively deeply. I would have expected it to be more like 2di personally

pine yarrow
#

this system was originally written back in the days of... Foundry 0.0.4 or something. so it doesn't follow a lot of the more recent standards

worthy spear
#

Yeah, that checks out

wild tiger
#

@viral crow I hope you could share some thoughts on this case when you have a chance.

viral crow
#

Yes, 2i is not a valid dice term, custom terms should be in the form 2di as mxzf said. You can register custom terms with a custom denominator like so:

class DifficultyDie extends foundry.dice.terms.DiceTerm {
  constructor(data) {
    data.faces = 8;
    super(data);
  }

  static DENOMINATION = "i";
}

CONFIG.Dice.terms.i = DifficultyDie;
#

Looking through the code, it looks like you've done this already, mostly

#

Can you check if Roll.parse("2di") works?

wild tiger
#

@viral crow I don't remember, did we end up adding any sort of hook for a formula pre-processor? I feel like that is something we might have discussed

#

something that would allow a system to, for example, re-interpret input strings like "2i" into a string "2di"?

viral crow
#

Does sound familiar, we haven't added anything though

#

Roll.parse is public so systems are free to override it

pine yarrow
viral crow
#

I will have to look into it further then, it's not clear why it wouldn't still resolve to a string term

viral crow
#

OK, I think I got to the bottom of it

#

Because StringTerms are lower precedence than NumericTerms, the 2 in 2i was being matched as a NumericTerm, and then throwing an error because the only things that can follow a NumericTerm are flavour, an operator, or the end of input, and i is obviously none of those things.

pine yarrow
#

not having looked at the changelog yet, is there a fix for this in the testing release 1?

pine yarrow
#

having now looked, I don't see it noted. @viral crow do you happen to know if this is planned to be fixed at all and/or prior to a full v12 release?

wild tiger
pine yarrow
viral crow
#

This was my mistake, I neglected to add an issue for this when resolving it; it slipped my mind, sorry