Conditional choices

Have you ever felt like you wanted better control over which choices you present to the player? Tired of repeating similar "Show choices" branches and jumping to-and-fro with labels? "Conditional Choices" may be just what you need! If not, chime in and help me make it so! Or if you already have a solution, please share 🙂


This will be my first plugin for MV, although I was quite active in the XP scripting scene. As such, I'd love to know what message systems you use so that I can attempt to integrate seamlessly, or if there are already any alternatives to this plugin. If you're feeling particularly selfless, maybe some pointers with regards to testing plugin code, utilities similar to the RMXP SDK or MACL (I'm looking at MVCommons right now), or how to export a demo project so that it isn't 400MB+...


I have recorded a short video of the plugin in action. A single "Show choices" branch is used for the conversation, while the plugin takes care of hiding the unavailable options - see the attached screenshot. The code is hosted publicly at Bitbucket if you want to take a look. There is a description at the top of the script, with a bunch of examples and a more-or-less structured definition of the tag language (for those inclined).


Conditional Choices.png


Edit: I just uploaded version 0.2, which fixes an issue (pointed out by JLowther) which caused every condition after the first one to be ignored.
Hmm, the biggest plugin I can think of (for me) would be making it compatible with Hime's Large Choices plug-in (http://himeworks.com/2015/10/large-choices-mv/). Which basically combines several choices into one large list. (Instead of having option 6 set to 'More...') Hime also has a few other plug-ins that affect choices (using alternate text if conditions are/are not met) that you may want to consider making it compatible with.

 
Hmm, the biggest plugin I can think of (for me) would be making it compatible with Hime's Large Choices plug-in (http://himeworks.com/2015/10/large-choices-mv/). Which basically combines several choices into one large list. (Instead of having option 6 set to 'More...') Hime also has a few other plug-ins that affect choices (using alternate text if conditions are/are not met) that you may want to consider making it compatible with.

 



Thanks! Combining multiple "Show choice" branches into a single window was actually something I had planned to do soon-ish, but had no idea how to go about in a clean way. Hime seems to have implemented exactly the functionality I wanted, so I'll definitely look into working together with that instead of reinventing it. I see there's also http://himeworks.com/2015/11/hidden-choice-conditions/ which does roughly the same thing I'm doing here, although I think I prefer my embedded tags over explicit plugin calls. I look forward to comparing our approaches in more depth tomorrow to learn what I can.
When adding additional characters to your choices, you may need to make sure that it doesn't affect the size of the choice box shown with extra spaces.
Have you ever felt like you wanted better control over which choices you present to the player? Tired of repeating similar "Show choices" branches and jumping to-and-fro with labels? "Conditional Choices" may be just what you need! If not, chime in and help me make it so! Or if you already have a solution, please share 🙂


This will be my first plugin for MV, although I was quite active in the XP scripting scene. As such, I'd love to know what message systems you use so that I can attempt to integrate seamlessly, or if there are already any alternatives to this plugin. If you're feeling particularly selfless, maybe some pointers with regards to testing plugin code, utilities similar to the RMXP SDK or MACL (I'm looking at MVCommons right now), or how to export a demo project so that it isn't 400MB+...


I have recorded a short video of the plugin in action. A single "Show choices" branch is used for the conversation, while the plugin takes care of hiding the unavailable options - see the attached screenshot. The code is hosted publicly at Bitbucket if you want to take a look. Hopefully the description will be enough to figure out how it is used, for now.


View attachment 32128



I'm having an issue with multiple conditions in the same choice. For example, if I use [cc:S14] and [cc:S30=off], it will only use the first condition I've entered.


I've tried this as both a common event and a troop event. The same thing happens in both cases. Any idea what might cause this?


Thanks in advance!
I'm having an issue with multiple conditions in the same choice. For example, if I use [cc:S14] and [cc:S30=off], it will only use the first condition I've entered.


I've tried this as both a common event and a troop event. The same thing happens in both cases. Any idea what might cause this?


Thanks in advance!



I found the cause, which was an error on my part. I'm not sure how I managed to mess up quite that badly (multiple conditions would just never work at all), and I'm sorry for any time you wasted trying to debug or work around this. I will edit the main post within a few minutes, with an updated version of the script. If you continue to use this, please let me know if you run into any further issues and I'll try to respond in a more timely manner.

When adding additional characters to your choices, you may need to make sure that it doesn't affect the size of the choice box shown with extra spaces.



I filter the choice texts (and remove tags) before any window is created, so this, at least, should be handled correctly.
I found the cause, which was an error on my part. I'm not sure how I managed to mess up quite that badly (multiple conditions would just never work at all), and I'm sorry for any time you wasted trying to debug or work around this. I will edit the main post within a few minutes, with an updated version of the script. If you continue to use this, please let me know if you run into any further issues and I'll try to respond in a more timely manner.



Pff, no worries at all. You're doing this for free and don't owe me or anyone anything. 🙂


I appreciate you looking into it!
Hello! very neat plugin. I was curious, what are the terms of use for this plugin?
I have been using this plugin for a while and it has worked great! However, now I am having an issue with one of the events which I am hoping someone can help me with.

I am using a choice event(picture attached) where I want the player to be able to cancel the choice and go into a separate branch. If I turn this plugin off it works fine but when this plugin is on it disallows the cancel choice instead of going to a new branch. In the plugin I have the cancel fallback set to 'smart' and there are no priorities used in my choice event. I have also tried putting this plugin at the top of my plugin list and disabling my other choice related plugins.

Anyone have any ideas?

upload_2019-11-17_11-9-49.png
選択肢拡張
Choice expansion

Unlimited options that can normally be displayed only up to six can be expanded.
You can set the presence or absence of the option by using conditions such as switches and variables.
You can temporarily change the display position of the choice window.
By setting a condition, you can make the item translucent and unselectable.

Original thread: https://forums.rpgmakerweb.com/threads/conditional-choices.57246/