Dialogue System - Best practices regarding examining world items.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
jpulliam
Posts: 2
Joined: Fri Sep 26, 2014 7:50 am

Dialogue System - Best practices regarding examining world items.

Post by jpulliam »

I have a situation where I need to be able to inspect world items and have a conversation flow. I then need to be able to send a signal that states which conversation items have been selected.



For example, the game character goes to examine a motor and the following dialogue might occur.



-Examine barrings?



-Examine shaft?



-Examine windings?



-----------------------------



--Examine Barrings -



----Barrings are worn, replace barrings



------Response: YES



------Response: NO











I hope that makes some sense. So the way I've been handling writing the dialogue is to make each type of interactive object an NPC and have every actor and conversant in the dialogue tree be the player. This seems sub-optimal but I'm not sure I understand the system well enough to know how to do it better.



In addition I need to log each response so that I can send what the players have done to a central server. I was thinking of using the ConversationLogger Class so that I would log an onConversationStart() to open the logging then log each line the close with onConversationEnd().
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Dialogue System - Best practices regarding examining world items.

Post by Tony Li »

Hi,



You might prefer to define each item in the Item section of your dialogue database, although defining them as NPCs is fine, too. You can add custom fields to each item, such as Item[Barrings].Replaced. Note that I expressed the field in Lua code format.



Then, in the Script field of your "Barrings are worn. Replace? Yes" dialogue entry, you can click the "..." and use pop up menus to set the field to Item[Barrings].Replaced=true.



You can also check the values in the Conditions field to make your conversations branch according to the current state of the fields.



Here are some options for updating the server at the end:



1. Register a simple C# function with Lua, using Lua.RegisterFunction, that updates the server immediately. Add the function call to the Script field.



2. Using ConversationLogger as a template, handle updates in the OnConversationLine method.



3. Write an OnConversationEnd method that updates the server at the end of the conversation.



I'm out of the office until September 30. If you'd like more details, please reply here or email tony (at) pixelcrushers.com and I'll reply as soon as I can.
Post Reply