Thank you for the fast answer and help. 🙂 (\s/)
Disabled Choice Conditions
JS Plugin Releases (RMMV)I've always made heavy use of your dialog scripts. This one is no exception.
I prefer keeping options visible, as a form of foreshadowing. It gives the player a clear indication whats possible, and they can't do it YET.
If they want to, they need to find a way.
I prefer keeping options visible, as a form of foreshadowing. It gives the player a clear indication whats possible, and they can't do it YET.
If they want to, they need to find a way.
Attempting to call a self variable in a disable choice function seems to break things.
disable_choice(1, "this.get_self_variable(\"HAS_QUEST\") === false");
I am guessing that 'this' may not be in the correct object?
disable_choice(1, "this.get_self_variable(\"HAS_QUEST\") === false");
Code:
TypeError: undefined is not a function at eval (eval at <anonymous> (file:///X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/plugins/Hime_DisabledChoiceConditions.js:130:42), <anonymous>:1:6) at disable_choice (file:///X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/plugins/Hime_DisabledChoiceConditions.js:130:37) at Game_Interpreter.eval (eval at <anonymous> (file:///X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/rpg_objects.js:10438:10), <anonymous>:1:1) at Game_Interpreter.command355 (file:///X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/rpg_objects.js:10438:5) at Game_Interpreter.executeCommand (file:///X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/rpg_objects.js:8896:34) at Game_Interpreter.update (file:///X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/rpg_objects.js:8804:19) at Game_Map.updateInterpreter (file:///X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/rpg_objects.js:6081:27) at Game_Map.update (file:///X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/rpg_objects.js:5988:14) at Scene_Map.updateMain (file:///X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/rpg_scenes.js:417:14) at Scene_Map.updateMainMultiply (file:///X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/rpg_scenes.js:409:10) at Scene_Map.update (file:///X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/rpg_scenes.js:398:10)
As you expected, the script call is in global window scope and not in interpreter scope.
I've updated the plugin so you can use an interpreter variant
I've updated the plugin so you can use an interpreter variant
Code:
this.disableChoice(2, "this.get_self_variable('HAS_QUEST') === false");
thanks for the fix Hime. Unfortunately... Using that replacement removes the error but the choice is not disabled.
this.disableChoice(1, "this.get_self_variable('HAS_QUEST') === false");Replacing the self variable call with a game variable call works normally.
Code:
this.disableChoice(1, "$gameSwitches.value(181) === false");
I have no clue why... But the above self variable comparison to false doesn't work at all...
This works:
this.disableChoice(1, "!this.get_self_variable('HAS_QUEST')");These conditionals do not work. As in, they are totally ignored as if no code was even entered. No error, nothing.
this.disableChoice(1, "this.get_self_variable('HAS_QUEST') === false");this.disableChoice(1, "this.get_self_variable('HAS_QUEST') == false");But comparisons to true work fine.
Example:

EDIT:
I even tried using false comparisons in normal conditionals...
This doesn't work.

This does work.

Seems the issue may be with self variables... Or some odd syntax quirk?!?
This works:
this.disableChoice(1, "!this.get_self_variable('HAS_QUEST')");These conditionals do not work. As in, they are totally ignored as if no code was even entered. No error, nothing.
this.disableChoice(1, "this.get_self_variable('HAS_QUEST') === false");this.disableChoice(1, "this.get_self_variable('HAS_QUEST') == false");But comparisons to true work fine.
Example:

EDIT:
I even tried using false comparisons in normal conditionals...
This doesn't work.

This does work.

Seems the issue may be with self variables... Or some odd syntax quirk?!?
Chances are, those variables have not been set, so they are undefined.
undefined is not equal to false.
However, saying "!undefined" would perform a boolean check, and undefined would resolve to false in that case. This would be one of those odd syntax things since "undefined" is not a boolean value.
It may be better to avoid using == for that reason and just stick with something like
undefined is not equal to false.
However, saying "!undefined" would perform a boolean check, and undefined would resolve to false in that case. This would be one of those odd syntax things since "undefined" is not a boolean value.
It may be better to avoid using == for that reason and just stick with something like
Code:
"!expression " // check false"!!expression " // check true (negate a false)
The variables are set in the screen shot examples... It was my first assumption as well. Which is why I made sure to set them immediately before trying to use them. 🤔
This is really weird.
Is there a version compatible with MZ? It's just that Large Choices is compatible with MZ and this plugin doesn't work.
Hi!
Maybe you have another plugin conflicting?
Because as I can see on the plugin file, it indeed does support MZ.
Maybe. I'll try to find out with which plugin the conflict is. There are really no errors. It just doesn't disable choice.
So. I found out. It's just that your plugin will have to be installed below VisuMZ_1_MessageCore.
Nice!
But this plugin is not mine xD
Original thread: https://forums.rpgmakerweb.com/threads/disabled-choice-conditions.48734/