ABOUT

Contains all dialogues data for NPC in characters.json from assets/creatures/

Diagram of dialogue object:

Dialogue Object (or we can call it phrase object) structure and logic

JSON structure looks like this:

{
  "start_dialogue": "DIALOGUE ID", // phrase object that will be ran firs
  "dialogues": { // array of phrase objects 
	"DIALOGUE ID": { // ID of phrase, used in "start_dialogue" and in "go_to"
	  "text": "TEXT IN NPC WINDOW", // NPC talking text
	  "answers": [ // array of player's answers objects, amount of objects equal phrases amount
		{
		  "text": "PLAYER ANSWER", // answer text, please, use lang key
		  "go_to": "NEXT DIALOGUE ID, OR SPECIAL KEYS (close_dialog - close dialogue window, close_game - quit from game)",
		  "condition_has": "event.key.id" // answer will be shown if player has this event key ()
		  "condition_has_items": ["af_bengal"], // array of item_id that must contains player to show this replic ()
		  "condition_money": 600, // if player has this amount of money, replic will be available ()
		  "actions": { //actions ()
			"add_money": 0,
			"del_money": 0,
			"add_e_key": ["event.key.id"], // you can create any id, just remember it for usage
			"del_e_key": ["event.key.id"], // delete keys
			"add_quest": ["quest_id"], // add quests
			"add_item": ["item_id"], // add items
			"del_item": ["item_id"] // delete items
		  }
		}
	  ]
	},
	... // can be many as possible
}

Dialogue can be created or edited by Dialogue Editor

Last updated