Unity scripts for creating a .tgf
graph file for importing into the yEd Graph Editor from a root .ink
file written in Inkle's Ink scripting language.
Here is an example of 'The Intercept' ink story looks like as an exported graph in the yEd Graph Editor.
- Pull down this project from GitHub.
- Install the free yEd Graph Editor
- Associate yEd with
.tgf
files. - Add your ink scripts to this project or add the 'Unity Ink Graph' folder to your own project.
- In the 'Project' window, click
+ Menu > Ink Graph Settings
- Assign your root
.ink
file to theRoot Ink Script
field in the new Ink Graph Settings file using the Inspector.
The Ink Graph Settings inspector should look something like this:
- Select the Ink Graph Settings file you created in the Project window
- Set the settings you want to use to export in the Inspector window.
- Click the 'Create Graph' button.
-
If your graph didn't open automatically in the yEd Graph Editor...
- Open yEd Graph Editor
File > Open...
to the.tgf
file you exported.
(default is<project>/Exports/<ink file name>.tgf
)
-
Select your desired import options. For complex stories, you probably want to ignore edge labels.
-
Select
Tools > Fit Node to Label
to resize nodes to the labels of the new graph.Note: The Fit Node to Label dialog box can be 'docked' for quick access in yEd.
-
Select
Layout > Hierarchical
orLayout > Organic
to quickly group your graph.Note: The Layout dialog box can be 'docked' for quick access in yEd.
Copyright (c) 2021 Fantabulous Tech
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.