Dialog System

From Legends of Aria Admin and Modding Wiki
Revision as of 16:57, 26 May 2021 by Gizmo (talk | contribs)
Jump to: navigation, search

This is a Stub page.
Since many of us admins basically have no clue how to use and create new dialogs for NPCs, could someone from CS jump in and give us at least a primer here?

The Dialog system is easy to use once you get use to how it is structured. You can find all the basic functions to override within the base_ai_npc.lua file. When you open this file you will notice the Dialog variable. This table holds all the dialog related functions.

Lets discuss the life time of the dialog window shall we. When the player interacts with the npc, an event messaged named "base_ai_conversation" fires up the HandleInteract function. At the botton of this function for basic dialog interact Dialog.OpenGreetingDialog(user) is called. This opens up the dialog.

Here is an example of a simple Greetings Dialog override.

function Dialog.OpenGreetingDialog(user)
    text = "Hello Stranger, What brings you to my part of town?"
    response = {}
    response[1] = {}
    response[1].text = "Do you know the muffin Man?"
    response[1].handle = "MuffinMan"     

    NPCInteractionLongButton(text,this,user,"Responses",response)
end