Daggerfall : Création de quêtes
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
The compiler/decompiler will complain from time to time about anomalies when it encounters them. Some errors are simply reflected from the underlying operating system and won't be covered here. In such cases, the compiler generally annotates the system complaint with its own spin.
Error messages usually begin with the tag qcomp: although the Qrc compiler sometimes complains using the tag qrc: if it is unable to access the Qrc file for some reason.
The source line containing the error will usually be listed prior to the error message complaining about it.
NN is an invalid Qbn section number. Only [0, 10] are allowed.
The compiler discovered it was asked to create a non-existent Qbn section. It usually indicates Windows has shot itself in the foot or allowed some other application to shoot the compiler in the foot.
_symbol_ appears in Qrc without mention in Qbn.
The compiler detected a quest symbol that was used in a Qrc message block, but which was never defined by a corresponding quest resource. This usually means that either the symbol is misspelt in the Qrc block or in the quest resource, but it can't tell you which one is suppose to be right. Misspelt Qrc symbols will crash the quest, or at best give the infamous BLANK text.
_symbol_ at &N is the wrong type of symbol for this operation.
Expected symbol type NN but found symbol type MM.
While reducing a qbn resource to its numeric form, the compiler discovered a usage which clashs with the type of operation being performed. For example
give pc _house_
can produce this error, since it isn't reasonable to install a quest location in the PC's inventory.
_symbol_ will be replaced by whatever resource the compiler is actually grieved about. NN and MM are Qbn section numbers.
_symbol_ has not been defined.
While reducing a Qbn resource to its numeric form, the compiler discovered it refers to a non-existant resource. _symbol_ is replaced by whatever text the compiler is actually grumbling about.
For example, defining an action to use an item resource without actually defining the item resource to be used can create this error condition. Mispelling an item's symbol can as well.
Bad DagText number NNNN (should be between 1000 and 2100).
An action in a quest task has specified a bogus Qrc text number. Bad DagText numbers can crash X-engine.
Buffer overrun.
While decompiling a Qrc file, the decompiler encountered a message block too large for its internal buffer area. The decompiler assumes every Qrc message block is smaller than about 1000 characters.
Cannot use a symbol for amount of gold reward.
An item gold directive tried to provide the amount of cash non-numerically. The compiler expects cash values to be numbers.
Cannot use same symbol with differing contexts.
Previous context is:
The compiler encountered an invalid symbol usage. The previous context is the resource definition which conflicts with the present resource definition. For example
Item _reward_ gold 10 _reward_ task:
would trigger a conflict because all item and task names must be unique.
Code parameter count must be in [1, 5].
The compiler discovered a Qbn template in its .src database with a suspicious number of operands defined. All known Qbn condition/responses take between 1 and 5 operands.
Could not convert the new size value.
A .src file containing a size: NN directive failed to convert NN Texte italiquewithout error.
Could not open aFileName for input.
The compiler was unable to access the file aFileName for input.
Could not open 'aFileName' for input.
The compiler/decompiler was unable to access the .src/.qbn file to operate on.
Hmmm, this quest doesn't seem to have anything to say.
('qcomp' would like some text to work with)
The compiler discovered that it would create an empty Qrc file, which doesn't seem very likely.
Implicit task gives template more than NN words.
A resource directive in the .src database has tried to install more arguments in a resource brick than are expected.
Line NNNN 'fragment'
At line NNNN of the quest source file, the compiler stumbled while analysing a fragment of that line. A complaint detailing the trouble it got into generally follows.
No command handler for Qbn section NN has been created yet.
The compiler discovered it was asked to create an unused Qbn section. Since all the known Qbn sections in use have handlers created for them, in practice this should not arise unless Windows is taking pot-shots again.
No command number; cannot convert template to Qbn section.
A command/directive template has been added to the compiler's .src database that does not properly define a Qbn resource. All well-defined resource directives must specify an index to the Qbn section as the first field of the template defining the resource.
No template matches this pattern.
The compiler could not locate a match for a resource directive in its .src data base.
Quest contains errors. Please review the output log.
One or more errors occurred during the processing of the quest source file. The Qrc/Qbn files for this quest will in general be unusable.
Quest: 'aFilePattern' doesn't follow the pattern for Daggerfall quest file names.
The Quest: directive used in the quest preamble does not follow the pattern for Daggerfall quest file names.
Seek to text offset barfed (NN != MM).
While positioning the Qrc file to process an existing message block, the decompiler discovered that the position requested did not match the position arrived at. This generally indicates someone else is trying to update the Qrc file at the same time the decompiler is trying to read it.
Source file has no extension.
While trying to infer the Qrc/Qbn file name from the source file name, the compiler discovered that no .src extension was present. For the nonce, the compiler relies on the .src extension for various internal reasons.
Stopping compilation because Qrc compile has failed.
Quest compilation proceeds in two parts. First the message blocks are assembled to produce a Qrc file. Then the quest resource definitions are assembled to produce a Qbn file. Each part will generally try to compile all of the statements associated with it so you can receive all the compiler's complaints en masse, so to speak. However, if the Qrc part did not compile successfully, the Qbn part notices this fact and doesn't start.
Template failed to assign an item.
One of the object templates has failed to assign a required parameter for that type of object. If you modify one of the compiler .src files (to define additional items perhaps) that change has offended the compiler somehow.
This clock doesn't have an associated timer task.
The compiler tried to assemble an action refering to a clock resource and discovered that no task had been created for that clock. X-engine expects every timer to have a task defined for it, even if there are no actions to associate with the task.
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.