Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Harlowe: Choices, Font, and Loops

Hi, I'm new to Twine, enjoying using Twine 2 Harlowe online. I'm pushing myself on a game jam so I've been a little frustrated at trying to learn Harlowe on the fly because the documentation is new and still being created.  :P

I've been able to figure most things out or just simplify them for the time, but I do have a few questions.

1. The first is that I cannot find a replacement for the old Twine's <<choice>> macro. I've been combing through the forums and I just can't seem to find something that works. At it's simplest level, I'm talking about giving the player the option to put something in their pocket or eat it. I don't want them to be able to do both, or go back and do it again.

2. I can't seem to use the font I want. It's located at OpenFontLibrary, and I've tried using @open url and then font-family , as well as
@font-family:
src: url(blahblah.tiff)
My stylesheet never seems to recognize src as valid.

3. This is a bit bigger question I could use advice on. The story I'm working on is told from three perspectives, one beginning when the previous one ends. So I'm going to be moving through the same spaces, just with some different flavor text, and with different parts of the passages usable depending on character. My current plan is to set a variable for each character, and then when one ends, "turn off" the previous character and flip the next one on. Then each room will have conditionals for each character that determine the rest. Is there a good example of this, or any way I could save myself headaches?

Thank you so much for any help, I love using Twine (although I wish I could access it from different machines) and the community has been a wonderful resource so far.

Comments

  • ...well, I wrote up a bunch of example code about setting a variable to indicate that it had been done, but the undo button also unsets variables so that doesn't work.

    Have you considered turning off the undo button?
  • [quote]
    1. The first is that I cannot find a replacement for the old Twine's <<choice>> macro


    The <<choice>> macro did two things, a) removed the ability to click on the other options while viewing current passage, and b) disable all options next time this passage is displayed. Doing b) in Harlowe is currently difficult.

    The following is an example of one  way to do a)
    note: I have formatted the (click:) macros over multiple lines for readability, you can remove the line-breaks.

    |choices>[[The Blue Pill]<opt1|
    [The Red Pill]<opt2|
    ]

    (click: ?opt1)[
    (set: $pill to "Blue")
    (replace: ?choices)[The Blue Pill]
    ]
    (click: ?opt2)[
    (set: $pill to "Red")
    (replace: ?choices)[The Red Pill]
    ]
    [quote]
    2. I can't seem to use the font I want.


    This article explains about using @font-face and a little about the compatibility of different font file types. The general format of a @font-face call looks like the following:

    @font-face {
    font-family: 'MyWebFont';
    src: url('myfont.woff2') format('woff2'), url('myfont.woff') format('woff');
    }
    The fonts I looked at on the Open Font site were not woff files so the following example uses a font from Google Fonts:
    note: The @font-face rule must be at the start / top of your Story Stylesheet:

    @font-face {
    font-family: 'Indie Flower';
    font-style: normal;
    font-weight: 400;
    src: local('Indie Flower'), local('IndieFlower'), url(http://fonts.gstatic.com/s/indieflower/v7/10JVD_humAd5zP2yrFqw6ugdm0LZdjqr5-oayXSOefg.woff2) format('woff2'), url(http://fonts.gstatic.com/s/indieflower/v7/10JVD_humAd5zP2yrFqw6nhCUOGz7vYGh680lGh-uXM.woff) format('woff');
    }

    html {
    font-family: 'Indie Flower', cursive;
    }
    [quote]
    3. This is a bit bigger question I could use advice on.


    You are correct, the easiest way to do this is to assign a variable a value (eg.  (set: $perspective to "bob") ) and use (if:) macros to display the relevant text for each perspective.

    (if: $perspective is "bob")[
    The text to show Bob!
    ]
    (elseif: $perspective is "jane")[
    The text to show Jane!
    ]
    (else:)[
    The text to show everyone else!
    ]
  • Thank you very much for the help!

    Unfortunately I still can't get the font to work, that CSS tips sheet is actually the one I've been working from.
    @font-face {
    font-family: 'PressStart2PRegular';
    src: url('assets/fonts/press-start-2p/6b0a4bbcec8eb53940cbfcb409a788ee/74496d9086d97aaeeafb3085e9957668/PressStart2PRegular.ttf') format('truetype');
    font-style: normal;
    font-weight: 400;

    }

    html{
    font-family: 'PressStart2PRegular', normal;
    color: #FFFF66;
    }

    body {
    background-color: black;

    }

    tw-story {
    font-family: 'PressStart2PRegular';
    color: #FFFF66;
    font-size: 0.9em;
    }
    Sorry about the size. I've made redundancies because I saw multiple posts/tips that had the info in different places. None of them individually work, neither do all of them, but they're all in there. When I'm in style sheet the url and font name always appear red, as though it's not being recognized. Not 'url', mind you, but the 'http://...';
  • [quote]
    src: url('assets/fonts/press-start-2p/6b0a4bbcec8eb53940cbfcb409a788ee/74496d9086d97aaeeafb3085e9957668/PressStart2PRegular.ttf')


    This URL is assuming that the font file is either on the same web server as your hosted story's HTML file or if your loading your story HTML file locally that the font file is in a sub-directory / sub-folder named "assets/fonts/press-start-2p/6b0a4bbcec8eb53940cbfcb409a788ee/74496d9086d97aaeeafb3085e9957668".

    If either of these situations are not the case then you need to add the host name to the start of the URL like so:


    src: url('http://openfontlibrary.org/assets/fonts/press-start-2p/6b0a4bbcec8eb53940cbfcb409a788ee/74496d9086d97aaeeafb3085e9957668/PressStart2PRegular.ttf')
Sign In or Register to comment.