I think It'd be easier and more robust to handle more of eventing in pure JS and just pass a script function to an event. I tried creating dialog with 2 choices where the first choice would show more dialog. However, I can't seem to get the gameMessage.add to work well..
I call the script this:
Here is the code:
I want it to show "text" with the choices, then message "text2" if I click "test" option, and finally then "text3".
What happens is it shows "text" and "text2" in the same line along with the choices. Then it never shows "text2" despite the "n2" console log showing up. I'm doing the messages wrong somehow but I'm not sure. Any ideas?
I call the script this:
Here is the code:
JavaScript:
Game_Interpreter.prototype.testShatterEffects = (interpreter) => {
$gameMessage.add('text');
$gameMessage.setChoices(['test', 'test2'], 0, 1);
console.log('this2', this);
interpreter.setWaitMode('message');
$gameMessage.add('text3');
interpreter.setWaitMode('message');
// $gameMessage.setChoiceBackground(bgType);
// $gameMessage.setChoicePositionType(posType);
$gameMessage.setChoiceCallback(function (n) {
console.log('n', n)
if (n === 0) {
console.log('n2', n)
$gameMessage.add('text2');
interpreter.setWaitMode('message');
}
});
};
I want it to show "text" with the choices, then message "text2" if I click "test" option, and finally then "text3".
What happens is it shows "text" and "text2" in the same line along with the choices. Then it never shows "text2" despite the "n2" console log showing up. I'm doing the messages wrong somehow but I'm not sure. Any ideas?