Howdy, Stranger!

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

add a line of text to all passages [Twine2]

Hi, I'm just trying to experiment things with twine. Using twine 2 Harlowe.

Is there a way to add a line of text to all the passages ?
I doubt this exist, but anyway. Still asking

Thanks ! :)

Comments

  • edited September 2015
    In the Harlowe project overview, within the 1.1.0 changes: New Features section you will find information about the special behaviour for passages tagged with header, footer, or startup.

    You can create a new passage with either a header or footer tag and the contents of this new passage will appear either before or after every other passage shown to the Reader.

    You should use a passage tagged with startup to initialise (give a default value) to all your story's $variables.
  • Thanks a lot, guy ! :)
  • Another little question if I may.

    Header's working just fine, but it's loading faster than the actual passages.
    Is there a function or tag that makes it wait for the passage to load before displaying ?
  • I can think of three potential ways to delay the displaying of the header contents, though both have issues.

    1. Use a (live:) macro to delay the displaying of the content, the issue is that the amount of time to delay depends greatly on the machine of the person viewing the story.

    Place the following in your header passage, it will update the named hook's content after 100 milliseconds. Note the usage of a (stop:) macro to force the (live:) macro to occur only once.
    (live: 100ms)[(replace: ?header)[This is the header text](stop:)]
    

    2. Use a footer passage to update the contents of your header passage, the issue is that the header will now appear after the actual passage does.

    a. Your header passage:
    |header>[]
    
    b. Your footer passage:
    (replace: ?header)[This is the header text]
    

    3. Use (or change the existing) transitional CSS to delay the displaying the header passage. You will need the help of someone that knows CSS better than I do for this one.

    Someone else may be able to come up with a different solution.
  • greyelf wrote: »
    I can think of three potential ways to delay the displaying of the header contents, though both have issues.

    1. Use a (live:) macro to delay the displaying of the content, the issue is that the amount of time to delay depends greatly on the machine of the person viewing the story.

    Place the following in your header passage, it will update the named hook's content after 100 milliseconds. Note the usage of a (stop:) macro to force the (live:) macro to occur only once.
    (live: 100ms)[(replace: ?header)[This is the header text](stop:)]
    

    2. Use a footer passage to update the contents of your header passage, the issue is that the header will now appear after the actual passage does.

    a. Your header passage:
    |header>[]
    
    b. Your footer passage:
    (replace: ?header)[This is the header text]
    

    3. Use (or change the existing) transitional CSS to delay the displaying the header passage. You will need the help of someone that knows CSS better than I do for this one.

    Someone else may be able to come up with a different solution.

    1. It works but without the "(replace: ?header)" thing. Otherwise nothing is displayed.

    - like this
    (live: 100ms)[[This is the header text](stop:)]

    It's not really an accurate thing.. But still better than nothing. Thanks.

    2. Wow that's weird. Actually it doesn't change anything.
    The text is still displayed before everything. If I type something else in the footer, it's displayed after. I think the "|header>[]" is executed even if the footer isn't displayed.

    But thanks for the idea

    3. Well I'll ask my dev about that one. If someone has an idea here it'd be great too.
    I'll tell you if I find something.
  • In point 1 I forgot to include the |header>[] part of the header passage, so it should of looked like:
    |header>[]
    (live: 100ms)[(replace: ?header)[This is the header text](stop:)]
    
    Did you trying increasing the number of milliseconds to delay for, say to 200 or even higher? (1000 milliseconds equals 1 second).
  • edited September 2015
    Yep I tried and wouldn't work.
    This one either by the way.

    But this works just fine:
    (live: 100ms)[This is the header text(stop:)]

    Edit: Also I noticed that the (stop:) function seems to makes the passage text load longer.
Sign In or Register to comment.