I am attempting to include choices and message windows in complex logic I can only write with JS (heavy use of multi dimensional arrays)
The issue I'm running into is nothing works if I include more then one set of choices or multiple message box in the entirety of a script call. Having a single set of choices or a single message box works fine, but If I include another anywhere in the code even in conditionals that wont trigger (only one textbox will display when the code runs, but many exist within the code) nothing works at all.
here's an example of how I implement choices in my code:
Am I doing something wrong? is it impossible to include more than one set of choices or more than one text window in a script call?
it seems that even when I put 2 script calls next to each other in an event I have the same problem. Separating them with anything else besides a script call works, but this is to limited for my needs.
is there any way around this?
Thanks for your time / help!
The issue I'm running into is nothing works if I include more then one set of choices or multiple message box in the entirety of a script call. Having a single set of choices or a single message box works fine, but If I include another anywhere in the code even in conditionals that wont trigger (only one textbox will display when the code runs, but many exist within the code) nothing works at all.
here's an example of how I implement choices in my code:
JavaScript:
var itemID = $gameVariables.value(6);
var mainItemArray = $gameVariables.value(7);
var selectedItem = $dataItems[itemID].name;
var foundItemArray = [];
var foundItemChoices = [];
var foundAtIndex = [];
for (var count = 0; count < mainItemArray.length; count++) {
if (mainItemArray[count][0] === selectedItem) {
foundItemArray.push(mainItemArray[count]);
foundAtIndex.push(count);
}
}
for (var nextCount = 0; nextCount < foundItemArray.length; nextCount++) {
foundItemChoices.push(foundItemArray[nextCount][5]);
}
$gameMessage.setChoices(foundItemChoices, -1, -1);
$gameMessage.setChoiceCallback(function(responseIndex) {
$gameVariables.setValue(5, foundItemArray[responseIndex]);
$gameVariables.setValue(8, foundAtIndex[responseIndex]);
});
Am I doing something wrong? is it impossible to include more than one set of choices or more than one text window in a script call?
it seems that even when I put 2 script calls next to each other in an event I have the same problem. Separating them with anything else besides a script call works, but this is to limited for my needs.
is there any way around this?
Thanks for your time / help!