Page 1 of 1

[Solved] Force Recompile from Terminal

Posted: Wed Oct 05, 2022 7:52 pm
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!

Re: Force Recompile from Terminal

Posted: Thu Oct 06, 2022 3:11 am
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.

Re: Force Recompile from Terminal

Posted: Thu Oct 06, 2022 2:12 pm
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?

Re: Force Recompile from Terminal

Posted: Thu Oct 06, 2022 5:47 pm
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.

Re: Force Recompile from Terminal

Posted: Fri Oct 07, 2022 4:25 pm
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.

Re: Force Recompile from Terminal

Posted: Sat Oct 08, 2022 4:21 am
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.

Re: Force Recompile from Terminal

Posted: Sat Oct 08, 2022 11:55 am
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.