Plugin: Dynamic Text (Patreon)
Downloads
Content
PLUGIN DESCRIPTION
Plugin that attaches to Text atoms.
* it enables rich text (color/font/size https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/StyledText.html)
* it adds 25 custom rules to replace in the text. For example the text can be "{name} likes apples." and have {names} as a variable to be replaced with "Alice". The text in the scene will be "Alice likes apples".
* it allows multiple options separated by "|", a random one will be chosen each time when updating the text
* it allows references to other Text atoms by using "@" followed by id. For example for the text "{name} likes apples." if {name} is set to @mytext, the script will look for the atom with the ID mytext and uses it's values.
* It goes up to 10 levels deep when searching for references. There can be variables referencing variables referencing variables etc, this is very powerful and allows creating very complex stuff rather quickly.
* advanced triggers to replace the string directly from other plugins or through vam actions
WHO'S THIS FOR
Mainly for other creators to create mini-games, scenes, visual-novels i hope
AETERNUM ROLE
Was a necessary step in order to get decent dynamic text panels which were missing from VAM which is rather static in this regard. This plugin will allow to set up text that has lots of variation very quickly. It turned out more powerful that I planned so I will used on other stuff too like character interaction and minigames.
DEMO SCENE
There's a demo scene included that showcases what the plugin can do. It's an example for visual novel logic Here's what the scene does:
- there's a text field (pink) that acts like a visual novel text display. It has the plugin with the text value set to {slide} and then a custom variable {slide} = @slide1. When the scene loads the Plugins searches for the element with the id slide1 and replaces {slide} with the text of that atom
- there are 4 other text atoms in the scene with the plugin, slide1,slide2,slide3 and slide4. They each have their own text and rules to create a variation of some phrases. slide1 says hi, slide2 asks for your help, slide3 is a positive response and slide4 is a negative response.
- there are 4 buttons, each setting the current slide to a different step (@slide1-@slide4) and updates the main text display.
- there are also 3 text atoms that hold variables that can be used globally. For example the name of the character is held in the Text Atom with the id variableName. Then the plugin can access it through @variableName
DEMO VIDEO
KNOWN ISSUES
- the text field in the plugin has only one line visible. didn't figure out how to make it work on multiple lines in unity. to compensate I added live updates on the Text atom. So when you change the text in the plugin you can view the result live on the scene including rich text and variables replaced in real-time