Runtime visual novel editor

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
picobyte
Newbie
Posts: 15
Joined: Mon Mar 14, 2016 2:15 pm
Contact:

Runtime visual novel editor

#1 Post by picobyte »

# EditButton
Add a quick fix/edit button for Ren'Py developerment. Without config.developer the editor is not be accessible.

The editor provides a means to proofread your visual novel while running it and without leaving. One button in the quickmenu provides access to this editor that shows the Ren'py code at the location you were, in visual modus. The editor provides basic features, has a few quirks still.

Installation into existing git project add as a git submodule:
https://github.com/picobyte/RVRE

and run
game/RVRE/scripts_and_fixes/install.sh

or if in windows:
game\RVRE\scripts_and_fixes\install.bat

An example repository (and a tutorial for the editor)
https://github.com/picobyte/EditButton

Issues and feature requests can be added to this thread or in the issues of the respective repositories

Features:
The editor isn't perfect, and currently has a limited set of features:
* basic editing
- cursor, clipboard, selection (Shift+)(Ctrl+)key movement,
- selection can only cover the screen you're working in; WIP
* Undo / redo, (Ctrl-z/Ctrl-y), only the cursor position thereafter is a bit odd, WIP.
* editor display style configuration (color scheme)
* Ren'py error checking - can be hidden.
* file saving
- only available if the code is without errors. A safety net, because errors make the editor unavailable.
- 'Apply' returns to visual modus with a reload so changes should be visible.
(there should probably also be a save without leaving the editor)
* returning to visual modus discarding changes
* returning to visual modus keeping changes *temporarily* in memory
- changes are lost after reload or loading.
* Spell checking - can be disabled:
- languages English, also available for French, German, Portuguese, Spanish. Russian should work with an update see instruction in EditButton Readme.
- suggestions for changes can be chosen from a drop-down (or pull-up) menu
* find text, very basic, still.
* file and line number are shown in the window title, cursor and mouse position as well, updated upon cursor movement.
* there is a right-click mouse menu.
- languages and styles can be chosen here.
- Selecting font is listed (changing to a larger font while text is selected causes error, though).


This is a runtime Ren'py editor. Licensed LGPL or MIT can be allowed under certain conditions. Do not use this in commercial closed source only visual novels without eventual public releases unless a permission was granted. It's ok in commercial if the public version is a few behind.
Attachments
edit_button_anim.gif
Last edited by picobyte on Wed Sep 29, 2021 6:49 pm, edited 46 times in total.

User avatar
Taleweaver
Writing Maniac
Posts: 3428
Joined: Tue Nov 11, 2003 8:51 am
Completed: Metropolitan Blues, The Loyal Kinsman, Daemonophilia, The Dreaming, The Thirteenth Year, Adrift, Bionic Heart 2, Secrets of the Wolf, The Photographer
Projects: The Pilgrim's Path, Elspeth's Garden, Secret Adventure Game!
Organization: Tall Tales Productions
Location: Germany
Contact:

Re: Edit dialogue + Code button for developer

#2 Post by Taleweaver »

Wrong forum. Thread moved.
Scriptwriter and producer of Metropolitan Blues
Creator of The Loyal Kinsman
Scriptwriter and director of Daemonophilia
Scriptwriter and director of The Dreaming
Scriptwriter of Zenith Chronicles
Scriptwriter and director of The Thirteenth Year
Scriptwriter and director of Romance is Dead
Scriptwriter and producer of Adrift
More about me in my blog
"Adrift - Like Ever17, but without the Deus Ex Machina" - HigurashiKira

picobyte
Newbie
Posts: 15
Joined: Mon Mar 14, 2016 2:15 pm
Contact:

Re: Edit dialogue + Code button for developer

#3 Post by picobyte »

Taleweaver wrote:Wrong forum. Thread moved.
So what exactly seems to be my question?

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Edit dialogue + Code button for developer

#4 Post by trooper6 »

You are currently in the Cookbook section, where people share code...which is what you are doing with your post, yes?
You are not currently in the Questions Section.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

picobyte
Newbie
Posts: 15
Joined: Mon Mar 14, 2016 2:15 pm
Contact:

Re: Edit dialogue + Code button for developer

#5 Post by picobyte »

Ah yes, that seems right.

picobyte
Newbie
Posts: 15
Joined: Mon Mar 14, 2016 2:15 pm
Contact:

Re: Edit dialogue + Code button for developer

#6 Post by picobyte »

A new version is pushed to the github repository. Pygments is now a requirement. Highlights:
Editing is improved.
There is some mouse support (cursor movement by mouseclick).
Live highlighting and debugging.
Debug check that allows only applying code that cause no parse errors.
The visual novel script explains how the editor works.

picobyte
Newbie
Posts: 15
Joined: Mon Mar 14, 2016 2:15 pm
Contact:

Re: Edit dialogue + Code button for developer

#7 Post by picobyte »

added undo (ctrl+z) and redo (ctrl+y)

picobyte
Newbie
Posts: 15
Joined: Mon Mar 14, 2016 2:15 pm
Contact:

Re: Runtime visual novel editor

#8 Post by picobyte »

Fixed selection, some cursor issues, and error display.

picobyte
Newbie
Posts: 15
Joined: Mon Mar 14, 2016 2:15 pm
Contact:

Re: Runtime visual novel editor

#9 Post by picobyte »

Added search with Ctrl+f and fixed some more issues. Also see the animated gif which displays what the current version looks like.

picobyte
Newbie
Posts: 15
Joined: Mon Mar 14, 2016 2:15 pm
Contact:

Re: Runtime visual novel editor

#10 Post by picobyte »

Added a spell checker. Currently mistakes can be shown (in red) or toggled off. Suggesting alternatives is still under development.
The language is set on the line

Code: Select all

lang = SpellChecker(language='en')
the checker also supports other languages, with 'ru', 'es', 'fr', 'pt' or 'de'

Edit: Added some instructions that should hopefully also work in windows

picobyte
Newbie
Posts: 15
Joined: Mon Mar 14, 2016 2:15 pm
Contact:

Re: Runtime visual novel editor

#11 Post by picobyte »

Added spelling replacement suggestion dropdown menus
explanation on github how to install libraries for editor in windows
Attachments
dropdown.gif

picobyte
Newbie
Posts: 15
Joined: Mon Mar 14, 2016 2:15 pm
Contact:

Re: Runtime visual novel editor

#12 Post by picobyte »

updated the undo/redo code:

Changes in history are stored per line, now only the initial state is stored, not every small edit. Cursor updates are now also stored in history. The result is that edits between cursor updates can now undone / redone together, which is more intuitive. The view is now also updated after undo/redo, which is better, although the view position is not always exactly where you'd expect it, still.

This is fairly complex (could introduce bugs). Edit: bugs I observed seem resolved, only cursor position after undo/redo remains a bit odd.

picobyte
Newbie
Posts: 15
Joined: Mon Mar 14, 2016 2:15 pm
Contact:

Re: Runtime visual novel editor

#13 Post by picobyte »

Font and font_size should can now be adjusted more easily. Two fonts are preconfigured: Inconsolata and ProggyClean. Adding a different custom mono font should be doable, but requires tweaking font_w_ratio and font_h_ratio:

adjust font_h_ratio until selection shadows lines vertically, if shadow is shown before lines, decrease ratio.
adjust font_w_ratio until selection shadows a line entirely, if shadow is too short, decrease ratio.
wordwrap is also affected, which makes it a little confusing. just scroll to the first line, start from there.

Edit 1: suggestion menus now pull-up if too low on screen. They also auto-close, if not hoovered, in 1.5 sec.
Edit 2: suggestions now only occur in strings or comments.

picobyte
Newbie
Posts: 15
Joined: Mon Mar 14, 2016 2:15 pm
Contact:

Re: Runtime visual novel editor

#14 Post by picobyte »

Added context menu, i.e. right mouse button menu. This is still work in progress. Implemented are changing styles and changing language.
Instructions in README for Russian language (requires updated databases). However, couldn't get it to display Cyrillic, other languages seemed ok. Could be UTF-8 or locale or charset related, not sure.
would like to add:
* code templates
* renpy.jump() to this (cursor) location
* jump to definition (maybe using exuberant tags or so).
* a file menu (open/browse files, save as, etc.)
Not everything should end up in the context menu, the idea is to make the bottom buttons drop-up menus as well for (the usual) options.
Also some kind of forms would be nice to have
Added lots of bugs^H^H^H^Hfeatures.

Edit: the edit_button.rpy is becoming too large, moved python code to module.
Edit: performance improved a bit
Separate repo for editor only and more easy install

Post Reply

Who is online

Users browsing this forum: No registered users