Disclaimer: I'm very new to js (although have a firm grasp on several other languages...); I'm toying with 'lightweight' one-liner script calls, not wanting to get into plug-ins and prototyping and stuff (yet...). I'm hoping that this is an easy one for the more experienced out there with The Knowledge. Here we go...
I've found out how to reference a Variable whose ID is held in another...
$gameVariables.value($gameVariables.value(3))!==0
... where '3' is the Variable holding the ID I'm testing (If Variable n is not zero', 'n' being held in Variable 3...)
My problem is wanting to subract '1' from the Variable n. Here's my latest attempt...
$gameVariables.setValue(($gameVariables.Value(3)),$gameVariables.Value($gameVariables.Value(3))-1)
... which throws an error. This should 'read' as...
Set the value of the Variable referenced in Variable 3 to that same value minus 1 (and so subtracting 1...).
The first part works if I use a constant, thus...
$gameVariables.setValue(($gameVariables.Value(3)),6)
The second part works on its own...
$gameVariables.Value($gameVariables.Value(3)) returns the value referenced in Variable 3
It's when I put them together with or without the subtraction, that it throws the error...
Type Error
Defined is not a function
I'm presuming that there's a Dumbo-style stoopid error there somewhere, and I'm hoping that the more experienced will, with a sly chuckle, ba able to point me to the True Path of Enlightenment, saving me a fortune on aspirin.
Any takers, please..?
I've found out how to reference a Variable whose ID is held in another...
$gameVariables.value($gameVariables.value(3))!==0
... where '3' is the Variable holding the ID I'm testing (If Variable n is not zero', 'n' being held in Variable 3...)
My problem is wanting to subract '1' from the Variable n. Here's my latest attempt...
$gameVariables.setValue(($gameVariables.Value(3)),$gameVariables.Value($gameVariables.Value(3))-1)
... which throws an error. This should 'read' as...
Set the value of the Variable referenced in Variable 3 to that same value minus 1 (and so subtracting 1...).
The first part works if I use a constant, thus...
$gameVariables.setValue(($gameVariables.Value(3)),6)
The second part works on its own...
$gameVariables.Value($gameVariables.Value(3)) returns the value referenced in Variable 3
It's when I put them together with or without the subtraction, that it throws the error...
Type Error
Defined is not a function
I'm presuming that there's a Dumbo-style stoopid error there somewhere, and I'm hoping that the more experienced will, with a sly chuckle, ba able to point me to the True Path of Enlightenment, saving me a fortune on aspirin.
Any takers, please..?