- Joined
- Dec 13, 2015
- Messages
- 6
- Reaction score
- 0
- First Language
- English
So this part of my code isn't showing up when I call the scene. Developer console not displaying any errors since it's not crashing, so I think I may be missing a line or two since this is my first time using the $ RMMV Script commands.
CardGame_Scene.prototype.playMessage = function() {
$gameMessage.setFaceImage('Actor1',0)
$gameMessage.setBackground(1)
$gameMessage.setPositionType(1)
$gameMessage.add('Wanna play?')
choices = [];
params = [];
$gameMessage.setChoices(["Yes", "No"], 0, -1)
$gameMessage.setChoiceCallback(function (choice) {
if (choice == 1) {
SoundManager.playCancel();
SceneManager.goto(Scene_Map);
};
if (choice == 0) {
$gameMessage.add("You currently have \G\$")
var bet;
$gameMessage.setNumberInput(bet, 5);
$gameMessage.setChoices(["I got the cash","Nevermind",0,-1]);
$gameMessage.setChoiceCallback(function (choice) {
if (choice == 1) {
SoundManager.playCancel();
SceneManager.goto(Scene_Map);
};
if (choice == 0) {
$gameParty.gainGold(-bet);
};
});
}; /
});
};
Some lines are deliberately missing semi-colons as per the format of the RMMV script calls list. When I tried having each line end with a semicolon, it doesn't change the effect - the scene pops up fine, but the playMessage doesn't display.
I started JS just a couple weeks ago, and I'm new to coding in general so any help or tips will be appreciated.
CardGame_Scene.prototype.playMessage = function() {
$gameMessage.setFaceImage('Actor1',0)
$gameMessage.setBackground(1)
$gameMessage.setPositionType(1)
$gameMessage.add('Wanna play?')
choices = [];
params = [];
$gameMessage.setChoices(["Yes", "No"], 0, -1)
$gameMessage.setChoiceCallback(function (choice) {
if (choice == 1) {
SoundManager.playCancel();
SceneManager.goto(Scene_Map);
};
if (choice == 0) {
$gameMessage.add("You currently have \G\$")
var bet;
$gameMessage.setNumberInput(bet, 5);
$gameMessage.setChoices(["I got the cash","Nevermind",0,-1]);
$gameMessage.setChoiceCallback(function (choice) {
if (choice == 1) {
SoundManager.playCancel();
SceneManager.goto(Scene_Map);
};
if (choice == 0) {
$gameParty.gainGold(-bet);
};
});
}; /
});
};
Some lines are deliberately missing semi-colons as per the format of the RMMV script calls list. When I tried having each line end with a semicolon, it doesn't change the effect - the scene pops up fine, but the playMessage doesn't display.
I started JS just a couple weeks ago, and I'm new to coding in general so any help or tips will be appreciated.
Last edited by a moderator:
