The Bisquixe interpreter for Inform 7 and Inform 10 styling (new:full sound, internal links)

Cool. Yeah, I’d hope the phrases / words or whatever would actually make it easier–“StatusLine” is easier to remember than “.GridWindow”. Maybe something as simple as “Game” for “.BufferWindow”. I think good documentation will be crucial for either format. But it seems more Inform-y to me to use readable words.

For the fonts, in theory two would probably be sufficient (display font + body font), but heaven knows there’s a lot of potential fun to be had by having umpteen fonts at your disposal.

3 Likes

In experimenting, I’m noticing some weirdness with the vertical scrollbar, which appears to be within the original Quixe. (I think.)

In this post by @Draconis, there’s a fix. I wonder if it could be included here? (I tried to get that template up and running but ran into a variety of errors.)

I don’t know what the real issue is, of course, but the malfunctioning scrollbar really makes things unpleasant at times. And I really only want my web design skills to accomplish that.

I tried Edge and Chrome; both had the same issue.

2 Likes

What’s the scrollbar issue? I swear I remember something about it from before, but that post is not specific…

I know that you can change it from overflow: scroll to overflow: auto (scroll only when there is too much text) or scroll: hidden. But which issue are you referring to?

2 Likes

It’s weird. Basically the text goes below the edge of the window, and the cursor gets lost. To keep playing the game, I need to scroll down and also click back on the prompt.

The JS is simple and is included as a separate file:

function fix_height(){
	document.getElementById("gameport").style.setProperty("height", "auto");
}
window.addEventListener('scroll', fix_height);

I don’t know if something else calls it or if it’s self-sufficient. I think it might be the latter. (I’ve got virtually no JS skills.) I tried setting #gameport in Inform, but no dice.

2 Likes

Oh, okay, that should work great. Event listeners check for something happening and then do something, so this should be good to just chuck into the “Template” files. Thanks! I’ll make sure to include it in the next release!

1 Like

(For this and other reasons, I wish this had been branched from Parchment rather than Quixe. I’m pretty sure I’d fixed most of the scrollbar issues.
Though it’s not necessarily too late to switch.)

4 Likes

So, some of the issue for me personally is that I didn’t know Parchment was even an option for Glulx games: I had presumed (felt fairly confident, really) that Parchment was only for Z-code games. And in 6M62, the documentation says that Parchment is for Z-code, and Quixe is for Glulx.

I just tried Parchment for a Glulx game in 6M62, and I get an error message:

You asked to release along with a copy of the ‘Parchment’ in-browser interpreter, but this can’t handle story files which use the Glulx story file format. (The format can be changed on Inform’s Settings panel for a project.)

The documentation in I10 is now explicit that Parchment is for both. But my goal (insofar as I can have a goal, seeing as I’m doing none of the actual work here) would be to make it as easy as possible for beginners or those uncomfortable with CSS to style their releases. Since I7 or I10 defaults to Glulx and Quixe, it makes sense to me to target Quixe.

(Side note–I just tried releasing a small Glulx project with Parchment in I10, and it doesn’t work for me–the loading graphic just spins. It works fine with Quixe, though. Then I tried changing it to Z-code, and Parchment still won’t work for me in I10. It works in I7.)

But (don’t tell Quixe this) I think I like the Parchment defaults better. So perhaps this extension eventually being available to both would be ideal? Again, that’s very easy for me to say when I’m not doing the work.

2 Likes

I don’t mind looking at Parchment, but if it’s not very similar to Quixe, I simply won’t be able to understand it. I started trying to figure out how Quixe works in 2018, and I’m barely getting it now in 2023. Unless it has very similar techniques, it’ll most likely just be too hard to understand for me.

But…I’m not in a race to have the ‘best’ interpreter. If all that happens is that after I release my interpreter, everyone improves theirs to have even better functionality and mine just evaporates, I’d be happy.

With that said, I will look at parchment once I have things like sound working in Bisquixe.

2 Likes

Okay, I’ve updated Bisquixe interpreter to version 2, and the extensions to version 3 each.

New features:

-Import google fonts
-Play sound.

The documentation can be found here: The Bisquixe interpreter for Inform 7 and Inform 10 styling (new: Google fonts, sound) - #2 by mathbrush

A sample game is here:

Full code:

Summary
"Audiovisual" by Mathbrush

[Significant chunks of code were first written by Petter Sjölund.]

The release number is 3.

Release along with a "Bisquixe" interpreter.

Include Simple Multimedia Effects by Mathbrush.

Sandbox is a room. "Hello! To try various features, try clicking links, typing Z to see text alignment, typing JUMP to see various colors used in the same paragraph, or typing I to hear a sound.

From here, you can go [boldnorth]."

To say right:
	set-any-class "right_just";
	
To say left:
	set-any-class "left_just";
	
To say center:
	set-any-class "center_just";

Sound of bells is the file "Bells1.ogg".

When play begins:
	css-set-fast ".Buffer_right_just;text-align;right";
	css-set-fast ".Buffer_left_just;text-align;left";
	css-set-fast ".Buffer_center_just;text-align;center";
	import-google-fonts "Kalnia:wght@300&family=Rubik+Bubbles";
	css-set-fast ".BufferLine;font-family;Kalnia";
	upload-audio "Bells1"  with internal name sound of bells;

Instead of taking inventory:
	play sound of bells;

To say boldnorth:
	hyperlink "north" as "north";

WeirdRoom is north from Sandbox.

The dog is in weirdroom.

Rule for printing the name of the dog:
	hyperlink "dog" as "x dog";

Instead of jumping:
	repeat with current running from 3 to 50:
		let bigcurrent be current * 3;
		let bigtemp be 255 - bigcurrent;
		let temp be ".Style_user[current];color;rgb([bigtemp],[bigcurrent],[bigcurrent])";
		css-set-fast temp;
		let tempclass be "user[current]";
		set-any-class tempclass;
		say "M";

Instead of waiting:
	say "[right]I am on the right!

[center]I am on the middle!

[left]I am on the left!";

Edit: Note that this is backwards compatible, so if you wrote code under the old version, it should still work.

3 Likes

If sound were easily viable in Inform 7 in the browser, it might possibly pull me back.

Unfortunately I’m not hearing any sound (by pressing I?) on a Mac using Safari on itch.

1 Like

a lot of browsers do not automatically play sounds. until focused.

I really like this. especially the Twine-a-like demo. it works here.

Could Bisquixe have pictures?

1 Like

I did focus: I clicked the link, I typed, but no sound. I understand the browser restriction that it won’t play sound on first load until interaction happens.

It looks like on Safari I get the error “unhandled promise rejection: notsupportederror: the operation is not supported”. There’s a few guides about that online that I can check out.

As for pictures, I plan on working on that next, but they’re a little tricky given all the information the game sends through glk for normal graphics stuff. It’s definitely in the works though!

2 Likes

You can download an updated Parchment for both 6M62 and 10.1 that supports Glulx. I think for 10.1 there was a bug that made it in to the release - very embarassing, but also a little odd that so few people reported running into it.

It’s almost identical, just with AsyncGlk instead of GlkOte. The GlkApi file that you added your new Glk functions into is basically unchanged.

2 Likes

I’ll keep parchment in mind then!

I’ve now patched the audio problem and released a new version of the interpreter and extensions. The issue was that Inform only uses .ogg files, and safari can’t play them.

So this update requires both version of the sound files to be in the sounds directories; so each file needs both a .ogg version and a .mp3 version. If you aren’t planning on your game running in gargoyle or frotz and only doing a webversion, you can just make fake .ogg’s (like copying the mp3’s and changing the extension).

@HanonO can you confirm if audio works now at the same link? It does on mobile safari for me.

1 Like

I can hear sound! What kind of incomprehensible genius are you? :joy:

1 Like

More of a dumb-ius; I got all this working years ago for Absence of Law, and I didn’t think about downloading it and checking it out. I was adding all sorts of stuff to my files, like ‘crossorigin=‘anonymous’’ and ‘audioelement.load()’ and every single thing I could think of online. Then I looked at my old AoL code and saw the mp3s and thought, ‘it couldn’t be that easy!’. And that’s all it was…

1 Like

I guess it makes sense sometimes that inspiration=problem+lots of time.

I’m sure I told you how I attempted a Petit-Mort Ectocomp entry and got hopelessly in the weeds unable to make the entire gimmick work. I didn’t touch it nor think about it at all for an entire year. Near next Ectocomp I casually opened it to see if anything was salvageable and instantly realized what the problem was and had it ready to submit in 5 minutes. :roll_eyes:

2 Likes

Do you happen to know what happens if you ask the interpreter whether it can play sound?

As in, if a game uses one of the conventional test phrases from something like Glulx Entry Points to say ‘Hey interpreter, do we have sound?’, does BisQuixe report true? Or false because it’s not using the native mechanism?

I can test this myself eventually, but I figured you may already know, or would have a bunch of test projects set up where you could check this.

(Ugh, I can’t even find the definition of the phrase ‘if Glulx sound is supported’. Glulx Entry Points uses it, but doesn’t define it. Does that mean it became built into Inform at some point?)

-Wade

1 Like