CyclopsMC / IntegratedScripting

Create scripts for handling complex operations in Integrated Dynamics
MIT License
8 stars 1 forks source link

Syntax error in variables while editing script #5

Closed QinomeD closed 5 months ago

QinomeD commented 7 months ago

Issue type:


Short description:

When adding a reassignment (smth like let str = "test"; str = "test 2"), the variable card gives me a syntax error (for example in display panels). Reinserting the variable card solves the issue (it's still annoying regardless).

Steps to reproduce the problem:

  1. Add a variable to your script, for example let str = "Hi InDy"
  2. Use this variable in a variable card and insert it into a connected display panel
  3. The variable's value is displayed properly
  4. Reassign the variable in your script, like str += " and InScripting!"
  5. Display Panel shows an X, hovering over the X in display panel's GUI shows that it's a SyntaxError (depends on what type of variable you are reassigning)

Expected behaviour:

New value displays correctly.


Versions:

Log file:

rubensworks commented 7 months ago

Thanks for reporting!

rubensworks commented 7 months ago

Could you share the syntax error message you're getting?

QinomeD commented 7 months ago

Sure, one sec!

QinomeD commented 7 months ago

image image This is for the number type, for some reason syntax error says there's no ar symbol, but I use arr, so idk

QinomeD commented 7 months ago

image image This happens for reassigning array values

rubensworks commented 7 months ago

The script variable probably got updated while you were typing, at which point the line was not complete yet and would result in a syntax error. So I don't think the re-assignment itself is the problem.

Not sure yet what a good solution to this could be...

QinomeD commented 7 months ago

oh yeah, it's actually not only reassigning, I just didn't really test anything, since just changing the value manually didn't trigger the error

maybe the variable should be updated when the player stops writing?

rubensworks commented 7 months ago

Note to self: consider invalidating errored variables, but only those that errored due to the currently edited script.