[Solved] How to call RenPy distribute from the command line

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
Rabid
Newbie
Posts: 4
Joined: Sun Oct 23, 2022 7:15 am
Contact:

[Solved] How to call RenPy distribute from the command line

#1 Post by Rabid »

Hello.

I want to set up an automatic pipeline to automatically build and generate the different builds for my game.

How can this be achieved from the command line? I can't find anywhere documentation regarding what arguments does it accept like how can you specify which distributions you want, for example.

Thanks in advance.
Last edited by Rabid on Tue Oct 25, 2022 3:13 pm, edited 1 time in total.

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: How to call RenPy distribute from the command line

#2 Post by Tess »

I had a really good discussion with someone over here about how to do Ren'Py commands from the terminal: viewtopic.php?f=8&t=65466

If you're on Windows, I believe you can go to your Ren'Py directory and type:

Code: Select all

lib/py2-windows-i686/python.exe renpy.py -h
to get a list of console commands and a little information on what they do.

I'm assuming it would be similar on Linux, but the exe would be an sh file instead. Don't use Linux much though, so take that with a grain of salt.
Have no idea how it works on Mac unfortunately.

Rabid
Newbie
Posts: 4
Joined: Sun Oct 23, 2022 7:15 am
Contact:

Re: How to call RenPy distribute from the command line

#3 Post by Rabid »

Thanks for pointing me the existence of that python.exe inside the lib folder, I was getting some weird af errors and that got rid of those.

However I can't still get it to work, not even output the help for the distribute command.

My RenPy 8.0.3 is installed at D:\RenPy\renpy-8.0.3-sdk
My game is at D:\VisualNovelGame (this is the folder that has the game folder inside it)

So what I do is run the following command

Code: Select all

D:\RenPy\renpy-8.0.3-sdk\lib\py3-windows-x86_64\python.exe D:\RenPy\renpy-8.0.3-sdk\renpy.py D:\VisualNovelGame distribute -h
But the output I get is

Code: Select all

usage: renpy.py [--savedir DIRECTORY] [--trace LEVEL] [--version] [--compile] [--keep-orphan-rpyc] [--errors-in-editor] [--safe-mode] [--json-dump FILE]
                [--json-dump-private] [--json-dump-common] [-h]
                basedir command
renpy.py: error: Command distribute is unknown.
So I thought maybe I typed wrongly the distribute command, just to double check I ran the same command but without the distribute option

Code: Select all

D:\RenPy\renpy-8.0.3-sdk\lib\py3-windows-x86_64\python.exe D:\RenPy\renpy-8.0.3-sdk\renpy.py D:\VisualNovelGame -h
Surprisingly the output didn't mention that the distribute command even existed

Code: Select all

. . .

The Ren'Py visual novel engine.

positional arguments:
  basedir              The base directory containing of the project to run. This defaults to the directory containing the Ren'Py executable.
  command              The command to execute. Available commands are: add_from, compile, dialogue, director, extract_strings, gui_images, lint,
                       merge_strings, quit, rmpersistent, run, test, translate, update. Defaults to 'run'.
. . .
So after a lot of tries, I ran the same command but WITHOUT the base dir of my game, like so:

Code: Select all

D:\RenPy\renpy-8.0.3-sdk\lib\py3-windows-x86_64\python.exe D:\RenPy\renpy-8.0.3-sdk\renpy.py -h
Then the output did mention the distribute command

Code: Select all

. . .

The Ren'Py visual novel engine.

positional arguments:
  basedir              The base directory containing of the project to run. This defaults to the directory containing the Ren'Py executable.
  command              The command to execute. Available commands are: add_from, android_build, compile, dialogue, director, distribute, extract_strings,
                       generate_gui, get_projects_directory, gui_images, ios_create, ios_populate, lint, merge_strings, quit, rmpersistent, run,
                       set_projects_directory, test, translate, update, update_old_game. Defaults to 'run'.
. . .
So I don't know what I'm doing wrong, if I type any command without providing my game's base dir it just complains that basedir is needed.

Any tips? I'm on Win10 btw

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: How to call RenPy distribute from the command line

#4 Post by Zetsubou »

"distribute" appears to be a command of the "launcher" project in your sdk folder, not one from renpy.py itself.
So the syntax is a little different.

Code: Select all

./renpy.sh launcher distribute the_question
So from your examples it would be

Code: Select all

D:\RenPy\renpy-8.0.3-sdk\lib\py3-windows-x86_64\python.exe D:\RenPy\renpy-8.0.3-sdk\renpy.py D:\RenPy\renpy-8.0.3-sdk\launcher distribute D:\VisualNovelGame
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

Rabid
Newbie
Posts: 4
Joined: Sun Oct 23, 2022 7:15 am
Contact:

Re: How to call RenPy distribute from the command line

#5 Post by Rabid »

Thanks a lot, that did indeed work. I have other question though, what about android and web builds? I have only seen options for android but no mention of web from the command line arguments.

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: How to call RenPy distribute from the command line

#6 Post by Zetsubou »

I don't know about the web build. I haven't tried building it before and didn't see anything in the CLI help menu.
Android is straightforward though. In the help menu text you posted above

Code: Select all

. . .

The Ren'Py visual novel engine.

positional arguments:
  basedir              The base directory containing of the project to run. This defaults to the directory containing the Ren'Py executable.
  command              The command to execute. Available commands are: add_from, android_build, compile, dialogue, director, distribute, extract_strings,
                       generate_gui, get_projects_directory, gui_images, ios_create, ios_populate, lint, merge_strings, quit, rmpersistent, run,
                       set_projects_directory, test, translate, update, update_old_game. Defaults to 'run'.
. . .
it mentions android_build, which is the command you need.
The syntax is the same as for distribute, but replacing "distribute" with "android_build".
For more information you can use the -h parameter like usual. eg.

Code: Select all

./renpy.sh launcher android_build the_question -h
but with the paths you used before.
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

Rabid
Newbie
Posts: 4
Joined: Sun Oct 23, 2022 7:15 am
Contact:

Re: How to call RenPy distribute from the command line

#7 Post by Rabid »

Thanks a lot then I consider this solved :)

Post Reply

Who is online

Users browsing this forum: Ocelot