User Tools

Site Tools


hpl3:game:dialoghandler

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
hpl3:game:dialoghandler [2012/12/12 13:04]
thomas [Variables]
hpl3:game:dialoghandler [2015/09/17 10:18] (current)
ian.thomas
Line 5: Line 5:
 The dialog handler is a used to create dialog that support basic branching behavior. If you want to do straight forward dialogs that have no branching at all, you might as well just call the Voice Handler directly. But if there are some branching, even simple like breaking the dialog if the player stop looking at a character, then the Dialog Handler is what you want. The dialog handler is a used to create dialog that support basic branching behavior. If you want to do straight forward dialogs that have no branching at all, you might as well just call the Voice Handler directly. But if there are some branching, even simple like breaking the dialog if the player stop looking at a character, then the Dialog Handler is what you want.
  
-===== Basic functioning ​=====+===== Basic functionality ​=====
  
 The dialog is setup just before it is a about to get played, so there is not special init (other than what you do for the [[hpl3:​game:​voicehandler|voice handler]]). You begin by calling Dialog_Begin() which makes the initial preparations and allows you to call the other functions. After that it is time to add a branch using Dialog_AddBranch. You can then use Dialog_AddSubject to add voice subjects to that branch. Once you add a new branch, then those subjects will belong to the newly added branch. When all branches and subjects are added, call Dialog_End to run the dialog. Dialog_End will also check which characters are used in this dialog, and by using Dialog_CharacterIsActive you can check which are currently in the middle of a dialog. The dialog is setup just before it is a about to get played, so there is not special init (other than what you do for the [[hpl3:​game:​voicehandler|voice handler]]). You begin by calling Dialog_Begin() which makes the initial preparations and allows you to call the other functions. After that it is time to add a branch using Dialog_AddBranch. You can then use Dialog_AddSubject to add voice subjects to that branch. Once you add a new branch, then those subjects will belong to the newly added branch. When all branches and subjects are added, call Dialog_End to run the dialog. Dialog_End will also check which characters are used in this dialog, and by using Dialog_CharacterIsActive you can check which are currently in the middle of a dialog.
Line 153: Line 153:
  
 When the selection is done, the implementation must call ReturnResponseSelectChoice in cLuxDialogHandler with the selected option. If time has run out, then -1 shall be sent as argument. When the selection is done, the implementation must call ReturnResponseSelectChoice in cLuxDialogHandler with the selected option. If time has run out, then -1 shall be sent as argument.
 +
 +===== Locking the player into a conversation =====
 +
 +There are a few cases in SOMA where we lock the player into a conversation i.e. they can't move their feet while it's happening.
 +
 +''​Dialog_StartConversation''​ is the simplest form of this; it just locks the player where they'​re standing right now.
 +''​Dialog_StartConversation_PosBased''​ actually moves the player'​s viewpoint to a specified position before starting the conversation,​ which is useful if you're worried about eyelines etc.
hpl3/game/dialoghandler.txt ยท Last modified: 2015/09/17 10:18 by ian.thomas