Real time preview test in Ren'Py

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
akakyouryuu
Regular
Posts: 162
Joined: Fri Nov 30, 2012 10:29 am
Contact:

Real time preview test in Ren'Py

#1 Post by akakyouryuu »

I write a code for communication between Ren'Py and an editor. This is mainly intended to do real time preview in Ren'Py like lightvn
The result is more smooth than I thought but I don't know whether it is actually available for the real project which have bigger files than the_question's.






https://github.com/kyouryuukunn/RenPy_E ... nteraction

How to install
1. Place editor_interaction.rpy into your game directory.
2. Set your Editor to edit interaction_file and write the code which is done by Ren'Py.

This example is vim script. I don't know ATOM and VS code.

Code: Select all

"" set temp file pass
let g:interaction_pass="E:/Soft/renpy/the_question/game/interaction_file"

function! WarpToCurrentLine() if &modified return endif
    ""Don't warp when the current file isn't saved.
    if &modified
        return
    endif

    "" write 'renpy.warp_to_line("<current file>:<current line number>")' on temp file.
    let file_path = expand("%:p")
    let file_path = split(expand("%:p"), "game")[-1][1:]
    let line_number = line('.')
    let warp_to_line = "renpy.warp_to_line('".file_path.":".line_number."')"
    call writefile([warp_to_line], g:interaction_pass)
endfunction

augroup renpy autocmd!
     "" WarpToCurrentLine function is called per cursor move.
     autocmd CursorMoved *rpy call WarpToCurrentLine()
 augroup END
 
3. launch the game and set _editor_interaction.interaction_on = 1 then communication with the editor starts.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2405
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Real time preview test in Ren'Py

#2 Post by Ocelot »

akakyouryuu wrote: Sat Dec 23, 2023 8:26 am The result is more smooth than I thought but I don't know whether it is actually available for the real project which have bigger files than the_question's.
Warps don't really work for anything but "standard" VNs, but for them they are mostly fine (I would not suggest playing from that state, but checking how the scene looks after changes should work).
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]