Setting up AI Dialog

How to setup dialog for AI

Friendly AI characters will not attack player and can be used for plethora of things regarding player interaction toward them. One of those interactions is Dialog that can be started between player and AI. To add dialog to your AI select "Setup Dialog" inside Top Down AI Component.

Now a new game object will be spawned as child of your AI containing new dialog component. Then you can enter your opening line (line of dialog that will show up when conversation is started) and you can add player controlled dialog responses from which numerous actions can be called.

There are few types of responses. First is none, where only a new dialog text will show when clicked on. Close Dialog means that after choosing that response AI will show his dialog text and then conversation will be closed. Immediate Close will close conversation window immediately when response is selected. Branch Dialog will create yet another Dialog component and game object as child of first Dialog component and that response will lead to that Dialog. Combat Dialog response will on shown AIs dialog text make AI hostile and after conversation closes AI will become hostile.

You can also set various Unity Event calls like custom functions and other (giving player item, enabling/disabling objects, starting/updating/finishing quests etc) that will be called when response is selected.

If you check 'Remove After Activating' that response will be removed from conversation when clicked on and AIs dialog is shown.

Last updated