View Full Version : Dialog System?

10-27-2008, 07:41 AM
I was wondering if there is a system in Novashell for creating, storing and accessing dialogs, specifically rpg-style back and forth chatter and response selections. I've checked out the selection dialog special entity and would like to learn more but I can't find the source code and Seth hasn't gotten to the documentation yet!

...so I went ahead and set up my own system for dialog. I have the dialog for each character saved in a nested table with dialog branches that hold leafs for each piece of dialog. The player must meet requirements for each branch as well as each leaf. It's easy for my getDlg function to determine which leaf is supposed to come up each time the player interacts with a character. I'll probably set up a simple html/javascript interface to edit dialogs and generate the tables because I'm a web developer and could do it quickly that way.

If there is nothing like this in place or planned for Novashell I'm willing to share the code. Once I've tested it out and make sure it does everything I need I'll post it up here for suggestions.

10-29-2008, 04:08 AM
The dialog special entity is pretty bare-bones, writing your own system for a dialog/GUI intensive game is probably a good idea.

If there is nothing like this in place or planned for Novashell I'm willing to share the code.

Cool :)

11-01-2008, 11:37 PM
I'm at a point where I need to modify the code for the ChoiceDialog special entity. Where can I find this?

11-02-2008, 01:48 AM
It's EntChoiceDialog.x and EntChoiceDialog.cpp.

Hint for next time: Scan the source code for the word ChoiceDialog. ;)

If you don't have a way to do that, figure one out, it's invaluable! And will show you the other places that need to be modified to add a NEW custom class that can be initted by script if that's the route you end up going.

(If you're using MSVC, it's Ctrl-Shift-F by default I believe, or alternatively, Edit->Find and replace->Find in files.

If you aren't adding functionality to EntChoiceDialog but rather just want a way to control the existing system's dialog tree flow, it might make more sense to write something that merely "uses" EntChoiceDialog?

I guess it depends on how much you need to change, if a lot, might make sense to rename EntChoiceDialog EntChoiceRPGDialog and gut it from there as a template to start from. (So the original EntChoiceDialog functionality could still be used, and you don't have to be careful not to break it with the changes)

11-02-2008, 10:01 PM
Thanks. Pretty much all I need is to have the existing choice dialog take a different anonymous function for each choice that is selected, instead of using one function with a string that is passed as an argument from each choice. I'll probably do a copy and paste and create a new special entity with it. I was expecting to find most of the choice dialog code as Lua script, I guess that C++ bible that I only got 100 pages through a year ago is going to come in handy :)

12-22-2008, 12:29 AM
expect to get a few questions from me. Luckily I see I can call LogMsg from the source, so that's going to be a big help. I created a back up of the original EntChoiceDialog.cpp and now I'm working on modifying it to run an anonymous Lua function for whatever choice is selected. Shouldn't be too hard. From the looks of it I can probably get the current EntChoiceDialog class to work the old way with one function and my new way with many functions without any modification to existing games that use the class.