The Regnus Scripting Tutorial
Part 13: Hidden Text
There are times when you may want to carry out the action of a reference without displaying the resulting text to the user. This is possible in Regnus using the "hidden text" feature, which allows you to simply enclose any portion of text in bracket characters ("{" and "}"), which causes it not to be displayed. So:
START <Example>{This text is not displayed!}This text is displayed!
In what circumstances might this be useful? Well, the main reason is for storing a set of data in storage slots at the beginning of a script to be retrieved later in order to keep a script tidy. For example:
START <Example>{#>(0):Species;}Tom had a pet ##[0]; called Jerry.
GROUP Species
ENTRY frog
ENTRY dog
ENTRY cat
Of course, in that particular example, there is little reason to use hidden text, but in a much larger script with a lot of different stored variables, it can help enormously in keeping the script tidy and readable if all the slots are named helpfully and the random data is all generated before the main part of the content.
However, where pre-generating data using hidden text brackets really comes into its own is when using aliases. For example, consider the following script:
START <Example>{#>(0):Species;}"#@[0]:(1);" said Tom's pet ##[0];.
GROUP Species
ENTRY frog
ENTRY dog
ENTRY cat
ALIAS frog:Ribbit!
ALIAS dog:Woof!
ALIAS cat:Miaow!
Here, we want to use the correct sound based on the species selected, but we want to use the result before we know the species. Therefore to get around this, we generate the species first, but hide the result with brackets, then use the alias to return the correct sound.
This script is not especially complex, but once you understand how it works, you should be able to expand on this concepts to create very powerful text generation procedures!