Declare image from online source possible?

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
Will4697
Newbie
Posts: 3
Joined: Wed Sep 06, 2023 1:05 pm
Contact:

Declare image from online source possible?

#1 Post by Will4697 »

Hi everyone,

I want to ask if it is possible if I want to declare my images and videos from online sources (http)?

So right now I'm making a game that uses images and videos that are quite large in terms of memory. and this will continue to increase along with the upcoming updates.

This then made me think whether there might be another way to deal with this? and it occurred to me what if data such as images and videos were stored online??

I got an example from here:
viewtopic.php?p=153041#p153041

I have copied the code and tried to run it, but the results were unsuccessful and an error appeared when running it. After I looked again, it turns out this post is very old, 2011.... 😅😅

So I want to know if there is a solution or trick to do this in RenPy? Please help everyone, Thank you!!!

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

Re: Declare image from online source possible?

#2 Post by Imperf3kt »

Sort of.
I managed to do this for favicons and logos for my socials links, but you will require a Web server specifically set up to host the files if you want to use your own.

Also of concern is the file size, if the files are too large, the player will have to wait for them to download every single time and while they're stored in cache, they will take up a lot of resources.

I used a slightly modified version of the renpy news feature
Last edited by Imperf3kt on Thu Dec 14, 2023 2:30 am, edited 1 time in total.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Will4697
Newbie
Posts: 3
Joined: Wed Sep 06, 2023 1:05 pm
Contact:

Re: Declare image from online source possible?

#3 Post by Will4697 »

Imperf3kt wrote: Tue Dec 12, 2023 7:58 pm Sort of.
I managed to do this for favicons and logos for my socials links, but you will require a Web server specifically set up to host the files if you want to use your own.

Also of concern is the file size, if the files are too large, the perjury will have to wait for them to dowoad every single time and while they're stored in cache, they will take up a lot of resources.

I used a slightly modified version of the renpy news feature
Hello Imperf3kt,

Ahh I see, then what if the image is stored online, but not declared as a variable? Like just stream when the scene is needed Or is there really no other way than to declare it in the initial image declaration?

Do you have any alternatives or suggestions for cases like this where the game memory size (video size) is too large but you don't want to include it with the game files?

By the way, thank yuo for answering!!

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

Re: Declare image from online source possible?

#4 Post by Imperf3kt »

I haven't needed to worry about such things yet, so am not familiar with how to go about it, but the latest version of renpy patreon articles have been mentioning something about letting Android users download additional files when your app is over the 2GB limit, it may hold some information you can use
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot], Google [Bot]