Quest JS - another sort of update

K.V.

I made the object links work (finally), but I need to figure out how to bind the functions to them on game load without the menu popping up...

It also displays the object's listalias in the pane, if the object has one.


Thanks to Raist and mrangel!


QuestJS no longer compiles playable games, as of Quest 5.7.2.


K.V.

I need this to happen when each link with the class 'elementmenu' is printed:

bindMenu($('.elementmenu').attr('id'), $('.elementmenu').attr('data-verbs'), $('.elementmenu').html(), false);

Any suggestions?


K.V.

Ha!

I got it!


K.V.

QuestJS no longer compiles playable games, as of Quest 5.7.2.


Good going.

Interested to see the progress of this project; but from what I can understand, I don't think I like the core structure.
At some point I intend to try building my own JS-Quest thing, starting from the other way of doing it.


K.V.

Thank you, sir.

..and yeah... Quest JS just takes in a .quest file and (sometimes) spits out a website.

You still have to have Windows to run it. (In fact, I've gotten Quest to do everything EXCEPT play a game under Wine in Linux, but I can't get Quest JS to even open under Wine.) So, it's sort of worthless if you only have *Nix.

...but, it does have 80% of the Quest functions translated to JS in the file called game.js.

https://github.com/KVonGit/quest-js/blob/master/Compiler/game.js

As far as I can tell, the game will not compile when the game contains a function which does not exist in game.js. (Or something to that effect.)


In a perfect world, Quest would run under any platform, and you could compile to a website.

Alex tried to pull this off with Quest 6, but the only part that runs in *Nix is the player, and you need gulp to run it on a local server.

Plus, it only plays the example game you can publish with Quest 6. AND if you alter that example game at all, nothing works when you play that game in the Quest 6 game runner (or hoster, or whatever it is).

Mr. Warren posted about Quest 6's editor running in *Nix and compiling to a website for quite a while, but the editor only runs in Windows.

There are posts after the last update to Quest 6 which say QuestKit is (was) destined to be the Quest for all platforms.

Basically, it seems to me  that he realized Quest wasn't getting ported without rewriting more than 75% of it, especially anything concerning the GUI editor.

All the functions (and scripts) need JS equivalents to run in the browser without the server.

Blah, blah, blah...

I've tried to use MonoDevelop. It will load the project, but it some of the files' formats don't work with it. So, that failed.

I toyed with the notion of creating a GTK+ interface, but I got nowhere fast with Glade.

I do have a version of game.js I've been altering so I can run a quasi-Quest game from scratch.

I've got an HTML file with the appropriate elements (and ids and classes).

I just write a separate JS file, which works just like Quest's .aslx file, calling functions from game.js.

It works fairly well, except for the scrolling... It works right most of the time.

...but the scrolling doesn't matter. Neither does the HTML at this point.

Once I get all the functions converted to JS, we could easily use the HTML from the web editor as the GUI, and just pull the values of the fields to created the game's own JS file. (Did I make sense that entire time? Probably not...)


K.V.

In fact, MrAngel...

Just after you unwillingly went off the grid, I attempted to convert an .aslx file to JSON, then use JS to create objects from that.

https://textadventures.co.uk/forum/quest/topic/iua84phpek_x5pnyc6z5qq/json

It was almost successful.

I think this would be better than Quest JS if I could break it all the way down.

Here's the closest I got (this is the last pertinent post in that same thread):
https://textadventures.co.uk/forum/quest/topic/iua84phpek_x5pnyc6z5qq/json#b92be5a0-32aa-4c4a-a5b5-413984abd9ff


To me, compiling Quest to JS seems like it will always have issues with games that might rely on its async behaviours. Could work, but implemented in a language I don't like anyway :p

My "other method" was going to be writing an interpreter for Quest script in Javascript. Parsing the XML file isn't going to be a problem, because jQuery can handle arbitrary XML formats a little better than it deals with HTML.

(I got distracted wondering if I should do a pure JS version of the editor too. It's easy enough to make it work, but in the process I realised just how weird the XML format is for libraries that want to add editor components, and got distracted into trying to work out additions that could make it more elegant)

[Signature/begging PS: I'm releasing a new book, Pasts & Futures, at the start of Feb. I'm trying to improve my Author Rank so that it gets a high position on the "This week's new releases" page, so am urging anybody who cares to check out Into Dreams (which is free on Kindle until Thursday) or some of my other books while waiting for the new one to appear]


K.V.

I added a few more things.


My "other method" was going to be writing an interpreter for Quest script in Javascript. Parsing the XML file isn't going to be a problem, because jQuery can handle arbitrary XML formats a little better than it deals with HTML.

(I got distracted wondering if I should do a pure JS version of the editor too.

Same here.

That's what I'm posting about in that thread I linked to.


My Kindle is now charging.

I'll check out the book(s) shortly.


I was confused why you're converting the .aslx file to JSON. I was looking at something more like:

$(function() {
  $.get ("URL of an .aslx file", , function (data) {
    var quest_file = $(data);
    var player_object = quest_file.find("object[name='player']");
    var starting_room = player_object.parent();
    alert ("File loaded! Simple test, the player is in room: "+(starting_room.attr("alias") || starting_room.attr("name")));
    // code to actually parse the game's scripts goes here :-p
  });
});

Though if I was building something more complex, I'd likely start with:

  quest_file.find("object[name]:not([id])").each(function () { $(this).attr('id', this.name); });

So that I can then use quest_file.find("#player") to get any object by name.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums