intfiction.org

The Interactive Fiction Community Forum
It is currently Mon Sep 25, 2017 1:40 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Jul 05, 2016 8:29 pm 
Offline

Joined: Tue Jul 28, 2015 1:05 pm
Posts: 732
I've noticed that parchment urls just point to an online blorb or z machine file, so I assume it just reads it in. I'm trying to find a way to play Blue Lacuna on android (for my post series), and I've been having trouble doing it. Is there any way to direct the parchment url to a file on local storage?

_________________
-My IFDB name is Mathbrush (this was an alternate account I started because I was going to submit my IFComp game anonymously)


Top
 Profile Send private message  
 
PostPosted: Tue Jul 05, 2016 8:50 pm 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 2394
It might work if it the gblorb is in the same folder as index.html, but web browsers are pretty temperamental when it comes to running stuff from the local file system. (The same will apply to using Quixe directly)


Top
 Profile Send private message  
 
PostPosted: Tue Jul 05, 2016 11:31 pm 
Offline

Joined: Sat Dec 22, 2007 11:52 pm
Posts: 1051
You could also give a shot at running a webserver on your device to serve the local files. A quick Google shows some Android web servers.


Top
 Profile Send private message  
 
PostPosted: Wed Jul 06, 2016 12:19 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5449
You can transform the zcode file to a JS-data-format which Parchment can always read from the local filesystem. (I7 does this when building a playable web page.) It's the zcode2js.py script in parchment/tools.


Top
 Profile Send private message  
 
PostPosted: Wed Jul 27, 2016 9:00 pm 
Offline

Joined: Sun Jun 01, 2014 2:25 pm
Posts: 31
zarf wrote:
You can transform the zcode file to a JS-data-format which Parchment can always read from the local filesystem. (I7 does this when building a playable web page.) It's the zcode2js.py script in parchment/tools.

Correct me if I'm wrong, but doesn't that just base64-encode the binary file (so it can be represented in 7-bit ASCII)?


Top
 Profile Send private message  
 
PostPosted: Wed Jul 27, 2016 11:43 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5449
It does that and then wraps the base64 string in a processBase64Zcode('...') function call.


Top
 Profile Send private message  
 
PostPosted: Mon Aug 01, 2016 2:46 am 
Offline

Joined: Sun Jun 01, 2014 2:25 pm
Posts: 31
Ah, okay. I made a shellscript that used some creative 'sed', 'head', 'tail', and 'wc' to cut everything except the base64 string and then decoded it. Since I am on Android, python was a luxury I did not have easy access to (just busybox and a 'base64' binary I compiled).

This was for automatic decoding of encoded files, though... kinda the reverse of what you want here.

It'd probably not be hard at all to accomplish the reverse in a shellscript. Easier, even.


Top
 Profile Send private message  
 
PostPosted: Wed Nov 30, 2016 6:22 pm 
Offline

Joined: Tue Nov 29, 2016 8:56 am
Posts: 64
I have manage to do that in two ways:
- making an index.html that points to parchment.html=?story...
- Adding the adventure file in the script (see below an example for A Mind forever Voyaging).

If you put everything into a folder: www
Code:
+ www
  -index.html
  -amfv.z4
  + /lib
   - jquery.min.js
   - parchment.min.js
   - parchment.min.css
   - gnusto.min.js

and install nodejs on your system, and
Code:
npm install -g cordova

Once you have cordova installed, you can move to the folder you have the www in, and do:

Code:
 cordova add platform android


wait for everything to download. Once done,

Code:
 cordova build --device android


and you will get a prety apk with a webview that opens index.html


Code:
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>A Mind Forever Voyaging</title>
	<script src="lib/jquery.min.js"></script>
	<script src="lib/parchment.min.js"></script>
	<link rel="stylesheet" href="lib/parchment.min.css">
	<meta name="viewport" content="width=device-width,user-scalable=no">	</head>
<body>
	<div id="about">
		<h1>Parchment</h1>
		<p>is an interpreter for Interactive Fiction. <a href="http://parchment.googlecode.com">Find out more.</a></p>
		<noscript><p>Parchment requires Javascript. Please enable it in your browser.</p></noscript>
	</div>
	<div id="parchment"></div>
<script type="text/javascript">
parchment.options.default_story = "amfv.z4";
parchment.options.page_title = 0;
</script>
</body>
</html>


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group