Local or temporary variables are only usable within the current step. It is rather a way to write more readable, expressive code. But they are really powerful, because they allow you to do everything that a regular memory does, but temporarily. For more information about local variables, see the
Local variables are useful for temporary calculations. You do not want to memorize your internal temporary steps, rather save useful information about the user.
somestep:do tmpvar = "Hi there"say tmpvar // "Hi there"goto otherstepotherstep:say tmpvar // NULL
Long-term memories on the other hand are at the core of the purpose of CSML. When two persons converse, they constantly memorize information, which they can reuse in other discussions. For example, if I gathered that my friend likes Iron Man, I might propose later that we go see Captain America together. I do not have to ask them again about their favorite film, because I already learned this information before, even if it was in a different conversation, even if the topic of that conversation might have been completely unrelated.
The memory API is very powerful: by default a bot never forgets anything about the current user. For more information, see the
somestep:remember tmpvar = "Hi there"say tmpvar // "Hi there"goto otherstepotherstep:say tmpvar // "Hi there"