Disabled Choice Conditions

● ARCHIVED · READ-ONLY
Started by Tsukihime 33 posts Page 2 of 2 View original ↗
  1. Tsukihime said:
    For hiding choices from view, use the Hidden Choice Conditions plugin which is the same idea except instead of disabling them you hide them.
    Thank you for the fast answer and help. :) (\s/)
  2. 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.
  3. 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");
    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)
    I am guessing that 'this' may not be in the correct object?
  4. 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

    Code:
    this.disableChoice(2, "this.get_self_variable('HAS_QUEST') === false");
  5. Tsukihime said:
    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

    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");
  6. 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:

    16_0107_selfVariable _issue_1.PNG

    EDIT:

    I even tried using false comparisons in normal conditionals...

    This doesn't work.

    16_0107_selfVariable _issue_1b.PNG

    This does work.
    16_0107_selfVariable _issue_1c.PNG

    Seems the issue may be with self variables... Or some odd syntax quirk?!?
  7. 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

    Code:
    "!expression "  // check false"!!expression " // check true (negate a false)
  8. Tsukihime said:
    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

    "!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. :unsure:

    This is really weird.
  9. Is there a version compatible with MZ? It's just that Large Choices is compatible with MZ and this plugin doesn't work.
  10. Alexandr_7 said:
    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.
    1648537274088.png
  11. Eliaquim said:
    Hi!
    Maybe you have another plugin conflicting?
    Because as I can see on the plugin file, it indeed does support MZ.
    View attachment 221388
    Maybe. I'll try to find out with which plugin the conflict is. There are really no errors. It just doesn't disable choice.
  12. So. I found out. It's just that your plugin will have to be installed below VisuMZ_1_MessageCore.
  13. Alexandr_7 said:
    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