Ren'Py Script Builder: Making life easy for your writers!

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
User avatar
torrentails
Newbie
Posts: 5
Joined: Tue Sep 06, 2016 11:45 pm
Organization: Tails Mediaworks
Deviantart: torrentails
Github: torrentails
Skype: torrentails
Location: Adelaide, Australia
Contact:

Ren'Py Script Builder: Making life easy for your writers!

#1 Post by torrentails »

Hey all, I've been working on a couple of projects using Ren'Py and being a programmer at heart, I'm always looking to improve my work flow and Ren'Py make that easy and a joy to work with. But there is one thing that frustrated me to no end when actually writing the script for these games: quotes.

Every line of dialogue and narration requires them to be wrapped in quotes. I hated having to write like that and so I just wrote in plain text and regexed the file occasionally to test the game, but that's still a very manual way of doing things and required me to go over it and add in and bits of code and whatnot after the fact.

Anyways, long story short I wrote a simple scripting specification and a parser in python that does all this for me and more! Now I could focus on writing the script without worrying about quotes or having to inset code/labels/menus/etc. afterwards, and now you can too!

Ren'Py Script Builder on github

Quickstart:
  1. Download the rpsb.py file
  2. feed it a .rps file (or really any file extension you like, it doesn't discriminate)
  3. ???
  4. PROFIT!
Read the readme for a more detailed usage information and the script syntax or check out the scripts directory for some examples.

Feel free to ask any questions or whatnot. If you find any bugs or have any feature requests, let me know on github and/or get involved its the development.

User avatar
Katta
Veteran
Posts: 499
Joined: Sat May 04, 2013 11:18 am
Tumblr: gamesbykatta
Deviantart: katjama
Contact:

Re: Ren'Py Script Builder: Making life easy for your writers

#2 Post by Katta »

Looks like something that'd be really useful for me. I'm not sure if you have this transformation: Alex: Hi! => Alex "Hi!" since I don't know how to run your script. I wonder if you could please make a version for people unrelated to programming or maybe add a more detailed instruction.

User avatar
Darim
Regular
Posts: 67
Joined: Sun Jun 21, 2015 4:17 pm
Organization: Setsuna Ken
Github: SetsunaKen
Location: Germany
Contact:

Re: Ren'Py Script Builder: Making life easy for your writers

#3 Post by Darim »

Works great on Linux. I will test it with more complex script files later.

I hate the quotes too. :D

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Ren'Py Script Builder: Making life easy for your writers

#4 Post by PyTom »

While I'm not a huge fan of the language itself - I think it prioritizes writability over readability, which is often a mistake - I'm glad you made it. It's a good example of the flexibility a text-based scripting language brings us, as even if we disagree on the right way to write a game, we can "agree to disagree", by using generation tools like this one. So thanks for making it!

How are you invoking this? I'm wondering if it makes sense to add support somewhere - for example, in the launcher - for running add on tools like this one, as a preprocessing pass before launching the game.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
torrentails
Newbie
Posts: 5
Joined: Tue Sep 06, 2016 11:45 pm
Organization: Tails Mediaworks
Deviantart: torrentails
Github: torrentails
Skype: torrentails
Location: Adelaide, Australia
Contact:

Re: Ren'Py Script Builder: Making life easy for your writers

#5 Post by torrentails »

Katta wrote:Looks like something that'd be really useful for me. I'm not sure if you have this transformation: Alex: Hi! => Alex "Hi!" since I don't know how to run your script. I wonder if you could please make a version for people unrelated to programming or maybe add a more detailed instruction.
Yeah, simple enough, just add :p Alex: = Alex at the beginning then you can write Alex: Hi! and it'll be transformed into Alex "Hi!" in the output.
I could look at making a more easy to use GUI but that'd much further down the line.

One of the benefits of this is that the programmer of the game can set up the settings, config options and replacements and then just :import them so that the writers who don't know much about programming don't have to worry about it and can just focus on the script.
I'm intending to add a few more examples and help/documentation as things go, for now I'm just focused on getting v1.0 out.
PyTom wrote:How are you invoking this? I'm wondering if it makes sense to add support somewhere - for example, in the launcher - for running add on tools like this one, as a preprocessing pass before launching the game.
Right now, it's run as a standalone python script, but it really wouldn't be that hard to integrate into the build processes of games automatically as it could be easily modularized and a few lines of python during init to build the .rpy files I think would be all that's needed; depends on how Ren'Py handles loading of files, something I haven't really investigated much.

Glad you like it though, everyone has different ideas about how thing should be done and I appreciate you understand that; Some programmers I know don't. It's worth noting that I'm working on a Sublime Text/TextMate grammar definition that should improve readability for people who use them.
Darim wrote:Works great on Linux. I will test it with more complex script files later.
Cheers for testing, though I'd be surprised if it didn't work on pretty much any python platform as it only uses builtin libraries (well, except coloramma, but that's optional in the script). I'm running a 5,000+ line script through it with file mixing, transformations, complex line replacements, etc. to test it. Soon enough I'll make a smaller test file that'll test every different feature of the script in different ways.

User avatar
torrentails
Newbie
Posts: 5
Joined: Tue Sep 06, 2016 11:45 pm
Organization: Tails Mediaworks
Deviantart: torrentails
Github: torrentails
Skype: torrentails
Location: Adelaide, Australia
Contact:

Re: Ren'Py Script Builder: Making life easy for your writers

#6 Post by torrentails »

For those interested, there is now syntax highlighting available for Sublime Text 3 that should be available through package control in the next day or so. If you don't want to wait, you can get the files here.

Other than that, the script parser has undergone a few changes, adding music and sound controls, renaming some commands and general bug fixing. There's also a test file which tests out all the features.

The next step is to clean up the last few issues and work on making it capable to be loaded as a module so that it can be more easily integrated in a games build process. After that, maybe look at Ren'Py itself and see if we can bootstrap this to fire before the launch logic.
Attachments
screenshot.png

User avatar
Mammon
Miko-Class Veteran
Posts: 712
Joined: Sat Nov 07, 2015 3:09 pm
Completed: Pervert&Yandere, Stalker&Yandere
Projects: Roses Of The Thorn Prince
Contact:

Re: Ren'Py Script Builder: Making life easy for your writers

#7 Post by Mammon »

Wow, this program seems useful indeed, I remember spending a couple of days just adding ' to the script line by line, scene by scene. If this program can import from Word documents I'll definately be using it in future projects from now on.
ImageImageImage

Want some CC sprites?

User avatar
torrentails
Newbie
Posts: 5
Joined: Tue Sep 06, 2016 11:45 pm
Organization: Tails Mediaworks
Deviantart: torrentails
Github: torrentails
Skype: torrentails
Location: Adelaide, Australia
Contact:

Re: Ren'Py Script Builder: Making life easy for your writers

#8 Post by torrentails »

Hmm, I don't know about word documents; maybe something to look at later on, but you should be able to save your word document in plain text format and run it on that.

Post Reply

Who is online

Users browsing this forum: No registered users