Use mini-engine can't archive file image?

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
lyminh99
Regular
Posts: 38
Joined: Sat Jun 14, 2014 1:09 pm
Contact:

Use mini-engine can't archive file image?

#1 Post by lyminh99 »

I used this mini engine to auto define images http://www.renpy.org/wiki/renpy/doc/coo ... ing_Images for my project to develop. But when i public it and run the code error. Is it mean that the engine can't call when file images were archived? Or is there any way for it. Please help me :(

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Use mini-engine can't archive file image?

#2 Post by PyTom »

That code is obsolete.

You can now use renpy.list_files() to get a list of files, including files in the archive. So code like:

Code: Select all

init python:
    for fn in renpy.list_files():
        if fn.startswith("gfx/") and fn.endswith((".jpg", ".png")):
            name = fn[4:-4]
            renpy.image(name, fn) 
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

lyminh99
Regular
Posts: 38
Joined: Sat Jun 14, 2014 1:09 pm
Contact:

Re: Use mini-engine can't archive file image?

#3 Post by lyminh99 »

Ok, it's good now, thanks :D

Post Reply

Who is online

Users browsing this forum: Google [Bot]