Modding Resources: Installing Mods | Creating Mods | Basic Code Examples | Creating a Character | Audio and Visual Effects | The Automator | User Interface | Graph Editor

Using the Graph Editor

The Graph Editor is a graphical user interface that can help you to place the nodes and edges in a character's level graph. It then creates the data that would go into the levelGraphObject as detailed in Creating a Level Graph. You can find the editor in the mods/tools folder, which is in the following location by default:

    C:\Program Files (x86)\Steam\steamapps\common\Clicker Heroes 2\mods\tools\GraphEditor.swf

You will need to have Adobe Flash Player installed and then double-click on GraphEditor.swf to run it.

General Interactions

The "Grid" button brings up a grid that you can use to help with the placement of nodes relative to each other.

You can move the level graph area around in the window by clicking and dragging with the right mouse button.

You can scroll in and out with the mouse wheel.

The crossed circle button will bring the view back to the center of the level graph.

Importing

If you want to edit a pre-existing level graph you can import the current code into the program by clicking the "Import" button and copying and pasting the content of a levelGraph Object. For example:

	
	newCharacter.levelGraphObject = {"edges":[{"1":[1,2]}], "nodes":[{"1":{"val":"N1", "x": 0, "y": 0}},{"2":{"val":"N2","x":75,"y":0}}]};
	

From the above line of code you will want to copy everything to the right of the assignment operator (=), excluding the semicolon (;), but including the outer curly braces ({ }). Paste this into the text entry box that the Import button opens.

Now when you click "OK" you will see the layout of the level graph you imported. The above code will look like this, with one edge (connecting line) and two nodes at (0,0) and (75,0), with the values N1 and N2:

Creating & Editing Nodes

To create a new node, click the "Create New Nodes" button to turn on node creation. Now you can click anywhere in the window space to place a new node there. You can create multiple empty nodes at a time if you'd like, and when you're done click on "Create New Nodes" again to turn it off.

Once a node is placed, left-clicking on it will open up a text box where you can enter the reference ID of a Node. This will fill in the "val" of the node in the levelGraphObject and should reference a node that has already been defined in your mod (see Creating a Level Graph for more information about how the levelGraphObject works and how to create nodes). In the import example, the values being used were N1 and N2, but those can be changed to something else in the same way. When you are done, hitting Enter or clicking elsewhere on the window will close this text box.

If you want to move a node after it has been placed you can click and drag on an individual node to do so. You can also click and drag on the background to create a selection box to select multiple nodes at once, and then click and grab any of the selected nodes to move the whole group. You can also move your selections with the directional arrows on the keyboard, or rotate them by holding down shift plus left or right.

To delete a node, it needs to be selected by clicking and dragging a selection box around it, and then hitting the delete key on the keyboard. Any edges it is attached to will be deleted as well.

Selected nodes and edge:

Creating Edges

To connect two nodes to each other click on the "Create New Edges" button to turn on edge creation. Once it's enabled you can click on one node, and then on another node and those two nodes will now be connected. You can continue to do this as many times as you want and when you are done you will need to click on the "Create New Edges" button again to turn it off.

Edges will automatically move and resize when you move the nodes they are attached to and will be deleted if one or both of the nodes they are attached to are deleted. If you want to delete an edge on its own you can click and drag to select only the edge with a selection box and then hit delete on the keyboard.

Exporting

After you're done making your edits, clicking on the "Export" button will bring up a text box with code that you can copy and then paste into your mod's levelGraphObject. For example:

	
	newCharacter.levelGraphObject = <Paste Export Code from Graph Editor Here>;
	

Keyboard Shortcuts

Note: The following interactions can be unstable and can cause the program to have odd behavior. It's recommended to export and save your work frequently if you are going to use them:

  • Copy: Ctrl+Shift+C
  • Paste: Ctrl+Shift+V (pastes to 0,0 - the origin/middle of the graph)
  • Undo: Ctrl+Z

If you run into problems, export your code, close and reopen the program, and then re-import.