HTML Twine (Sugarcube) Video & Image Local Storage

dalin55738

New Member
Feb 19, 2021
8
22
I created a game that heavily features embedded videos and images. I'm currently sourcing those from RedGifs' CDN instead of storing them locally.

Obviously, I would rather store them locally for a variety of reasons, not the least of which is because the CDN gets ridiculously slow in the evenings (US time).

I can easily create relative links once the HTML file is Published. But when I'm running the game by clicking the "Play" button (which I need to do regularly to test), it stores the HTML file in a newly created folder with a seemingly random series of strings.

The only other advice I've found is converting my files to Base64 and placing those strings in the code, but that seems insane.

So, my question is, what's the best way to store images and videos in Twine (using SugarCube) so that I can still Test/Play during development?
 

Rafster

Bear chaser
Game Developer
Mar 23, 2019
2,099
4,087
This is completely HiEv 's field of expertice but on you can find a code that will allow you to load images that show when you hit up the play button.
 
  • Like
Reactions: dalin55738

dalin55738

New Member
Feb 19, 2021
8
22
This is completely HiEv 's field of expertice but on you can find a code that will allow you to load images that show when you hit up the play button.
Thank you! That's exactly what I'm looking for.

The only change, since I'm on a Mac (also for Linux systems) would be to change "/temp/" to "/private/" (and the path format is different).

So if HiEv sees this, I'd recommend that addition.
 
  • Like
Reactions: Rafster

HiEv

Member
Sep 1, 2017
384
785
Thank you! That's exactly what I'm looking for.

The only change, since I'm on a Mac (also for Linux systems) would be to change "/temp/" to "/private/" (and the path format is different).

So if HiEv sees this, I'd recommend that addition.
Ah, thanks. I knew it would be different on other OSes, but I wasn't sure what they would use. I've updated that code.

Anyways, glad I could help. :)

Also, if you're looking for additional Twine help, these places are pretty good for that:

Reddit:
IntFiction.org:
TFGamesSite:
Discord:

Have fun!