Implementing passworded content in a Twine work

- Posted in Coding by

It's not terribly difficult to implement passwording in a Twine work. First, you'd drop this into your story javascript passage:

/* hashStr - Start */
window.hashStr = function(txt) {
    var hash = 0, i, chr;
    if (txt.length === 0) return hash;
    for (i = 0; i < txt.length; i++) {
            chr   = txt.charCodeAt(i);
            hash  = ((hash << 5) - hash) + chr;
            hash |= 0; // Convert to 32bit integer
    }
    return hash;
};
/* hashStr - End */

Next, you'd need to go here (or message me and I'll help you) and use the Enter text here textbox to enter the desired password. For example, if your desired password is redrum, the hash will return -934876071 Copy that number to the clipboard, because we'll use it in the next step.

Step 3: Finally, you'll need to put the following code into a Twine passage and specify the number you got in step 2. This is a textbox where users can try to enter the correct password:

You can view the raw text here, online...

The convoluted nature of learning

- Posted in Coding by

I get a bit frustrated that I don't find myself making dazzling progress in coding works of Twine. However, I realized this afternoon while doing a lot of reading on http://intfiction.org, https://twinery.org, https://twinelab.net/twine-resources/#/, and other forums that it is this reading, interspersed with trying out snippets of Twinescript and Javascript, that make learning possible.

I know enough about learning theory to appreciate that sometimes periods of apparent non-productivity are in fact allowing the brain to percolate and make mental connections between concepts — even to have occasional epiphanies.

And so, I'll continue to read Reddit posts that are Twine-related. I'll read them trolling for valuable snippets, but also because they encourage me when I see that many other people have (1) many of the same questions I have, and (2) have creative aspirations in common with my own.

One possible stylesheet for a Twine

- Posted in Coding by

html { font: 100% Georgia,serif; color: #000; } tw-story { background-color: white; color: #808080; font-family: "Tahoma" font-size: 1.5em; line-height: 1.5em; }

#text_centered {
text-align: center;
}

tw-sidebar {
    display: none;
}

tw-passage a {
    color: #4169E1;
    font-weight: 700;
    text-decoration: none;
}
tw-passage a:hover {
    color: #00bfff;
}

Important notes regarding Harlowe 3 programming in Twine

- Posted in Coding by

Well, I've learned an important lesson regarding menuing in Harlowe. Don't set variables inside menu passages. I've also found some resources online including Tweego templates, SugarCube templates, etc.

I've also developed some interest in learning SugarCube, but I'm not entirely sure I have the programming chops for it.

I'm spending some time looking over [this][1] often-cited introductory material on Twine.

In the current story I'm writing, I've been able to figure out how to advance the story both by clicking on links (the hallmark of Twine) and by just clicking on or tapping the screen.

Here is the Save/Load code I'm currently using:

<div id="text_centered"><small> 
    {(link-repeat:'[Save]<saverepeat|')[
        (if: (save-game:"GameSlot1"))[
            (replace: ?saverepeat)[SAVE AGAIN!]
            (dialog: "#### Save Successful!")
        ]
        (if: not (save-game:"GameSlot1"))[
            (replace: ?saverepeat)[Save... Again?]
            (dialog: "### Save Failed...", "Bummer...")
        ]
    ]
    (link-repeat:'Load')[
        (if: (savedgames:) contains "GameSlot1") [
            (dialog: "### Loaded Save", "Yay!")
            (load-game:"GameSlot1")      
    ]
  (else:)[
    (dialog: "### No Savefile!", "Ah...")
  ]
]}
</small></div>

Twine, Tweego, and story formats

- Posted in Coding by

I have figured out how to use Tweego not only to produce Twine HTML stories, but also to produce proofing HTML in both the Illume (by Michael McCollum) and Paperthin formats.

I've also archived a copy of the Illume proofing format for Twine here on my Microsoft Onedrive account, and here on my OpenDrive account. Christy Tucker has an article on how to use this format at this page on her website.

Paperthin, another proofing format (and more austere than Illume) can be found on the author's Github, or here on my Onedrive, or here on my OpenDrive. Here is a sample of Illume's output.

Dotgraph is a proofing format with nice colored-nodes showing the arrangement of your twine passages. It can be downloaded here, or here, or here.

To add DeMarco's DotScap proofing format to Twine 2, we'd use https://mcdemarco.net/tools/scree/dotscap/format.js

Chapel's poof proofing format can be downloaded here, or here.

To add the PrePub format to the desktop version of Twine, we'd use this link to the format. PrePub is able to flatten simple twines to markdown in preparation for converting them to ePub format via Pandoc.

We would produce the markdown file via Twine or Tweego, and then convert to ePub in Pandoc like so:

pandoc -o my-story.epub prepub123456789.md --epub-chapter-level=2 --toc-depth=1 --css=prepub.css

I have archived a functional storyformats folder from Tweego here, here, and here.

Here are samples of the Illume, Paperthin, and Poof proofing formats.

You can use this installer to install Tweego 2 on Windows (or here on my Onedrive). There's another copy of the installer here. For my Tweego installation, I chose to put it close to the root of my main drive:

MyTweego

Notice the yellow-highlighted storyformats subfolder shown in the above screenshot.

I'm very interested in Twine

- Posted in Coding by

I've been interested in Twine 2.0 since it emerged onto the IF scene in 2009. But I only recently (August 2019) revisited it and began to experiment with it in earnest. As I nail down concepts, achieve insights, and come up with snippets of script that work, I'm collecting them here.

Some credit goes to Chapel and the code and examples he's made available on the Twine lab under this license.

I keep a copy of the Windows version 2.3.3 of Twine here. It's an 84.8 Mb download.

If you want a zero-install Twine engine, with some additional story formats and an extractible Web-to-Exe that can turn your Twine stories into stand-alone applications, get this. It's an 85.8 Mb download. You can put it wherever you want on your hard drive (excepting the Program Files directory) and pin a shortcut to the Twine executable to your Start Menu or Desktop.

If you experiment with Twine and decide you want to spend some extended time using it, you may want to peruse Chapel's custom macros. You can put together a custom download of the macros you like here.

Twine Fray

- Posted in Coding by

I've discovered the blog of Mr. Riley, a web programmer. He has lots of great Twine code examples.

Mr. Riley is a teacher. He has a good starting point example of a combat system for a Twine game called Twine Fray.

I plan to scour his blog for learning purposes.

Lately, I've been reading some articles put out by prominent researchers in the SETI at Home project: Here is an explanation of the Drake Equation. And here is an article of what we might expect from E.T.

For a while now, I've had my desktop PC (which I don't use on a daily basis but do leave running) executing BOINC and assisting the SETI @ Home program to process telescopic data.

BOINC downloads scientific computing jobs to your computer and runs them invisibly in the background. It's easy and safe.

About 30 science projects use BOINC; examples include Einstein@Home, IBM World Community Grid, and SETI@home. These projects investigate diseases, study global warming, discover pulsars, and do many other types of scientific research.

Twine and Glaive Seeker

- Posted in Coding by

I'd estimate I'm probably halfway through the development of Glaive Seeker, a play-in-your-browser game I'm authoring with Squiffy for the player in my Earth Apotheosis game on r.rpol.net.

I've not been impressed with the robustness with which Squiffy handles variables. Twine seems more robust in that regard. In fairness, though, I just wrote a very brief example source file, and variable incrementing worked as expected. So perhaps I have syntax errors in the game I'm writing. I'm not experienced using Squiffy, after all.

I'm thinking that Twine is a more mature tool, certainly in terms of its age. However, in doing some reading about the new v3.01 Harlowe story format, it seems far more complicated than what I want to fool with or need. At the time of this writing, I'm thinking future games or tutorials might best be fit by the SugarCube2 format for Twine.

Incidentally, the nodes screenshot above was taken from a layout created using Twine. That's right, I'm using Twine to help visualize the flow of my Squiffy story.

I shared the above screenshot with my player on 9/16/2019 (note that this assertion conflicts with the date shown above this post's title; that's because Flatpress uses UTC time) in msg 120 of a private message thread and will be interested in the player's reaction.

Page 2 of 2