Nevermind, i fixed it. For all who want to do it for themselves:
1. Add this code to your Story Javascript:
/* Usage: <<autopopup "Pasage Name">> */
Macro.add('autopopup', {
handler : function () {
if (this.args.length === 0) {
return this.error('no passage name specified');
}
var passage = this.args[0];
Dialog.setup(passage, 'popup');
Dialog.wiki(Story.get(passage).processText().trim());
Dialog.open();
}
});
Then use this code in your story (for a link):
<<link "Link Name">><<script>>UI.close()<</script>><<autopopup "Next passage to display">><</link>>
Or this (for a button):
<<button "Link Name">><<script>>UI.close()<</script>><<autopopup "Next passage to display">><</button>>
What this does (for total noobs) <<button>> and <</button>> form a button. <<link>> and <</link>> form a link. Between <<script>> and <</script>> any javascript is executed (UI.close() means close the popup). <<autopopup>> is what the Javascript above defined: a popup of a story passage.