Running a game with command line arguments?
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.
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.
Running a game with command line arguments?
I'm making a game that is in sections and only some are made with Ren'py. All controlled from a launcher made with Clickteam Fusion.
I want to be able to run a Ren'py game multiple times but each time I run it I want it to start at a different point in the game. I was thinking that perhaps I could run the Ren'py game with a command line argument that could in some way provide a variable for use in a conditional statement at the start of the game allowing a jump to the appropriate label. Is this possible or am I thinking about this problem in entirely the wrong way?
I want to be able to run a Ren'py game multiple times but each time I run it I want it to start at a different point in the game. I was thinking that perhaps I could run the Ren'py game with a command line argument that could in some way provide a variable for use in a conditional statement at the start of the game allowing a jump to the appropriate label. Is this possible or am I thinking about this problem in entirely the wrong way?
- Ocelot
- Eileen-Class Veteran
- Posts: 1883
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Running a game with command line arguments?
Why not separate it into several games?
< < insert Rick Cook quote here > >
Re: Running a game with command line arguments?
I was thinking about keeping the overall file size down. Could I do as you suggest and have the separate exe files share the same game assets, libraries, etc?
- Ocelot
- Eileen-Class Veteran
- Posts: 1883
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Running a game with command line arguments?
You can share assets between RenPy games. For example you can have assets directory alongside game directories and use relative paths in those games:
Here ../ means one level up
Code: Select all
image foo = "../assets/images/1.jpg"< < insert Rick Cook quote here > >
Re: Running a game with command line arguments?
OK that seems to work. Thanks.
For anyone else reading this with the same problem this is what I did.
I made two test games and made Windows x86 builds (this game is Windows only as some of the other non-Ren'py parts are made with software that can only build for Windows).
Folders as follows:
TopLevelFolder
----MyNonRenpyLauncher.exe
----AssetsFolder
----RenpyGamesFolder
--------game (folder)
--------lib (folder)
--------renpy (folder)
--------renpygame1.exe
--------renpygame1.py
--------renpygame2.exe
--------renpygame2.py
The only additional step was in the lib\windows-i686 folder I needed to make sure that I had copied the game exe files from the individual lib\windows-i686 build folders.
Doing this I ended up with two games that share assets and Ren'py system files, libraries, etc.
If anyone spots anything wrong with this please say and I'll edit it to avoid leading anyone else astray.
For anyone else reading this with the same problem this is what I did.
I made two test games and made Windows x86 builds (this game is Windows only as some of the other non-Ren'py parts are made with software that can only build for Windows).
Folders as follows:
TopLevelFolder
----MyNonRenpyLauncher.exe
----AssetsFolder
----RenpyGamesFolder
--------game (folder)
--------lib (folder)
--------renpy (folder)
--------renpygame1.exe
--------renpygame1.py
--------renpygame2.exe
--------renpygame2.py
The only additional step was in the lib\windows-i686 folder I needed to make sure that I had copied the game exe files from the individual lib\windows-i686 build folders.
Doing this I ended up with two games that share assets and Ren'py system files, libraries, etc.
If anyone spots anything wrong with this please say and I'll edit it to avoid leading anyone else astray.
Who is online
Users browsing this forum: Google [Bot]