is it possible: running twine files in tw5

104 views
Skip to first unread message

Stefan Pfister

unread,
Mar 21, 2019, 1:19:26 PM3/21/19
to tiddl...@googlegroups.com
Hi folks,

I tried to import a file of a twine game in the twine output format into tw5. But the game is not running.  Only the black background is displaying in the tiddler.

It is running directly as a html-file in the browser. 

Is there a way to store twine output files in a tw5-wiki in order to play them directly?

Thanks,

Stefan

Stefan Pfister

unread,
Mar 21, 2019, 2:59:14 PM3/21/19
to tiddl...@googlegroups.com
I tried another file. Now the file was displayed but the links in the game are not working. I pasted the html-code in the file to a tiddler. The tiddlerformat is "txt/html". The game is in german but I think: This doesn't matter for this technical problem.


ApokalypseaufdemChromebook.html

TonyM

unread,
Mar 22, 2019, 11:01:18 PM3/22/19
to TiddlyWiki
If you store the html in the same place as the wiki this works

<iframe src='ApokalypseaufdemChromebook.html' frameborder="0" width="1024"; height="600"></iframe>

I would take it further and try embedding it except I do not speak German and its hard to understand as a result, but the links may be fooled by tiddlywikis own structure

If you are serving it on Node try tiddlywikiaddress/tiddlername when tiddler name is a html tiddler containing your game, at that address I believe the tiddler is presented as static html, rather than tiddlywikiaddress#tiddlername

I am not sure if this needs to be switched on somehow.

Regards
Tony

Mark S.

unread,
Mar 23, 2019, 12:39:38 AM3/23/19
to TiddlyWiki
I'm pretty sure that the text/html mode in TW prevents javascript from running.

Personally I'm a little wary of allowing a big chunk of javascript run on my machine, though I think it should be sandboxed.

But you might try:

<iframe srcdoc={{mygame}} ></iframe>

where "mygame" is a tiddler containing your Twine game.

The srcdoc attribute is not supported on Microsoft (Edge, IE) browsers according to the sources I found.

Another variation of this requires you to translate the tiddler via urlencode. The only tool for that in TW is a url encoding
filter. Kind of suspect that that would break.


On Thursday, March 21, 2019 at 10:19:26 AM UTC-7, Stefan Pfister wrote:
Hi folks,

I tried to import a file of a twine game in the twine output format into tw5. But the game is not running.  Only the black background is displaying in the tiddler

Stefan Pfister

unread,
Mar 24, 2019, 11:01:20 AM3/24/19
to TiddlyWiki
Thank you Mark.

Wow, this is really cool. It works. Now I can host twine (textonly) games in a simple single tiddlywiki file. I use it for classroom teaching. The students now can get a tiddlywiki with all of the created twine games of a lesson. Simply opening it with a browser - and search and play.

Including images in the game would be great, but twine 2 doesn't really include images in a game. It can only link to external ressources or use Base64 (very ugly). I want to stay with a single tiddlywiki file as the whole ressource.

It needs some css styling too. The viewarea of the game is very small. I put the following in a css file. After that I changed the palette to my needs.

body {
    margin: 0; 
}

iframe {
    display: block;      
    background: #000;
    border: none;        
    height: 100vh;       
    width: 100vw;
}



Message has been deleted

Stefan Pfister

unread,
Mar 24, 2019, 11:48:59 AM3/24/19
to TiddlyWiki
Hi Tony,

sounds interesting, thanks. I try it.

Cu, 
Stefan
Reply all
Reply to author
Forward
0 new messages