Local HTML Links
playinful
12 Jun 2016, 14:50So I have a bit of an... interesting query here. You know how Quest lets you include HTML links? Well, I was trying to find out if local links worked too, so I found out how Quest references files like images using HTML tools, and I tried to use <a href="quest://local/testpage.html"> (I am using the display message command, so all of this is being put within a <span> element). No dice. So then I tried to just copy the same image link and try to use an <a> element with it. Also no luck. So then I thought, maybe I can use an iframe? So I tried making an iframe with the same address, and it worked.

Then I decided to use an actual online page to test it (since I know that http:// links work). I used my old school's website as a test. And it worked, too.

I downloaded the page to test it locally. I put it in the game folder, typed the appropriate address, and here's where it gets strange...

It just displays the raw HTML. Weird.
...In summary, I just want to find out how to create a link from within the game's folder.

Then I decided to use an actual online page to test it (since I know that http:// links work). I used my old school's website as a test. And it worked, too.

I downloaded the page to test it locally. I put it in the game folder, typed the appropriate address, and here's where it gets strange...

It just displays the raw HTML. Weird.
...In summary, I just want to find out how to create a link from within the game's folder.

jaynabonne
14 Jun 2016, 16:20I tried it and got something similar. It showed the HTML for the page, but it also blinked like crazy, spewed all kind of errors in the console log, and kept loading the page over and over (I had used a JavsScript eval setting document.location.href, so I might have seen odder behavior than you). It might have something to do with its handling of the quest:// protocol when it comes to HTML pages.

jaynabonne
14 Jun 2016, 16:22This is what I had used to load the URL. It might be helpful to know about GetFileURL, which evaluates to the quest:// thing in the downloaded player and to a more server-side url when played online:
JS.eval("document.location.href=\"" + GetFileURL("clicked.html") + "\"")
JS.eval("document.location.href=\"" + GetFileURL("clicked.html") + "\"")
playinful
15 Jun 2016, 03:12I tried that document href JS you mentioned, and it just set my window to the base code again.

That's when I decided to look with the HTML tools and here's what I saw...

It was all inside a <pre> element!

...with the symbols dummied out.
Why does Quest do this, I wonder, and how can it be fixed or averted?

That's when I decided to look with the HTML tools and here's what I saw...

It was all inside a <pre> element!

...with the symbols dummied out.
Why does Quest do this, I wonder, and how can it be fixed or averted?
playinful
15 Jun 2016, 03:17...But that's not all. I decided to use another online Quest game, to see how the online player handles the files.

I was able to open this image multiple times, using the same address each time, and the online player seems to use the definite address of the file, not the "quest://" one. Then things got interesting...
I decided to use that JS.eval method using the address of an online Quest game.

Interestingly, it opened the game in the player window, but did not overwrite the previous game's output. The link I had made to the local file was still there. I decided to click on it, and...

The link, which before, did nothing at all, now opened the correct page (albeit as raw code), in a completely separate window! I don't know what this says about Quest's player, but it seemed too relevant not to post.

I was able to open this image multiple times, using the same address each time, and the online player seems to use the definite address of the file, not the "quest://" one. Then things got interesting...
I decided to use that JS.eval method using the address of an online Quest game.

Interestingly, it opened the game in the player window, but did not overwrite the previous game's output. The link I had made to the local file was still there. I decided to click on it, and...

The link, which before, did nothing at all, now opened the correct page (albeit as raw code), in a completely separate window! I don't know what this says about Quest's player, but it seemed too relevant not to post.
playinful
15 Jun 2016, 03:35The link would probably work online, but definitely will not work in the desktop. I thought about a sort of "if you are playing online, click here; if you are playing the desktop version, open whatever.html" but that wouldn't work because the files are saved within the .quest file. I even deleted the original source file, and the page stayed, so I know it must be saved within the .quest.

Pertex
15 Jun 2016, 06:41By the way, why do you want to open a html page in Quest?
playinful
15 Jun 2016, 17:21It's for a sort of hint book thing. I want to display it in HTML because it would take up too much space in the Quest player.
Also it would be helpful for players to be able to look at the hint book while playing the game, if they so desire. For this reason it would be helpful to have the hints open in a new tab.
Also it would be helpful for players to be able to look at the hint book while playing the game, if they so desire. For this reason it would be helpful to have the hints open in a new tab.

Pertex
15 Jun 2016, 18:56And this hint book needs to be a html page? Why not put a hint book object into the inventory and when the player reads the book show some text and /or pictures in the main window? After reading in the book the player could "remove" the book, the text could removed by script.
playinful
15 Jun 2016, 19:39Right, I see what you mean, I'd just rather the player be able to view the hintbook and the game side-by-side, instead of having to constantly switch if they decide to use it.
I was thinking, I could make it so that if the game was being played online, it'd open the page, but if it was played offline, it'd print a message saying "Only available when playing online" or something like that. But then I'd need a way to tell whether the game was using the online or desktop player. And even then, I'm not entirely sure it's such a great idea.
I was thinking, I could make it so that if the game was being played online, it'd open the page, but if it was played offline, it'd print a message saying "Only available when playing online" or something like that. But then I'd need a way to tell whether the game was using the online or desktop player. And even then, I'm not entirely sure it's such a great idea.

XanMag
15 Jun 2016, 20:51If you want to do that, just put your hint book on a separate dedicated web page and link it on the title page, or use a hint command to show the page's URL while in game. There are a lot of pretty neat and creative ways you can implement a hint system using Quest.
playinful
15 Jun 2016, 21:31Interesting idea. I'll try that.