A Markup Language for Interstitial Stories

The next step in providing for interstitial stories is the design of the markup language. My goal here is to make it easier to grasp and use than the original system. I’d like to include some of the features developed for SWAT, but that requires a more complex scripting language. 

XML?
An obvious approach is to do something in XML; that would permit the use of XML tools both for development and for processing. My objection to this is that some elements of the system must be embedded into a text string without otherwise disturbing that string. For example, consider this simple menu item element:

<Menu>Wait for and go along with whatever action <Name> takes.</Menu>

Hmm… there is indeed a solution to this: use different bracket delimiters, like so:

<Menu>Wait for and go along with whatever action {Name} takes.</Menu>

This separates the substitution process from the organization process. Thus, a single interstitial story record would take this form:

<Interstitial story>
   <Intro>Intro text</Intro>
   <Option>
       <Option Text>menu item text</Option Text>
       <Reaction>
           <Skip if>boolean expression</Skip if>
           <Adjustment>[increase/decrease] [Affection/Trust/Dominance] by arithmetic expression</Adjustment>
           <Output Text>output to player</Output Text>
       </Reaction>
      ...additional reactions…
   </Option>
   ...additional options...

<Interstitial story>

Substitutions
These are labels that stand for text expressions containing some variable element.

{Name} is replaced with the name of the selected actor
{Nominative Pronoun} is replaced with the gender-appropriate nominative pronoun he/she
{Accusative Pronoun} is replaced with the gender-appropriate accusative pronoun him/her
{Genitive Pronoun} is replaced with the gender-appropriate genitive pronound his/hers
{Genitive Adjective} is replaced with the gender-appropriate genitive pronound his/her
{Reflexive Pronoun} is replaced with the gender-appropriate genitive pronound himself/herself

An arithmetic expression consists of a numeric constant, a variable, or the operators BSum, BDifference, or Blend.