- Sep 28, 2017
- Reaction score
- First Language
- Primarily Uses
Conditional "Show Choices"Note: This plugin is not under active maintenance.
by Aloe Guvner
by Aloe Guvner
This plugin allows developers to set conditions directly in the "Show Choices" event command.
These conditions can determine whether the choice is hidden or disabled.
No scripting knowledge or plugin commands are required!
Everything is done directly in the "Show Choices" event command, providing an intuitive and efficient way to increase the depth of your story-telling through more interesting choices.
How to use:
The conditions to hide or disable the choice are written directly into the choice.
An example is shown below. In this example, the first choice is hidden if switch #1 is ON, and the second choice is hidden if variable #1 is greater than zero. The third choice does not contain any conditions.
The format of the conditions is:
If the HIDE condition is true, the choice will be hidden.
If the DISABLE condition is true, the choice will be disabled.
To include only a HIDE condition, no comma is needed:
To include only a DISABLE condition, a comma is needed:
To include both a HIDE and a DISABLE condition, separate with a comma:
The following short-hand abbreviations may be used inside the conditions to make it easier to write conditions:
s[x] --> Game Switch #x
v[x] --> Game Variable #x
a[x] --> Actor #x (database id)
p[x] --> Party Member x (index, which starts at 0)
t[x] --> Troop Member x (index, which starts at 0)
ss[x] --> Self Switch 'X' (these are from the Yanfly plugin, not the normal Self Switches)
sv[x] --> Self Variable 'X' (from the Yanfly plugin)
&& --> AND
|| --> OR
! --> NOT
=== --> EQUAL TO
!== --> NOT EQUAL TO
> --> GREATER THAN
>= --> GREATER THAN OR EQUAL TO
< --> LESS THAN
<= --> LESS THAN OR EQUAL TO
+ --> ADDITION
- --> SUBTRACTION / NEGATIVE
* --> MULTIPLICATION
/ --> DIVISION
% --> MODULO
** --> EXPONENT
To hide a choice if Switch # 4 is ON:
◆My Choice <<s>>
To disable a choice if Switch #4 is ON:
◆My Choice <<,s>>
To hide a choice if Switch # 6 is OFF:
◆My Choice <<!s>>
To hide a choice if Variable # 2 is greater than 10:
◆My Choice <<v > 10>>
To hide a choice if Variable # 3 is less than or equal to 10:
◆My Choice <<v <= 10>>
To hide a choice if Variable #1 is less than 10 and disable if Variable #1 is less than 20:
◆My Choice <<v < 10, v < 20>>
To hide a choice if Switch #17 AND Switch #18 are ON:
◆My Choice <<s && s>>
To disable a choice if Variable #17 equals 100 OR Variable #18 equals 100:
◆My Choice <<,v === 100 || v === 100>>
To hide a choice if the Party leader's HP is less than 50:
◆My Choice <<p.hp < 50>>
To disable a choice if the Actor #1's name is NOT Banjo:
◆My Choice <<,a.name() !== 'Banjo'>>
To hide a choice if none in the party are named Kazooie:
◆My Choice <<p.every(member => member.name() !== 'Kazooie')>>
To hide a choice if any in the party learned skill #4:
◆My Choice <<p.some(member => member.hasSkill(4))>>
To disable a choice if every troop member's HP is below 25%:
◆My Choice <<,t.every(member => member.hp < member.mhp * .25)>>
This plugin is compatible with the HIME Large Choices plugin.
Make sure to install this plugin above HIME's plugin.
This plugin is compatible with Yanfly's Self Variables and Self Switches plugin.
Note the instructions in the help file for accessing these variables and switches. Plugin order doesn't matter for this one.
Free for use in commercial or non-commercial projects.
Credits required to: Aloe Guvner
- v1.2.0 (September 9 2018)
- Update variable retrieval to use getters to avoid undefined values
- v1.1.0 (August 23 2018)
- Added capability to use Yanfly's Self Variables and Self Switches in conditions
- v1.0.1 (July 1 2018)
- Fixed bug with the width of the choice window
- v1.0.0 (June 26 2018)
- Initial release