renpyGraphParser

package module
v0.0.0-...-d3a8076 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

README

Ren'Py graph vizualiser

Go Reference Go Report Card GitHub Workflow Status

This is a tool written in Go that allows you to visualise the routes of your story.

Routes of the Question, the classic Ren'Py example

Doki Doki Litterature Club will no longer have secrets for you!

An extract from my personnal VN, Coalescence. You can't imagine handling a heavy VN like this one without graphic tools... (the labels aren't blurred on the real image)

How to use

  • Download latest version
  • Move the program in your game folder
  • Run it from the command line
    • you might have to give yourself the permissions: don't worry my program isn't a virus ! Run chmod +x renpy-graphviz*
  • renpy-graphviz.png just appeared, enjoy !

Advanced usage

Tags

I made a tag system to enforce some behaviours. For example

label chapter_1: #renpy-graphviz: TITLE

Before tags, you must write renpy-graphviz to ensure there are no collision with existing words in your VN.

Here are the tags available

  • TITLE: set the current label style in the graph to a title
  • BREAK: breaks the current flow, for parallel labels for example
  • IGNORE: ignores the current label. Jumps to this label still exist
  • ... more to come

Case, spaces and separators are handled just fine, don't worry about it.

Disclaimer

This require your VN to be structured in a certain way, so it's possible that it isn't perfect for you. Feel free to raise an issue here, or to change your VN structure.

LICENSE

This program is free and under the AGPLv3 license.

Beware, if you use this program, you must credit it somewhere on your game.

Used Renpy Graph Vizualiser from EwenQuim

Enjoy!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context gives information about the state of the current line of the script

func (*Context) HandleTags

func (context *Context) HandleTags(line string)

type Node

type Node struct {
	// contains filtered or unexported fields
}

A Node is a Ren'Py label and some properties, including its graph representation

type RenpyGraph

type RenpyGraph struct {
	// contains filtered or unexported fields
}

RenpyGraph is the graph of Ren'Py story structure

func Graph

func Graph(text []string) RenpyGraph

Graph creates a RenpyGraph from lines of script

func NewGraph

func NewGraph() RenpyGraph

NewGraph creates a new graph

func (*RenpyGraph) AddEdge

func (g *RenpyGraph) AddEdge(tags Tag, label ...string)

AddEdge to the renpy graph

func (*RenpyGraph) AddNode

func (g *RenpyGraph) AddNode(tags Tag, label string)

AddNode to the ren'py graph, ignore if label already exists

func (*RenpyGraph) CreateFile

func (g *RenpyGraph) CreateFile(fileName string) error

GetDotGraphFile creates a file with the graph description in dot language It is meant to be used on a computer

func (RenpyGraph) PrettyPrint

func (g RenpyGraph) PrettyPrint()

PrettyPrint prints the graph in the terminal

func (*RenpyGraph) String

func (g *RenpyGraph) String() string

String returns a string with the graph description in dot language It is meant to be used by other libraries or programs

type Tag

type Tag struct {
	// contains filtered or unexported fields
}

Tags allows more control on the graph structure

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL