I'm trying to use a general construct to not type in hundreds or thousands of variable names by myself.
The general idea is using variables that start with $Door and then simply adding a number to them, to form variable names like $Door1, $Door240, and so on. The variables are meant to be simple integers, reflecting the state of the door, like 0 for locked, 1 for unlocked so that I can check against them from everywhere in the game.
For testing, I have set up a widget that simply takes the first argument provided and should use it to set the variable.
<<set $Door+`args` = 1>>
I also tried variations of the backquotes like `$Door+args` but I'm still getting the same error.
Giving the widget the argument 4 should assign the variable $Door4 the value 1.
Sadly it's not working, and sugarcube is only throwing
Error: <<set>>: bad evaluation: invalid assignment left-hand side
I guess either the backquote (`) usage is wrong, or I'm not getting what they're supposed to do. I have other passage in my code where a simple printing of stuff via backquotes work, but have not successfully used it to describe the variable name itself.