[Solved] Force Recompile from Terminal

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
Tess
Regular
Posts: 59
Joined: Thu Aug 04, 2022 3:43 pm
Projects: The Songbird Guild
Organization: Yurisoft
Github: wainwt2
Discord: Tess#7782
Contact:

[Solved] Force Recompile from Terminal

#1 Post by Tess »

I wrote a task in VSCode that runs my game with a key press, and I'm really enjoying it.
I was wondering if it was possible to do other editor commands, such as Force Recompile, from the terminal as well so I could make more VSCode tasks for them.
Thanks!
Last edited by Tess on Sat Oct 08, 2022 4:58 pm, edited 1 time in total.

User avatar
Zetsubou
Miko-Class Veteran
Posts: 522
Joined: Wed Mar 05, 2014 1:00 am
Completed: See my signature
Github: koroshiya
itch: zetsuboushita
Contact:

Re: Force Recompile from Terminal

#2 Post by Zetsubou »

You can get a list of different commands and arguments by running renpy from your terminal with the "-h" parameter.

Code: Select all

./renpy.sh -h
So what you're looking for seems to be the "--compile" argument.
From the help menu:
--compile Forces all .rpy scripts to be recompiled before proceeding.

So possibly something like

Code: Select all

./renpy.sh --compile yourProject compile
though that's just a guess based on the help command output. I haven't actually tried it.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails

Working on:
Sable's Grimoire 2

https://zetsubou.games

User avatar
Tess
Regular
Posts: 59
Joined: Thu Aug 04, 2022 3:43 pm
Projects: The Songbird Guild
Organization: Yurisoft
Github: wainwt2
Discord: Tess#7782
Contact:

Re: Force Recompile from Terminal

#3 Post by Tess »

Ah, I should have specified: I'm on Windows, not Linux. When I go to the folder the exe is in and type

Code: Select all

> renpy-32.exe -h
it doesn't do anything. Do you know the Windows CMD equivalent?

User avatar
Zetsubou
Miko-Class Veteran
Posts: 522
Joined: Wed Mar 05, 2014 1:00 am
Completed: See my signature
Github: koroshiya
itch: zetsuboushita
Contact:

Re: Force Recompile from Terminal

#4 Post by Zetsubou »

Ah, since you said terminal I assumed you were using Linux or Mac.
I would have thought the command would be the same on windows, but I guess not.

I tried running it on a windows machine just now and got the same results as you did.
I did notice, however, that a log.txt file was created in the renpy folder. And the help menu contents were listed at the end of that file.
Maybe check if your machine generated the same file and if the output is in there?

Otherwise you can run the renpy.py file directly (instead of the .exe file) with the -h parameter.
I think that'll only work if you have python installed though.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails

Working on:
Sable's Grimoire 2

https://zetsubou.games

User avatar
Tess
Regular
Posts: 59
Joined: Thu Aug 04, 2022 3:43 pm
Projects: The Songbird Guild
Organization: Yurisoft
Github: wainwt2
Discord: Tess#7782
Contact:

Re: Force Recompile from Terminal

#5 Post by Tess »

I did get a log.txt file in my renpy directory with lots of helpful information, but when I try to give commands it gives me the following error:

Code: Select all

Could not import renpy.bootstrap. Please ensure you decompressed Ren'Py correctly, preserving the directory structure.
The two commands I was trying to make work were:

Code: Select all

renpy.py -h
and

Code: Select all

renpy.py <game directory> lint
and both give the same error. It's weird because renpy-32.exe opens fine and linting works fine in the regular editor, it just seems to struggle in the command line for some reason.

User avatar
Zetsubou
Miko-Class Veteran
Posts: 522
Joined: Wed Mar 05, 2014 1:00 am
Completed: See my signature
Github: koroshiya
itch: zetsuboushita
Contact:

Re: Force Recompile from Terminal

#6 Post by Zetsubou »

Scratch what I said about needing python installed. I always forget how Renpy does this lol.
Renpy ships with its own version of python. So if you're invoking the renpy.py file directly, then you'll need to use the version of python shipped with renpy.
The renpy.exe or renpy.sh file points to the bundled python executable, so usually you don't need to worry about it.

If you're invoking the python file directly, then instead of

Code: Select all

python.exe /my/renpy/install/folder/renpy.py -h
you would need to call

Code: Select all

/my/renpy/install/folder/lib/py2-windows-i686/python.exe /my/renpy/install/folder/renpy.py -h
The lib folder path will depend on which version of renpy you're using and which platform.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails

Working on:
Sable's Grimoire 2

https://zetsubou.games

User avatar
Tess
Regular
Posts: 59
Joined: Thu Aug 04, 2022 3:43 pm
Projects: The Songbird Guild
Organization: Yurisoft
Github: wainwt2
Discord: Tess#7782
Contact:

Re: Force Recompile from Terminal

#7 Post by Tess »

It worked!! Thank you so, so much for all your help. I'm having a TON of fun experimenting with all the different options that are there.

Post Reply

Who is online

Users browsing this forum: Google [Bot]