Psi

Psi

45M Downloads

Trick: Play Note's input Instrument requires a Number Constant, not a Number

floral-qua-floral opened this issue ยท 0 comments

commented

Version Information

Forge version: 1.16.5-36.1.0
Psi version: 1.16-95

Further Information

Link to crash log: N/A
Steps to reproduce:

  1. Import my demonstration spell:
    {modsRequired:[{modVersion:"1.16-95",modName:"psi"}],spellName:"Note Swappable",uuidMost:6077035015180075357L,validSpell:1b,spellList:[{data:{key:"psi:selector_focal_point"},x:3,y:3},{data:{key:"psi:constant_number",constantValue:"15"},x:3,y:4},{data:{params:{_target:1},key:"psi:connector"},x:3,y:5},{data:{params:{_target:3},key:"psi:operator_entity_position"},x:4,y:3},{data:{comment:'Change my "Instrument" input!;Left: Always banjo;Right: Compilation error;Down: Random instrument',params:{_volume:0,_pitch:0,_instrument:3,_position:1},key:"psi:trick_play_sound"},x:4,y:4},{data:{params:{_target:4,_constant:3},key:"psi:constant_wrapper"},x:4,y:5},{data:{key:"psi:constant_number",constantValue:"15"},x:5,y:3},{data:{params:{_max:1,_min:0},key:"psi:operator_random"},x:5,y:4},{data:{params:{_target:1},key:"psi:connector"},x:5,y:5}],uuidLeast:-7359371605942121183L}
  2. Run the spell and confirm that it plays a Banjo note every time.
  3. Change the "Instrument" input on the Trick: Play Note in the center, to face the right, towards the Operator: Random. Observe that the spell no longer compiles - the error message claims that Instrument is now facing an empty cell, which is clearly incorrect.
  4. Change the "Instrument" input to face downwards, towards the Constant: Wrapper. Observe that the spell now compiles successfully.
  5. Run the spell and confirm that it plays a note from a randomized instrument every time.

What I expected to happen:
The Trick: Play Note's "Instrument" input should accept non-constants (the same way Pitch and Volume do), as its tooltip implies.
Alternatively, the Trick: Play Note's tooltip should say "Input Instrument [Number Constant]" (the same way Trick: Add Motion's "Speed" input is written) to accurately describe what data type is required, and the error message for providing a non-constant should say "A Parameter is facing an invalid piece" rather than "A Parameter is facing an empty cell" (the same error that occurs when feeding a non-constant to Trick: Add Motion's "Speed" input).

What happened instead:
The spell actually requires a Number Constant, and yields the wrong error when this is not supplied to it.