Difference between revisions of "Project Phoenix 2 Dialogs"

From Legends of Aria Admin and Modding Wiki
Jump to: navigation, search
(Conversation Node Table)
Line 7: Line 7:
 
add it to the global Dialog table, it will be a simple as adding a string object variable to any merchant in my merchant system. Lets take a look at setting up a conversation node shall we?
 
add it to the global Dialog table, it will be a simple as adding a string object variable to any merchant in my merchant system. Lets take a look at setting up a conversation node shall we?
  
====Conversation Node Table====
+
===Conversation Node Table===
 
Below is a small example table of a conversation
 
Below is a small example table of a conversation
  
Line 33: Line 33:
 
  },
 
  },
 
  }
 
  }
 +
 +
Each merchant in the game can also be just a person with some conversation. On each merchant you will see a object variable named Data.Dialog. This is a string value which represents the node name to use. In the examples case it will be HelloWorld as our string value. When the player brings up the dialog window, they will always pull up StartNode on the first use of the dialog. Every dialog needs to have At least StartNode entry as it is the entry point for every
 +
dialog. To test your dialog just create a merchant_male or merchant_female, use your info command and change the Data.Dialog variable to the name of your Dialog.DialogName table... in the example again, we will be using HelloWorld.

Revision as of 05:24, 24 July 2019

Welcome

The dialog system consists of a group of tables, functions and variables. The dynamic window display is used in the merchant systems user interface that comes with Project Phoenix. The system is simply designed and easy to modify to suit your server needs. It uses your basic Node based design. It allows you to have required variables or skill level to access the Node or even the player responses. Allowing you to set up simple dialog to complex progressive dialogs. In this documentation I will explain the basics of how it is set up.

Dialog Table

The dialog table is a global variable that will contain each of your dialog trees. This Table is located in the mods/ProjectPhoenix2/scripts/dialog/dialog.lua. The table name is Dialog. Once you create a new dialog table and add it to the global Dialog table, it will be a simple as adding a string object variable to any merchant in my merchant system. Lets take a look at setting up a conversation node shall we?

Conversation Node Table

Below is a small example table of a conversation

Dialog.HelloWorld=
{
	StartNode =
	{
		NpcText="Hello World",
		Responses=
		{
			{
				Text="Hello Mr Npc, What else do you know?|GotoNode|WhatElse",		
			},
		},
	},
	WhatElse =
	{
		NpcText="Click continue for some fun.",
		Responses=
		{
			{
				Text="Sure lets see what is next|GotoNode|StartNode",		
			},
		},		
	},
}

Each merchant in the game can also be just a person with some conversation. On each merchant you will see a object variable named Data.Dialog. This is a string value which represents the node name to use. In the examples case it will be HelloWorld as our string value. When the player brings up the dialog window, they will always pull up StartNode on the first use of the dialog. Every dialog needs to have At least StartNode entry as it is the entry point for every dialog. To test your dialog just create a merchant_male or merchant_female, use your info command and change the Data.Dialog variable to the name of your Dialog.DialogName table... in the example again, we will be using HelloWorld.