An author's reference for Bisquixe, a tool for adding audiovisual content to Inform projects (up: inline links and minor tweaks)

Thank you very much for writing these guides, which I have been reading with interest, even though I am not an inform author. But I am a big fan of IF with graphics and sound. let’s hope more authors follow this and expand inform capabilities to use graphics with effect.

2 Likes

Thanks! I know you spend a lot of time on these things in your own work, so I appreciate your comment.

1 Like

Here’s another example, this time based on the Fake Twine example by @mathbrush.

Features:

  • hidden command prompt, intended to use links only
  • light and dark modes
  • a “back” button
  • differently-styled links

From an authorial perspective, I think in-line links are preferable, but, with two color schemes, I needed a way to match link colors to two different backgrounds.

Observations:

  • It would be interesting to see what could come of combining links with “Hybrid Choices” by AW Freyr. I think they would work very well together.
  • A “back” button requires some thought. It isn’t exacly “undo”, but perhaps with “Undo Output Control” we could get good results with less effort.
  • I think this runs pretty well on a phone in portrait orientation. Perhaps because .Input is not displayed, the keyboard does not pop up.
  • Since Bisquixe uses text strings, you can use substitutions and such. To change color mode here, I use a [one of]...[cycling]

Here’s a link to the demo. Note that the words and links don’t mean anything, they are just there to demonstrate functionality.

This will probably be the last demo that I will do for a bit. I’m interested in the command bar concept, but I’m not sure when I’ll have time to look into it. In the meantime, here’s the source.

Fake Twine 2: The Twining
"Fake Twine 2" by Kamineko.

the story headline is "Based on Fake Twine by Mathbrush"

Release along with a "Bisquixe" interpreter.

Include Simple Multimedia Effects for v10 by Mathbrush.
Include Basic Screen Effects by Emily Short.

[initial play setup]

the twining is a room.

id is a number that varies.
id is zero.

rule for constructing the status line:
	do nothing;

When play begins:
	follow the window setup rule;
	follow the typography rule;
	follow the color switch rule;
	follow the link styling rule;
	
[a small play area, no other visible elements]

this is the window setup rule:
	css-set-fast ".play; width; 23%";
	css-set-fast ".BufferWindow; overflow; auto";
	css-set-fast ".BufferWindow; padding; 5%";
	css-set-fast ".Input; display; none";
	css-set-fast ".Style_input; display; none";
	css-set-fast ".coverimage; display; none";
	css-set-fast ".interpretercredit; display; none";
	css-set-fast ".links; display; none";
	css-set-fast ".play; background-color; #020146";
	now the command prompt is "";
	
[download a font and set it. use a larger font to compensate for lower contrast]
	
this is the typography rule:
	import-google-fonts "Comfortaa";
	css-set-fast ".BufferLine; font-family; Comfortaa, sans serif";
	css-set-fast ".BufferWindow;font-size; 24px";
	
[use variable text substitutions depending on light or dark mode

because of the [one of] construction, the colors will alternate whenever these rules are re-run]
	
this is the color switch rule:
	css-set-fast ".BufferWindow; background-color; [one of]#020146[or]#f3f2fc[cycling]";
	css-set-fast ".BufferWindow; color; [one of]#f3f2fc[or]#020146[cycling]";
	css-set-fast ".GridWindow;background-color; [one of]#020146[or]#f3f2fc[cycling]";
	
[set up styling for links, again based on light or dark mode]
	
this is the link styling rule:
	css-set-fast ".Style_a-style a:any-link; color; [one of]#f7a240[or]#e97d01[cycling]";
	css-set-fast ".Style_b-style a:any-link; color; [one of]#fd9bd9[or]#823a68[cycling]";
	css-set-fast ".Style_back-style a:any-link; color; [one of]#50f2c1[or]#4f4f4f[cycling]";
	css-set-fast "a:any-link; color; [one of]#cdf9d2[or]#000000[cycling]";
	css-set-fast "a:hover; color; [one of]#ffffff[or]#000000[cycling]";
	css-set-fast "a:hover; font-weight; bold";
	css-set-fast "a:any-link; font-weight; bold";
	
to say a-style:
	set-any-class "a-style";
	
to say b-style:
	set-any-class "b-style";
	
to say back-style:
	set-any-class "back-style";

Instead of looking:
	say paragraph break;
	say "[color][roman type] or [click-begin]";
	
to say color:
	hyperlink "Change color mode" as "color";
	
to say click-begin:
	hyperlink "click here to begin" as "strt";
	
[an option for setting the color mode]

coloring is an action applying to nothing.
understand "color" as coloring.

[lots of paragraph breaks to pervent a scrolling effect when the player chooses a different color scheme]

carry out coloring:
	follow the color switch rule;
	follow the link styling rule;
	clear the screen;
	say paragraph break;
	say paragraph break;
	say paragraph break;
	say the banner text;
	try looking;
	
[starting is what happens at the, er, start]
	
starting is an action applying to nothing.
understand "strt" as starting.
	
carry out starting:
	clear the screen;
	say paragraph break;
	say paragraph break;
	choose row with an index of ID from the table of click history;
	now action entry is the current action;
	choose row with an index of id from the table of a-track links;
	say track A entry;
	increment id;
	
[atracking and btracking print the next text based on ID. They are the two choices on almost every screen.]
	
atracking is an action applying to nothing.
understand "atrack" as atracking.
btracking is an action applying to nothing.
understand "btrack" as btracking.

atracking is progressing.
btracking is progressing.

[up the counter, update play history, and clear the screen]

before progressing when ID is less than 4:
	choose row with an index of ID from the table of click history;
	now action entry is the current action;
	clear the screen;
	say paragraph break;
	say paragraph break;
	
[print the output]

carry out atracking:
	choose row with an index of id from the table of a-track links;
	say track A entry;
		
carry out btracking:
	choose row with an index of id from the table of b-track links;
	say track b entry;
	
[if we've reached the end, start over instead]

before progressing when id is 4:
	now id is 0;
	repeat through the table of click history:
		blank out action entry;
	try resetting instead;
	
[if there is a "back" to go back to, print the "back" link]
	
after progressing:
	say line break;
	if id is greater than zero,
		say "[back-style][back][roman type]";
	say line break;
	say line break;
	increment ID;
	continue the action;
	
[for use with a "back button]
	
regressing is an action applying to nothing.
understand "regress" as regressing.
	
to say back:
	hyperlink "(Go back)" as "regress";
	
[if id is too low, just reset the ID and start again]
	
check regressing when id is one:
	clear the screen;
	now id is 0;
	try starting instead;

[otherwise, go back to steps, then repeat the player's action according to the history table]

carry out regressing:
	now id is id minus two;
	choose row with an index of id from the table of click history;
	try action entry;
	
[once a full cycle of text has been printed, reset the cycle]
	
resetting is an action applying to nothing.
understand "reset" as resetting.

carry out resetting:
	clear the screen;
	say paragraph break;
	say paragraph break;
	say "Had I made the right choices? How could I even know?
	
I began to second-guess myself.";
	now id is 0;
	say paragraph break;
	say paragraph break;
	hyperlink "Click here to reflect on your choices." as "strt";
	
[the table of click history is filled automatically as play progresses. we never manually add to it]
	
table of click history
index	action
0	(an action)
1	--
2	--
3	--
4	--
5	--

[all texts for atracting action. The click-aa and click-ab values are used to build the hyperlinks in-text. Note that we have to style the links OUSIDE of the links. In the future, we will have inline styling that ought to reduce the overhead]

table of a-track links
index	click-aa (a text)	click-ab (a text)	track A (a text)
0	"one"	"two"	"In the end, I could only do [a-style][hyperlink-aa][roman type] of [b-style][hyperlink-bb][roman type] things."
1	"his clothing changed"	"He also wore a knapsack"	"Whenever D. appeared in the land of Zork, [a-style][hyperlink-aa][roman type] so that he could fit in. He was now wearing brown canvas trousers with a loose white shirt, just like all of the other boys his age. [b-style][hyperlink-ab][roman type] for carrying Marbles around. Marbles had her front paws perched on his shoulder. 'Mraow,' she said."
2	"She waved the wand again"	"a differently-shaded square"	"'My goodness!' Ms. N. said. 'Such a smart boy! Your parents must be very proud. It is thirty-six squares. Some of them are filled in, though.' [a-style][hyperlink-aa][roman type], and some of the squares became blocked off. 'Then there are some squares that can be pushed into open spaces.' The wand moved yet again, and [b-style][hyperlink-ab][roman type] began moving around the grid."
3	"He was the hero of Zork"	"The lights flickered dimly"	"Marbles was right, of course. [a-style][hyperlink-aa][roman type], and Zork was the only place where life seemed fair, the only place that he could ever win. He'd do anything and go anywhere to protect his place there, even if he had to use a time machine. He jumped in, turned the dial, and, before he could lose his nerve, pushed the button. There was a bright, blinding flash. When his eyes recovered, he was still in the museum, but it was a very different museum. [b-style][hyperlink-ab][roman type] and the place seemed very run down. Nearby machines were covered in rust. There was nobody there, not even the guards. D. and Marbles were alone."	

[identically-structured table for btracting action.]

table of b-track links
index	click-ba	click-bb	track B
0	"one"	"two"	"In the end, I could only do [a-style][hyperlink-aa][roman type] of [b-style][hyperlink-bb][roman type] things."
1	"The room was completely bare!"	"Where did everybody go?"	"'Gosh, Marbles, how are we supposed to get through those doors? Do you suppose we're trapped here?' D. Looked around. [a-style][hyperlink-ba][roman type] The musem's exhibits, posters, and signs were all gone. D. felt worried about Miss N. Hopefully, she had found some nice place to be. [b-style][hyperlink-bb][roman type]"
2	"niiice huuuman"	"a prettyyy good cat"	"Bug gurgled. 'No, but I appreciaaate you asking. You are the first [a-style][hyperlink-ba][roman type] I've ever met. And you seeeem like a [b-style][hyperlink-bb][roman type], Marbles. But a gruuuue must taaake their own waaaay.' One of their coat sleeves flopped ridiculously. Perhaps they were waving. 'So long, huuumans of empiiiire.'"
3	"what a strange encounter"	"maybe there was more to it"	"D and Marbles headed forward, and soon Bugs was out of sight. 'Jeeze, Marbles, [a-style][hyperlink-ba][roman type]! I never thought I'd meet a grue in person!' Marbles meowed. 'It's true, they might not all be so bad. I wonder what happened with the Empire? It all seemed like a lot of fun, but [b-style][hyperlink-bb][roman type].' Marbles meowed again. 'That's right Marbles, when it comes to grown-ups, you never know.'"

[generating links based on click-xx entries in tables]
	
to say hyperlink-aa:
	choose row with an index of id from the table of a-track links;
	hyperlink "[click-aa entry]" as "atrack";
	
to say hyperlink-ab:
	choose row with an index of id from the table of a-track links;
	hyperlink "[click-ab entry]" as "atrack";
	
to say hyperlink-ba:
	choose row with an index of id from the table of b-track links;
	hyperlink "[click-ba entry]" as "btrack";
	
to say hyperlink-bb:
	choose row with an index of id from the table of b-track links;
	hyperlink "[click-bb entry]" as "btrack";
4 Likes

Based on recent conversations, I have made an extension with a few fixes/changes.

  • Inline link capabilities (thanks to @Draconis). It requires a dev version of Formatting Capture, which you can find in this post.
  • A check to determine whether or not the game is currently running in a Bisquixe interpreter
  • An increase to maximum string size
  • A change to default white space behavior (pre-wrap)

If something new comes up, I’ll update here. This won’t be uploaded to Friends of Inform; it should be superseded by the next version of Bisquixe.

This has only been tested with Inform 10.1.2, though I imagine it would work with Inform 9 after some minor tweaks. I am unable to provide Inform 9-specific updates at this time.

To use it, just include it in your project (in addition to SImple Multimedia Effects for v10, of course).

Bisquixe Customizations and Updates.i7x (2.8 KB)

1 Like