Saving/loading and using brackets in Harlowe

Twine Version: Harlowe, 2.10.0

How do I make a save/load game option?
Is there a direct document list of all Twine commands?
I know some HTML and also wanted to ask: Can someone make a version of Twine that just uses HTML codes? ‘’‘’ and //// I want replaced by and commands, for example, because they’re easier to remember. Twine already uses a markup language, so it just feels off not having these.
I also can’t use brackets in my games because it’s using them for the commands. Is there a way I can add brackets? I wanted to make EXP links and more, and links that sent you to the title screen. These are set up in single brackets. [Home] is one. It turns off the computer in the game and you go to the home screen.

[Save] and [Load] are important commands for my visual novels. These are usually in a visual novel above the dialogue box. I can make do with having these at the bottom of every passage, but I still don’t know Twine very well. In HTML, and in some other code, I could use if/than statements, but now I don’t remember how to do this. It was on some program once where it was literally the funnest and easiest thing to do. I learned it in class, too. If answer = 45 then problem must be = 1 + 2, correct? = no, for example. Those classes were insane.

Thank you!
noobx

Twine, despite its simplicity, is still a coding environment. At its core, you will need to have some mastery over programming basics. We can help you through these hurdles.

However, I urge you to try working with a codeless authoring tool to get your feet wet. I suggest Moiki.

→ (Website) https://moiki.fr/en
→ (Documentation) https://documentation.moiki.fr/en/docs/intro/

The website is created by a French speaking developer, but the English translation is very good. The end games look great and play well on mobile and desktop.

By using Moiki, you will become familiar with the structure of a choice-based IF framework. It has many built-in features that require much more programming prowess to accomplish in Twine. See if Moiki’s built-in features support what you want to do with your story, or see if you can adapt your story to fit Moiki’s framework.


In regards to Harlowe, I’m just going to state some basics first (just in case there is any misunderstanding). First off, think of Twine as the code editor only. Harlowe is the story format you have chosen (it’s the default one) and its programming language is specific to itself. Other story formats include Chapbook, SugarCube, etc.

Some good Harlowe resources are:

Official Manual
https://twine2.neocities.org/

Example Coding – Cookbook
https://twinery.org/cookbook/savinggames/harlowe/harlowe_savinggames.html

Video Series
https://www.youtube.com/playlist?list=PLlXuD3kyVEr662CjQjQHOVJhmdsl2TgYk

General IF Resources
https://www.ifwiki.org/Main_Page

You’ve asked a bunch of questions that are addressed in the links I’ve provided. I believe you may need to get a stronger understanding of the basics of Harlowe first though. Saving and loading a story (game) is more advanced than if/else conditions, for example. Once you get familiar with creating and changing variables, checking the values of variables and displaying them in the story, the other things will become easier to understand and implement.

I hope this helps you.

Note: It’s best to ask a single question or two in their own threads to help others find specific answers to specific questions more easily.

1 Like

Is there specifically a save/load option in the links?
I want every passage to be able to be saved on, and loaded to for the player.
Thanks!
I’ll check those out,
Noobx

If I understand this question correctly, you want your project’s links to appear wrapped in Square Brackets [ ].
eg. If you add a Markup based Link like the following to a Passage…

[[Link Label->Target Passage]]

…you want the Link Label to be display like so on the page…

[Link Label]

If the above assumption is correct, then what you want can be achieved by adding the following CSS Rules to your project’s Story Stylesheet area.

tw-link:before {
	content: '[';
}
tw-link:after {
	content: ']';
}

note: If you only want specific Links to be wrapped in Square Brackets, then you would need to wrap all of those specific Links in a known Named Named (like squared)…

|squared>[ [[Data Driven]]]

…and then alter the above two CSS Rules to only target links that are wrapped in that specific Named Hook…

tw-hook[name="squared"] tw-link:before {
	content: '[';
}
tw-hook[name="squared"] tw-link:after {
	content: ']';
}

There are three macros in the saving section of Harlowe’s manual named (load-game:), (save-game:), and (saved-games:) that can be used to create save/load options.

And those three macros can be used within the associated Hook of one of the “link” family of macros…

(link-repeat: "Save - Slot A")[
    (save-game: "Slot A")
]

And if you want your project’s save/load links to appear below the Undo & Redo options that are shown in the left side-bar, then I suggest you read the “Left Sidebar”: Harlowe (only v2.1.0 or later) recipe found in the official Twine Cookbook.

Nope, I wanted to use brackets in my text, but they’re not allowed in 2.10 due to them being used, even single ones, for functions apparently.
Is there a way to use them?

I think you can use HTML entities. So for left square bracket, you should be able to input [(or unicode [), and for right square bracket, use ] (or ]).

Yes. In the Harlowe Manual I linked to there is a section for verbatim output.

https://twine2.neocities.org/#markup_verbatim

This is how to display opening `[` and closing `]` brackets.