I don't understand one thing... in the code up here ↑ there is a piece of code that says:
I tried to figure out where this index variable is defined and searching in the core js of RPGMMV I've found that:
Game_Interpreter._index exist and its default value is zero... when I launch an event with only this script inside:
after I launch the game and interact with this event I can press F8/F12 (open console) and If I ask the value of a it says me it is 0 or 1 in according with my choice respectively of "yes" or "no".
but if I use this script in the event instead of that up here:
And I make it run in game and open the console it says...
So maybe this "index" and Game_Interpreter._index are not the same thing... someone could explain me where and when the $gameMessage.setChoiceCallback() function define/assign this index or let me know in which line it happens in wich file of the core?
JavaScript:
$gameMessage.setChoiceCallback(function(index){
target.removeState(choiceStates[index]);
});
I tried to figure out where this index variable is defined and searching in the core js of RPGMMV I've found that:
Game_Interpreter._index exist and its default value is zero... when I launch an event with only this script inside:
JavaScript:
var choices = ["yes", "no"];
b = this
$gameMessage.setChoices(choices, 0);
$gameMessage.setChoiceCallback(function(indice) {
a = indice //comment - indice is another word for index
});
but if I use this script in the event instead of that up here:
JavaScript:
var choices = ["yes", "no"];
b = this
$gameMessage.setChoices(choices, 0);
$gameMessage.setChoiceCallback(function(indice) {
a = indice //comment - indice is another word for index
});
b = this._index //Game_Interpreter._index
And I make it run in game and open the console it says...
So maybe this "index" and Game_Interpreter._index are not the same thing... someone could explain me where and when the $gameMessage.setChoiceCallback() function define/assign this index or let me know in which line it happens in wich file of the core?