General syntax of events
An Event starts according to this general code pattern
{[[(marker), event1, event2, ...]] text and/or [[actions1]] [[action2]],...}.
The order of text and/or actions is not mandatory, it's possible to have only text, only actions, or text followed by actions, or actions followed by text, or an alternation between text and actions!
Examples:
{[[(G),ON_OPEN]] As soon as you open the secret door a strange force pushes you towards the fireplace [[MOVE_HERO(K12)]] }
or
{[[(G),ON_OPEN]] [[MOVE_HERO(K12)]] As soon as you open the secret door a strange force pushes you towards the fireplace }
.
or
{[[(G),ON_OPEN]] As soon as you open the secret door.. [[MOVE_HERO(K12)]] …a strange force pushes you towards the fireplace }
.
In the following line, the pattern is repeated, with different parts colored to clarify the correspondence of each part of the code.
{[[ (marker) , event1 ; event2 ; ...]] text and/or [[action21]] [[action2]] ... }
{[[ (G) , ON_OPEN ]] As soon as you open the secret door a strange force pushes you towards the fireplace [[MOVE_HERO(K12)]] }.The marker represents the position on the map to which the event is associated, all markers allowed by hQuestBuilder can be used, the letters from A to Z, a number from 1 to 20, or one of the arrows respectively called "FancyArrow", "Arrow", "inOut"
After the marker, one or more Events are listed, separated by commas.
- In many cases, the exact position of the marker is not important. What matters is that it is in the room or corridor section where the event should occur.
- However, there are some events (e.g.,
ON_STEP
), which refer to the exact position of the marker, meaning that the associated actions occur only when something happens at the specific marker position. - Finally, there are cases where the marker's position is entirely irrelevant because the event affects the game in general (e.g.,
ON_NEW_TURN
), or because it must be specified elsewhere where it will have an effect (e.g., ON_OPEN).
Attention: If a marker is not present on the map, the events associated with that marker will never be activated. When it is necessary to indicate a particular cell with an action or an event, it must be indicated by a pair of a Letter (from A to S) and a number from 1 to 26; you can see which is a cell coordinate directly from hQuestBuilder by holding down Q and D together, this will show in the bottom right corner of the browser a small box containing the coordinates of the selected cell.
Modifiers
Some Events support Modifiers. The possible Modifiers are :REPEAT (or :R), :LAST. In the description of each event, it is specified whether and which Modifiers it supports.
:REPEAT
or:R
, the actions of an event are triggered only once (unless specific cases), with the use of this modifier instead the actions will be executed every time the event occurs.:LAST
, with the use of this modifier, the actions will be executed only when the last hero triggers the event. (currently the only event that supports it is ON_STEP)
Parameters
Some Events support Parameters. Parameters are passed by indicating the values within round parentheses ( ). In the description of each Event, it is indicated whether it supports Parameters and what they are.
Style
Texts can be written in HTML language, so it is possible to format the text as desired, with tags or with CSS to change color, or insert images using the <img>
tag.
Style
Texts can be written in HTML language, so it's possible to format the text as desired, with tags or with CSS to change color, or insert images through the <img>
tag.
Example:
{[[(G),ON_OPEN]] <i>As soon as you open the secret door</i> a strange <b>force</b> pushes you towards the <b style=”color: red;”>fireplace</b> <img src=”http://1.bp.blogspot.com/-LKmZrDXEiN8/Uj3AmK0xEZI/AAAAAAAAAf0/2hnNyILomOQ/s400/firecomp1.jpg” /> [[MOVE_HERO(K12)]] }.
For the same reason, it's necessary to use the HTML line break
inside the texts, where deemed necessary.
NOTE: Any other text outside the {}
will be ignored, so you can leave the original notes of the maps, or add notes to the written QuestDown code.
Example:
The line of code below is used to define the starting square
{[[(A), ON_START]]}
the event below moves the heroes who try to open the secret door
{[[(G),ON_OPEN]] [[MOVE_HERO(K12)]] As soon as you open the secret door a strange force pushes you towards the fireplace }.
Formatting
Events and Actions are case-insensitive, but it's recommended for better code readability to write them in uppercase. In QuestDown, line breaks are also ignored, so it's not necessary to write a whole event on a single line, this means that the following two examples are equivalent:
Example 1:
{[[(G),ON_OPEN]] [[MOVE_HERO(K12)]] As soon as you open the secret door a strange force pushes you towards the fireplace }.
Example 2:
{[[(G),ON_OPEN]]
[[MOVE_HERO(K12)]]
As soon as you open the secret door a strange force pushes you towards the fireplace
}