Ren'py support

47 views
Skip to first unread message

Szabolcs Páhán

unread,
Dec 31, 2021, 8:46:05 AM12/31/21
to yWriter
Hi Simon,
I have started working on a VN on the Ren'py platform.

I have recently stumbled upon yWriter and have found it very useful in organising my ideas.
It would be nice to be able to export my stuff directly from here to .rpy files. (And vice versa: import existing scenes into a skeleton.)

However, I do understand that you are very busy. Since I am somewhat proficient in C# .Net programming, I should have no problem writing an export program myself.

My initial question is, do I understand correctly that the entire project is contained in an xml file named *.yw7?

My second question is, is there any convention for embedding code in the text so that other exporters are not affected? Or would it be possible to disable the other exporters by, say, adding the "<rpy>" tag to the beginning of the scene?

Peter T.

unread,
Dec 31, 2021, 4:11:17 PM12/31/21
to yWriter
If you want to write your own exporter, you might want to take a look at my pyWriter Python library. With Python, it's quite easy to set up a file converter reading and writing yWriter projects. I did it for Aeon Timeline, Open/LibreOffice, HTML, Markdown, etc.

To answer your questions:
  1. Yes, the entire yw7 project is contained in a single XML file. Additional files or folders generated by yWriter are basically dispensable.
  2. You can embed your own code as comments, bracketed with slashes and asterisks (like /* this is a comment */)

Is there a file specification for Ren'py?

Cheers, 
Peter

Simon Haynes

unread,
Dec 31, 2021, 9:40:22 PM12/31/21
to ywr...@googlegroups.com
If you enclose your code with <htm and /htm> tags it will be exported as-is. (However, if you export to text or latex, those sections will be removed, which may or may not be a problem.)

As Peter suggested you can use the /* comments */ tags, but if you do, you will need to go into the exporter and remove the option to delete comments on export, or those will be removed too.


--
You received this message because you are subscribed to the Google Groups "yWriter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ywriter+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ywriter/bb3b4f6a-f791-4aa7-be73-107fc4239f79n%40googlegroups.com.


--

--
Visit Spacejock Software, the home of yWriter, FCharts and more
Visit spacejock.com.au for my articles on writing and publishing novels.

Peter T.

unread,
Jan 1, 2022, 2:17:15 AM1/1/22
to yWriter
On Friday, December 31, 2021 at 2:46:05 PM UTC+1 szabolc wrote:
Or would it be possible to disable the other exporters by, say, adding the "<rpy>" tag to the beginning of the scene?

Actually, this is your third question. In yWriter, there are several ways to exclude scenes from export. For example, you can set for each individual scene whether it should be exported as text, RTF, LaTeX or HTML. Another possibility would be to control the export via scene tags. All this applies if you use the built-in exporter of yWriter and convert the exported file to ren'py using a custom postprocessor.

If you convert the yw7 XML file directly, you also have the option to store Ren'py specific metadata in senes of a special type, e.g. "Notes" or "ToDo". This is then easier to keep track of within yWriter. Furthermore, a separate XML parser gives you free access to all metadata stored in yWriter.

If you don't need to change the document structure when converting to ren'py, but need more metadata or structural information than provided by the regular yWriter export, you can also try my template-based HTML exporter and remove the HTML tags from the scenes with a postprocessor.

Good luck and a happy New Year, 
Peter
Reply all
Reply to author
Forward
0 new messages