The dataSetVar native AI script function changes the content of a script data variable. The data variable name is composed of a file name and a variable name separated with :, like in "file:variable".
()dataSetVar(name: s, value: s); // dataSetVar_ss_
()dataSetVar(name: s, value: f); // dataSetVar_sf_
"file:variable".()dataSetVar("Fyros:Patrol1State", "Active");
This example code sets the content of the "Fyros:Patrol1State" data variable to "Active".
()dataSetVar("Fyros:PatrolCount", nbPatrol);
This example code sets the content of the "Fyros:PatrolCount" data variable to the value of the nbPatrol variable.
The name argument must be a string in the format "file:variable". If the file or variable name does not exist, it will be created.
The value argument can be a string or a float. If it is a float, it will be converted to a string before being stored.