(reload:) in Harlowe

0 votes
asked Nov 8, 2017 by theghostbear (140 points)
The (reload:) works perfectly offline. However, once I import it to itch or philomela, that macro doesn't reset my variables nor my game.

all my variables are on separate passage that gets called during my startup phase, so just looping back won't do it. goto-url doesn't work also for some reason.

My game is in Harlowe 1.2.4.

My code is simple:   (link:"Maybe you missed something...")[(reload:)]

Any suggestions? Cheers.

1 Answer

0 votes
answered Nov 8, 2017 by greyelf (76,130 points)

WARNING: I don't have an account with either of the listed web-sites so I could only debug the issue by looking at other people's Twine based stories/games, and I was not able to quickly find a Harlowe based one on either site. I also only tested this issue using a single brand of web-browser running on a single brand (and version) of operating system, and because each brand (and versions) of each of these things can behave differently the following information is not all encompassing and may not represent everyone's experience. 

Both (reload:) and (goto-url:) work by telling the web-browser's location system to load a web-page, in the case of (reload:) it is using a call to the web-browser's window.location.reload function to reload the current web-page and in the case of (goto-url:) it uses the web-browser's window.location.assign function to load what-ever URL you passed to the macro.

The Itch web-site embeds the Twine based Story HTML file within one of their own web-pages via an HTML iframe element and this can complicate the matter because it's up to the web-browser Developer to choose if its window.location.reload function will reload the child Story HTML file referenced within the iframe element (the Twine Story HTML file) or if it will reload the parent Itch web-page that contains the iframe element, and the outcome of this choice can lead to different results.

...on separate passage that gets called during my startup phase...

I am unsure exactly what you mean by this statement but the recommended method to initialise your story's variables is to add a startup tagged special passage to your story project and to assign the default values of all your story variables within that passage.

commented Nov 9, 2017 by theghostbear (140 points)

Hi greyelf,

Wow, thank you for the clarification. For a reference to the reload issue with itch, my story is here.

Sorry for the confusion/word jumble... I am using a startup tag to initialise all my variables. 


Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.