Greetings!
Currently, I'm using Twine2.1.3 with Sugarcube 2.18 to build a game that I someday hope to convert into an Android app utilizing PhoneGap or Ionic, or Cordova. Whatever works. In order to balance the workflow and organize the project, as well as keep the HTML page sizes smaller for better handling on phones, I'm planning on using multiple HTML files to handle different sections of the game.
One part for the prologue, chapter 1, one for the dictionary, one for items, maybe even one for combat. Each part of the game's story and primary functionality will be a separate file, I hope, with links connecting them. I would use LocalStorage to transfer the necessary variables between pages (Thanks Chapel, GreyElf, and Akjosch for replying to my last question).
However, for a nicer flow, I was thinking of using Claretta's Popup, modified, in order to access the player's items or the encyclopedia or such. So, is there a way to make that popup pull up a different HTML page and potentially passage through an argument? Here's the popup I'm using. By the by, I'm using a Repopup macro to reload the popup on new link clicks, allowing players to navigate through numerous passages using the popup.
/* Opens up a popup: arg[0] is the link title and arg[1] is the passage name */
Macro.add("popup", {
version : {major: 1, minor: 0, revision: 0},
handler : function() {
/* ------------------Error Handler */
if (this.args.length < 1) {
return "No link text specified.";
}
if (this.args.length < 2) {
return "No link text or passage name specified.";
}
/* ----------------- <<End of Error Handler>> */
/* --------------Begin actual handler functionality */
/* Init Vars */
var linkElement = document.createElement("a");
var passageName = this.args[1];
var title;
/* Create the link functionality to click for the popup */
linkElement.innerHTML = this.args[0];
linkElement.className = "link-internal macro-popup";
linkElement.setAttribute("data-passage", passageName);
title = this.args[2];
/* Create click handler */
UI.addClickHandler(linkElement, null, function (event) {
var dialog = UI.setup(title, "popup");
new Wikifier(dialog, tale.get(passageName).processText().trim());
});
this.output.appendChild(linkElement);
}
});
So, in summary, is it possible to use the Wikifier object, or something, to open a new Twine Story HTML file and passage within it, pass in variables, and do it all within the popup?