AI Zone Admin Forum Add your forum

NEWS: survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Modify variable from C++


One question and some informations about our project.


I’d like to modify chatscript variable with robot data. For exemple:
* robot see a face with camera and face recognition algorithm
* We set $username
* We can use it without asking his name to user.

In c++ i made:

#include "src/variableSystem.h"

and in we have

$username "nobody" 

in a topic we can have

u:(do you recognize me)
if (
$username != "nobody")
you are $username

The problem is SetUserVariable doesn’t modify $username (value is always “nobody”)

i tried to debug, we enter in function WORDP StoreWord(char* word, uint64 properties)
StoreWord found the variable $username here
  if (fullhash == D->hash)
return D;

but in static WORDP CreateUserVariable(char* var)
if (!(D->systemFlags & VAR_CHANGED)) //  not current
is true (all pointers of D seems invalid) and variable is not modified.

I still investigate but may be you have an idea ?

I work on windows with last version.

Information about nao robot:

We progress in dialog with a real robot. We already done:
- Create a little french dictionnary
- Create some topic with most common sentense (100 input).
- Create a script that generate a Nuance Speech recognition file.

For exemple we can say:
- move
- tell me a story
- or like siri: remember me i have a meeting tomorow at 2 o’clock.
- what is your name….

I’ll try to make a video.

best regards,


Image Attachments

  [ # 1 ]

So…..CreateUserVariable(var) should be returning some copy of the user variable, such that SetUserVariable can change it.

But first question is WHERE is this SetUserVariable call you created?  You can only set a user variable from within a volley, because the first thing the system does for incoming input is read in the current user data, then process input, then write out user data. If you try to SetUserVariable from outside of this, it will get overwritten on reading in user data.


  login or register to react