Hello everyone,
I upgraded to the last version of ChatScript (6.83) and I started to play around with the local variables. While they work perfectly with the outputmacros I have a problem with the topics.
As per documentation:
Local variables used in a topic all remain accessible while in that topic.
the scope of a local variable in a topic should be the topic itself and not the rule where it’s declared. But this is not the case.
For instance, this code doesn’t work:
t: Do you want to set a local variable?
a: (~yesanswer) Nice $_local = 1
a: ( ~noanswer ) ok $_local = 0
t: ($_local=1) You set the variable!
t: ($_local=0) You did not set the variable!
t: CHECK () The value of the local variable is: $_local
The variable is resetted after the first gambit, hence only the CHECK gambit is outputted and the variable results undefined.
Is this a bug or I’m doing something wrong?
Thank you in advance,
Dario