How to dynamically change the image file path of an object using an expression

Before proceeding, please use the forum search feature at the top of the page to check if your question has already been answered.

As the title says. I want to be able to change the image of an object dynamically.
lets say, the image path is: assets/folder1/folder2/image1.jpg

i want to be able to do domething like: assets/variable1/variable2/variable3

things i tried:

  • using (set image) of a panel sprite doesnt work because the file selection is not an expression, its a folder browser.
  • (loadImageFromURL) extension, i think, is only meant for URLs. my assets are on my pc
  • the closest one so far, is the unofficial extension: (LoadCustomImage) by omega_slender. the issue is that i cannot make it work. --link below–

https://forum.gdevelop.io/t/load-custom-image-extension-for-loading-images-and-applying-them-to-sprite-objects/56171/5?u=aldebaranstudio

this link leads to my message describing my problem on the topic of the said extension. If you are interested by the extension, go check it out as well.

Hi, I’m sure you’ll hate this but you could break it down into separate events.

Change variable number to random number from numbers 1 to 5

Variable number is 1, change panel sprite to image1
Variable number is 2, change panel sprite to image2
etc.

But the other thing you can do is to give support to this feature request.

i cannot do the former because i got over 100 images to cycle through. the latter is a good idea. though there is already the loadcustomimage extension doing EXACTLY what i want. (problem is that it doesnt work cus i dont know how to use it)

I got the extension working. It works after you do a windows export. You then must put your image folder in the place where the exe installs to. Which in my case was

C:\Users\Bubble\AppData\Local\Programs\GameNameFolder

Instructions on the Itch page.
When you finish your project and export it as an executable, you'll need to copy the folders with the images you created in the GDevelop executable directory and paste them into the directory where your project's executable is located.

LoadImageFromFolderTest

thank you for your help!

does that mean that it doesnt work in the preview? only when exported?
its kind of a bummer

its kinda sad cuz its so close!

i cannot make a visual novel in this state of GD i guess. ill try renpy if it can do what i need