=============================================================================== Universal Strife Dialog Format Specification v2.2 - 03/17/14 Written by Braden "Blzut3" Obrzut - admin@maniacsvault.net Defined with input from: CodeImp Gez Graf Zahl Quasar et al. Copyright (c) 2014 Braden Obrzut. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. =============================================================================== ======================================= Changes in v2.2 ======================================= * Formalized behavior of random strings in dialog text. * Allow USDF to be used as a replacement for SCRIPT00. * Added fields for customizing the "bye" response. * Changed text about an id for conversations to specify that the id for external scripts should be the same as the value set for actor. * Clarified some statements. ======================================= I. Grammar / Syntax ======================================= The grammar and syntax is similar to that of UDMF. A compliant UDMF parser should be applyable to the USDF. However, it will need to be capable of handling sub-blocks. Unknown sub-blocks should be skipped. ======================================= II. Implementation Semantics ======================================= ------------------------------------ II.A : Storage and Retrieval of Data ------------------------------------ This is the same as in UDMF. ----------------------------------- II.B : Storage Within Archive Files ----------------------------------- There are two options for the USDF lump placement. This can either be a part of the UDMF lump list or standalone. If used stand alone the lump name DIALOGXY is used corresponding with MAPXY. (As opposed to SCRIPTXY to prevent compatibility issues with editors that store ACS sources in those lumps.) For UDMF the lump shall be called "DIALOGUE". If the map does not contain a USDF format script, DIALOG00 should be loaded. Only if that fails should SCRIPT00 be loaded. DIALOG00 should be considered a replacement for SCRIPT00 even if the map uses the binary dialog format. -------------------------------- II.C : Implementation Dependence -------------------------------- USDF also implements the namespace statement. This has all the same requirements as UDMF. --------------------- II.D : Random Strings --------------------- On specified fields (those accepting ), if the content of a string begins with the case sensitive string "RANDOM_", then a string table lookup should be performed. The exact string which will be used should be determined dynamically while displaying the dialog page and shall be based upon the remain characters in the string. It is implementation defined how the string lookup will be performed and what will happen if the lookup fails. That is, the source of the replacement strings and how many options it choses from is left up to the implementation. The behavior, however, should be the same as handling for the binary dialog format if supported. ======================================= III. Standardized Fields ======================================= The following are required for all USDF complient implementations. Like UDMF, any unknown field/function should be ignored and not treated as an error. NOTE: "mobj" refers to Strife's conversationIDs and not doom editor numbers or Hexen's spawnids. A valid mobj value is any positive integer greater than or equal to 1. --------------------- III.A : Conversations --------------------- As per UDMF specs, the standard fields are specified here. They should be recognized by implementing ports, but are not necessarily required to be supported. conversation // Starts a dialog. { actor = ; // Identifier for conversation. If previously used, // this will override the previous conversation. // Conversations are automatically bound to mobjs based // on this value, but may also be used as a reference // for external scripting. page // Starts a new page. Pages are automatically numbered starting at 1. { name = ; // Name that goes in the upper left hand corner panel = ; // Name of lump to render as the background. voice = ; // Narration sound lump. dialog = ; // Dialog of the page. drop = ; // mobj for the object to drop if the actor is // killed. link = ; // Page to jump to if all ifitem conditions are // satisified. // jumps to the specified page if the player has the specified amount // or more of item in their inventory. This can be repeated as many // times as the author wants, all conditions must be met for the // jump to occur. ifitem { item = ; // mobj of item to check. amount = ; // amount required to be in inventory. } // Choices shall be automatically numbered. choice { text = ; // Name of the choice. // The amount of an item needed to successfully pick this option. // This can be repeated, but only the first will be shown (provided // diaplaycost is true). All costs must be satisfied for success. cost { item = ; // Item that is required for this option. amount = ; // Minimum amount of the item needed. } displaycost = ; // Weather the cost should be // displayed with the option. // If no cost is specified this should // be ignored. Default: false yesmessage = ; // Text to add to console when choice // is accepted. nomessage = ; // Text to add to console when choice // is denied. log = ; // LOG entry to use on success. giveitem = ; // Gives the specified item upon // success. // The following are the same as the special for linedefs in UDMF. // They are executed on success. special = ; arg0 = ; arg1 = ; arg2 = ; arg3 = ; arg4 = ; nextpage = ; // Sets the next page. closedialog = ; // Should the dialog be closed upon // selecting this choice? // Default: false } // Optional block to change the default close dialog response. If the // user closes the dialog by some other means (pressing escape) the // result shall be equivalent to picking this option. byechoice { // All fields from a choice should be valid here except: // cost - The player must always be able to choose this option. // displaycost - No cost, so always false. // closedialog - Always true. // Additionally if text is empty then the option is hidden, but // does not prevent the option from being chosen by other means. // Default: // text = "RANDOM_GOODBYE"; } } } ------------------------------- III.B : Including Other Dialogs ------------------------------- Unlike the original Strife dialog format. The lump "SCRIPT00" should not be included automatically. Instead the user must specify this behavior by using the include function, which takes the name of a lump to include. Include only needs to be available in the global scope and for compatibility reasons, must include the result of the script and not act like a preprocessor statement. include = ; If a script attempts to include SCRIPT00, then the same replacement rules specified in section II.B apply. =============================================================================== EOF ===============================================================================