# Tag

Custom decorators

Tags allow you to decorate your script statements for specific behaviors in custom widgets and Interpreters. They are just additional metadata to be used by your own Blueprints/Classes; they do nothing by default.

  • A tag instruction starts with a # (Hashtag) followed by its name.

You can place multiple tags in a single instruction or concatenate multiple instructions, both methods result in the same array of tags. A statement can have as many tags as required.

As a usage example, your project may have a Dialog Box widget that shows your character expression when saying a sentence or a Selection Box widget that colorizes an option.

Your custom widgets will receive these tags as an Array of Strings in its Play event 'Tags' parameter.

Key-Value Pair

A tag can be formatted in a key-value pair pattern using : (Colon) like the example below.

On your Interpreter or custom widget, you can check your tags and split the data.

Custom Patterns

Notice that tags are simple strings, meaning you can use custom patterns and formats to pass data, and later, you code your widgets and/or Interpreter to identify these patterns and act accordingly.

For example, you can write a tag using commas or semicolons and split the data later in your custom code.

- Bob | #data1;data2;data3;data4
  Hello!
  
- Bob | #list=1,5,3
  Hello!
  
- Bob | #struct:name=move;location=0,0
  Hello!

Last updated