VGPrompter
Hi. So... I wrote a C# library to parse a (slightly tweaked*) subset of the Ren'Py script syntax (dialogue lines, menus and flow control statements).
The source code is available on GitHub (MIT-licensed).
I published it as a free Unity3D plugin along with a demo that should explain how it works better than a thousand pages of documentation. The library contains no Unity-specific code, though.
Here's the gist of it: the logic stays in Unity, dialogue and flow control (if so desired) in the .rpy files. Nothing in the .rpy script gets evaluated: conditions (bool methods with no arguments) and Actions (void methods with no arguments) are just referred to in the .rpy via aliases.
Quickstart
You provide a path to one or more .rpy files, you get an iterable object that returns dialogue lines and menus according to the flow control statements and the assigned conditions.
Then you tell the plugin what it's supposed to do under the following circumstances:
- when returning a dialogue line: e.g., print it to screen;
- when returning a menu: e.g., show the menu and return the index of the selected choice;
- after a choice gets selected: e.g., repeat the text of the choice once it is selected;
- when returning period (optional): e.g., show a 'the end' scene.
Random remarks
It is NOT a port of Ren'Py to Unity, and actually not a visual novel engine at all; I suppose one could be built on top of it, though.
I guess I could add support for multimedia-related Ren'Py constructs (play, scene...) as well, so that you could provide OnAudio, OnScene methods to customize their behavior... Let me know if you'd find that useful.
Full compatibility with Ren'Py is probably unattainable; ease of porting is the best I could hope to provide.
Disclaimer
I published it now because I feared the alternative would have been never; it's still in beta, and right now I don't have the time to test it thoroughly (by the end of October I could be back to it, if there's some interest in the project).
Any feedback would be greatly appreciated.
* You can tag menu choices as you'd dialogue lines; single-word (non-keyword) lines are interpreted as Action aliases.
[Unity] VGPrompter: parsing a subset of the Ren'Py syntax
- eugeniusfox
- Newbie
- Posts: 1
- Joined: Tue Aug 30, 2016 3:56 pm
- Github: eugeniusfox
- Location: Italy
- Contact:
Who is online
Users browsing this forum: No registered users