Switchable Text Plugin v1.1 for RPG Maker MZ

Hey RPG Makers!

McKathlin has updated her Switchable Text plugin with two new features:

  • Switchable text snippets can now be nested!
  • Variables can now be compared to other variables!

Nested Switchable Text!

You can now have multiple nested text snippets inside each other, with an unlimited depth of nesting. In most cases two to three nested snippets are sufficient to accomplish the desired goal.

Consider this example of text within a Show Text event command:

Excuse me for a moment. My \OV[v2>1]{\ON[41]{enemies}{friends} have}{\ON[41]{enemy}{friend} has} arrived.

In the above example, assume the event (in this case a nobleman) is speaking about his rivals. Variable 2 is being used to track how many rivals the nobleman has. Switch 41 is tracking whether the rivals are enemies, or if they are friends.

As we can see, \OV[v2>1] checks whether variable 2 is greater than one. If so, then we know there are multiple rivals, so we proceed to the statement inside the “if” curly brackets. If there is only one rival, then the statement inside the “else” curly brackets is used.

Inside both the “if” and the “else” curly brackets, \ON[41] checks whether Switch 41 is currently on. If so, then the nested “if” curly brackets are used to indicate an enemy or enemies; otherwise the nested “else” is used to indicate a friend or friends.

Using McKathlin's Switchable Text plugin, switchable text snippets can be nested. Depending on a variable and a switch, this statement may read "enemies have", "friends have", "enemy has", or "friend has".

Variable-to-Variable Comparison!

Now the Switchable Text plugin allows variables to be compared to other variables!

Here is a fun example of variable-to-variable comparison!

We have\OV[v22!=v23]{n’t} squished the same number of bugs.

In the above example, we use \OV[v22!=v23] to compare variable 22 and variable 23. If they are not equal, then the curly brackets are used to make the word “haven’t”. If they are equal, then the word is not changed and stays as “have”.

This causes me to wonder, does McKathlin’s home have bugs, or is she playing an RPG with a bug squishing quest, or is she coding? Bugs of all types had better scurry in fear!

You are not logged in.
Download available to supporters of the Design Counselor level and higher.

There is a newer version of Switchable Text for MZ!

To install:

  1. Download the file, and unzip it.
  2. Make sure the unzipped file is named McKathlin_SwitchableText.js and is saved as a .js file.
  3. Open the file folder of your project. Place the file in your project’s “js” folder, within the “plugins” folder.
  4. Open your project in RPG Maker MZ, then go to the Tools menu and select Plugin Manager. Use the Plugin Manager to add and activate the plugin.
  5. I recommend you place this plugin toward the bottom of your plugin list, so it has high priority.

The Switchable Text help document is included below!

McKathlin Switchable Text for RPG Maker MZ
v1.1, released 9/13/2020

Desciption of Plugin:

This plugin enables text codes for use in messages or dialogue choices. Text is inserted in place at runtime based on state of the referenced switch or variable.

How to use this plugin:

To start a switch-based snippet, use one of the following text codes:

  • \ON[ID]{text} Show the contained text if the switch is ON (true).
  • \OFF[ID]{text} Show the contained text if the switch is OFF (false).
  • \ON[ID]{foo}{bar} Show “foo” if switch is on; otherwise show “bar”.
  • \OFF[ID]{blue}{red} Show “blue” if switch is off; otherwise show “red”.

An integer ID will check the corresponding game-wide switch. If the ID is the letter A, B, C, or D, then the calling event’s self switch is checked.

Start a variable-based snippet with a statement like this:

  • \OV[vID>=N]{text} Show the text if the variable with the given ID has a value greater than or equal to N.
  • \OV[vID==N]{foo}{bar} Show “foo” if the variable’s value is equal to N; Otherwise, show “bar”.
  • \OV[vJ < vK]{blah} Show “blah” if variable J’s value is less than variable K’s value.

The following comparison operators are valid for variable-based snippets:

== Equal
!= Not equal
>= Greater or equal
> Greater than
<= Less or equal
< Less than

If a dialogue choice ends up empty for a given Switchable state, it will not appear in the player’s list of dialogue choices. This allows available choices to vary dynamically based on game state.

Due to Switchable Text’s use of curly braces as delimiters, any text in which switchable snippets and literal curly braces both occur will need to escape the literal curly braces thus:

  • \BO Opening brace {
  • \BC Closing brace }

Examples:

  • Good \ON[21]{evening}{day}, \OFF[A]{stranger}{friend}. Go safely. \OV[143<=10]{Watch out for wolves.}
  • Excuse me for a moment. My \OV[v2>1]{\ON[41]{enemies}{friends} have}{\ON[41]{enemy}{friend} has} arrived.
  • We have\OV[v22!=v23]{n’t} squished the same number of bugs.

This plugin does not use any parameters or plugin commands.

Version History:

v1.0: 9/3/2020

  • Switchable Text plugin released for RPG Maker MZ!

v1.1: 9/13/2020

  • Added nested text snippets! Now, you can use switchable text snippets nested within each other!
  • Added variable-to-variable comparison. You can now check one variable’s value against the value of another variable.

Terms of Use:

  1. You joined Tyruswoo.com as a paying member when you downloaded this plugin. You do not have to remain a paying member to use the plugin you downloaded. However, your support is greatly appreciated, and allows me to continue improving and updating plugins.
  2. You agree to not redistribute this plugin. You agree to direct others to Tyruswoo.com if they want the plugin.
  3. You may use this for any game for which you are one of the main developers. This includes any commercial or non-commercial game you are creating.
  4. Adding “McKathlin” to your game’s credits is greatly appreciated, but not required.
  5. Likewise, listing which Tyruswoo Team plugins you used is appreciated, but not required.
  6. A free copy of your game is awesome, but not required.

Enjoy the plugin!
-McKathlin

Big thanks to McKathlin for this update to the Switchable Text plugin!

Tyruswoo

Questions or concerns? Check out the forums to ask a question. You may even find an answer there, already!

To view and submit comments on this post, you must be logged in and joined as at least a Warm Fuzzy member. Log In No account, or ready to upgrade your membership? Join the adventure!

Tyruswoo

Indie Game Designer
creating game content!

Latest RPG Maker

Pin It on Pinterest

Shares