So I found this in the big spreadsheet with all of the script calls
choices = []; params = [];
$gameMessage.setChoices(choices, 0)
choices.push("I love you1");choices.push("I love you2");
choices.push("I love you3");choices.push("I love you4");
choices.push("I love you5");choices.push("I love you6");
choices.push("I love you7");choices.push("I love you8");
params.push()
I understand that the I love you# parts are the text displayed in the choice window what I'm wondering is how do I add the code that is supposed to be executed by clicking one of the choices?
Iam not a Scripter and i would not be able to do this, but:
Thanks to Script equivalents Thread and help from rpg-studio.org we have this for Eventcommand Script:
The Textbox Code infront of it is optional.
The chosen number is safed in variable1 in this case, just create a conditional branch for every answer to let the stuff happen.
$game_message.face_name = 'Actor1'
$game_message.face_index = 0
$game_message.background = 0
$game_message.position = 2
$game_message.add("Choose your Style")
params = []
choices = []
choices.push("Warrior")
choices.push("Magician", "Knight", "Archer")
choices.push("Mergent", "Chuck Norris", "Eric Cartman", "MacGyver")
params.push(choices)
params.push(0) #what if cancel? 0=nocancel, 1 or more for answer,answr 1 will be value0 in variable
setup_choices(params)
wait_for_message
$game_variables[1] = @branch[@indent]
Edit:
Big fault of mine. I was sure i read VX-Ace. Iam sorry this isnt working in MV.
You would need a Scripter who gives you the Eventcommand Scriptcommand for this in Java Script insteed of Ruby.
Ah my fault, everything behind a # sign isnt executed.
And i added the explanation for the "cancel" case, that wasnt there before, and the line is very long that means it gets drawn in the seccond line and therefor some letters get exectured and cause the error.
Try this one:
$game_message.face_name = 'Actor1'
$game_message.face_index = 0
$game_message.background = 0
$game_message.position = 2
$game_message.add("Choose your Style")
params = []
choices = []
choices.push("Warrior")
choices.push("Magician", "Knight", "Archer")
choices.push("Mergent", "Chuck Norris", "Eric Cartman", "MacGyver")
params.push(choices)
params.push(0)
setup_choices(params)
wait_for_message
$game_variables[1] = @branch[@indent]
Big fault of mine. I was sure i read VX-Ace. Iam sorry this isnt working in MV.
You would need a Scripter who gives you the Eventcommand Scriptcommand for this in Java Script insteed of Ruby.
It looks like I got it working for anyone wondering the code looks something like this
choices = []; params = [];
$gameMessage.setChoices(choices, 0)
choices.push("Yes");
choices.push("No");
params.push()
$gameMessage.setChoiceCallback(function(responseIndex) {
if (responseIndex === 0) {
// Player chose "Yes"
$gameScreen.startFlash([250, 250, 250, 100], 60);
} else {
$gameScreen.startFlash([0, 0, 250, 100], 60);
}
});
Are you able to repeat with else if with however many choices you may have given the player, say 8? Edit: This doesn't seem to work for me it crashes when it gets here {