Différences entre les versions de « Daggerfall : Création de quêtes »
m |
m |
||
Ligne 1 849 : | Ligne 1 849 : | ||
The detailed descriptions of the quest conditions follows. | The detailed descriptions of the quest conditions follows. | ||
==Locating things in the game world== | ==Locating things in the game world== | ||
clicked ''aThing'' | |||
when ''aThing'' clicked | |||
toting ''anItem'' and ''anNPC'' clicked | |||
When the player character clicks on a quest related item or NPC this condition will schedule the actions associated with this task for execution by the '''X-engine'''. ''aThing'' must be a quest item created by an ''Item'' command, or a quest NPC created by a ''Person'' command. | |||
Message: 1017 | |||
<ce> Your quest is complete. | |||
when _item1_ clicked | |||
say 1017 | |||
end quest | |||
In this quest fragment, when the PC clicks the mouse on _item1_ in the game world, message number 1017 is displayed and the quest is finished. | |||
Alternatively, the same task could be written: | |||
foundItem task: | |||
clicked _item1_ | |||
say 1017 | |||
end quest | |||
Sometimes you only want to take action if the PC approachs your NPC with a specific quest item | |||
Message: 1020 | |||
<ce> Thank you for returning my widget. | |||
returnItem task: | |||
toting _item1_ and _questor_ clicked | |||
say 1020 | |||
So the questor won't congradulate you unless you return with the quest item he's waiting for. | |||
This last form, toting and clicked has an important side-effect when you include it in a scenario: T'''he item is destroyed when both parts of the condition are true.''' | |||
==By the player's cash on hand== | ==By the player's cash on hand== | ||
clicked ''anNPC'' and at least ''anAmount'' gold otherwise do ''aTask'' | |||
When the PC clicks on a quest NPC in order to obtain a quest item from the NPC, the quest can assign a cost to the quest item and take different actions if the PC doesn't have the requisite cash available. | |||
If the PC has at least the specified amount of gold on hand, that number of gold pieces will be taken from the PC and the remainder of the actions in this task will be performed. | |||
If the PC doesn't have enough gold (and it must be available as pieces of gold; letters of credit don't seem to apply) none of the actions in the task are performed. Instead, the '''X-engine''' schedules the other task mentioned by the condition. | |||
_buyTalisman_ task: | |||
clicked _healer_ and at least 20 gold otherwise do _pcTooPoor_ | |||
say 1013 | |||
get item talisman | |||
log 1017 step 2 | |||
_pcTooPoor_ task: | |||
say 1015 | |||
clear _buyTalisman_ _pcTooPoor_ | |||
==By the clock== | ==By the clock== | ||
daily from ''aTime1'' to ''aTime2'' | |||
from ''aTime1'' to ''aTime2'' daily | |||
A quest may direct the '''X-engine''' to perform some task on a daily schedule. Often this involves sending nasties to plague the player, but any quest action is possible. This condition is used in the main story for example to make the ghost of King Lysandus haunt Daggerfall City for several hours after sunset. For example | |||
from 06:00 to 10:00 daily | |||
create _foe_ every 10 minutes 7 times with 100% success | |||
or | |||
plague task: | |||
daily from 6:00 to 10:00 | |||
create _foe_ every 10 minutes 7 times with 100% success | |||
would create waves of nasties to plague the player character every morning from 6 to 10 for the duration of the quest. | |||
Note also that each ''Clock'' command creates an implicit time-out condition. Create a task with the same name as the clock to activate when the clock runs out. Note that a ''Clock'' resource doesn't automatically start ticking, and must be started by using the [[#start timer aClock|start timer]] action. | |||
Message: 1019 | |||
<ce> Well, you've run out of time now. | |||
Clock _tooSlow_ 12.0 | |||
-- Quest startup: | |||
start timer _tooSlow_ | |||
_tooSlow_ task: | |||
say 1019 | |||
end quest | |||
In this quest fragment, if the PC is still plodding along after 12 days on this quest, chide him and terminate the quest. | |||
==Checking the PC's repute== | ==Checking the PC's repute== | ||
A quest can check the player's repute with a particular quest NPC and take different actions according to whether the NPC likes or dislikes the PC. | |||
repute with ''anNPC'' exceeds ''nn'' do ''aTask'' | |||
is the condition to schedule a different task if the NPC favors the player character enough. ''NN'' is the PC's minimum repute with the NPC, usually between 0 and 100, although the PC's reputation can be negative. | |||
Message: 1019 | |||
<ce> I suppose this will have to do. | |||
<ce> Couldn't you have brought a fresher sample? | |||
Message: 1020 | |||
<ce> I say, that was quite good work for a %ra. | |||
<ce> Here, take this extra reward for special service. | |||
checkForBonus task: | |||
repute with _npc_ exceeds 41 do bonus | |||
variable bonus | |||
bonusReward task: | |||
when deadFoe and bonus | |||
say 1020 | |||
give pc _reward_ _extraReward_ | |||
end quest | |||
regularReward task: | |||
when deadFoe and not bonus | |||
say 1019 | |||
give pc _reward_ | |||
end quest | |||
which bestows one reward if the PC's reputation with the NPC is smaller than 42 and bestows two rewards if the reputation is larger than 41. You can write quests to shine the PC on if the NPC doesn't like the PC's previous affilliations. | |||
==Using items== | ==Using items== | ||
have ''anItem'' set ''aVariable'' | |||
have ''anItem'' do ''aTask'' | |||
''anItem'' used do ''aTask'' | |||
''anItem'' used saying ''nnnn'' do ''aTask'' | |||
There are times when a quest author wants to take some special action when the player manipulates an object pertaining to the quest. | |||
A quest can detect when the player has a particular item in the inventory by using the ''have anItem'' condition. The two forms are really equivalent, for in the '''X-engine''' a variable is just a task without any conditions or actions. | |||
Message: 1015 | |||
<ce> You notice a sudden change in your surroundings. | |||
ambush task: | |||
say 1015 | |||
move _foe_ to pc | |||
waiting task: | |||
have _questItem_ do ambush | |||
would set up to ambush the PC after a quest item was added to the inventory. | |||
Message: 1015 | |||
<ce> As you examine the parchment | |||
<ce> you notice your surroundings change. | |||
ambush task: | |||
say 1015 | |||
teleport pc to _newDungeon_ | |||
waiting task: | |||
_questItem_ used do ambush | |||
would teleport the PC to a different dungeon when the quest item was used in the inventory screen (to read a quest letter perhaps). | |||
==Attacking foes== | ==Attacking foes== | ||
A quest can detect when the PC first injures an enemy in a fight or when the enemy is dead. | |||
injured ''aFoe'' | |||
killed ''aFoe'' | |||
killed ''nn'' ''aFoe'' | |||
when ''aFoe'' injured | |||
when ''aFoe'' killed | |||
For example | |||
Message: 1099 | |||
<ce> No, I won't let you kill me. Begone! | |||
When _foe_ injured | |||
say 1099 | |||
teleport pc to _newDungeon_ | |||
which contrives to teleport the player elsewhere if the specified foe has been injured. | |||
Message: 1099 | |||
<ce> Congradulations, you've killed the orc commander. | |||
When _foe_ killed | |||
say 1099 | |||
end quest | |||
which pops up a message box when the PC slaughters the specified foe. | |||
Recall that the ''Foe'' command will create mobs of kindred foes. You can specify how many of the mob must be slain for the condition | |||
Foe _foe_ is 17 vampire | |||
enoughDead task: | |||
killed 5 _foe_ | |||
get item _reward_ | |||
teleport pc to _newDungeon_ | |||
would trigger the requested actions after killing 5 of the 17 vampires. | |||
Note that the killed task will be permanently retired by the '''X-engine''' once the number of foes created by the associated ''Foe'' command have been slaughtered. | |||
That sounds reasonable enough, but notice that it clashs with the use of the ''create foe'' command, which may create more foes to be killed than can be tested by the killed condition. | |||
Even worse, you can't use several kill commands to check for different numbers of foes slaughtered. You can have only one killed action for each ''Foe'' declaration. If you provide more than one, the action response becomes ''unpredictable''. | |||
==Locating the PC in the game world== | ==Locating the PC in the game world== | ||
==Noticing player discards== | ==Noticing player discards== |
Version du 15 octobre 2012 à 10:01
Cet article est actuellement en travaux importants par abg depuis le 23/08/2012. Contactez cette personne pour toute modification majeure de l'article. Si vous voulez participer directement à cet article vous pouvez créer une discussion (voir onglet discussion ci-dessus), ou utiliser le forum afin de coordonner vos interventions. |
Le compilateur de quêtes Template, de Donald Tipton, est l'outil fondamental pour créer et modifier les quêtes daggerfalliennes.
Traduction commentée du document questing.html
Utiliser le décompilateur de quête
Vous pouvez examiner le contenu de n'importe quelle quête de Daggerfall. Les seules qui seront inaccessibles seront les quêtes ayant un fichier Qbn mais aucun fichier Qrc. Comme il n'y a pas de bonne méthode pour deviner les textes manquants, le décompilateur ne vous montrera pas le contenu de telles "erreurs". Certaines discordances semblent être liées à des incohérences de nommage (réputation, numéro de série de la quête...) entre QBN et QRC. (NDT : Normalement, depuis l'époque de D.Tipton, ces bugs ont été réparés...)
Le décompilateur est assez bavard, préférant autant que possible l'anglais de base. Bien qu'il ait ses propres idées à propos de la casse des caractères, ça n'a que peu d'importance autant pour lire la quête décompilée que pour la recompiler.
(NDT : La casse des caractères n'a aucune importance dans le code source)
Pour décompiler une quête, vous devez dire au décompilateur quelle quête vous intéresse, ainsi que où écrire le résultat de la décompilation.
template -d d:\game\dag\arena2\40c00y00.qbn 40c00y00.src
Où :
- template est le nom du décompilateur.
- -d est le switch de commande spécifiant une décompilation.
- d:\game\dag\arena2\40c00y00.qbn est le chemin d'accès de la quête.
- (Utilisez votre propre chemin d'accès menant jusqu'au dossier arena2 de votre installation de Daggerfall)
- 40c00y00.src est le fichier qui va recevoir la quête décompilée.
Si vous omettez cette destination, le compilateur décompilera la quête spécifiée dans le répertoire où se trouvent les fichiers qbn/qrc et nommera la quête décompilée avec l'extension .src
Vous pouvez ensuite modifier la quête en éditant le fichier .src avec un éditeur de texte. Si vous utilisez un traitement de texte, assurez vous bien qu'il laisse le texte en tant que ascii propre (pas de conversion de format) si vous voulez pouvoir recompiler la quête.
Utiliser le compilateur de quête
Pour compiler une quête, inversez le processus :
template 40c00y00.src
Où :
- template est le nom du compilateur de quête.
- 40c00y00.src est le nom de la quête à compiler.
Par défaut, le compilateur créé les fichiers qbn/qrc dans le répertoire même où se trouve le fichier .src. Le compilateur va lister le source vers la sortie standard, ainsi que les éventuelles plaintes pour problèmes rencontrés en cours de route. Si la quête contient une quelconque erreur, la dernière ligne de sortie va le rappeler et vous inviter à revoir le source pour corriger les erreurs.
N'espérez pas que les fichiers qbn/qrc soient utilisables si le compilateur a trouvé des erreurs.
Vous pouvez demander une compilation "verbeuse" en incluant le switch -v:
template -v 40c00y00.src
Cela amènera le compilateur à réciter tout ce qu'il fait pour produire les fichiers qbn/qrc, incluant ses construction de syntaxe à partir des modèles sources (source patterns), ainsi que le code binaire émis pour constituer le fichier qbn.
(NDT : Le résultat est vraiment verbeux. Pensez à faire une redirection système pour lecture à tête reposée :
template -v 40c00y00.src >compilation.log
)
Additionnellement, le scénario de quête obtenu (NDT : La sortie de Template en mode "verbose") contient les informations requises pour utiliser le débogueur de quête de X-engine. Voir Utiliser le débogueur de X-Engine pour plus d'informations.
Diagnostics
Le compilateur/décompilateur va se plaindre de temps en temps à propos des anomalies qu'il rencontrera. Certaines erreurs reflètent simplement le système d'exploitation sous-jacent et ne seront pas traitées ici. Dans de tels cas, le compilateur annote généralement le message système avec sa propre interprétation.
Les messages d'erreur sont annoncés généralement par la balise qcomp: bien que le compilateur se plaigne parfois en utilisant la balise qrc: si pour une raison ou une autre il ne peut accéder au fichier Qrc.
La ligne de source contenant l'erreur sera habituellement listée avant le message d'erreur la mettant en cause.
NN is an invalid Qbn section number. Only [0, 10] are allowed.
Le compilateur a découvert qu'on lui demandait de créer une section Qbn inexistante. Indique habituellement que Windows s'est tiré dans le pied ou qu'une application quelconque a tiré dans le pied du compilateur. (!!)
_symbol_ appears in Qrc without mention in Qbn.
Le compilateur a détecté un symbole de quête utilisé dans un bloc de message du Qrc, mais n'ayant jamais été défini comme ressource de quête. Signifie le plus souvent une erreur de syntaxe dans le symbole au niveau du Qrc ou dans les déclarations de ressources. Le compilateur ne peut vous dire quelle syntaxe est la bonne. Des symboles mal orthographiés dans le Qrc peuvent planter la quête, ou au moins engendrer l'apparition de chaînes "BLANK". (NDT : "VIDE" selon la traduction PFD)
_symbol_ at &N is the wrong type of symbol for this operation. Expected symbol type NN but found symbol type MM.
En réduisant une ressource du Qbn à sa forme numérique, le compilateur a découvert un usage en conflit avec le type d'opération accompli. Par exemple :
give pc _house_
peut engendrer cette erreur, car il n'est pas raisonnable de tenter d'ajouter un site de quête à l'inventaire du PJ.
_symbol_ sera remplacé par la ressource qui chagrine le compilateur. NN et MM correspondent aux numéros de section du Qbn
_symbol_ has not been defined.
En réduisant une ressource du Qbn à sa forme numérique, le compilateur a découvert une référence à une ressource inexistante. _symbol_ est remplacé par le texte qui fait râler le compilateur.
Par exemple, définir une action utilisant une ressource item (objet de quête) sans avoir défini la ressource à utiliser peut déclencher cette condition d'erreur. Mal orthographier un symbole d'objet le peut aussi.
Bad DagText number NNNN (should be between 1000 and 2100).
Une action dans une tâche de quête a spécifié un mauvais numéro de texte Qrc. Les "Bad DagText" peuvent planter X-engine.
Buffer overrun.
En décompilant un fichier Qrc, le décompilateur a rencontré un bloc de message trop grand pour son tampon interne. Le décompilateur assume que tout bloc de message a une taille inférieure à 1000 caractères.
Cannot use a symbol for amount of gold reward.
Une directive item gold a tenté de définir un montant d'or de façon non numérique. Le compilateur attend que les quantités monétaires soient exprimées par des nombres.
Cannot use same symbol with differing contexts. Previous context is:
Le compilateur a rencontré un usage non valide d'un symbole. Le contexte précédent (previous context) est la définition de la ressource qui entre en conflit avec la présente définition. Par exemple :
Item _reward_ gold 10 _reward_ task:
va déclencher un conflit car tout les noms d'objet et de tâche doivent être unique.
Code parameter count must be in [1, 5].
Le compilateur a découvert un modèle Qbn (Qbn template) dans sa base de données .src qui a un nombre d'opérandes définies suspect. Toutes les conditions/réponses connues dans les Qbn ont entre 1 et 5 opérandes.
Could not convert the new size value.
Un fichier .src contient une directive de taille NN qui ne peut être convertie sans erreur.
Could not open aFileName for input.
Le compilateur n'a pas été capable d'accéder en lecture au fichier aFileName.
Could not open 'aFileName' for input.
Le compilateur/décompilateur n'a pas été capable d'accéder au fichier .src/.qbn pour travailler dessus.
Hmmm, this quest doesn't seem to have anything to say. ('qcomp' would like some text to work with)
Le compilateur s'est aperçu qu'il allait devoir créer un fichier Qrc vide, ce qui semble improbable.
Implicit task gives template more than NN words.
Une directive de ressource dans la base de données .src a tenté de placer plus d'arguments qu'attendu dans une brique ressource.
Line NNNN 'fragment'
A la ligne NNNN du fichier source d'une quête, le compilateur a trébuché en analysant un fragment de cette ligne. Une plainte détaillant le problème rencontré suit généralement.
No command handler for Qbn section NN has been created yet.
Le compilateur a découvert qu'il lui était demandé de créer une section inutilisée dans le Qbn. Dans la mesure où toutes les sections connues de Qbn en usage ont des gestionnaires (handlers) créés pour eux, dans la pratique ça ne devrait pas arriver, à moins que Windows ne fasse encore des siennes.
No command number; cannot convert template to Qbn section.
Un modèle de commande ou de directive a été ajouté à la base de données .src du compilateur, qui ne définit pas de façon propre une ressource de Qbn. Toutes les directives de ressources correctement définies doivent spécifier un index de section Qbn en tant que premier champ dans le modèle définissant la ressource.
No template matches this pattern.
Le compilateur ne peut pas localiser une correspondance pour une directive de ressource dans sa base de données .src..
Quest contains errors. Please review the output log.
Une ou plusieurs erreurs sont survenues durant le traitement du fichier source de la quête. Les fichiers Qrc/Qbn pour cette quête seront probablement inutilisables.
Quest: 'aFilePattern' doesn't follow the pattern for Daggerfall quest file names.
La directive Quest: utilisé dans le préambule de la quête ne suit pas le modèle des noms de fichiers quête de Daggerfall.
Seek to text offset barfed (NN != MM).
En se parcourant le fichier Qrc pour traiter un bloc de message existant, le décompilateur a découvert que la position demandée ne correspondait pas à la position actuelle. Cela indique généralement que quelqu'un etait en train de modifier le fichier Qrc au moment où le décompilateur essayait de le lire.
Source file has no extension.
En tentant de définir les noms de fichiers Qrc/Qbn à partir du nom de fichier source, le compilateur a découvert que l'extension .src n'était pas présente. Pour diverses raisons internes, le compilateur compte sur la présence de l'extension .src.
Stopping compilation because Qrc compile has failed.
La compilation d'une quête se déroule en deux parties. D'abord les blocs de messages sont assemblés pour produire un fichier Qrc. Ensuite les définitions de ressources de la quête sont assemblées pour produire un fichier Qbn. Chaque partie va généralement essayer de compiler toutes les déclarations associées. C'est pourquoi vous pouvez recevoir toutes les plaintes du compilateur "en masse" pour ainsi dire. Cependant, si la partie Qrc ne se compile pas avec succès, la partie Qbn remarque cette situation et ne démarre pas.
Template failed to assign an item.
Un des modèles d'objets a échoué à assigner un paramètre requis pour ce type d'objet. Si vous modifiez un des fichiers .src du compilateur (pour définir des objets additionnels par exemple), il se peut que ce changement dérange le compilateur.
This clock doesn't have an associated timer task.
Le compilateur a essayé d'assembler une action se référant à une ressource "clock" et a découvert qu'aucune tâche n'a été créée pour cette horloge. X-engine s'attend à ce que chaque "timer" ait une tâche définie pour lui, même si aucune action n'est associée à la tâche.
Too many Daggerfall variables. Symbol table size of NN is too small.
While compiling the Qrc message blocks, the compiler discovered the table it uses to track misspelt symbols was used up. This table can hold up to 1000 symbols, which ought to be adequate for ordinary quests.
Unable to create command output.
The compiler was unable to manufacture an argument brick for a quest resource. This usually indicates that system resources or memory are low.
Unable to determine the <parameter> (NN).
Quest resources (like NPCs, Foes, etc) have to be reduced to a numeric form for the X-engine. When the compiler tried to do so, it couldn't figure out how to represent the parameter as a number. This usually means you've mispelled a quest resource or used a quest resource that isn't present in the compiler's .src database. If you've made changes to the compiler's .src database, the field number where the mishap occured is given by NN. parameter spans the names of the qbn fields for all the Qbn record types.
Unable to determine the permanent site.
A quest Place resource has requested an unknown location as a permanent site. Either it didn't recognize the spelling for the permanent site, or the requested site isn't part of the permanent site database.
Unable to open aPathName for reading.
While constructing the quest resource database, the compiler encountered a .src file name which it could not access.
Unable to open qrc file aFileName.
While creating a new quest, the compiler was unable to access the Qrc file for writing.
Unable to open the decompiled file 'aFileName'.
While setting up to disassemble a quest, the decompiler was unable to access the source file aFileName when it tried to create it or reuse it.
Unable to open the qbn file 'aFileName'.
While setting up to disassemble a quest, the decompiler was unable to access the Qbn file aFileName.
Unable to position the qrc file to next message descriptor.
While decompiling an existing Qrc file, the decompiler was unable to scroll the file to the next message block that it expected to process. Unless you're having hard drive problems, this usually indicates a mutant Qrc file has been found.
Unable to rewind the qrc file.
While decompiling a quest, the decompiler discovered it could not reposition the Qrc file to its beginning.
Unable to write an empty qrc file header.
While creating a new quest, the compiler was unable to write the Qrc file preamble.
Unknown configuration directive.
While processing its configuration file (template.cfg) the compiler encountered an unknown configuration directive.
Unknown switch '-x'.
While analyzing the command line arguments, the compiler encountered an unrecognized switch or setting.
Unable to open qrc file aFileName.
While setting up to disassemble an existing quest, the decompiler discovered it was unable to open the Qrc file of the Qrc/Qbn pair.
Unresolved symbolic references.
The compiler was presented with a quest resource definition which did not completely replace all symbols with numeric values in the resource argument brick. There should be one or more preceding complaints detailing which bits could not be resolved.
Warning: &N did not resolve to a numeric value.
After performing all the symbolic resolutions correctly, the compiler detected that parameter N was still a non-numeric value. This usually means that one of the .src files in the compiler's data base has been edited to create a non-numeric template. Typing the letter O instead of the number 0 can cause this.
Warning: making system quest file.
The compiler discovered that the file name pattern for the quest indicates that a main-story quest is being produced. The interrelation between main-story quests and their global states isn't well-understood, so the risk of substantial changes having surprising side-effects is higher in these cases.
Warning: no command templates have been detected.
After processing its configuration file (template.cfg) the compiler detected that no quest resource operations have been included.
Warning: no item definitions have been detected.
After processing its configuration file (template.cfg) the compiler detected that no quest items were present in the resulting database.
Warning: template does not assign all parameter tokens.
Each quest resource is determined by an argument brick of parameter values required by the X-engine to describe that resource. The compiler discovered a command template that failed to provide values for all of the parameters required to describe the resource.
Warning: this configuration has no command template files.
After processing its configuration file (template.cfg) the compiler detected that no quest resource operations have been included.
Well, that didn't work.
After processing a configuration directive the compiler noticed that something was amiss. Generally there is a preceding complaint detailing the trouble.
Wrong number of command line arguments.
While processing the command line arguments, too many parameters were encountered.
Utiliser le débogueur de X-Engine
When creating new quests, it is helpful from time to time to see which steps of a quest have been taken, and which have not.
X-Engine has a cheat mode key to overlay the main view with the tasks of a quest to show which ones have been acted on.
To access the X-Engine debugger, edit z.cfg and include the line
cheatmode 1
in the file before starting Daggerfall.
After acquiring the quest you want to examine, you can use the apostrophe or single quote key (') in the main 3D view to overlay a display of the quest tasks on the main view, on an active quest by active quest basis. (NDT : Sur clavier azerty, la touche est "ù")
When the overlay is active, the name of the quest, along with the player position, is displayed at the bottom of the overlay. You may need to adjust the camera position to find a suitable contrast between the view background colors and the yellow letters of the overlay.
The apostrophe or single quote key (') will step the display through each active quest of the character. Each time the key is pressed, the tasks of the next active quest of the PC will be displayed, until the display finally returns to the first quest shown.
The quests are displayed in no particular order, so you will have to cycle through the open quests until the one you're interested in appears on the screen.
To clear the task overlay from the screen, press F9. If you have used the game's control panel to modify the behavior attached to F9, you may need to revert that assignment to enable F9 to clear the overlay display.
For each open quest, X-Engine displays a flag to indicate which steps of the quest have been taken, and which are as yet inactive.
Tasks are listed in the same order which the scenario declared them. But as a fail-safe check, the symbol name of each task is displayed in numerical form. Executed tasks are highlighted in dirty orange; unexecuted ones in yellow.
When you use the -v[erbose] option of the compiler program, the end of that listing will show the same numerical values which will appear in the X-Engine debug screen.
In addition, debugging information is added to the quest file which X-engine will access to provide symbols in the display overlay in place of raw numbers.
When -v is used to compile a quest, after cycling the display to that quest with the apostrophe (') key, you can use the semicolon (;) key to cycle through the various quest resource sections.
For items, persons, and foes, the world coordinates of the thing are displayed. If the thing hasn't yet been installed in the game world, its coordinates will be zero. If the thing is in the same vicinity as the PC (the current town or dungeon) it will be highlighted a dirty orange color, else displayed in yellow.
For clocks, the elapsed time and the alarm time are displayed in game minutes.
For randomly selected dungeons, whether the location has been revealed or not is available, as well as its world coordinates once it has been revealed. Note that even if the dungeon has already been revealed on the province map by an earlier quest, this display shows whether the present quest has revealed it or not. Other quest locations are never hidden, and so always appear on the world map.
And as before, without the debugging information, the state of the tasks of the quest is available, but now all the tasks have their names from the quest scenario source displayed too. Executed tasks are displayed in dirty orange, unexecuted ones in yellow.
Note that the compiler calls these symbols, while X-Engine calls them flags--they refer to the same task block in the quest scenario.
When X-Engine indicates a flag is true, this means that task is presently executing/has already executed. When X-Engine indicates a flag is false, this means that task has not been executed, or that the task has already been cleared so it may rerun when conditions are ripe.
Certain game conditions (e.g., daily from) are automatically rescheduled for execution each game world minute, and so always are reported as false, even though the task has executed.
Again, use the apostrophe (') or single quote key to cycle through the different open quests. Use the F9 to remove the task overlay from the screen.
Examiner une quête "live"
The quest decompiler engine can be used to examine the contents of an open quest in the player's logbook. In addition to the usual disassembled details, links to other saved game records for items, NPCs, and places are available, among other details. The native Linux decompiler supports date recovery, which is not available without the ATLAS package and isn't implemented under Dos.
To decompile a living quest, the desired quest must first be extracted from the saved game of interest. The TES2 tool will extract all the open quests with its -Q option.
C> tes2 -Q 3
extracts all the living quests in saved game slot 3 into the fictitious quest player.qbn. Each open quest is assigned an arbitrary serial number (1, 2, 3, ...) when the saved game is created. The serial numbers change whenever quests start up or stand down, and so must be determined in situ each time. The end of the regular TES2 report shows the serial numbers currently in use by open quests:
Active Quests (2) s0000977 (4) S0000021 (6) s0000012 (3) s0000999
The gaps (2, 3, 4, 6) in the serial numbers are normal.
To examine the living state of quest 3, s0000999, use the SAVEQBN tool to extract quest 3 from player.qbn and feed the extracted quest to the decompiler using the -s switch instead of the usual -d switch:
C> saveqbn 3 <player.qbn >s0000999.qbn C> template -s s0000999.qbn snapshot.src
where -s stands for sans Qrc. For example, from an unrelated living quest
-- Quest start-up: place item _I.01_ at _L.04_ -- exec: 1 (000b58c6) 09:42 Morndas, 7 of Mid Year, 405. -- hash: 00644605 44ebfa04 00000000 00000000 dialog link for person _victim_ -- exec: 1 (000b58c6) 09:42 Morndas, 7 of Mid Year, 405. -- hash: 00000000 483b3e45 00000000 00000000
The exec tag gives the last time of access and whether the action has been accomplished yet. 0 generally means not performed while 1 indicates completed. Other states are possible, e.g. for letters as yet undelivered to the PC but already en route.
The hash tag lists the object identifiers for the four possible opcode operands. There will be an item record in the saved game with object id 0x00644605, a quest location with object id 0x44ebfa04, and an NPC record with id 0x483b3e45.
NPC and place object identifiers use the Daggerfall GPS notation. So this quest NPC's birthplace is somewhere in site 0x483b. ATLAS shows that 0x483b is Langpath, Anticlere. The specific lot number, 0x3e45, is tied to a quest location 0xfann by another record in the saved game. If the PC isn't presently in Langpath, that relation won't necessarily exist until the Langpath site has been rendered.
MAPS.BSA identifies the possible quest locations at a site with a special codex listing the lot numbers that correspond to quest locations. A quest site, whether in town or in a dungeon, is indexed by the special lot code 0xfann, where nn is the consecutive serial number of quest locations at a site (0xfa01, 0xfa02, ...). If the site is a dungeon, these correspond to the rooms which the teleport jump cheat links together.
The place 0x44eb is the Ruins of Ashsly Manor in Anticlere province, where the fourth teleport jump has been randomly assigned as the spot where the quest item will be hidden.
You can use the -s option to decompile just the Qbn portion of an ordinary quest file, but the resulting extra information is uniformly uninteresting.
Organisation d'une quête
The source file created by the quest decompiler is divided into three parts:
- Quest preamble
- Qrc text blocks
- Quest resources and operation (Qbn)
which are discussed subsequently.
Préambule d'une quête
The quest preamble lays out the general requirements of the quest: who offers it, who can receive it, how it is started, etc. The purpose of this preamble is to collect the information required to fabricate a standard quest file name pattern. There are two ways to do so, concisely or verbosely.
Quest: pattern
where pattern is the desired quest file name pattern. For example
Quest: b0c00y13
Alternately, the pattern can be inferred by the compiler from the following verbose descriptions. Case is insignificant.
StartsBy: [Letter | NPC]
Indicates whether the quest starts by the player character receiving a letter or by contacting an NPC (non-player character) in the game.
Questee: [Initiate | Member | Anyone]
Indicates what general relationship the PC must have with respect to the NPC / group that offers the quest.
Initiate Initial invitation to join Member PC must be a member of this group Anyone Anyone may be offered this quest
Questor: quest grantor or single letter key
The questor is the group, guild, or daedra prince which offers the quest. It can be specified by single letter key (as used by the quest file name pattern) or by the proper name of the group, taken from the following list:
Questor | Key | Ids[1] | Questor | Key | Ids | Questor | Key | Ids |
---|---|---|---|---|---|---|---|---|
Akatosh | D | 0 | Lady Azura | T | 0 | Peasant | A | 0-18 |
Arkay | E | 0 | Mage | N | 1-18 | Peryite | 5 | 0 |
Boethiah | U | 0 | Main | S | [2] | Royalty | R | 0-28 |
Brotherhood | L | 0-11 | Malacath | 8 | 0 | Sanguine | 7 | 0 |
Clavicus Vile | V | 0 | Mara | H | 0 | Sheogorath | 6 | 0 |
Dibella | F | 0 | Mehrunes Dagon | Y | 0 | Stendarr | I | 0 |
Fighter | M | 0-19 | Mephala | Z | 0 | Temple | C | 0-15 |
Hermaeus Mora | W | 0 | Merchant | K | 0-10 | Thief | O | 0-12 |
Hircine | X | 0 | Meridia | 1 | 0 | Vaernima | 9 | 0 |
Julianos | 0 | 0 | Molag Bal | 2 | 0 | Vampire | P | 0-10 |
Knight | B | 0-17 | Namira | 3 | 0 | Witch | Q | 0-8 |
Kynareth | G | 0 | Nocturnal | 4 | 0 | Zenithar | J | 0 |
[1]See QuestId: below. CompUSA quests are included. [2]Main story numbers in use are 1-22, 100-107, 500-503, 977, 988, and 999.
Again, case is not significant. Space, for those daedra princes with two names, is. Main refers to the main story quests.
Questor: Arkay
indicates a quest offered by the temple of Arkay, for example.
Repute: mm
The repute is the minimum repute the PC must have with respect to the group / prince offering the quest. It can also indicate a range of reputes for which the quest is offered.
If mm is strictly numeric, then it indicates the minimum repute the PC must have, with 0 being the smallest repute and 99 the largest.
Quests can be restricted to a particular decade of the PC's repute with the questor by writing the units digit as the letter x.
Repute: 3x
limits the quest to PCs whose repute is between 30 and 39 with the questor.
QuestId: nn
X-engine expects every quest associated with one of the questor groups to have a unique two-digit serial number assigned to it.
QuestId: 17
assigns 17 as the quest id in the file name pattern for the quest.
If the quest preamble describes a quest that already exists, the compiler will replace the original contents of that quest with the new contents from this source file.
If that quest does not already exist, the compiler will create a new Daggerfall quest for it.
Please see the table of guilds/questors for the quest ids already in use by the game.
Messages: aNumber
The quest compiler needs to know approximately how many message blocks will be recorded in the Qrc file before it begins processing. By default it reserves space for 50 message blocks. If the quest scenario supplies more than 50 messages, the compiler needs to be told the number of messages to expect with this directive.
The decompiler now automatically includes this directive when it decompiles a quest, as a convenience for recompiling quests. However, adding additional messages to existing quests may bump into the message count limit. The limit need not be exact, just more than enough.
AllowDupes:
Some existing quests from Bethesda have Qrc files that contain duplicate message block numbers. This is arguably wrong when you're creating a fresh quest, and the compiler normally smacks you if you try to do such a thing. But to allow the existing quests to recompile without trying to figure out which text block is the valid one--good luck--supplying this directive in the quest preamble will instruct the compiler not to whine if it finds message block numbers are being reused.
QuestDir: aDirectoryPath
You can tell the compiler where you want it to produce the qrc/qbn files by supplying the directory path name where you'd like them to go. By default, the compiler drops them in the same directory as the scenario source file.
QuestDir: d:\games\dag\arena2
directs the compiler to the arena2 directory of my Daggerfall installation.
Les blocs de texte du QRC
Every message displayed by a quest is assigned a serial number starting from 1000 and increasing. The first dozen numbers have stock behavior associated with them, and may be called for display automatically by the game engine during the quest, without an explicit trigger in the compiled quest script.
The text block section of the source file is announced by the directive:
Qrc:
The compiler will expect to find text message blocks thereafter in the source file, until it is told otherwise. Again, the case of the directive doesn't matter.
In the source file, the text composing a quest message is introduced by the Message: directive followed by the message number to assign to the text block.
The compiler accepts synonyms for the stock quest messages:
QuestorOffer: Message: 1000
What the questor says when the PC makes contact for the quest. Although not enforced by the compiler, for quests started in person, this is likely a required message.
RefuseQuest: Message: 1001
What the questor says when the PC refuses the quest offer. Again, while the compiler is silent about its omission, for quests started in person, this is likely a required message block.
AcceptQuest: Message: 1002
What the questor says when the PC accepts the quest. Again, this block is likely expected for quests started in person.
QuestFailed: Message: 1003
What the questor says until the PC completes the quest. Again, this block is likely expected for quests started in person.
QuestComplete: Message: 1004
What the questor says when the PC completes the quest and returns. Again, this block is likely expected for quests started in person.
Note that certain quest actions will post this message automatically. See give pc / give pc nothing.
RumorsDuringQuest: Message: 1005
Gives information that may come up during Any News? dialogs the PC has during the quest.
RumorsPostFailure: Message: 1006
Gives information that may come up during Any News? dialogs the PC has after failing the quest. The X-engine eventually retires these after a suitable time lag.
RumorsPostSuccess: Message: 1007
Gives information that may come up during Any News? dialogs the PC has after completing the quest. The X-engine eventually retires these after a suitable time lag.
QuestorPostSuccess: Message: 1008
What the questor says to the PC in dialog after a successful quest. That is, when the PC chats with the questor through the dialog screen.
QuestorPostFailure: Message: 1009
What the questor says to the PC in dialog after a failed quest. That is, when the PC chats through the dialog screen.
QuestLogEntry: Message: 1010
The message inserted into the PC's log when the quest is accepted. Probably not used automatically.
QuestTimeLapse: Message: 1045
Displayed when the PC fails to meet a quest with a dead-line. Probably not used automatically.
The quest author can create as many additional message blocks as the quest requires, although the compiler arbitrarily complains if you choose message numbers larger than 2100. 1000 message blocks isn't a quest, it's a whole game.
Since remembering what text is associated with a Qrc message number is tedious, the compiler will accept an arbitrary label in place of a message number. The compiler will automatically assign the next available message number to each message label you provide. And you can refer to the Qrc message by that label in the Qbn section of the quest file.
Message: NpcPeeved What? I can't believe you took so long for such a simple request!
You can mix labels with section numbering in different message blocks.
Following the Message: directive are the lines composing that message block. By default, left justification is used.
Text can be centered by using the <ce> tag at the beginning of the line to be centered.
An empty or blank line can be inserted by using the <br> tag for the content of a line.
A message block may be divided into subsections. When X-engine displays a subsectioned message block, it displays only one of the available subsections of that block at a time. The selected subsection is chosen at random from the subsections available for the block. The next time X-engine is asked to display that message block it repeats this process, and so may select a different subsection for display.
Subsectioning gives variety to the messages that appear when the PC performs the same quest more than once. Indeed, with clever use, the quests can appear quite different when coupled with the randomizing feature in the Qbn section. While there may be an upper bound on the number of subsections the X-engine can handle, there are existing quests with upwards of a dozen subsections each in several different message blocks.
Any message block can be subsectioned by using the <---> tag on a line to start a new subsection:
RumorsDuringQuest: <ce>I heard that %ra is a complete loser. <---> That %ra is after some loser's hide. <---> <ce>Isn't %ra chasing after _questgiver_ for something?
The position of the tag on the line is irrelevant.
RumorsDuringQuest: <ce>I heard that %ra is a complete loser. <---> That %ra is after some loser's hide. <---> <ce>Isn't %ra chasing after _questgiver_ for something?
works just as well. The decompiler takes advantage of this to center the decompiled text as required.
Be careful of leaving blank lines between different quest message blocks unless you intend the message to display empty lines in the block. Generally, you want only one blank line between the end of one block and the next message block:
RumorsDuringQuest: Very strange sounds come out of the _house_. <---> _qgiver_'s house has really gone to Oblivion.
RumorsPostfailure: Poor _qgiver_ has to hire an exterminator. <---> It's going to cost _qgiver_ to clean that house.
Les symboles du QRC
X-engine likes to name replaceable parts of text as _symbol_, where in fact symbol can be any meaningful mnemonic. (See Quest Resources for how symbols are created)
There are some fairly intricate rules for using symbols in a Qrc message block.
_foo_ is replaced with the name of foo : a ring, an NPC's name, or kind of enemy. It is generally an error to use this form for a Place or Clock quest resource. The quest compiler won't stop you from doing so, but the results within the game world aren't likely to be what you expect.
=foo_ is replaced by the clock time (expressed as the number of days that the clock will be active) when _foo_ is a Clock quest resource. Or by the character class when _foo_ is an NPC quest resource, or by the foe's name for enemy resource.
==foo_ is replaced by the faction association for an NPC quest resource. So for a Person symbol:
_foo_ of ==foo_
would result in something like
Zaphod Beeblebrox of the Blades
while
_foo_ the =foo_
would result in something like
Zaphod Beeblebrox the Acrobat
If _foo_ is a Person resource then ___foo_ (three leading underscores) gives the town name where _foo_ can be found. While __foo_ (two leading underscores) gives the name of the house/shop in that town where _foo_ can be found. If you move _foo_ to different places in the game world, it isn't obvious that these symbols will track those moves. I tend to regard them as 'birthplace' markers, rather than present residence markers.
Place symbols follow slightly different semantics.
_foo_ is the form of a shop name.
__foo_ is the town where the shop can be found.
___foo_ is the form of a dungeon name.
____foo_ is the name of the province where the place can be found.
This pattern holds regardless of whether _foo_ was created as a shop or as a dungeon. This is why some existing quests give out mysterious hints about non-existent shops. The quest author left out underscores in the Qrc text, and got the shop name format instead of the dungeon name format.
Note that quest locations which are not randomly generated, the permanent sites, do not follow these rules at all. The symbol used to represent a permanent site is always replaced by random garbage in a Qrc block. So the information for a permanent site must needs be written out in full inside a Qrc block.
The following table summarizes the usage. NO means you probably don't want to use that substitution. At any rate, there aren't any such examples in the existing quests.
Symbol | Item | Person | Place[1] | Foe | Clock |
---|---|---|---|---|---|
_foo_ | ring | Zaphod Beeblebrox | Lord Marcus' Arms | warrior | NO |
__foo_ | NO | Adams residence | Daggerfall City[2] | NO | NO |
___foo_ | NO | Gothway Gardens | Ruins of Bethsoft | NO | NO |
____foo_ | NO | NO | Daggerfall | NO | NO |
=foo_ | NO | Acrobat | NO | Arthur Dent | 4 days |
==foo_ | NO | Blades | NO | Fighter | NO |
[1]Not available for permanent sites. [2]This form is invalid for remote dungeons.
There is a whole family of %symbols to scrape out information about the PC, NPC gender, and the like, which are tabulated below. [1]
The pronomial forms (%g, %g1, etc) refer back to the last NPC or foe symbol appearing in the same Qrc text block to determine the proper declension. It is usually an error in content to use one of them prior to the first appearance of the proper noun you want them bound to. When a computer refers back that way, it's anybody's guess which person will actually be used for the construction. That happens from time to time in the existing quests, and so you may see quirky constructs like "...her research lab where Andystair Bonedoggle..." when you're pretty sure Andystair takes the masculine, not feminine gender.
All of these symbols appear at one time or another, either in arena2\text.rsc, fall.exe, arena2\*.qrc, or arena2\bio*.txt. It is unclear whether their use is restricted to contexts appropriate to each of those file sets, or whether you're free to mix bio*.txt symbols within Qrc blocks. If you use one of these symbols in an improper context, Daggerfall generally posts an error message naming the offensive symbol and dies.
Symbols in italics appear in the existing qrc files from Bethesda.
%1am | 1st + Magnitude |
%1bm | 1st base Magnitude |
%1com | Greeting (?) |
%1hn | ? |
%2am | 2nd + Magnitude |
%2bm | 2nd Base Magnitude |
%2com | ? |
%2hn | ? |
%3hn | ? |
%a | Cost of somthing. |
%ach | + Chance per |
%adr | ? |
%adr | + Duration per |
%agi | Amount of Agility |
%arm | Armour |
%ark | ? |
%ba | Book Author |
%bch | Base chance |
%bdr | Base Duration |
%bn | ? |
%bt | Book title |
%cbl | Cash balance in current region |
%clc | Per level (Chance) |
%cld | Per level (Duration) |
%clm | Per level (Magnitude) |
%cn | Current City |
%cn2 | ? |
%cpn | Current shop name |
%cri | Accused crime |
%crn | Current Region |
%dae | A daedra |
%dam | Damage modifyer |
%dat | Date |
%di | Direction |
%dip | ? |
%dng | Dungeon |
%dts | Daedra |
%dwr | ? |
%ef | Local shop name |
%enc | Encumberence |
%end | Amount of Endurance |
%fcn | Another city |
%fe | ? |
%fea | ? |
%fl1 | Lord of %fx1 |
%fl2 | Lord of %fx2 |
%fn | Random first(?) name (Female?) |
%fn2 | Same as %mn2 (?) |
%fnpc | ? |
%fon | ? |
%fpa | ? |
%fpc | ? |
%fx1 | A faction in news |
%fx2 | Another faction in news |
%g | He/She etc... |
%g1 | He/She ??? |
%g2 | Him/Her etc... |
%g2self | Himself/Herself etc... |
%g3 | His/Hers/Theirs etc... |
%gii | Amount of gold in hand |
%god | Some god (listed in TEXT.RSC) |
%gtp | Amount of fine |
%hea | HP Modifier |
%hmd | Healing rate modifer |
%hnr | Honorific |
%hnt | Direction of location. |
%hnt2 | ? |
%hol | Holiday |
%hpn | ? |
%hpw | ? |
%hrg | ? |
%hs | Holding Soul type |
%htwn | ? |
%imp | ? |
%int | Amount of Intelligence |
%it | Item |
%jok | A joke |
%key | A location (?) |
%key2 | Another location |
%kg | Weight of items |
%kno | A knightly guild name |
%lev | Rank in guild that you are in. |
%ln | Random lastname |
%loc | Location marked on map |
%lt1 | Title of %fl1 |
%ltn | In the eyes of the law you are....... |
%luc | Luck |
%map | ? |
%mad | Resistance |
%mat | Material |
%mit | Item |
%mn | Random First(?) name (Male?) |
%mn2 | Same as %mn (?) |
%mod | Modification |
%mpw | Magic powers |
%n | A random female first name |
%nam | A random full name |
%nrn | Noble of the current region |
%nt | ? |
%ol1 | Old lord of %fx1 |
%olf | What happened to %ol1 |
%on | ? |
%oth | An oath (listed in TEXT.RSC) |
%pc | ? |
%pcf | Character's first name |
%pcn | Character's full name |
%pct | Character's class |
%pdg | Days in jail |
%pen | Prison sentence |
%per | Amount of Personality |
%plq | Place of something in log. |
%pnq | Person of something in log |
%pp1 | ? |
%pp2 | ? |
%pqn | Potential Quest Giver |
%pqp | Potential Quest Giver's Location |
%ptm | An enemy of the current region (?) |
%q1 to %q12 | Effects of questions answered in bio. |
%qdt | Quest date of log entry |
%qdat | Quest date of log entry [2] |
%qot | The log comment |
%qua | Condition |
%r1 | Commoners rep |
%r2 | Merchants rep |
%r3 | Scholers rep |
%r4 | Nobilitys rep |
%r5 | Underworld rep |
%ra | Player's race |
%reg | Region |
%rn | Regent's Name |
%rt | Regent's Title |
%spc | Current Spell Points |
%ski | Skill |
%spd | Speed |
%spt | ? |
%str | Amount of strength |
%sub | ? |
%t | Regent's Title |
%tcn | ? |
%thd | Combat odds |
%tim | Time |
%vam | PC's vampire clan |
%vcn | Vampire's Clan |
%vn | ? |
%wdm | Weapon damage |
%wep | Weapon |
%wil | ? |
%wpn | Poison (?) |
%wth | Worth |
[1] Reproduced from Appendix A, Daggerfall Quest File (QRC/QBN) Hacking Results - v1.00, by Dave Humphrey uesp@m0use.net. I've added 2 or 3 additional symbols from the qrc files.
[2] Appears in d0b00y00, the Akatosh Chantry quest, but looks like a simple misspelling of %qdt.
Ressources et opérations
Once the text blocks for the quest have been laid out, the contents of the Qbn file are described by using the Qbn directive
Qbn:
to instruct the compiler to finish the Qrc section and begin the Qbn section of the source code.
The Qbn section is by far the more complicated part, and is itself further divided into subsections:
- Items required in the quest
- Persons encountered in the quest
- Places encountered in the quest
- Clocks or timers used in the quest
- Foes encountered in the quest
- Condition/responses that operate during the quest
The exact order you pick is somewhat irrelevant. The only requirement by the compiler is that the condition/responses appear last, since they generally refer to resources defined by the other sections.
Gérer l'écran de dialogue
The scenario can control whether to include each quest item, person, or place resource in the pick list under the Tell me about... dialog tab.
Each item, person, or place resource can be embellished with the tag
anyInfo aQrcNumber
where aQrcNumber is a Qrc message block to display in the dialog screen when the PC chats about that particular resource.
When the scenario assigns an anyInfo Qrc message to a quest resource, the name of that resource automatically appears as a new entry in the pick list under the Tell me about... dialog tab.
Such entries are available throughout the duration of the quest for use in conversation with anyone the PC happens upon in the game world.
Note, however, that the PC's repute with the NPC being spoken to affects the outcome of chatting about such entries. So not every NPC spoken to will offer the information provided by the scenario when quizzed by the PC. But, when combined with the subsectioning message block technique, different pieces of information may be supplied at each chat session.
But sometimes a scenario wants to make such information available only after the PC has met certain milestones within the quest. In such cases, the scenario can control when the anyInfo messages become available through the dialog link and add dialog family of quest actions.
Note that once an entry has been added to the Tell me about... pick list, it is stuck there for the remaining life of the quest. There does not appear to be any quest action to delete entries from the list.
A person or place quest resource may be further embellished with the tag
rumors aQrcNumber
where aQrcNumber is a Qrc message block to display in the dialog screen when the PC selects the Any News? dialog option.
Oftentimes, adding a rumors tag will insert the quest resource into the dialog picklist as well, but this insertion can be suppressed with dialog link family of commands.
Objets de quête
Every item associated with the quest must be described for the X-engine using a form of the Item command. Items include not only things, like rings, letters, drugs, or artifacts, but also quest rewards like gold payment.
In addition each item can have message text from the Qrc file associated with it, which is displayed when the item is discussed with an NPC or when the PC 'uses' the item in the inventory screen.
Quest items with usage text will also appear in the About picklist when conversing with NPCs. The Qrc text will be 'spoken' by the NPC if asked about the item.
Whether the item automatically appears as a topic under the Tell me about... dialog tab is somewhat variable. Non-letter items tend always to appear, while letter items tend to depend upon their method of delivery to the PC.
Regardless, the scenario can regulate the contents of the Tell me about... picklist with the dialog link and add dialog actions.
To prevent a quest item with usage text from appearing in the dialog picklist, simply include a dialog link item for it in the quest start-up. If there is no corresponding add dialog item action for it, then it will never appear.
As a rule, when the PC acquires a quest item in the inventory it shows up with a green background. Furthermore, such items will be automatically taken from the player when the quest terminates. Special steps have to be taken in the condition/response section to bestow an item (like an artifact) on the player permanently.
So in general, don't expect a quest item to hang around after the player completes the quest unless you provide for that specially in the condition/response section.
Also note that quest items are unknown to X-Engine until the scenario puts them somewhere in the game world. The practical consequence of this is that displaying a Qrc message block referring to a quest item before that item has been placed in the world, or after it has been destroyed, will most likely result in the infamous BLANK text when the Qrc message is shown to the player.
A quest isn't required to have a item section, but most quests that do anything interesting have them.
There are three general forms for the Item command:
- reward (gold) items
- artifact items
- other items
Objets de récompense
Item _symbol_ gold item _symbol_ gold range nn to mm
The first form creates a random amount of gold reward proportional to the player's current level. While the relation isn't exactly linear in player level, expect about 100 times the player's level when the quest begins. So for a level 2 player, expect the gold reward to be in the neighborhood of 200 gold.
_symbol_ is an arbitrary name to refer to the item throughout the quest scenario. It must be unique among all the item resources--the compiler will smack you if it isn't--and it is helpful to make it unique to all the symbol names you use in the Qbn section, as well as indicative of what the item is:
Item _reward_ gold Item _bribe1_ gold range 50 to 100
The second form of the reward item selects a random amount within the requested range. If the PC repeats the quest, that attempt won't necessarily have exactly the same reward amount.
This isn't always a bargain. Some players react to this with "Goody, it's different this time." But others react with "Boo! This quest isn't the same! What's wrong now?"
To make a reward of an exact amount, use the same number for the beginning and end of the range.
Any Item command can be embellished to provide a message when the player chats about the item with another NPC.
Item _reward_ gold anyInfo 1017
requests the X-engine to display Qrc message block 1017 when the gold reward is discussed with another NPC.
Every item command can be embellished to provide a message when the item is 'used' in the player's inventory screen.
Item _letter1_ letter used 1022
requests the X-engine to display Qrc message block 1022 when the item is used in the player's inventory screen.
The two embellishments can be combined:
Item _letter1_ letter anyInfo 1014 used 1022
Artefacts
Item _symbol_ artifact artifactName
describes an artifact item appearing in a quest. artifactName must be one of the known Tamriel artifacts:
Auriels_Bow | Oghma_Infinium |
Auriels_Shield | Ring_of_Khajiit |
Azuras_Star | Ring_of_Namira |
Chrysamere | Sanguine_Rose |
Ebony_Blade | Skeletons_Key |
Ebony_Mail | Skull_of_Corruption |
Hircine_Ring | Spell_Breaker |
Lords_Mail | Staff_of_Magnus |
Mace_of_Molag_Bal | Volendrung |
Masque_of_Clavicus_Vile | Wabbajack |
Necromancers_Amulet | Warlocks_Ring |
As usual, case doesn't matter, but notice underscores (_) used instead of blanks. You can, however, change the names to your own liking by editing items.src. Indeed you can change most of the compiler's notion of spelling by editing any of the *.src files to your own preferences.
The artifact item command can be embellished with an anyInfo notice. Some item artifacts in the existing quests from Bethesda are embellished with the used tag, but this is inconsistent. When an artifact is used in the inventory screen, the message displayed is invariably taken from TEXT.RSC, not the Qrc block.
Autres objets
Item _symbol_ someItemName Item _symbol_ item class nn subclass mm
Some common items are prefabricated in the items.src data base. Daggerfall also uses a sort of generic item specification, to select randomly one item from a group of related items. These forms are shown in italics in the following table.
aegrostat | amulet | armbands |
armor | book | book0 |
book1 | book2 | book3 |
boots | bracelet | bracer |
cloth_amulet | coins | common_symbol |
daedra_heart | decanter | deed |
diamond | drug | element |
emerald | finger | flamable |
gem | gold_bar | harpy_feather |
horn | indulcet | ivory |
jade | junk | kimono |
lantern | large_plant | large_sack |
letter | lich_dust | lodestone |
magic_item | malachite | mantella_crux |
map | mark | mens_clothing |
mineral | misc | mummy_wrappings |
mythic | organs | painting |
pearl | portrait | quaesto_vil |
random_map | random_recipe | religious |
ring | root_tendrils | ruby |
sapphire | scarab | skin |
small_plant | small_sack | snake_venom |
specials | straps | sursam |
talisman | telescope | torc |
totem | transport | trinket |
turquoise | tusk | wand |
weapon | werewolf_blood | womens_clothing |
womens_robe | wraith_essence | yellow_flowers |
Other items can be created at will by using the class/subclass form to describe any Daggerfall item.
Again, the item command can be further embellished with an anyInfo notice and/or a used notice.
You can find tables of the known Daggerfall item codes at the Unofficial Elder Scrolls Pages.
Quest Persons
Each NPC involved in a quest has to be described in the Qbn section with a Person command. Most quests will have at least one Person command to describe the questor NPC granting the quest to the player. This appears to be how the X-engine couples the change of repute to the allied/enemy factions associated with the questor when the PC completes or fails the quest.
Factional alliances / repudiations are fairly involved in Daggerfall. This document won't treat all aspects of factions or how to choose correct factions for a quest. Basically it just depends on the goals of the quest.
Briefly, the Daggerfall social structure forms a four-tier hierarchy of Guild-Group, Social Group, Faction Type, Individual-Faction. Unfortunately I haven't been able to determine the magic numbers used to describe Social Groups in the Qbn files. The elements of the remaining classifications are, however, known.
For example, Clavicus Vile, a Daedra, Supernatural Being, of Oblivion. The guild-group name is Oblivion, the social group is Supernatural Being, the faction-type is Daedra, and the individual-faction is Clavicus Vile.
Or another example, The Battlelords subgroup of the Guild Members of the Knightly Order. The guild-group name is Knightly Order, the social group is Guild Members, the faction-type is Subgroup, and the individual-faction is The Battlelords.
All the non-permanent NPCs in the game can be so classified.
Permanent NPCs are slightly different, in that they have no top level guild-group name. For example, King Gothryd, a person of nobility. The social group is nobility, the faction-type is person, and the individual-faction is King Gothryd.
For the nonce, NPCs can be selected by faction type, guild group, individual faction, or permanent NPC.
As with Items, message blocks can be associated with NPCs in two different ways.
anyInfo nn adds the Qrc message nn to the Tell me about... dialog responses under the NPC's name.
rumors nn adds the Qrc message nn as a possible response when gossiping in the dialog panel under Any News?. Under patch 213 it also adds the NPC's name to the dialog list of choices, even if there is no anyInfo nn entry for the NPC.
These tags can be appended to any Person command.
Permanent NPC
Basically, a permanent NPC is one of the named major figures of the royal houses in Daggerfall, Sentinel, or Wayrest, or supernatural figures like the King of Worms. They are all generally involved in the main quest in one way or another.
The Person command tags a permanent NPC with the named field, since all permanent NPCs have invarient names within the game.
Permanent NPCs can be used in one of two ways. They can be located at their regular place in the game world, which the Person command tags as atHome. So the player would encounter a permanent NPC at their normal place in the game world.
Alternatively, the permanent NPC can be positioned elsewhere in the Bay area for the duration of the quest. The X-engine needs to be told up front which you plan to do so it can do all the necessary bookkeeping to keep the NPC portraits managed correctly.
Be aware that fiddling with the NPCs associated with the main story in side-quests can have surprising side-effects. Recall that it is always possible for the PC to have several quests operating concurrently.
It's even possible to have multiple copies of the same side-quest active at the same time. Consider the typical mage guild quest to fetch a rare ingredient from a dungeon. It's perfectly possible to pick up that quest from the guild in Wayrest, say, and immediately teleport to Sentinel and acquire the same quest from the guild hall there.
You need to consider consequences of that sort if you use permanent NPCs in a quest offered from more than one location in the game world. It probably isn't realistic to expect the X-engine to situate the King of Worms in two different places at the same time.
The quest condition faction available can help to determine whether a permanent NPC is presently starring in another quest.
Person _symbol_ named aPermanentNPC Person _symbol_ named aPermanentNPC atHome
The complete list of permanent NPCs is shown below.
Azura | Baltham_Greyman | Baron_Shrike |
Baroness_Dh'emka | Boethiah | Br'itsa |
Charvek-si | Chulmore_Quill | Clavicus_Vile |
Farrington | Gortwog | Hermaeus_Mora |
Hircine | Karethys | King_Eadwyre |
King_Gothryd | King_of_Worms | Lady_Bridwell |
Lady_Brisienna | Lady_Doryanna_Flyte | Lord_Auberon_Flyte |
Lord_Bertram_Spode | Lord_Bridwell | Lord_Castellian |
Lord_Coulder | Lord_Darkworth | Lord_Harth |
Lord_K'avar | Lord_Khane | Lord_Kilbar |
Lord_Perwright | Lord_Plessington | Lord_Provlith |
Lord_Quistley | Lord_Vhosek | Lord_Woodborne |
Malacath | Medora | Mehrunes_Dagon |
Mephala | Meridia | Mobar |
Molag_Bal | Mynisera | Namira |
Nocturnal | Nulfaga | Orsinium |
Peryite | Popudax | Prince_Greklith |
Prince_Helseth | Prince_Lhotun | Princess_Elysana |
Princess_Morgiah | Queen_Akorithi | Queen_Aubk-i |
Queen_Barenziah | Sanguine | Sheogorath |
Skakmat | Sylch_Greenwood | Thaik |
The_Crow | The_Night_Mother | The_Squid |
The_Underking | Thyr_Topfield | Vaernima |
Whitka |
Person _qMother_ named mynisera
creates the queen mother Mynisera as an NPC in a quest. She'll be teleported to a remote spot by the start-up task of the quest.
Note that you may easily confuse the player if your quest, say, teleports the King of Worms away somewhere while the player is off to fetch the lich soul for him as part of the main story. On the other hand, it might serve an interesting twist to the main plot.
Faction Type
An NPC can be created with an affiliation with one of the twenty-odd factions to control how the success or failure of the player in the quest is spread among the Iliac Bay inhabitants.
Person _symbol_ factionType aFactionName Person _symbol_ factionType aFactionName female Person _symbol_ factionType aFactionName male
where aFactionName is one of the known faction types:
Court | People |
Daedra | Person |
Generic_Group | Region |
God | Subgroup |
Group | Temple |
Knightly_Guard | Thieves_Den |
Magic_User | Vampire_Clan |
Official | Witches_Coven |
You can use the generic name Faction to select a faction at random when the quest begins.
The first form of the Person command picks the gender of the NPC at random, while the latter two forms request a specific gender.
anyInfo nn and rumors nn tags can be appended to supply message block numbers to use in the dialog screen.
Person _npc1_ factionType temple male
would select a male NPC allied with the temple crowd.
Group Alliances
An NPC can be created with an affiliation for one of the occupations found in Tamriel.
Person _symbol_ group aGroupName Person _symbol_ group aGroupName female Person _symbol_ group aGroupName male
where aGroupName is one of the social groups/guilds:
Armorer | Jeweler | Resident3 |
Banker | Librarian | Resident4 |
Bookseller | Noble | Shopkeeper |
Carpenter | Pawnbroker | Smith |
Chemist | Questor | Spellcaster |
Cleric | Resident1 | Tailor |
Innkeeper | Resident2 |
By coordinating the occupation of the NPC with site selection, you can control the venue that your NPCs appear in. Selecting a spellcaster as an NPC and a mage's guild hall for a site ensures the resulting sprite will be one the player is accustomed to finding in that locale. See Local and Remote Sites for additional information.
The first form of the Person command picks the gender of the NPC at random, while the later two forms request a specific gender.
anyInfo nn and rumors nn tags can be appended to supply message block numbers to use in the dialog screen.
Person _npc1_ group pawnbroker
would select an NPC allied with the pawnbrokers. The gender of the NPC is taken at random.
Faction Alliances
An NPC can be created with an affiliation with a specific faction in the game.
Person _symbol_ faction aFactionName Person _symbol_ faction aFactionName female Person _symbol_ faction aFactionName male
where aFactionName is one of the 400-odd factions from the table below.
Abibon-Gora | Agents_of_The_Underking | Akatosh |
Alcaire | Alik'ra | Anticlere |
Antiphyllos | Apothecaries_of_Akatosh | Apothecaries_of_Arkay |
Apothecaries_of_Dibella | Apothecaries_of_Mara | Apothecaries_of_Stendarr |
Apothecaries_of_Z'en | Arkay | Ayasofya |
Bergama | Betony | Bhoraine |
Binders_of_Arkay | Children | Court_of_Abibon-Gora |
Court_of_Alcaire | Court_of_Alik'ra | Court_of_Anticlere |
Court_of_Antiphyllos | Court_of_Ayasofya | Court_of_Balfiera |
Court_of_Bergama | Court_of_Betony | Court_of_Bhoraine |
Court_of_Cybiades | Court_of_Daenia | Court_of_Daggerfall |
Court_of_Dak'fron | Court_of_Dragontail | Court_of_Dwynnen |
Court_of_Ephesus | Court_of_Gavaudon | Court_of_Glenpoint |
Court_of_Glenumbra_Moors | Court_of_Ilessen_Hills | Court_of_Kairou |
Court_of_Kambria | Court_of_Koegria | Court_of_Koegria |
Court_of_Kozanset | Court_of_Lainlyn | Court_of_Menevia |
Court_of_Mournoth | Court_of_Myrkwasa | Court_of_Northmoor |
Court_of_Orsinium | Court_of_Phrygia | Court_of_Pothago |
Court_of_Santaki | Court_of_Satakalaam | Court_of_Sentinel |
Court_of_Tigonus | Court_of_Totambu | Court_of_Tulune |
Court_of_Urvaius | Court_of_Wayrest | Court_of_Wrothgaria |
Court_of_Ykalon | Crafters_of_Julianos | Cybiades |
Cyndassa | Daenia | Daggerfall |
Dak'fron | Dancers | Dark_Binders |
Dark_Mixers | Dark_Plotters | Dark_Slayers |
Dark_Trainers | Default | Dibella |
Dragontail | Dwynnen | Ebonarm |
Enchanters_of_Kynareth | Ephesus | Fighter_Equippers |
Fighter_Questers | Fighter_Trainers | Gavaudon |
Generic_Knightly_Order | Generic_Temple | Glenpoint |
Glenumbra_Moors | Healers | Ilessan_Hills |
Isle_of_Balfiera | Julianos | Kairou |
Kambria | Koegria | Kozanset |
Kynareth | Lady_Northbridge | Lainlyn |
Mara | Menevia | Mixers_of_Akatosh |
Mixers_of_Arkay | Mixers_of_Dibella | Mixers_of_Mara |
Mixers_of_Stendarr | Mixers_of_Z'en | Mournoth |
Myrkwasa | Northmoor | Oblivion |
Orsinium | People_of_Abibon-Gora | People_of_Alcaire |
People_of_Alik'ra | People_of_Anticlere | People_of_Antiphyllos |
People_of_Ayasofya | People_of_Balfiera | People_of_Bergama |
People_of_Betony | People_of_Bhoraine | People_of_Cybiades |
People_of_Daenia | People_of_Daggerfall | People_of_Dak'fron |
People_of_Dragontail | People_of_Dwynnen | People_of_Ephesus |
People_of_Gavaudon | People_of_Glenpoint | People_of_Glenumbra_Moors |
People_of_Ilessen_Hills | People_of_Kairou | People_of_Kambria |
People_of_Koegria | People_of_Koegria | People_of_Kozanset |
People_of_Lainlyn | People_of_Menevia | People_of_Mournoth |
People_of_Myrkwasa | People_of_Northmoor | People_of_Orsinium |
People_of_Phrygia | People_of_Pothago | People_of_Santaki |
People_of_Satakalaam | People_of_Sentinel | People_of_Tigonus |
People_of_Totambu | People_of_Tulune | People_of_Urvaius |
People_of_Wayrest | People_of_Wrothgaria | People_of_Ykalon |
Phrygia | Pothago | Questers |
Random_Knight | Random_Noble | Random_Ruler |
Santaki | Satakalaam | Secret_of_Oblivion |
Seneschal | Sentinel | Shalgora |
Smiths | Smiths_of_Julianos | Spellsmiths_of_Kynareth |
Stendarr | Summoners_of_Akatosh | Summoners_of_Arkay |
Summoners_of_Dibella | Summoners_of_Julianos | Summoners_of_Kynareth |
Summoners_of_Mara | Summoners_of_Stendarr | Summonists_of_Z'en |
Teachers_of_Akatosh | Teachers_of_Arkay | Teachers_of_Dibella |
Teachers_of_Julianos | Teachers_of_Kynareth | Teachers_of_Mara |
Teachers_of_Stendarr | Teachers_of_z'en | Temple_Blessers |
Temple_Healers | Temple_Missionaries | Temple_Treasurers |
The_Academics | The_Acolyte | The_Akatosh_Chantry |
The_Anthotis | The_Archmagister | The_Bards |
The_Battlelords | The_Beldama | The_Benevolence_of_Mara |
The_Blades | The_Cabal | The_Citadel_of_Ebonarm |
The_Crafters | The_Crow | The_Crusaders |
The_Daggerfall_Witches | The_Dark_Brotherhood | The_Daughters_of_Wroth |
The_Dust_Witches | The_Fey | The_Fighters_Guild |
The_Garlythi | The_Glenmoril_Witches | The_Great_Knight |
The_Guildmagister | The_Haarvenu | The_Host_of_the_Horn |
The_Host_of_the_True_Horn | The_House_of_Dibella | The_Isolationists |
The_Khulari | The_Knights_Mentor | The_Knights_of_Iron |
The_Knights_of_the_Circle | The_Knights_of_the_Dragon | The_Knights_of_the_Flame |
The_Knights_of_the_Hawk | The_Knights_of_the_Owl | The_Knights_of_the_Rose |
The_Knights_of_the_Wheel | The_Kynaran_Order | The_Lyrezi |
The_Mages_Guild | The_Maran_Knights | The_Master_at_Arms |
The_Master_of_Academia | The_Master_of_Incunabula | The_Master_of_Initiates |
The_Master_of_Initiates2 | The_Master_of_the_Scry | The_Mercenary_Mages |
The_Merchants | The_Montalion | The_Mountain_Witches |
The_Necromancers | The_Odylic_Mages | The_Oracle |
The_Order_of_Arkay | The_Order_of_the_Candle | The_Order_of_the_Cup |
The_Order_of_the_Hour | The_Order_of_the_Lamp | The_Order_of_the_Lily |
The_Order_of_the_Raven | The_Order_of_the_Scarab | The_Palatinus |
The_Patricians | The_Prostitutes | The_Quill_Circus |
The_Resolution_of_Z'en | The_Royal_Guard | The_Royal_Guards |
The_School_of_Julianos | The_Selenu | The_Septim_Empire |
The_Shadow_Appraisers | The_Shadow_Schemers | The_Shadow_Spies |
The_Shadow_Trainers | The_Sisters_of_Kykos | The_Sisters_of_the_Bluff |
The_Skeffington_Witches | The_Tamarilyn_Witches | The_Temple_of_Kynareth |
The_Temple_of_Stendarr | The_Thieves_Guild | The_Thrafey |
The_Tide_Witches | The_Travelers_League | The_Utility_Mages |
The_Vraseth | The_Witches_of_Alcaire | The_Witches_of_Devilrock |
The_Witches_of_the_Marsh | Thyr_Topfield | Tigonus |
Totambu | Tulune | Urvaius |
Venom_Masters | Wayrest | Wrothgaria |
Ykalon | Zen |
The first form of the Person command picks the gender of the NPC at random, while the later two forms request a specific gender.
anyInfo nn and rumors nn tags can be appended to supply message block numbers to use in the dialog screen.
Person _lamper_ faction The_Order_of_the_Lamp anyInfo 1031
would select an NPC allied with The Order of the Lamp. Qrc message block 1031 is associated with the Tell me about.. dialog option of the game. The gender of the NPC is taken at random. (Although for the Order of the Lamp, females are rendered by male images as it happens)
Quest Places
Different locations can be associated with a quest. For example, the PC may have to steal something from a shop, scour a dungeon for some special ingredient, or what have you. These places must be tracked both by the X-engine and the quest itself (You might want something special to happen when the PC arrives at a quest location)
A Place command is used to describe each place a PC might visit in the quest where something out of the ordinary may take place in pursuit of the quest goal.
Message blocks can be associated with locations in two different ways.
anyInfo nn adds the Qrc message nn to the Tell me about.. dialog responses.
rumors nn adds the Qrc message nn to the rumors to spread when the PC asks for Any News? in the dialog panel.
These tags can be appended to any Place command. Although, beware that adding a remote dungeon to the pick list under the Tell me about... dialog tab doesn't always do the right thing.
Instead of displaying the name of the dungeon in the pick list, X-Engine usually displays the name of a fictitious alchemy shop. However, rumors spread through the Any News? query will display the remote dungeon name properly.
This unfortunate side-effect can be mitigated somewhat, by using the dialog link command to suppress the entry of the bogus shop name in the pick list.
Quest locations are divided into three groups:
- permanent sites
- local sites
- remote sites.
Permanent Sites
A permanent site is one that appears the same for every Daggerfall incarnation, and they are the obvious main story 'hot spots': Sentinel, Wayrest, Daggerfall, Dirinni Tower, Scourg Burrow, and so forth. Your quest is free to send the PC on a romp through Castle Daggerfall or Medora's tower if you want to.
Place _symbol_ permanent aPermanentPlace
where aPermanentPlace is one of the permanent Daggerfall sites. Some places have several forms, each of which indicates a different location within the dungeon that the teleport cheat travels to. These are used to indicate specific rooms in the castle dungeons, or rooms along the chain of teleport cheats for other dungeons.
DaggerfallCity1 | MantellanCrux | Sentinel4 |
DaggerfallCity2 | OrsiniumCastle1 | Shedungent1 |
DaggerfallCastle1 | OrsiniumCastle2 | Shedungent2 |
DaggerfallCastle2 | OrsiniumCastle3 | Shedungent4 |
DirenniTower | OrsiniumCastle4 | Skeffingcoven |
GlenmorilCoven | PirateerHold1 | TotambuCoven |
KykosCoven | PirateerHold2 | WayrestCastle |
LlugwychCastle | ScourgBarrow1 | WoodbourneHall4 |
LysandusTomb1 | ScourgBarrow2 | WoodbourneHall5 |
LysandusTomb2 | SentinelCastle |
If you choose a permanent location, you may need to make it visible on the proper province map. The three main castles and the starting dungeon are always present on the province map. The dungeons for Lysandus' tomb, Nulfagu, etc are initially absent from the travel map.
The reveal quest action can put permanent sites on the travel map.
Note also, that quest locations specified as permanent do not have their _symbol_ substituted properly in Qrc text blocks. So their names must be written out in full in any Qrc messages refering to that site.
Local Sites
A quest can associate a house or shop in the town currently occupied by the PC--there are no local dungeons in Daggerfall.
Place _symbol_ local aLocalSite
where aLocalSite is:
apothecary | house1 | palace |
armory | house2 | pawnshop |
bank | house3 | random |
bookstore | house4 | tavern |
clothingshop | jewelryshop | temple |
furnitureshop | library | weaponstore |
generalstore | magery |
house1 through house4 select between different styles of Daggerfall homes. Random selects the type of shop at random when the quest begins.
Remote Sites
A quest can associate a house or shop in a remote town, or it can associate a remote dungeon with the quest.
Place _symbol_ remote aRemoteSite
where aRemoteSite is:
apothecary | generalstore | magery |
armory | house1 | palace |
bank | house2 | pawnshop |
bookstore | house3 | random |
clothingshop | house4 | tavern |
dungeon | jewelryshop | temple |
furnitureshop | library | weaponstore |
When you specify a remote place, X-engine selects a location in the current province that has the type of remote site requested.
Note that this sometimes means the current location will be selected if it satisfies the site criteria. Really, local implies that no distant travel will be required, while remote implies that distant travel is optional.
Although there are no local dungeons, your quest scenario may request one. Why would you want to do this? One reason is to hide another quest resource where you are certain the PC can not locate it. Selecting a different remote dungeon that the quest does not reveal is not a certain guarantee that the PC can not locate the resource in the other dungeon. After all, the other dungeon may already be visible on the province map from an earlier quest. The present quest has no way of determining this fact.
Quest Clocks
Quests can associate time limits or durations to various parts of the quest by creating clocks to time events. Clocks specify how much time must elapse before a task in the condition/response section is activated.
Clocks can specify an absolute amount of time, or a range of time, or a random amount of time. Use an extended version of clock time format to specify an amount of time: days.hours:minutes
so 1.4:45 represents a time 1 day, 4 hours and 45 minutes in the future.
Clock _symbol_
creates a clock with a random amount of time to run.
Clock _symbol_ dd.hh:mm
creates a clock that runs down in dd days, hh hours, and mm minutes.
Clock _symbol_ dd.hh:mm aa.bb:cc
creates a clock that runs down between dd.hh:mm and aa.bb:cc.
The symbol assigned to a clock also names a task in the condition/ response section of the Qbn file. When the timer runs out, that task is actived in response to the time-out.
Note that a Clock resource doesn't automatically start ticking, and must be started by using the start timer action.
Quest Enemies
Quests can create specific enemies to plague the PC with.
Foe _symbol_ is anEnemy Foe _symbol_ is nn anEnemy
The first form creates a single foe of type anEnemy while the second form creates nn foes of type anEnemy.
Please see the file foes.src for the complete list of quest foes.
Foe _angryMages_ 17 mage
would describe a mob of seventeen (17) mages.
Unlike quest NPCs or places, quest foes must be installed in the game world through actions in the condition/response section of the quest file.
Quest Condition/Responses
The quest condition/response section is probably the most involved section of the quest. Here is the logic or scripting of what happens during the quest.
This section can be thought of as tasks or steps which are triggered by various events in the game world. It probably helps if you've been exposed to some programming concepts before, but it isn't essential.
Each task of the quest has a symbol name associated with it, which can be used in other tasks to determine whether that step has been taken yet.
The general pattern of a task is:
_symbol_ task: action1 action2 : :
or
_symbol_ task: condition1 condition2 : action1 action2 : :
or
_symbol_ task: condition1 condition2 : :
or
until _symbol_ performed: action1 action2 : :
where an action is the desired quest activity and condition is the quest event to trigger the desired action.
Quest tasks are usually written in what's called their positive-definite form, and so are usually performed but once. However the until performed form creates a task to perform over and over again until another task is finished.
There are also task forms which condense the task and conditions together as a sort of shorthand.
For example, suppose part of a quest involves locating an NPC to receive a hint or clue. When the player locates that person, the quest must tell the X-engine what to do. We can create a task to handle this event in the game world.
_npcClicked_ task: clicked _npc_ say 1014 log 1015 step 1 reveal _dungeon_ place _item_ at _dungeon_
which says roughly when the player clicks on _npc_ the NPC makes a speech from a Qrc message block, adds an entry to the player's log book, adds a dungeon to the province map, and hides a quest item in that dungeon.
Life isn't quite that simple though. What happens if the PC returns and clicks the NPC again? Does he get a free item? Oops. A better solution might be:
-- This task remembers whether the PC has clicked _npc_ _npcClicked_ when _npc_ clicked
-- This task remembers whether we've hidden the quest item or not. _itemHidden_ when _hideItem_
-- This task checks whether the PC has clicked _npc_ and only -- proceeds if we've not yet hidden the quest item. _hideItem_ task: when _npcClicked_ and not _itemHidden_ say 1014 log 1015 step 1 reveal _dungeon_ place _item_ at _dungeon_
-- This task intervenes if the PC clicks _npc_ again -- after we've hidden the quest item in the dungeon. _alreadyHidden_ task: when _npcClicked_ and _itemHidden_ say 1016
If the PC tries to 'cheat' by clicking the NPC again, the NPC chides the PC with message 1016.
Quest conditions
Apart from the quest start-up actions and clock time-outs, quest tasks are triggered by conditions or events within the game world which the quest wants to take special notice of, usually to supply some stimulus to the player character which would not otherwise arise.
This section catalogs the game world events which a quest can check for, to take appropriate action on as the circumstances require.
The game world events that a quest may capture are
- cast aSpell spell do aTask
- clicked anItem
- clicked anNPC
- clicked anNPC and at least anAmount gold otherwise do aTask
- daily from aTime1 to aTime2
- dropped anItem at aPlace
- faction aFaction available
- from aTime1 to aTime2 daily
- have anItem set aVariable
- injured aFoe
- killed aFoe
- level nnnn completed
- pc at aPlace do aTask
- repute with anNPC exceeds nn do aTask
- toting anItem and anNPC clicked
- anItem used do aTask
- anItem used saying nnnn do aTask
- when aFoe killed
- when aTaskHasBeenPerformed
- when anItem clicked
- when anItem used
- when anItem used saying nnnn
- when anNPC clicked
- when anItem dropped at aPlace
- when aSpell spell cast
- when repute with aFaction is at least nnn
- when pc at aPlace
- when pc not at aPlace
- when aSpell cast
- when toting anItem and anNPC clicked
Some of the conditions seem to describe the same thing (e.g., killed aFoe vs when aFoe killed) and they do refer to the same game world event, but have different contexts within the quest source file.
For the X-engine, conditions always have task names associated with them. But as a quest author you don't necessarily care about the task name a condition is associated with unless you need to refer to the completion of that task elsewhere in the quest.
So many of the conditions have two equivalent forms of expression, one which must follow a named task, and one which does not. The basic rule is that the forms beginning when ... create their own task names automatically while the other forms do not, and so must appear within a task named by the task: directive.
The detailed descriptions of the quest conditions follows.
Locating things in the game world
clicked aThing when aThing clicked toting anItem and anNPC clicked
When the player character clicks on a quest related item or NPC this condition will schedule the actions associated with this task for execution by the X-engine. aThing must be a quest item created by an Item command, or a quest NPC created by a Person command.
Message: 1017 <ce> Your quest is complete. when _item1_ clicked say 1017 end quest
In this quest fragment, when the PC clicks the mouse on _item1_ in the game world, message number 1017 is displayed and the quest is finished.
Alternatively, the same task could be written:
foundItem task: clicked _item1_ say 1017 end quest
Sometimes you only want to take action if the PC approachs your NPC with a specific quest item
Message: 1020 <ce> Thank you for returning my widget. returnItem task: toting _item1_ and _questor_ clicked say 1020
So the questor won't congradulate you unless you return with the quest item he's waiting for.
This last form, toting and clicked has an important side-effect when you include it in a scenario: The item is destroyed when both parts of the condition are true.
By the player's cash on hand
clicked anNPC and at least anAmount gold otherwise do aTask
When the PC clicks on a quest NPC in order to obtain a quest item from the NPC, the quest can assign a cost to the quest item and take different actions if the PC doesn't have the requisite cash available.
If the PC has at least the specified amount of gold on hand, that number of gold pieces will be taken from the PC and the remainder of the actions in this task will be performed.
If the PC doesn't have enough gold (and it must be available as pieces of gold; letters of credit don't seem to apply) none of the actions in the task are performed. Instead, the X-engine schedules the other task mentioned by the condition.
_buyTalisman_ task: clicked _healer_ and at least 20 gold otherwise do _pcTooPoor_ say 1013 get item talisman log 1017 step 2 _pcTooPoor_ task: say 1015 clear _buyTalisman_ _pcTooPoor_
By the clock
daily from aTime1 to aTime2 from aTime1 to aTime2 daily
A quest may direct the X-engine to perform some task on a daily schedule. Often this involves sending nasties to plague the player, but any quest action is possible. This condition is used in the main story for example to make the ghost of King Lysandus haunt Daggerfall City for several hours after sunset. For example
from 06:00 to 10:00 daily create _foe_ every 10 minutes 7 times with 100% success
or
plague task: daily from 6:00 to 10:00 create _foe_ every 10 minutes 7 times with 100% success
would create waves of nasties to plague the player character every morning from 6 to 10 for the duration of the quest.
Note also that each Clock command creates an implicit time-out condition. Create a task with the same name as the clock to activate when the clock runs out. Note that a Clock resource doesn't automatically start ticking, and must be started by using the start timer action.
Message: 1019 <ce> Well, you've run out of time now. Clock _tooSlow_ 12.0 -- Quest startup: start timer _tooSlow_ _tooSlow_ task: say 1019 end quest
In this quest fragment, if the PC is still plodding along after 12 days on this quest, chide him and terminate the quest.
Checking the PC's repute
A quest can check the player's repute with a particular quest NPC and take different actions according to whether the NPC likes or dislikes the PC.
repute with anNPC exceeds nn do aTask
is the condition to schedule a different task if the NPC favors the player character enough. NN is the PC's minimum repute with the NPC, usually between 0 and 100, although the PC's reputation can be negative.
Message: 1019 <ce> I suppose this will have to do. <ce> Couldn't you have brought a fresher sample? Message: 1020 <ce> I say, that was quite good work for a %ra. <ce> Here, take this extra reward for special service. checkForBonus task: repute with _npc_ exceeds 41 do bonus variable bonus bonusReward task: when deadFoe and bonus say 1020 give pc _reward_ _extraReward_ end quest regularReward task: when deadFoe and not bonus say 1019 give pc _reward_ end quest
which bestows one reward if the PC's reputation with the NPC is smaller than 42 and bestows two rewards if the reputation is larger than 41. You can write quests to shine the PC on if the NPC doesn't like the PC's previous affilliations.
Using items
have anItem set aVariable have anItem do aTask anItem used do aTask anItem used saying nnnn do aTask
There are times when a quest author wants to take some special action when the player manipulates an object pertaining to the quest.
A quest can detect when the player has a particular item in the inventory by using the have anItem condition. The two forms are really equivalent, for in the X-engine a variable is just a task without any conditions or actions.
Message: 1015 <ce> You notice a sudden change in your surroundings. ambush task: say 1015 move _foe_ to pc waiting task: have _questItem_ do ambush
would set up to ambush the PC after a quest item was added to the inventory.
Message: 1015 <ce> As you examine the parchment <ce> you notice your surroundings change. ambush task: say 1015 teleport pc to _newDungeon_ waiting task: _questItem_ used do ambush
would teleport the PC to a different dungeon when the quest item was used in the inventory screen (to read a quest letter perhaps).
Attacking foes
A quest can detect when the PC first injures an enemy in a fight or when the enemy is dead.
injured aFoe killed aFoe killed nn aFoe when aFoe injured when aFoe killed
For example
Message: 1099 <ce> No, I won't let you kill me. Begone! When _foe_ injured say 1099 teleport pc to _newDungeon_
which contrives to teleport the player elsewhere if the specified foe has been injured.
Message: 1099 <ce> Congradulations, you've killed the orc commander. When _foe_ killed say 1099 end quest
which pops up a message box when the PC slaughters the specified foe.
Recall that the Foe command will create mobs of kindred foes. You can specify how many of the mob must be slain for the condition
Foe _foe_ is 17 vampire enoughDead task: killed 5 _foe_ get item _reward_ teleport pc to _newDungeon_
would trigger the requested actions after killing 5 of the 17 vampires.
Note that the killed task will be permanently retired by the X-engine once the number of foes created by the associated Foe command have been slaughtered.
That sounds reasonable enough, but notice that it clashs with the use of the create foe command, which may create more foes to be killed than can be tested by the killed condition.
Even worse, you can't use several kill commands to check for different numbers of foes slaughtered. You can have only one killed action for each Foe declaration. If you provide more than one, the action response becomes unpredictable.