Conditional "Show Choices" (hide or disable choices)

daisyfairy42

Villager
Member
Joined
Jun 6, 2016
Messages
9
Reaction score
4
First Language
English
Primarily Uses
RMMV
Heyo, wanted to post a thank you! This is an absolute life-saver for me! I dropped it in, set it up like you said, and it worked like a charm!
 

lendokhar

Warper
Member
Joined
Oct 1, 2018
Messages
1
Reaction score
0
First Language
Spanish
Primarily Uses
RMMV
It doesn't work for me, once I run the game the choices show the <<s[1]>> and <<v[1]>> strings.
Is the plugin broken already?
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,119
First Language
English
Primarily Uses
RMMV
@lendokhar Works fine in all the tests I've run.

Some basic problem solving questions for you:

  1. Do you have the latest version?
  2. Does it work with all other plugins turned off?
    • If yes, it's a compatibility issue. You need to identify the incompatible plugin by turning them on one-by-one until the issue is found
    • If it's a compatibility issue, please post a screenshot of the list of plugins you use from your Plugin Manager
  3. Did you rename the plugin to something besides the original name?
  4. Did you change the plugin parameters to use something besides << and >> ?
    • Please post a screenshot of the settings of this plugin from the Plugin Manager
  5. Do any errors appear in the console? (press F8 during playtest to open it)
 

Qqernometabom

Villager
Member
Joined
Feb 19, 2018
Messages
13
Reaction score
6
First Language
English
Primarily Uses
RMMV
Is there a way to put a sound when selecting the disabled choice?
I don't know if i have authorization to change your plug-in.

For example:
Code:
        var se = {};
        se.name = 'Item3';
        se.pan = 0;
        se.pitch = 100;
        se.volume = 90;
        AudioManager.playSe(se);

It looks awesome !

EDITED:
Only now occurred to me that i disabled all rmmv default audio settings, and the default "disabled choice audio" will probably play when selecting. xD

EDITED 2:
Yes, it does. Lol, i'm sorry.
Don't know how to deleted this spam. D:
 
Last edited:

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,119
First Language
English
Primarily Uses
RMMV
I never tested for sound, so it's good to know it works :)

People are allowed to edit my plugins, if the edit can benefit most people then I request the edit is shared and I add it to a new version of the plugin.
 

jakr8911

Veteran
Veteran
Joined
Feb 18, 2017
Messages
34
Reaction score
1
First Language
english
Primarily Uses
Other
Is there a way to change the word on the option when player confrim their selection? I want to fool the player a bit
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,119
First Language
English
Primarily Uses
RMMV
What do you mean? When the player "confirms their selection"?

When the player selects a choice, the choice window goes away and the event moves to the next command. There would be no text to change.
 

Orleron

Warper
Member
Joined
Nov 13, 2017
Messages
2
Reaction score
0
First Language
English
Primarily Uses
Other
It doesn't work for me, once I run the game the choices show the <<s[1]>> and <<v[1]>> strings.

I have this same problem and I can confirm that it is because of the Yanfly Extended Messaging Pack 1 (YEP_X_ExtMesPack1). When I switch that plugin off, the problem goes away. Unfortunately, the extended messaging pack is quite valuable for my game.

fyi, thanks.
 

Kenode

Veteran
Veteran
Joined
Jun 17, 2018
Messages
68
Reaction score
26
First Language
Spanish
Primarily Uses
RMMV
I have this same problem and I can confirm that it is because of the Yanfly Extended Messaging Pack 1 (YEP_X_ExtMesPack1). When I switch that plugin off, the problem goes away. Unfortunately, the extended messaging pack is quite valuable for my game.

fyi, thanks.
I don't seem to have this issue myself, and I'm running a big load of plugins, are you placing Aloe's plugin BELOW Yanfly's?
 

kako05

Veteran
Veteran
Joined
Sep 11, 2017
Messages
168
Reaction score
18
First Language
Australian
Primarily Uses
RMMV
OR statement doesn't work.
<<,v[119] < 8 || ,v[119] >= 17>>
My 119 variable is set to 15 and it's disabled.

btw is it possible to check for an item? If party has item ID 3, show choice?
 
Last edited:

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,119
First Language
English
Primarily Uses
RMMV
I've tested "or" statements, it works fine

<<,v[119] < 8 || ,v[119] >= 17>>
There's an extra comma after the || operator that's probably causing a syntax error, if you remove the comma it should work. I log all errors to the console which can be opened in playtest by pressing F8.

You can also do it based on if the party has an item or not. You'll want to use the game party has item function.

Code:
gp.hasItem($dataItems[ID])
Replace ID with the ID# of the item. "gp" is an abbreviation for "$gameParty" only for this plugin.
 

kako05

Veteran
Veteran
Joined
Sep 11, 2017
Messages
168
Reaction score
18
First Language
Australian
Primarily Uses
RMMV
gp.hasItem($dataItems[ID]) works just fine, but instead of disabling I need to enable a choice.
I tried <<,gp.hasItem($dataItems[ID]) <= 0>> which should disable a choice if party has zero items? but had no success.

Also, you were right, it was a syntax error.
Really good plugin, one of my favorites. It helps with quest givers and progression of the quests.
 
Last edited:

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,119
First Language
English
Primarily Uses
RMMV
No problem - here's a quick tip:

In Javascript there are different types of data. The most common types are:
  • Numbers
  • Strings (letters / text)
  • Boolean (true or false)
The "has Item" function returns a boolean, so the result is either true or false. True if the party has the item and false if the party doesn't have the item (there must be a function that tells you how many items the party has but I forget what it is!)

To flip it so the choice is enabled when the party has an item, you do the opposite - in Javascript and many programming languages this is called a not operator and it is a "!" mark.

Code:
<<,!gp.hasItem($dataItems[ID])>>

In English, this means "Disable if the party does not have item" which is exactly the same as saying "Enable if the party does have item"

Hopefully this makes sense? :biggrin:
 

kako05

Veteran
Veteran
Joined
Sep 11, 2017
Messages
168
Reaction score
18
First Language
Australian
Primarily Uses
RMMV
Oh, thanks! That makes sense. Really appreciate. I made a workaround with IF command and control variables (if this item = set variable to X), but it'll be easier for the next event knowing what you told me :)
btw I'm using it with galv's picture choices
https://galvs-scripts.com/2016/12/09/mv-choice-pictures/
unfortunately, if the choice has a command << anything >> it won't display a picture upon choosing the choice. Would you take a look at it and what's causing it? I would pay for a compatibility patch :)
 
Last edited:

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,119
First Language
English
Primarily Uses
RMMV
If you find you are setting variables equal to the quantity of items a lot, you might be interested in this plugin. I found myself setting variables a lot so I wrote that to make it easier.

I'll look at the Galv plugin to see if there is a conflict.

Edit: Try putting my plugin below Galv's. He overwrites a function, I don't overwrite it (Window_ChoiceList.prototype.makeCommandList)
 
Last edited:

kako05

Veteran
Veteran
Joined
Sep 11, 2017
Messages
168
Reaction score
18
First Language
Australian
Primarily Uses
RMMV
Good news. I did that, it still didn't work. I managed to fix it by changing
Dog House <p:travel_dog_1,960,368> <<v[112] < 1>>
to
Dog House <<v[112] < 1>> <p:travel_dog_1,960,368>
:D
Galvs must be in front of the syntax.
 

gothicvoid

[GothicVoid]
Veteran
Joined
Feb 14, 2019
Messages
242
Reaction score
263
First Language
English
Primarily Uses
RMMV
was referred to this utility by another because i was having issues with another like plugin... (it kept freezing my game TT~~TT ) and it was SUPER SIMPLE!!! Thanks so much!!!
 

Almightypebble

Veteran
Veteran
Joined
Jan 13, 2017
Messages
78
Reaction score
5
First Language
Bulgarian
Primarily Uses
RMMV
Hey!
I seem to have a problem with this plugin when combined with Galv's Visual Novel Choices. If I put this plugin on top of his, your plugin doesn't seem to work, but if I put it below his, the pictures for his visual novel choices don't load and it cuts off the beginning and the end of my text.
Should I edit something in the plugins?
 

kako05

Veteran
Veteran
Joined
Sep 11, 2017
Messages
168
Reaction score
18
First Language
Australian
Primarily Uses
RMMV
Hey!
I seem to have a problem with this plugin when combined with Galv's Visual Novel Choices. If I put this plugin on top of his, your plugin doesn't seem to work, but if I put it below his, the pictures for his visual novel choices don't load and it cuts off the beginning and the end of my text.
Should I edit something in the plugins?
Galv's vnc is not compatible with this plugin. With this plugin, the text is pushed off the center in my project since this plugin code is invisible on gamerun, but it's treated as an additional text in dialogue menu. I add empty spaces to counter that, but it's a messy way to do it.
 

palatkorn

Veteran
Veteran
Joined
Nov 1, 2019
Messages
267
Reaction score
192
First Language
thai
Primarily Uses
RMMV
Excellent. This plugin works great. Hide and easily choose options.
Good work
 

Latest Threads

Latest Posts

Latest Profile Posts

oh looks like the forums updated while I wasn't looking and we can put a banner now. Neat!
Treating this as a devlog
Finally feel well enough to sketch. Took twenty minutes to find the tablet. Another ten for the cable. Only to discover that my Clip Studio Pro license has expired. Yup. Gonna be one of those days.
Is there a way to add pictures to profile posts?

Forum statistics

Threads
107,658
Messages
1,031,202
Members
139,784
Latest member
VictorDmAlves
Top