Psi

Psi

45M Downloads

Constant: Wrapper Not able to emulate values between -1 and 1

quicktinker opened this issue ยท 2 comments

commented

Version Information

Forge version:35.1.37
Psi version:1.16-91

Further Information

Steps to reproduce:

  1. First step: Create a shifting variable that will shift between -1 and 1
  2. Second step: use a wrapper with the target set on the variable and a constant of 1 or -1
  3. Third step: Output the result of the wrapper.

What I expected to happen:
I expected the wrapper to shift between -1 and 1 depending upon the target

What happened instead:
the wrapper only shifted from 0 to 1 (if the constant was 1) or -1 to 0 (if the constant was -1)
there was no way to feed in a range from -1 to 1 and have the wrapper output that range.

commented

To properly support this without making assumptions on spell costs that could be violated by an addon introducing tricks with nonstandard inputs that could vary between positive and negative values, it would require an overhaul of the underlying system to allow pieces to output a range at compile time.

Such a change is possible, but I wouldn't do so immediately due to it causing incompatibilities with addons. This change is probably best saved for refactoring while porting to 1.17.

commented

Fixing this would require changing the return type of SpellPiece.evaluate to account for both minimum and maximum values as the metadata calculation of some pieces could be dependent on the sign of a constant parameter.