Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
dialogues [2020/11/06 12:28] – [Events] admindialogues [2020/11/06 12:40] – [Load & Save] admin
Line 10: Line 10:
   * (Un)lockable items   * (Un)lockable items
   * Crosslinking of items possible   * Crosslinking of items possible
-  * Set question, answer or floating item display time for fast-reaction games+  * Question and Answer/Option model 
 +  * Display-Time and Timeout configuration
   * Design of dialogues & monologues with colloquist information   * Design of dialogues & monologues with colloquist information
   * Multilingual system easily definable   * Multilingual system easily definable
Line 197: Line 198:
 |Kind|Defines the kind of event. Supported types are: Text, Image, Audio, Video, Animation, Method, ObjProperty, Redirect, Timer, Misc| |Kind|Defines the kind of event. Supported types are: Text, Image, Audio, Video, Animation, Method, ObjProperty, Redirect, Timer, Misc|
 |Trigger |Defines the moment of event execution. Supported types are: OnBegin, OnEnd, OnTimeout| |Trigger |Defines the moment of event execution. Supported types are: OnBegin, OnEnd, OnTimeout|
-|Scope | A scope should be a component name or a dialogue item ident. Which value to be used depends on the kind of event. Use "ui" to work on the linked UIElement of the current dialogue item. Use "self" to work on the current event. |+|Scope | A scope should be a component name or a dialogue item ident. Which value to be used depends on the kind of event. Use "ui" to work on the linked UIElement of the current dialogue item. Use "self" to work on the current event. It's possible to use variable names here or different item id's.|
 |Data |Defines the multilingual data container. Use this property to define language specific texts, f.e. for displaying a text event.| |Data |Defines the multilingual data container. Use this property to define language specific texts, f.e. for displaying a text event.|
 |Iterations |If the property is set to zero, functionality is disabled. Values larger than zero, perform iteration checks inside Execute() method. For example: Value=3, the event will be called only if the item was played back 3 times.| |Iterations |If the property is set to zero, functionality is disabled. Values larger than zero, perform iteration checks inside Execute() method. For example: Value=3, the event will be called only if the item was played back 3 times.|
Line 227: Line 228:
 LEvent.Data.AddOrSetValue('en-us', 'flash_en-us.mp3'); LEvent.Data.AddOrSetValue('en-us', 'flash_en-us.mp3');
 LEvent.Data.AddOrSetValue('de-de', 'flash_de-de.mp3'); LEvent.Data.AddOrSetValue('de-de', 'flash_de-de.mp3');
 +</file>
 +
 +Example for adding generally available texts, by using "*" as language key:
 +<file pascal>
 +LEvent.Kind := TGorillaDialogueEventKind.Text;
 +LEvent.Data.AddOrSetValue('*', 'a b c d e f');
 </file> </file>
  
Line 238: Line 245:
 LEvent.Parameters.AddOrSetValue('Enabled', TValue.From<Boolean>(true)); LEvent.Parameters.AddOrSetValue('Enabled', TValue.From<Boolean>(true));
 </file> </file>
 +
 +===== Load & Save =====
 +
 +The dialogue system supports loading and storing conversations to file (*.dia;*.dlg).
 +The AssetsManager also supports this file format, so you can push those files to your game package.
 +
 +<file pascal>
 +FDialogueSys := TGorillaDialogueSystem.Create(Self);
 +FDialogueSys.LoadFromFile('MyDialogues.dia');
 +</file>
 +
 +To store your dialogue settings, simply call SaveToFile or SaveToStream.
 +
 +<file pascal>
 +FDialogueSys.SaveToFile('MyDialogues.dia');
 +</file>
 +
 +Next step: [[skillsystem|SkillSystem]]