the simplest way to use stuff like this is to use a table.
You need to have your variables already defined
Middle = "stufff" Left = "other stuff" Right = "weird stuff"
then have a table after those variables have been declared
vartables = {zright_gate = Right,zmiddle_gate = Middle,zleft_gate = Left}
then you can do
vartables[__WPL.FileName]
Example of working code looks like this
Code: Select all
Command>
Middle = "stufff"
Left = "other stuff"
Right = "weird stuff"
vartables= {zright_gate = Right,zmiddle_gate = Middle,zleft_gate = Left}
print(vartables["zmiddle_gate"])
stufff
You need to be very careful with the exact names and the usage of " "
--=== Added ===--
Adding this cus noobbotter posted before me.
What he said it true but the value will still be just a string and not the variable you want it to be.
__WPL.FileName.."Gate20"
that will be a string with the combination of the 2 things, ie
"LeftGate20"
and the string won't be the value of the variable that you want it to be.