Regnus 5.5

The Random Text Scripting Language

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):Animal;}Tommy had a pet ##[0]; called Jerry.

GROUP Animal
ENTRY frog
ENTRY dog
ENTRY beaver

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 instance, consider the following script:

START <Example>{#>(0):RandomName;}I had a friend. #@[0]:(1); name was ##[0];.

GROUP RandomName
ENTRY Tom
ENTRY Hilda

ALIAS Tom:His
ALIAS Hilda:Her

Here, we want to use the correct gender pronoun based on the name selected, but we want to use the result before we know the name. Therefore to get around this, we generate the name first, but hide the result with brackets, then use the alias to return the correct pronoun.

A more complex, but probably more elegant version of the same concept would be to generate the sex of the character first, and then choose a name based on the result, as well as other relevant information:

START <Example>{#>(0):Sex;}I had a friend called #@[0]:(Name);. #@[0]:(Pronoun); had a #@[0]:(Spouse); called #@[0]:(SpouseName);.

GROUP Sex
ENTRY male
ENTRY female

GROUP MaleName
ENTRY Tom
ENTRY Jerry

GROUP FemaleName
ENTRY Hilda
ENTRY Bertha

REFER 1:Name
ALIAS male:##MaleName;
ALIAS female:##FemaleName;

REFER 2:Pronoun
ALIAS male:He
ALIAS female:She

REFER 3:Spouse
ALIAS male:wife
ALIAS female:husband

REFER 4:SpouseName
ALIAS male:##FemaleName;
ALIAS female:##MaleName;

This script is not especially complex, but once you understand how it works, you should be able to expand on these princibles to create very powerful text generation procedures!