Dialogs

From Mod Wiki

Revision as of 22:44, 18 July 2008 by Drengor (Talk | contribs)
Jump to: navigation, search

Template:Inuse Template:Potential article

S.T.A.L.K.E.R. Dialogs

Firstly, there are two methods for creating dialogs.  As the Quest page has briefly documented, there is a 'static' dialog tree which allows for a fairly simple conversation to be defined.  Additionally, you can create 'dynamic' or script controlled dialogs.

'Static vs Dynamic - which to use.'

For most dialogs, the static dialog will be simpler and sufficient.  It will define a pre-planned conversation tree that can branch either by user selection, or the use of 'preconditions'.
Dynamic dialogs will use script to determine how the conversation progresses instead of a pre-planned tree.  In the standard game, nearly every stalker has the option of having 'cool info' that more or less randomly gives a response when you ask if they know anything interesting.  This uses a 'dynamic' dialog with script 'randomly'  deciding which response the stalker will give.
'Static Dialogs'
 A simple static dialog might be as follows.
 Hey, man, what's up?
  Not much, how are things with you?
   Pretty good, thanks.
    Good to hear, keep it up.
   I've been better.
    Well, tomorrow's a new day, here's hoping for better luck.
   I'm scraping bottom here, man.
    That sucks, mate.  Sorry to hear it.
 So a simple conversation with one opening line, one response, and three branches for the third response.  We may choose to let the user choose one of the three branches, or limit which are available with preconditions.
 To define this dialog statically, we would make a dialog xml structure, and insert it into one of the dialog*.xml files in the config\gameplay folder.

<dialog id="our_casual_conversation">

 <phrase_list>
   <phrase id="0">
     <text>our_casual_dialog_0</text>
     <next>1</next>
   </phrase>
   <phrase id="1">
     <text>our_casual_dialog_1</text>
     <next>11</next>
     <next>12</next>
     <next>13</next>
   </phrase>
   <phrase id="11">
     <text>our_casual_dialog_11</text>
     <next>111</next>
   </phrase>
   <phrase id="12">
     <text>our_casual_dialog_12</text>
     <next>121</next>
   </phrase>
   <phrase id="13">
     <text>our_casual_dialog_13</text>
     <next>131</next>
   </phrase>
   <phrase id="111">
   </phrase>
     <text>our_casual_dialog_111</text>
   <phrase id="121">
     <text>our_casual_dialog_121</text>
   </phrase>
   <phrase id="131">
     <text>our_casual_dialog_131</text>
   </phrase>
 </phrase_list>

</dialog>

Personal tools