Update - 30 Aug 2015
Version 1.0 is "ready." You can pull down the installer here. I have added a quick start guide
at this location.
Now, when I say "ready" what I mean is that I have tested this myself. If you've ever written software you know that testing your own stuff leaves you with huge blind spots.
So if you find a bug please report it to me via the email in the Contact Info section in the sidebar.
Update - 22 Aug 2015
Okay, I think it's ready for use so I'm going to start working with it to create conversations for my current (erstwhile) project and see what tweaks I think it needs.
Once I feel that it's solid I'll turn my attention to refactoring it as described earlier. This will place a larger burden on plugin writers but will also give them greater
control over how nodes are configured and therefore over the final output.
Update - 20 Aug 2015
This is almost ready - mostly just options dialogs left to fix. Right now you can begin editing a conversation graph, save it to disk (JSON format if anyone really cares)
and then load it back and continue editing. The TSWriterPlugin writes the conversation to TorqueScript that can be consumed by a conversation script system that I have been
fiddling with.
Next I plan to reorganize the systems so that the plugin manages the node types and internal item layouts so that the main program doesn't have to either dictate or care about
how that's done - plugins will be completely free to use the graph solely for editing and to deal with the data however it wants.
16 Aug 2015
So, got a wild hair and decided to build a conversation editor using the Graph library from here: https://github.com/LogicalError/Graph.
I made a few tweaks, but essentially it's ready to rock and roll out of the box. I just wanted to be able to handle clicks for all node items. I also wanted a way to make it easier to
see what tags I was actually using so I added this:
// Friendly tag def
public static class TagType
{
public static CheckboxClass CHECKBOX = new CheckboxClass();
public static ColorClass COLOR = new ColorClass();
public static DropDownClass DROPDOWN = new DropDownClass();
public static ImageClass IMAGE = new ImageClass();
public static LabelClass LABEL = new LabelClass();
public static NumericSliderClass NUMERICSLIDER = new NumericSliderClass();
public static SliderClass SLIDER = new SliderClass();
public static TextBoxClass TEXTBOX = new TextBoxClass();
public static NodeTitleClass NODETITLE = new NodeTitleClass();
}
// Dummy classes to use as types for item tags
public class CheckboxClass : object { }
public class ColorClass : object { }
public class DropDownClass : object { }
public class ImageClass : object { }
public class LabelClass : object { }
public class NumericSliderClass : object { }
public class SliderClass : object { }
public class TextBoxClass : object { }
public class NodeTitleClass : object { }
Since the node tag system relies on the tag's type, this works pretty well.
I also added a simple enum for the input/output property of node items instead of passing two booleans.
public enum NodeIOMode
{
None,
Input,
Output,
InOut
}
And now you create nodes something like so:
var node = new Node("Conversation Node");
node.AddItem(new NodeTextBoxItem("NodeName"));
node.AddItem(new NodeTextBoxItem("Enter NPC text", NodeIOMode.None));
node.AddItem(new NodeLabelItem("Conversation input", NodeIOMode.Input) { Tag = TagType.TEXTBOX });
var editNode = new NodeLabelItem("Click Here To Edit Output List");
editNode.Clicked += new EventHandler(editOutputListNode_MouseDown);
node.AddItem(editNode);
node.AddItem(new NodeTextBoxItem("Enter player text", NodeIOMode.Output) { Tag = TagType.TEXTBOX });
this.DoDragDrop(node, DragDropEffects.Copy);
So, mostly "quality of life" changes. Now I just have to get it to write the graph out as a bunch of script that can be used to power a conversation system in Torque! I've got a start on
that so all I have to do is get it all into a cohesive script package and away we go....