1.2 Update Release: Variables, Conditionals, "Twine mode", and Character Definitions


Hey all!

Twine to Ren'Py 1.2 is out!

Here's the changelog:

  • Convert Twine variables to Ren'Py including:
    • Setting variables
    • Using variables in text
    • Option to define default statements for all variables at the beginning of the script
      • Set these to a default value or just leave them as what they're defined as in Twine
  • Converts Twine conditionals to Ren'Py
  • "Twine mode": If you originally wrote the game for Twine, the tool will add quotes around every single line and make all other quotes work inline for Ren'Py
    • Basically, if you wrote your game for Twine, your game will now work out of the box in Ren'Py. I have a feeling most people who used the tool when I first launched it probably tried it out with their existing Twine games and then realized it didn't add quotes the way Ren'Py would use them--honestly a huge oversight on my part because our workflow for Salvage was only ever with Ren'Py in mind.
    • However, I assume most people who intend to use Ren'Py are using speaking characters, so this effectively treats every single line as if spoken by a narrator. Some games work like that! If you're creating IF focused games this tool will be more useful for you now.
  • Character definitions
    • By request! I also noticed this was actually reported as a bug a bit ago, but kudos for the detailed report and suggestion for features.
  • Set the name of the first file
    • By default the tool just grabs the title of the start passage, but now you can change your starting "Untitled_passage.rpy" to "start.rpy" if you wish to. 

Some existing known bugs that may or may not be fixed:

  • Latin characters get chewed up in the encode. This actually caused some problems for the slanted quotes as well, but the fix was nebulous. I tried to pass Latin characters in and out of the replace, but it doesn't work after compiled with pyinstaller, so the workaround might be passing their unicode string > actual characters as the replace. when I was digging into it I learned that some of the encode/decode bugs the tool ran into seemed to be fixed in python 3. I think to truly fix it, the tool would need a full overhaul for python 3 which would require entirely redoing the beautiful soup html parse. I think this is doable but maybe a project for the future, as I'm hesitant to change when most of my tool libraries for the game we're on currently use 2.7 and would mean redoing all of our existing tools.

I had a little bit of initial testing, but I'm sure this release will still have some bugs. Please feel free to drop reports in the comments or send them to me at jbtuason / gmail. Thanks again for your support!

Files

twine_to_rpy_1.2.zip 17 MB
Jul 03, 2022

Get Twine to Ren'Py Tool

Download NowName your own price

Comments

Log in with itch.io to leave a comment.

Hello, is this only for windows ? Or could this easily be ported to Mac ?

The tool itself is python, but I’ve packaged and released it as an .exe for ease. I’ve planned to release the source code for this release at some point so people could run or modify it from the source, so that’s one way it can be “ported to Mac”. The downside of this is that I’m using python 2.7 which is deprecated, especially the libraries I’m using. You can try that but you would have to install python and install the dependencies, which is doable (but may be a pain).

Hello, that's certainly an option that is doable for a Mac. Python 3 is by default installed on macs, and you can still install 2.7 if you really want it. I used to make plenty of python scripts in 2.7, so I already have it, but that's just me. I'll wait for the source then.

(+1)

The source code is up! This devlog has information and if you have any questions you can post them there.