Ren'Py

Simple scene library for Ren'Py

While some visual novels offer a way to play back scenes after completion of the game, Ren'Py doesn't offer a scene player in its standard menus. However, it is possible to add such a feature, as the code here demonstrates.

  1. # Copyright (c) 2010 Karl Knechtel, Chris Charabaruk
  2. # Licensed under the zlib/libpng license
  3. # see http://www.opensource.org/licenses/zlib-license.php
  4.  
  5. # Documentation is in-line with the source, or visit
  6. # http://labs.coldacid.net/code/simple-scene-library-renpy
  7. # for further details.
  8.  
  9. init python:
  10.    
  11.     # show_scene_ actually plays the scene, show_scene lets us use it
  12.     # from a button.
  13.     def show_scene_(scene_id):
  14.        
  15.         # Put a halt to music, in case the scene starts without any
  16.         renpy.music.stop(fadeout=0.0)
  17.        
  18.         # Now we actually star

Automatic directories for audio in Ren'Py

This is an idea I had for Ren'Py, which saves visual novel developers from having to type out a complete path for any music, sound or voice files they want to play in their project. If implemented, it will make for less cluttered project directories and less redundancy in play and queue statements.

  1. # No code yet, may add later

Ren'Py settings for SciTE 2.0.3+

With a minimal change, SciTE's Python lexer can be used for formatting of Ren'Py scripts. The property settings below can be used to configure SciTE 2.x to better deal with Ren'Py. Note, however, that properties in SciTE are global, and not per-buffer; if you're switching between Python and Ren'Py files, you'll need to write some Lua code to handle swapping property values whenever tabs are changed and files opened.

  1. # Define SciTE settings for Ren'Py files.
  2.  
  3. file.patterns.rpy=*.rpy;*.rpym
  4.  
  5. shbang.renpy=rpy
  6.  
  7. filter.renpy=Ren'Py (rpy rpym)|$(file.patterns.rpy)|
  8.  
  9. lexer.$(file.patterns.rpy)=python
  10. lexer.renpy.strings.over.newline=1
  11.  
  12. keywordclass.renpy=at call expression hide image init jump label menu \
  13. onlayer python scene set show with \
  14. and assert break class continue def del elif \
  15. else except exec finally for from global if import in is lambda None \
  16. not or pass print raise return try while yield $ \
  17. play queue stop sound music fadeout fadein channel \
  18. voice sustain nvl clear window
  19.  
  20. k
Syndicate content