Game_Variables.prototype.setValue = function(variableId, value) {
if (variableId > 0 && variableId < $dataSystem.variables.length) {
if (typeof value === 'number') {
value = Math.floor(value);
}
this._data[variableId] = value;
this.onChange();
}
};
@taarna23: I forgot to check what's the process behind the setValue. Thanks for this one I've created my own function that stored a Float Value in the variable.
Game_Variables.prototype.setValuetoFloat = function(variableId, value) {
if (variableId > 0 && variableId < $dataSystem.variables.length) {
if (typeof value === 'number') {
value = value.toFixed(2);
}
this._data[variableId] = value;
this.onChange();
}
};
For now i there's no error prompt. But i don't know if it's compatible.