0 votes
by (140 points)

I am trying to convert a twine story into an app (without using phonegap). Is there a java (not javascript) or objective C based parser that parses through twine script and converts that into java?




2 Answers

0 votes
by (149k points)

I am not sure if such a converter would handle a Twine based web-application (nor any web-app for that matter) due to the fact that the code of each of the Story Format engines assumes that there will be a HTML render and Document Object Model for them to interact with.

Each of the current Story Formats are a mini web-apps, the Twine application embeds the different types of  Passage data within this web-app, and the web-app is responsible of converting the contents of a Passage into HTML / CSS / Javascript as and when needed. The engine is also responsible of defining the macro language and implementing all functionality required to support that macro language as well as any of the features that engine has. 

What you could do is create a new Story Format template/engine that was based on a Java-application instead of a web-app, such an engine would need to be able to convert the contents of a Passage into whatever code is required by the Java-app, it would also need to implement all required functionality like the macro language.

by (140 points)
"Creation of the story format template/engine ...." is what I'm trying to do, but seems like a very big task. Hence, was looking if there's any work done on this already by anyone and can be shared.

The HTML can be rendered as-is, by the way. CSS and Javascript would have to be handled separately.

Thanks for your explanation.
by (149k points)

The HTML can be rendered as-is

If you are already embedding a HTML rendering capable widget in your Java application's GUI then why not use a widget that supports CSS (and Java-script) like the JavaFX Embedded Browser API one?


0 votes
by (2.2k points)

I doubt such thing exists. Existing formats, as @greyelf mentioned, rely pretty heavily on HTML and DOM, and these are not accessible in native environment -- unless through WebView, which defeats the point of not using PhoneGap.

If native mobile game is absolute requirement, I'd personally tried Unity3D + ink.

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.