[Solved] Ren'py archive exceptions

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
Exiscoming
Regular
Posts: 127
Joined: Tue Apr 29, 2014 5:37 pm
Contact:

[Solved] Ren'py archive exceptions

#1 Post by Exiscoming » Mon Jun 03, 2019 4:04 pm

Hi all, so I know you can archive files in your game by doing this:

Code: Select all

    build.classify('game/**.png', 'archive')

Now all .png files get archives. However I'd like to make an exception for my /mods folder, which contain .png files that can be overwritten by modded content.

Your help is appreciated!
Last edited by Exiscoming on Mon Jun 03, 2019 7:14 pm, edited 1 time in total.

User avatar
Andredron
Miko-Class Veteran
Posts: 535
Joined: Thu Dec 28, 2017 2:37 pm
Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
Location: Russia
Contact:

Re: Ren'py archive exceptions

#2 Post by Andredron » Mon Jun 03, 2019 6:00 pm

Exiscoming wrote:
Mon Jun 03, 2019 4:04 pm
Hi all, so I know you can archive files in your game by doing this:

Code: Select all

    build.classify('game/**.png', 'archive')

Now all .png files get archives. However I'd like to make an exception for my /mods folder, which contain .png files that can be overwritten by modded content.

Your help is appreciated!

How to create a separate archive for each type of file? (archive different files to different archives)
I will not go into the theory - it is here https://www.renpy.org/doc/html/build.html
Just describe the process in 2 short steps.

1. In the options.rpy file you will need to register the names of the archives you want to create. For example:
build.archive ("images", "all") # Instead of "images" there can be anything.
build.archive ("sounds", "all")
2. When we register archiving, we do it as follows:
build.classify ('game / **. png', 'images') # for images
build.classify ('game / **. jpg', 'images')
build.classify ('game / **. mp3', 'sounds') # for sounds
build.classify ('game / **. ogg', 'sounds')
# Learn more about the signs of the asterisk and how to use it - read the link above.

Similarly, you can create separate archives for the script, for videos and, generally speaking, for everything that your heart desires.
> IMPORTANT:
This will not save your game from decompiling, but it will be very easy to make patches for it, in which you can separately add images, change the script or change the music. The user will just need to copy the files with the replacement. =)

PS
1. Do not forget that you must NOT have the lines build.classify ('game /**.**', 'archive')
2. All extensions that are not listed in build.classify will NOT be archived
3. Do not forget to register build.classify ('saves /**.**', None), since there, in addition to saves, are stored constant variables
Last edited by Andredron on Mon Jun 03, 2019 6:27 pm, edited 1 time in total.
I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Help me to register in QQ International

Honest Critique

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Ren'py archive exceptions

#3 Post by Imperf3kt » Mon Jun 03, 2019 6:20 pm

Exiscoming wrote:
Mon Jun 03, 2019 4:04 pm
Hi all, so I know you can archive files in your game by doing this:

Code: Select all

    build.classify('game/**.png', 'archive')

Now all .png files get archives. However I'd like to make an exception for my /mods folder, which contain .png files that can be overwritten by modded content.

Your help is appreciated!
Use this instead.

Code: Select all

    build.classify('game/gui/**.png', 'archive')
    build.classify('game/image/**.png', 'archive')
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

Exiscoming
Regular
Posts: 127
Joined: Tue Apr 29, 2014 5:37 pm
Contact:

Re: Ren'py archive exceptions

#4 Post by Exiscoming » Mon Jun 03, 2019 7:13 pm

Aaah, it's that simple? Thanks lads.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]