- Mar 26, 2023
- 86
- 103
hi, i hope I m in the right place i'm trying to get sugarcube to display a random image from a folder as the polayer enters a passage chatgpt is giving me
<<set _cleanImages to ["1.png", "2.png", "3.png", "4.png", "5.png", "6.png", "7.png", "8.png", "9.png", "10.png", "11.png", "12.png"]>>
<<set _randomImg to _cleanImages.random()>>
<p>Chosen image: <<= _randomImg>></p>
<img src="Images/Lara/Bed/Play/<<=_randomImg>>" alt="Random image">.
But no matter how much is shake a stick at it nothing is working. the HTML file is in the same folder as the Images folder. I doubled check vbia httml that i could access the file file:///C:/sugarcube/V0.1/Images/Lara/Bed/Play/1.png
Anyone know what's going wrong? i'd really appreciate the help,
<<set _cleanImages to ["1.png", "2.png", "3.png", "4.png", "5.png", "6.png", "7.png", "8.png", "9.png", "10.png", "11.png", "12.png"]>>
<<set _randomImg to _cleanImages.random()>>
<p>Chosen image: <<= _randomImg>></p>
<img src="Images/Lara/Bed/Play/<<=_randomImg>>" alt="Random image">.
But no matter how much is shake a stick at it nothing is working. the HTML file is in the same folder as the Images folder. I doubled check vbia httml that i could access the file file:///C:/sugarcube/V0.1/Images/Lara/Bed/Play/1.png
Anyone know what's going wrong? i'd really appreciate the help,