Automatic flowchart for RenPy story scrips

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
User avatar
Andredron
Miko-Class Veteran
Posts: 688
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Automatic flowchart for RenPy story scrips

#1 Post by Andredron »

Hello everyone,

To support the writing of my branching stories, I wrote a Python tool (see attachment) to create a flowchart of the story line. The tool parses the RenPy story files (.rpy) in the game directory for label and jump commands and creates a .graphml file that can then be opened with yEd (free graph editor). The flow chart allows direct jumps to the correct line of an .rpy file in the Atom editor. Hopefully this is helpful, feel free to edit/improve it! I use it in Windows, the code might need some adapting to work on Apple.

There is a short demo video at .

Short instructions:
Create a new folder inside RenPy's "game" directory, copy the VNavigator.py file into it and execute it.
Non-story files gui.rpy, options.rpy, and screens.rpy are skipped.
Comments (#) behind label and jump commands are copied to the flowchart.
After opening the .graphml file with yEd, select Layout > Hierarchical to optimize the flowchart.
To prevent labels from being taken into account, start their comment with a "-".
viewtopic.php?f=8&t=66045

a similar tool made earlier:
viewtopic.php?f=8&t=61517

User avatar
Tiger Lyz
Newbie
Posts: 11
Joined: Fri Jan 17, 2020 4:09 am
Projects: Curvy heroine&Virtual Boyfriend, Homunculus, Voice of Paradaise, The Ugly Princess...
Contact:

Re: Automatic flowchart for RenPy story scrips

#2 Post by Tiger Lyz »

It's really useful. Thanks! :D

User avatar
Andredron
Miko-Class Veteran
Posts: 688
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: Automatic flowchart for RenPy story scrips

#3 Post by Andredron »

Articy to Ren'Py converter

https://github.com/DasDingoCodes/articy ... -Generator

The articy3RenPy Code Generator is a script that converts the JSON export of a given articy-project to RenPy code. It is designed for those who want to develop their RenPy game with the help of articy:draft 3.

Features of this Code Generator:

Converts all of Articy's Flow structure, entities and variables to RenPy code. You can basically write your whole game in Articy and profit from its easy to use graphical interface. And with just two commands (export Articy to JSON, execute this script) you convert all of it to working RenPy code! See the Showcase for an overview of its capabilities.
Generated code is easy to debug. The Code Generator does not write all of its code in one massive file, instead it recreates the structure you made in your Articy project. This might be helpful if you ever need to look into the generated files. The Code Generator also creates a log file with warnings, for example if a referenced image is missing or if it found a todo in the code you wrote.
Highly customisable. You can edit the config file to tailor the Code Generator to your needs. You also can use additional instructions to change the behaviour of a single node element, see here and here.
The Code Generator requires Python 3.9 or higher. I have tested the Code Generator with Articy V3.2.2 and RenPy 8.0.0. The generated code is pretty basic, I imagine it works with previous RenPy versions as well.

Post Reply

Who is online

Users browsing this forum: No registered users