Future Twine Titles

- Posted in Coding by

Adrift Until A Tad Bit Informed
At My Feet In Ashes Lay
From Coxwain To Captain
I Write In Twine Now
Nothing Broken In Heaven
Only In Extremis
That Which Crowned Our Past
The Affection I Once Bore You
Unexpected Benefits of the Apocalypse

SS Lesson 27 April 2025 - Healing Waters

- Posted in SundaySchool by

SS Lesson for 27th April 2025: Healing Waters

Recipe for an Inventory system in Twine Sugarcube

- Posted in Coding by

The anatomy of an inventory system: (a) the arbitrarily long return function (b) creating the YourInventory passage with a [noreturn] tag (c) creating the StoryMenu passage so we can link to YourInventory (d) give the player some starting inventory items (optional)


(a) The Arbitrarily Long Return function

/* Trigger the following code at the start of navigation to a new passage. */
$(document).on(":passagestart", function (event) {
        /* Make sure the current passage doesn't have a "noreturn" tag. */
        if (!tags().includes("noreturn")) {
                /* If it doesn't, then set $return to the current passage name. */
                State.variables.return = passage();
        }
});

In case the above inline code doesn't display correctly, or breaks at some point, here is the Github gist of the above Arbitrarily Long Return function.


Next I provide the code for the YourInventory passage and the two widgets it makes use of.

the passage code:

<<nobr>>
<<if $inventory eq undefined>>
Inventory is undefined
<<else>>
<<InventoryItemCount>>
<<InventoryItemListing>>
<</if>>
<</nobr>>

and the code for the two widgets:

<<widget "InventoryItemCount">>
/* This widget prints a message to the browser window telling the player how many items are in her inventory. I still need to add the Twinescript needed to accomplish this -- but all I have to do is copy/paste it from the YourInventory passage. */ 
<<nobr>>Your inventory contains:
<<if $inventory.length lt 1>>
nothing
<<elseif $inventory.length eq 1>>
1 item
<<else>>
<<= $inventory.length>> items
<</if>>
<</nobr>><</widget>>

<<widget "InventoryItemListing">>
/* This widget prints the inventory's items,
one per line */
<<nobr>><<if $inventory.length eq 1>>
$inventory[0]
<</if>>
<<if $inventory.length gt 1>>
<<= $inventory.join(`<br>`)>><br>
<</if>>
<</nobr>><</widget>>

And, against future need, here is a gist of the above passage code and code for the two widgets.

One option for making the YourInventory passage available during play is to add the following line to special passage StoryMenu:

<<link "Inventory">><<goto YourInventory>><</link>>

One way to give the player some beginning inventory items would be to set them in special passage StoryInit:

<<set $inventory to ['a canteen', 'a pocket knife', 'a handkerchief', 'a flashlight', 'a revolver']>>

I found some old Harlowe example code for Twine

- Posted in Coding by


I found my old Harlowe examples for Twine, and threw them up on a couple of servers.

Map of A Campfire Tale

- Posted in Coding by

I continue working on a Sugarcube tutorial for my friend, Deonna. Here is a map of the Twine passage layout as of 4/14/2025. On that same date, source code (JS and twinescript/twee3) files come to 222 Kb.

Thirst-Quenching Water

- Posted in SundaySchool by

Lesson for April 13, 2025: Thirst-Quenching Water

Change font face and size in Twine with Sugarcue

- Posted in Coding by

Thanks to Josh Grams, I now understand how to set up players/readers of my twines with the ability to change font face and font size. Below I link to the scripts you need to drop, respectively, into the javascript and stylesheet special passages in the desktop Twine 2.10.0 app. Here is the zip containing the needed JS and CSS. I host a demo of this here and here, and mention it in my Twine Tidbits on the local copy of my blog.

FileTimeChanger is a console windows app to change access creation modified file time and date

- Posted in software by

FileTimeChanger is a nice little tool with show, change, and help flags -s -c -h. Works great.

Confusion to Clarity

- Posted in SundaySchool by

Matthew 5 lesson for 4/6/2025. From Confusion to Clarity.