Game logic - Dialogue – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
=Description=
=Description=
Shows player a window of predefined options, which can be selected from. Each option then can execute its own sequence of actions.
When initiated using [[Ylands Tile - Show dialogue|'''Show Dialogue''']] instruction, it will display a window of predefined options as defined in properties. After selecting a option [[Ylands Tile - Dialogue On Answer|'''On Answer''']] event will be called inside the Dialogue logic. It's possible to show/hide answer options using [[Ylands Tile - Answer enabled|'''Answer Enabled''']] instruction, or modify their text.


*Dialogue between player and world entity (i.e NPC)
*Dialogue between player and world entity (i.e NPC)
*Initiated via Show dialog instruction
*Initiated via '''Show Dialog''' instruction
*Player selects from pre-defined answers
*Player selects from pre-defined answers
*Each answer can call different script instructions
*Each answer can call different script instructions
*Selected answer is obtained via Answer id, when On answered event is called (see example)
*Selected answer is obtained via '''Answer Id''' in '''On Answer''' event (see example)


=Properties=
=Properties=
*Question - question shown
===Question===
*Answer options - list of possible answers, number of option → Id
*Question displayed in the header of the dialogue
*Show leave button - whenever to show "leave" button or not
===Options===
*List of possible answers
*Number in the header of the option → answer Id
===Show leave button===
*Whenever to show "leave" button in the Dialogue window.


=Events=
=Dialogue events=
*On open - called when dialog start
*[[Ylands Tile - Dialogue On Answer|On Answer]]
*On answered - called when dialog option is selected
*[[Ylands Tile - Modal Dialogue On Open-Close|On Open / Close]]
*On closed - called when leave button clicked


=Instructions=
=Related instructions=
*Show dialog - opens dialogue window
*[[Ylands Tile - Show dialogue|Show dialogue]]
*Get/Set question - get or set dialogue question
*[[Ylands Tile - Dialogue question|Get / Set dialogue question]]
*Get/Set answer text - get or set specific dialogue option by Id
*[[Ylands Tile - Answer text|Get / Set answer text]]
*Get/Set answer enabled - get, enable or disable specific dialogue option by Id
*[[Ylands Tile - Answer enabled|Get / Set answer enabled]]
 
=Literals=
*Dialogue - target dialogue game logic
*Questioner - entity asking question
*Player - target player answering dialog
*Answer id - Id of selected answer (as in properties)




----
----
{{Ylands scripting navbox}}
{{Ylands scripting navbox}}

Revision as of 16:26, 2 December 2018

Description

When initiated using Show Dialogue instruction, it will display a window of predefined options as defined in properties. After selecting a option On Answer event will be called inside the Dialogue logic. It's possible to show/hide answer options using Answer Enabled instruction, or modify their text.

  • Dialogue between player and world entity (i.e NPC)
  • Initiated via Show Dialog instruction
  • Player selects from pre-defined answers
  • Each answer can call different script instructions
  • Selected answer is obtained via Answer Id in On Answer event (see example)

Properties

Question

  • Question displayed in the header of the dialogue

Options

  • List of possible answers
  • Number in the header of the option → answer Id

Show leave button

  • Whenever to show "leave" button in the Dialogue window.

Dialogue events

Related instructions



Template:Ylands scripting navbox