- Joined
- Aug 24, 2017
- Messages
- 81
- Reaction score
- 8
- First Language
- Chinese
- Primarily Uses
- RMMV
Hi
I got a question.
I would like to use JS code in event page 3 "script"
I was using "Self Switches & Variables" by yanfly
http://yanfly.moe/2016/08/06/yep-113-self-switches-variables-rpg-maker-mv/
the plugin have a code
When I use the code itself without anyother code, it work.
But when I put it inside show choices code it fail
I know little about JS.
Can anyone tell me how to make this work?
I got a question.
I would like to use JS code in event page 3 "script"
I was using "Self Switches & Variables" by yanfly
http://yanfly.moe/2016/08/06/yep-113-self-switches-variables-rpg-maker-mv/
the plugin have a code
Code:
this.setSelfVariableValue(mapId, eventId, varId, value)
But when I put it inside show choices code it fail
Code:
$gameMessage.add('Which one?');
$gameMessage.setChoices(['One', 'Two'], 0, -1);
$gameMessage.setChoiceCallback(
function (choice) {
if(choice === 0){
this.setSelfVariableValue(2, 5, 22, 1);//this one fail
};
if(choice === 1){};})
Can anyone tell me how to make this work?
