ABML Tag Reference

ABML Tags – Reference

General Information– General Information about Tag usage

Index:

  • tt – the Turn To tag
  • rtt – the Return To tag – when you don’t know where the reader came from
  • tts – the Turn To Script tag – turn to a calculated reference
  • tti – Turn To Input, turn to a readers choice
  • ttr – Turn To Restriction destinations (relevant for tti and tts)
  • ttf – Turn To Failure – text for failed Turn To attempts (relevant for tti and tts)
  • bookend – the ending an adventure tag
  • event – making things happen
  • choice – letting your characters do something
  • info – information for your readers
  • if – controlling your adventure
  • else – controlling your adventure
  • script – making complex things possible
  • include – combining documents
  • external – allows links to external pages from the hosted system (note: redundant since xhtml anchors are allowed anyway, please be sure to make your target attribute ‘_blank’ when you do so for courtesys’ sake)
  • xtt – substitute for the xhtml tt tag (no further documentation tt tag is html 5 redundant)

Under Consideration: ‘vtt’ – Verbose Turn To, Intended to ‘wrap’ 1 existing link creating tag (any of the tt group or the option tag) invisibly to provide a Verbose command sentence or group of words to select for use with Voice Controlled applications.

Example: “The boulder is rolling toward you. You may: <vtt>Run away down the corridor (<tt ref=”123″>turn to 123</tt>)</vtt> or try to <vtt>dive through the door to the left (<tt ref=”321”>turn to 321</tt>)</vtt>

It can be argued that judicious use of the tt tag itself renders this pointless, however I am attempting to cover visual ease requirements as well as the new wave of voice controlled potential.

Under Consideration: The ‘restarts’ attribute, clicking on link X (option or TT) will count as a full restart – to be used to allow re-rolling of stats without the aggro of going through the whole ‘Abandon and Restart’ procedure.

Under Consideration: The ‘cheat’ attribute, clicking on link X (option or TT) to indicate that this adventure attempt has been cheated in (maybe with a cheat count per attempt or something), so that attempts/completed may be clarified further.

Let me know your thoughts.

General Tag Information:

All tags follow the HTML standard of tagging, that being  <  and  >  enclosing the tag information, and each tag having the corresponding </> equivalent to end the tagged text.  Note some tags follow the xml style single tag <tagname attribute1=”value” attribute2=”value” attributeN=”value” /> which do not require a closing tag.  Some tags are optional in respect of being a single tag or requiring a closing tag.

At this time all tags are case sensitive, and should be lowercase (e.g. <tt ref=”123″>123</tt>).  Tags that are capitalised (e.g. TT) will be understood for the moment, but please use lowercase from now on as I plan to enforce correct XML style at some point in the future.  (Note: all existing adventures on the system will have all references updated automatically before I enforce the xml style in the system).

All tags have various attributes, some are optional and some are required to make the tag do anything at all. Attributes all follow the format <tagname attributename=”attributeinformation”>. As with tag names attibute names are (currently) case sensitive, the = is required, and the attribute information MUST be enclosed in double quote “” marks. Tags are allowed to have multiple attributes defined for them – though duplicate attributes in the same tag will cause an error.

SEL?

Many required attribute values will just state ‘SEL code’. This is the Simple Expression Language which is described elsewhere on the site.  You will require knowledge of this to produce anything but very simple adventures, though I am trying to make it as easy as possible – sorry!  But note, it can be as easy as asking an ‘if’ tag whether “$skill == 10;” in the attribute to see if a heros Skill is 10 or not.

Note that since ABML is meant to be (heading towards) an xml document definition, while SEL is used everywhere, the intention is that any script language which returns required information should be usable as long as the document parser can deal with it, it’s just that here on fightingfantasy.net the only script language usable is SEL.

Tag Nesting

Nesting is supported where appropriate, particularly inside ‘if’ and ‘else’ tags (tags such as ‘tt’ and ‘if’s inside ‘if’s, or inside ‘else’ etc.).

Whitespace

Whitespace in ABML is largely ignored *excepting* that, carriage returns outside a tag will be converted to a newline (<br /> in HTML).   Carriage returns inside a tag will be ignored so you may – if you have a complex tag – space it across several lines for readabilities sake, without messing up your adventure text formatting.

Boolean Attributes

As of today (October 2021) I am removing support for Boolean Attributes.  This is due to the current state of the 3rd Party Editor I am using which enforces all attributes to have a value association.  Fear not – too much, anyway, exisiting Boolean attributes in Adventures will process normally, however when EDITING a reference that contains a tag that contains a Boolean Attribute the Editor will currently substitute this for a valued attribute with the value of NULL, i.e. ‘enforce’ will become ‘enforce=””‘.  Unfortunately this means your attribute will now become FALSE even though it was meant to be TRUE!  To remedy this simply fill the value with ‘true’ i.e. enforce=’true’.  Do not worry too much – I will be attempting to make a site-wide script to rememedy this problem in all adventures at some time soon.

TLDR: Now all Boolean attributes MUST be valued ‘true’ or ‘false’.

Static Attribtes

Static attributes have no effect when the tag is generated dynamically, meaning if the tag is created with a script the attribute will be ignored if it is present.

Single Tags (aka Void or Singletons)

As of October 2021 I am removing support for the Single Tag style: <tag />, you must now use full tagging styles for all tags e.g.: <tag>content</tag>, even if there is no content.  This is due to the current state of the new 3rd party Text Area plugin I am using on the Editor which will throw a hissy fit at you using Singleton tags unless they are predefined HTML 5 Singleton tags.  I am presently in the process of writing a script to manually update all singleton tags in all references in all books site-wide so you hopefully will not  have to amend your adventures to reflect this change.

Special Note, Entities

As with HTML, using > or < symbols for any other purpose than tag delimitation will cause problems with your document. Due to not implementing a proper parser yet, this is specifically a problem for embedded SEL statements in tag attributes, for example:

<if condition=”$skill > 10;”>….</if>

…to check if a characters skill value is greater than 10, will break the page, since the > sign in the condition attribute will be read as closing the ‘if’ tag early, e.g. the system will see this as the whole tag:

<if condition=”$skill >

As with HTML simply use the following 2 replacements:

> use &gt;
< use &lt;

So in the example given you would write:

<if condition=”$skill &gt; 10;”>….</if>

Which will do what you expected with the > sign.

Also note the ampersand sign – & – needs to be written in the main text body as follows:

&amp;

You do NOT need to use this entity inside attributes (particularly SEL code attributes) here at fightingfantasy.net, you only need to use it in your text to be displayed.  This approach by me is probably bad practice xml-wise, so you may wish to do so anyway as it wont hurt your code (the entities are all replaced pretty much before anything else internally).

Lastly, if you are a xhtml coder you are probably wondering where &quot; and &apos; are.  Uhm… don’t look at me – yet *embarrassed*.  They will work fine in your main text though as this is just passed straight back at your browser, likewise all  xhtml numbered entities (&#34; etc.).

These bodge fixes should not be present in the final version of abml, and entity replacement, attribute character handling etc. should follow xhtml standards.

Also note (October 2021) the &quot; entity must be used within attribute parameters for double quote marks.  e.g. <script script=”&amp;print(&quot;hello world&quot;);”></script> when using the editor else it throws a hissy fit.  The &quot; entity may be used anywhere you want double-quotation marks, except attribute delimiters.

tt

The main tag used in creating adventure gamebooks, the tt tag is used to link your references/pages together. The enclosed text becomes the link for users to click on, taking them to the new reference/page.

(Please note the ‘Auto Tag’ button in the editor.  You may simply type ‘turn to 123 or turn to 432 but if you have a sword turn to 312’, then click the ‘Auto Tag’ button and your phrases will be automatically tagged with the tt tag correctly – but also note this currently only works for phrases that match ‘turn to #number’.  I may expand the regex to match a single word following the phrase ‘turn to’, e.g. ‘turn to introduction’ at some point.  Keep an eye on development news in the forum.)

Attributes

  • ref (required)
    ref defines which reference number/name you want the tt tag to link your text to. Naturally the reference name/number must exist before clicking on the link will work.
  • inv (optional)(boolean)(untested)
    Stands for ‘If Not Visited’. The link will be deactivated if the reference in ‘ref’ has already been visited.
  • script (optional)
    Any script code placed in this attribute will be executed in addition to the turn-to action, so you can both, for example, deduct gold and turn to another page in one tag.
  • enforce (optional) (boolean)
    This attribute will make all links on the page act as if the reader had clicked this link, forcing them to turn to the specified page. Subsequent links are disabled, but currently does not affect links outside its output area, i.e. enforced reference links do not affect a charsheet reference and vice versa.  It is a stand alone attribute and requires no value.
  • override (optional) (boolean)
    Disables subsequent links.  Useful for making a reader turn to a reference at least once before proceeding through a page (i.e. using the visits attribute in conjunction).
  • thumbprint (optional) (boolean)
    This attribute is intended for use in conjunction with a <rtt> tag. When present on a clicked link a thumbprint memo of the current reference is stored to which the next clicked <rtt> tag on any subsequent reference will return the user. The thumbprints are stored in a stack fashion meaning that if other thumbprints are clicked before a <rtt> tag is clicked the reader is returned to the most recent thumbprint.
  • bookmark (optional) (boolean)
    When present this attribute causes the system to store a ‘bookmark’ of the current state of this reference in play, such that if this reference is revisited all <events>, <options>, and <if>/<else> tags will be remembered as though the page had not been left.  For example, usually an <option> tag with a count of 3 (3 uses) would have this count reset to 3 if the reference was left and revisited.  When a reader leaves a reference using a <tt> tag with the bookmark tag enabled, the number of times that <option> tag has been used will be remembered if the reader revisits that reference, so if it had been used 3 times (and therefore disabled), the option tag will still be disabled when the reader returns to the reference.
  • visits (optional) (static)
    Used to limit the number of times a Turn-To link may be used. When present also stores a bookmark (see ‘bookmark’ attribute). The number defined for this attribute is the number of times a reader may pass through the <tt> tag. Note that since a bookmark is used then a reader passing through a tag without a bookmark or visits attribute on this reference will reset the count of times they have passed through this tag. Useful for ‘If you have not already done so, you may Turn To…’ scenarios.
  • recall (optional)(boolean)
    Shorthand for attributes visits=1 + override + thumbprint.  This is useful for the very common ‘Make a note of this reference, turn to X, and return here when finished’ instruction in gamebooks. Note that the ‘visits’ portion is static though the override and and thumbprint will apply if the tag is generated dynamically.

Examples:

<tt ref=”1″>Now Turn to 1</tt>

<tt ref=”1″ recall>Turn to 1</tt> and return here when finished.

<tt ref=”1″ script=”$gold=$gold+1;”>Gain 1 Gold and turn to 1</tt>

If you have not already done so you may <tt ref=”1″ visits=”1″>Turn to 1</tt>

You MUST <tt ref=”1″ enforce>Turn to 1</tt> without doing anything else on this reference.

Before proceeding any further now <tt ref=”1″ override visits=”1″>Turn to 1</tt> if you have not already done so.

You leave the room by <tt ref=”1″ bookmark>turning  to 1</tt> but have a feeling you will be returning here soon.

Make a note of this reference and <tt ref=”1″ thumbprint>Turn to 1</tt>

rtt

This tag returns the reader to the most recently created thumbprint (see ‘tt’ tag), or if no thumbprint is present returns the reader to the previous reference.  Being returned to a thumbprint removes the thumbprint from the stack so that previous thumbprints may be accessed.

Attributes

  • script (optional)
    As per the <tt> tag script attribute
  • enforce (optional) (boolean)
    As per the <tt> tag enforce attribute
  • override (optional) (boolean)
    As per the <tt> tag enforce attribute
  • thumbprint (optional) (boolean)
    As per the <tt> tag thumbprint attribute
  • bookmark (optional) (boolean)
    As per the <tt> tag bookmark attribute
  • visits (optional) (static)
    As per the <tt> tag visits attribute
  • recall (optional)(boolean)
    As per the <tt> tag recall attribute

Examples:
<rtt>Return to the reference you noted earlier</rtt>
<rtt>Return to the previous reference</rtt>

tts

This tag is the same as the <tt> tag currently only with the addition of a ‘refscript’ attribute, enabling calculated references to be turned to.  This tag is intended to be expanded with turn-to failure options hence why it is a seperate tag and not simply an expansion of the <tt> tag.  A ‘name’ attribute is forthcoming.

Attributes

  • ref (required)
    This attribute is the base value upon which the refscript attribute will operate. Note that refscript may not in fact use this value at all, but it is still required as an attribute (I may make this a default reference for failed attempts)
  • refscript (required)
    Script data is required here (SEL here at fightingfantasy.net). The tag will use the value returned by the script as the reference to turn to.  In the SEL system the attribute ‘ref’ is made available as the global variable $argv[1]. Therefore with a ref attribute of ‘5’, and a refscript attribute of ‘$argv[1]+10′, the tag will send the user to reference ’15’. Note in SEL $argv[0] contains the current reference number, and of course any other permanent variables are accessible therefore the scope for a calculated destination is significant.
  • script (optional)
    As per the <tt> tag script attribute
  • enforce (optional) (boolean)
    As per the <tt> tag enforce attribute
  • override (optional) (boolean)
    As per the <tt> tag enforce attribute
  • thumbprint (optional) (boolean)
    As per the <tt> tag thumbprint attribute
  • bookmark (optional) (boolean)
    As per the <tt> tag bookmark attribute
  • visits (optional) (static)
    As per the <tt> tag visits attribute except that the visits counts how many attempts are made on a Turn To as well as successful Turns, the link will disappear once the visits value has been exhausted (so if you want to only give a reader one shot at trying a reference to turn to set visits=”1″ – since the reference to turn to is dependant on possibly dynamic data in the script instructions it is not guaranteed that the target reference is allowed (see <ttr>) or exists).
  • recall (optional)(boolean)
    As per the <tt> tag recall attribute

Example:

Roll the dice, multiply by 10 and<tt ref=”10″ refscript=”$argv[1]*&dice(1);”>turn to that reference</tt>

tti

This tag presents the reader with an input box and button.  When the button is clicked an attempt is made to ‘turn to’ the reference entered in the input box.  If the reference exists then the story continues from there, if not the reader remains on the same page.  A ‘reference’ attribute is being considered for default failed attempts.

Attributes

  • name (required)
    Identifies the tag on the page for situations where a writer may wish to provide more than one tti tag.  While this is not yet relevant it will be when failure options, script options etc. are provided (see ABML Future Features)
  • refscript (optional)
    Allows modification of the input reference with script data (see the <tts> tag)
  • script (optional)
    As per the <tt> tag script attribute
  • enforce (optional) (boolean)
    As per the <tt> tag enforce attribute
  • override (optional) (boolean)
    As per the <tt> tag enforce attribute
  • thumbprint (optional) (boolean)
    As per the <tt> tag thumbprint attribute
  • bookmark (optional) (boolean)
    As per the <tt> tag bookmark attribute
  • visits (optional) (static)
    As per the <tt> tag visits attribute except that the visits counts how many attempts are made on a Turn To as well as successful Turns, the input box will disappear once the visits value has been exhausted (so if you want to only give a reader one shot at guessing a reference to turn to set visits=”1″ – since the input reference may not exist or is not allowed (see <ttr>))
  • recall (optional)(boolean)
    As per the <tt> tag recall attribute

Example
<tti name=”secret” ></tti>

ttr

Turn To Restriction. This tag is used in conjunction with <tti> and <tts> tags, (and theoretically with <tt> tags though not much use!). It restricts the destinations the system will actually allow the reader to turn-to, whether the reference was input or script generated (or even hard coded with a <tt> ‘ref’ attribute). It is only usable (or at least in the current system only has effect) inside or immediately after a <tti>, <tts> or <tt> tag. More than one <ttr> is permitted for multiple destination definitions.

Attributes

  • ref (required)
    The reference to which a turn to attempt is permitted

Example:

<tti name=”secret” visits=”1″><ttr ref=”123″ ></ttr><ttr ref=”456″ ></ttr></tti>

This will restrict the input destinations  for the ‘secret’ input box to either reference 123 or reference 456, any other reference input will be disallowed (and since visits=”1″ in this example the tti input box will disappear on a failed input).

ttf

Turn To Failure. This tag allows for abml to be activated only if a <tti>, <tts> or <tt> attempt fails. Text may also be completely hidden as well as making links only appear on failed attempts (though I am considering abandoning ‘hidden’ attributes completely).  To clarify, tags inside a <ttf> tag will NOT be evaluated until there is a failed Turn To attempt (so you can also make <event>’s only occur then)

Attributes

  • name (optional)
    Associates this <ttf> block to attempts made by a <tti> (and in future <tts>) tag with this name attribute. Omitting this attribute means the <ttf> text will be displayed if any Turn To attempt on this reference fails.
  • color (optional)
    Hex colour code for highlighting when a <ttf> block becomes active (i.e. there’s been a failed Turn To attempt)
  • hidden (optional)(boolean)
    Hides the contents of the <ttf> until a Turn To fails.

Example:

<tti name=”secret” visits=”1″><ttr ref=”123″ ></ttr></tti><ttf name=”secret” hidden>This text and link will only appear if the reader fails to guess at 123 in the input box.  I want to send them to ref <tt ref=”456″>456</tt> only if they fail – and they only get 1 guess</ttf>

Notes: I may change this tag as it often requires the editor to add text to an adventure text that may not be present in an authors canonical text – I may make the failure text an attribute – though this would remove the ability to add tags into failure text?  It’s a tricky one.  e.g. the necessary text may be there already but may also be part of an ‘if you do not know/possess’ in addition to ‘if you get it wrong’.  Or I might just not be utilising my own language fully to cover this eventually and there is actually a way round it, this happens a lot…

bookend

This tag is used to mark the end of a gamebook story path. The enclosed text will be the link that the user is required to click to acknowledge the ‘closing’ of the book and will take the user to the credits page.

Attributes

  • adventure (required)
    Allowed values are “failed” and “completed”. The value of “finished” is being considered for adventures that don’t actually have an objective.
  • enforce (optional)
    This option will make the tag link over-ride all other previously processed links in the document/page (and associated charsheet page, and vice-versa), and prevent any subsequent tag processing – meaning that any option link or turn-to link the user clicks on will behave as if they had clicked this link to close the book.  It is a standalone attribute that does not require a value.
    * idealism note: with a proper parser a tag with this attribute ought to actually remove any other links prior to, and subsequent to, this tags link.

Example

<bookend adventure=”completed” enforce>You leave the dungeon with a huge hoard of treasure, congratulations!</bookend>

event

An event tag will make something ‘happen’ in the book. Exactly what is dependant on the Script code given to the event attribute. Enclosed text within the open and close of the tag is optional.

Attributes

  • event (required)
    Valid Script code is required here, and will be the code executed every time this tag is evaluated – only once, per visit to the page/reference.
  • color (optional)
    Determines the colour of the text enclosed by the tag – you may want to use this to highlight what has happened to your reader. Allowed values are in the range of 000000 to ffffff (this is hexadecimal numbering), and support will be included for worded colour descriptions (e.g. ‘red’. ‘green’)

Example

<event event=”$gold=$gold+10;”>You gain 10 Gold Pieces</event>

Event tags are not re-evaluated.  This means the behaviour of the sel code will only be executed once regardless of how many times that reference is ‘loaded’/’refreshed’.
At this time the output of an event tag appears at the opening tag (in non self closed situations), it is intended to be changed to appear at the close of the tag.
Events are intended to be different from script in that they are generally one off events/instructions to the reader that are described in the text body itself and usually require no further interaction, though the result of the event may alter the story path, e.g. story termination (Stamina drops to 0 or below for example).

choice

Previously this tag was OPTION

A choice tag will provide the reader with a link to click on if they want something to happen – exactly what will depend on the SEL code supplied. The text enclosed within the tags will become the link.  Any output generated by the SEL code will go to the ‘actions’ area of the play area, not the area it was called in (e.g. the character sheet or the reference body).

Attributes

  • option (required)
    Valid SEL code is required here, and will be executed if the user clicks on that link.
  • count (optional) (static)
    A positive whole number is required here (from 1 upwards), OR the value ‘infinite’ to indicate that the reader may perform this action as many times as they wish. If this attribute is omitted, then 1 is assumed (reader may perform the action once)
  • selcount – deprecated, use scriptcount
  • scriptcount (optional) (static)
    Valid SEL code is required here. This is to allow the number of times the reader may select this action to be determined through SEL. Naturally the SEL must return a valid number as per the ‘count’ attribute, however 0 and negative numbers are allowed (negatives will be treated as 0). A scriptcount attribute will over-ride a count attribute if the author puts both in.
  • usedcolor (optional)
    Determines what colour the text that was a link will become when the choice has been ‘used up’ (determined by count attribute). Allowed values are in the range of 000000 to ffffff (this is hexadecimal numbering), and support will be included for worded colour descriptions (e.g. ‘red’).
  • override (optional) (boolean)
    Disables all subsequent tag evaluation meaning that no links AFTER this one will be active, until the count is exhausted.  This may be useful for when you want to pause the reading flow to allow Dice Rolls (or other SEL routines) to be manually executed, amongst other possibilities.  WARNING – a count of ‘infinite’ is NOT blocked at this time, meaning that if you have a count of infinite and override set, your reader will never progress past this tag, also note that since DYNAMIC (i.e. script generated) option tags are ALWAYS evaluated regardless of the count attribute (unless you set that to 0 for some reason) you should be EXTRA careful when implementing a choice tag in script code.
  • reval (optional)
    Indicates that the count (scriptcount or count) ought to be re-evaluated every time. This means that a scriptcount will make the choice tag appear unless the script evaluates to 0. I do not recommend using reval with a static count tag (this is merely a lazy oversight of mine) sinc that means effectively a positive number will ALWAYS show the choice tag regardless of the idea of count. I may remove the reval effect on simple count attributes at some point but don’t count on it. Haha.

Example:

<choice option=”$gold=$gold-2;$provisions=$provisions+1;” count=”3″>You may purchase up to 3 Provisions at 2 gold pieces each</choice>

info

This tag allows the author to diplay information in his/her text that is variable, for example a hero’s health value. The actual value displayed depends on the SEL code.

Attributes

  • info (required)
    Valid SEL code is required here. The value returned from the SEL will be the information given in the text of the reference.
  • color (optional)
    Determines the colour of the text enclosed by the tag, as well as the information returned from the SEL code. Allowed values are in the range of 000000 to ffffff (this is hexadecimal numbering), and support will be included for worded colour descriptions (e.g. ‘red’).
  • seperator (optional)
    If the information returned by the SEL code is a list, the value here determines what will be used to seperate each element of that list, for example using a comma as the value here will seperate every item with a comma. If ommitted a newline is the default seperator used.

Example

Your Luck is: <info info=”$luck” ></info>

Programmers Note: The difference between ‘info’ and ‘script’ is that ‘info’ takes the return value of the embedded code and displays that, it does not display any output such as &print statements, and is a convenient way of simply outputting a variable/array.  It’s a play on Perls function exit value (no, not Perls program exit value, I know what I’m talking about) being the last expression evaluated before finishing the function when there’s no return statement.  It’s probably a hideous little method technically speaking (and Iwouldn’t be surprised if it makes porting this tag to use other script languages impossible) but it does the job…

if

Allows the author to exclude the reader from certain actions, options, information, or to make those actions etc. available depending on a certain condition being met. Careful use of this tag is required, paying especial attention to the closing </if> tag. Other tags may be included in the text between the open and close of the IF tag, but they must be closed before the closing </if> tag. Failure to do so will cause unpredicatable results and at this time will probably give a nasty code error page to your reader. Other if tags may be enclosed inside an if tag (called nesting), but note that an /if closing tag will mark the end of the most recent unclosed if tag.  Unless the reval attribute is present <if> tags are only evaluated once on each visit to a reference, meaning that if the page is refreshed through an <option> action the <if> condition will NOT be checked again.  If the reference is left then revisited then it will be re-evaluated – unless a <tt> bookmark has been placed on this reference.

Attributes

  • condition (required)
    Valid SEL code is required here. If the code evaluates to anything other than 0 or logical ‘false’, the condition is considered to be true. In this case all tags within the if and /if will be evaluated and executed as normal. If the condition evaluates to 0 or logical false, then the tags inside the if will NOT be executed or even evaluated (including tt tags, and other if tags), leaving just the text for the user to read (e.g. the tt links will not be activated). The author can even prevent the user from seeing text – see the falsecolor and truecolor attribute.
  • truecolor (optional)
    Defines the color for the text inside an if statement that has been evaluated to TRUE. Allowed values are in the range of 000000 to ffffff (this is hexadecimal numbering), and support will be included for worded colour descriptions (e.g. ‘red’). The additional value of ‘hidden’ is allowed, which will remove text from display to the user entirely. Note that colour setting for tags inside the if will override the if colour setting excepting that ‘hidden’ will still hide all text regardless.
  • falsecolor (optional)
    Defines the color for the text inside an if statement that has been evaluated to FALSE. Allowed values are in the range of 000000 to ffffff (this is hexadecimal numbering), and support will be included for worded colour descriptions (e.g. ‘red’). The additional value of ‘hidden’ is allowed, which will remove text from display to the user entirely. Note that colour setting for tags inside the IF will override the IF colour setting excepting that ‘hidden’ will still hide all text regardless.
  • reval (optional)(boolean)
    Re-EVALuate.  Determines whether the condition attribute of an IF tag will be re-evaluated if the reference/page is reloaded (not browser refreshed) due to some action of the reader on that reference/page.  This value does need to be assigned a value just declared e.g. <if condition=”selcode;” reval> Some text </if>. Note that dynamic if tags are always re-evaluated regardless.

Example:

You stand at the door.  <if condition=”$keys==3;”>If you have 3 silver keys <tt ref=”240″>turn to page 240</tt></if>

else

The else tags are associated with if tags – and as they sound will do much the same as an if tag, by disabling enclosed tags and information, the condition however is the reverse of the if tag the else is associated to – if the if tag evaluated to TRUE then the else is considered to be FALSE automatically, and vice versa the else is considered to be TRUE if its associated if tag was evaluated to FALSE. The else tag will associate itself to the nearest previous closed if. As with ifs you may also nest more if statements inside an else. Also likewise it is important to remember to close the else tag properly – a /else closing tag will associate itself to the nearest previous unclosed else tag

Attributes

  • truecolor (optional)
    Defines the color for the text inside an else statement that has been evaluated to TRUE (therefore meaning that the associated if tag has evaluated to FALSE). Allowed values are in the range of 000000 to ffffff (this is hexadecimal numbering), and support will be included for worded colour descriptions (e.g. ‘red’). The additional value of ‘hidden’ is allowed, which will remove text from display to the user entirely. Note that colour setting for tags inside the else will override the else colour setting excepting that ‘hidden’ will still hide all text regardless.
  • falsecolor (optional)
    Defines the color for the text inside an else statement that has been evaluated to FALSE (therefore meaning that the associated if tag has evaluated to TRUE). Allowed values are in the range of 000000 to ffffff (this is hexadecimal numbering), and support will be included for worded colour descriptions (e.g. ‘red’). The additional value of ‘hidden’ is allowed, which will remove text from display to the user entirely. Note that colour setting for tags inside the else will override the else colour setting excepting that ‘hidden’ will still hide all text regardless.

Example

You stand at the door.  <if condition=”$keys==3;”>If you have 3 silver keys <tt ref=”240″>turn to page 240</tt></if>  <else>Otherwise <tt ref=”120″>Turn to 120</tt></else>

script

The script tag allows you to capture output from SEL to include in your page. It is unlike the info tag in that the info tag only captures the value(s) of the last statement evaluated in your script, whereas script will capture all information in SEL print statements (or other output statements) and output that instead. The output from the SEL script will be evaluated for tags in the same way an ABML document is. This allows truly complex and dynamic procedures such as combat to be implemented more efficiently. The output text will be inserted directly after the opening <script /> tag. It is planned to make this tag more flexible in the future by allowing other script languages (i.e. Javascript) be used instead of SEL. However note that any if or event tags that are generated by the script will always be evaluated regardless of the ‘reval’ attribute settings, and option tags will be considered to have an ‘infinite’ count setting.

Attributes

  • script (required)
    Contains the code to execute
  • color (optional)
    Default colour for text returned from the script. Note that if the script returns ABML with different colour settings, the dynamic colour will override the default.

Example:

<script script=”&display_items_enumerated();” ></script>

(Note these examples use SEL functions that require libraries to be loaded)

include

Inserts the contents of another reference file at this location in the current reference. The tags contained in the reference to be included will be processed as usual.  Recursive/circular inclusions are blocked and will not be processed (e.g. ref 3 includes ref 10 and ref 10 includes ref 3, reading ref 10 will show ref 3 but the inclusion of ref 10 inside ref 3 will not be shown)

Attributes

  • file (deprecated, use ‘reference’)
  • reference (required)
    The name of the reference/file to include

Example

Here is your character sheet: <include reference=”charsheet” ></include>
This adventure was written by: <include reference=”credits” ></include>

Leave a Reply

Straight outta Blacksand

Skip to toolbar