Speech Coding

From Blocksworld Wiki
Jump to: navigation, search

Speech coding can be used to display player names, the values of variables and to create buttons, activate signals, and more![edit | edit source]

Special Substitutions[edit | edit source]

To display a player's user name in a speech bubble or other UI text, put the following in your text:

                                                 /name/

To display the value of a variable, put this in your text:

                                               <variable>

For example, if the following text is in the world:

                                  Hello /name/, you now have <count> apples.

And Inkplane is playing your world and the variable called "count" now has a value of "5", the text in game would read:

                                   Hello Inkplane, you now have 5 apples.

Buttons[edit | edit source]

To make speech have buttons put brackets at the end of your text.

                                                 Hello!
                                                   []

And presto you have made a blank (and functionless) button!

To add text to a button simply put text inside of the brackets.

                                                 Hello!
                                                 [Red]

And now your button will be labelled with the text 'Red'!

Buttons With Signals[edit | edit source]

To make a button activate a signal put the name of the signal after a vertical bar. The Signal reference must be capitalized.

                                                 Hello!
                                                [Red|A] 

This will activate Signal A when the button labelled "Red" is pressed.

Similarly, to add a second button add a second set of brackets and follow the same rules as above.

                                                 Hello!
                                             [Red|A][Blue|B] 

This could be used to change the color of a block with a dialog prompt.

Bold and Italic Text[edit | edit source]

Text in Blocksworld uses Unity's built-in text formatting. This allows you to do bold and italic text, and even colors.

For bold and italic text, use tags inspired by HTML:

This is <b>bold</b> and this is <i>italic</i>.

Will show up as

This is bold and this is italic.

For a complete reference of the supported tags, check Unity's documentation here: https://docs.unity3d.com/Manual/StyledText.html