Love the new highlighting, BTW. It makes it so much easier to figure out my coding mistakes.
As helpful as it is, it's a major hamper on some CPU's, it seems. My laptop almost freezes up when I hold backspace for more then 2 seconds; the response times are really bad. I hope this particular bug can be fixed some time soon.
Squinky wrote:
Yeah, it's at the point where I have to copy/paste all my text to/from a proper text editor. :-\
That's a drag. I haven't noticed any slowdowns on my Mac, even with large passages. It's 6 years old with only a 2 GHz CPU, though a solid-state drive.
I'm revising my opinion. Now that people have pointed it out, yes there is a little lag when typing. It's not near as bad as some are experiencing, but there is a lag amounting to fractions of a second. The highlighting is well worth it, though. Mac OS X 10.7.5, Firefox 35.0.1.
OSX latest version, tested in the latest versions of both Chrome and Firefox. Reproducible when I create a new story/passage and paste in several paragraphs of Lorem Ipsum text.
Since the most recent beta no longer uses $Saves and $Passages, will you be using v1.1 after all or are there other incompatibility issues that'll give it v2.0?
I'm thinking of going back to 1.1 and releasing it as a minor (mandatory) update, not just because of that, but also because there isn't any real infrastructure in TwineJS to allow two versions of the same format in the story, so to get this out at present, I may have to avoid that approach altogether.
The aforementioned (hook:) bug will be fixed, thanks. Improving syntax highlighting perf is kind of difficult, though, but I'll try my best.
I get an error when I try to open a Twine file I created with 2.0.4, Harlowe 2.0.0 beta:
"JavaScript Sorry to interrupt, but this page's code has got itself in a mess. (Reference Error: Can't find variable: requestAnimationFrame) (This is probably due to a bug in the Twine game engine)"
This doesn't happen in Firefox, but happens in Safari 5.1.7 and Chrome 18.x (Mac).
(if:) requiring booleans is deliberate - this change is designed to help catch bugs of the form (if: $value is 2 or 3). This may evaluate to either true or 3, and as such it shall now raise an error instead of silently coercing the 3 to true.
Please forgive my noobiness with this issue. I am trying to work out if I will have to redo all the work I have started doing on Harlowe.
Are you saying that I can no longer have expressions such as:
(if: $variable is 0)[say a bunch of text. (set:$variable to 1)]
Also if I wanted to do something where I set a variable to different numbers, e.g. 1, 2, 3, 4, either by adding +1 whenever someone visits a passage, or by setting the variable to a specific number, then does that mean that I can't use the if statement anymore? For example:
(if: $variable is 1)[bunch of text]
(if: $variable is 2)[another bunch of text]
(if: $variable is 3)[yet another bunch of text]
Sorry if this is obvious and I am just missing something here, but I wanted to know how I should express my macros if the "if" statement no longer accepts numbers.
Are you saying that I can no longer have expressions such as:
(if: $variable is 0)[say a bunch of text. (set:$variable to 1)]
feliwebwork--Checked out your example and it works fine. I am using the Harlowe beta and don't have any trouble whatsoever using numbers in "if statements. Debug View reveals all...
Are you saying that I can no longer have expressions such as:
(if: $variable is 0)[say a bunch of text. (set:$variable to 1)]
No, he is saying the expression/conditional part of the (if:) macro must evaluate to either true or false (eg. Boolean).
So in your example the conditional part is $variable is 0 and this when evaluated is either true or false, so it is ok.
On the other hand the other example quoted (if: $value is 2 or 3) is a composite expression, consisting of two conditionals separated by an or.
The first conditional is $value is 2 which will evaluate to either true or false, so it is ok but the second conditional is 3 and in this case three does not evaluate to either true or false. **
The (if: $value is 2 or 3) example is actually invalid and should be written like follows:
(if: $value is 2 or $value is 3)
** note: generally any non-zero number does equate to true but Harlowe is designed so it is not.
Thanks, Denny, for responding. I am currently not using the Beta, because when I tried I experienced a lot of problems (when I used goto links, the previous passage text would still be displayed underneath the new passage link, etc.). But I wanted to make sure that the work I am doing can be transfered (even if it is mostly by copy and paste) to Harlowe 2.0 when it's released.
Thanks, greyelf! I understand it now thanks to your explanation. And thanks for showing how we can use the value equals 2 or 3 example.
Will there be any audio support for Harlowe 2.0? (ie. a way of natively playing sounds, fading in and out, and stopping sounds, etc.)?
I have started my project in Harlowe and am realising that perhaps I should have learned SugarCube instead, even though harlowe seemed a cleaner, easier to understand code.
Also, I thought I read in another post that there are problems with Harlowe when the story is too big?? What would be too big a story for Harlowe? What would cause it to take too long to load the game??
Ideally, I want to continue using harlowe (or else i would have to translate all my code to SugarCube, which who knows how long it will take or how to go about doing it).
{
(set: $test to 1)
(if: $test is 1)[(set: $test to 2)]
(else:)[(set $test to 3)]
}Test...
...Is outputting 3 lines of whitespace above the "Test..." text. So does:
{
(set: $test to 1)
(set: $test to 2)
(set: $test to 3)
}Test...
Which version of Twine 2 are you using and which browser?
I ask because I just tested both of your examples using Twine 2.0.4 (both online & download versions) and there were no extra lines of white space in the output.
note: I tested by placing each of your examples one at a time at the top of a new story's start page and then used Test, Play, and Publish to File to test each use case. I did this using Firefox 37.0.1 and Chrome 42.0.2311.135 on Windows
When I try it in 2.0.4 on the Twine website, there is no more formatting of code and it creates two white spaces rather than 3 line breaks. I'm using Chrome 42.0.2311.135.
Where is 2.0.4? I used the download link at the top of this thread.
The link in this thread was only for testing a beta version of the Harlowe story format, I would strongly suggest not using it for creating an actual story.
New build. I'm sorry, everyone - I've been a bit depressed this month, and also working on a commission, so I haven't been able to get this together in a timely fashion. I have tried to improve the performance of the syntax highlighter, but not as much as I'd hoped. I'll keep working on it until and after release.
Changes include:
* Arithmetic now uses the correct precedence (not always left-to-right).
* The (hook:) macro works again.
* Removed (position-x:) and (position-y:) for now, as I don't yet like how it handles passage element flow (that is, the entire hook's content is taken out of flow, leaving no space, which seems a tad counterintuitive).
* HTML comments
<!-- -->
can now be nested.
* (display:) loops and things like
(set: $x to "$x")$x
should now produce an error rather than freezing the browser.
I couldn't confirm the "Harlowe 1,000" bug reported above, so it may be fixed too.
I couldn't confirm the "Harlowe 1,000" bug reported above, so it may be fixed too.
Anytime there's a "0.", it goes to a numbered list, which I think is working as intended. However, it means that a sentence can't ever end in a (number ending in) zero and period. Your call. Of course, the new version might have fixed that, like you say. I've not updated yet, but probably will directly.
Highest among my suggestions and requests, by far, is to include a text box input like Sugarcane's. It feels like going back to Twine 1.3.5 without it. I've yet to make a game lacking it.
Also, whitespace has been harrying me terribly in Harlowe. I'm glad to see this new version will bring back the standalone backslash, which will hack out the worst of that fluff. Since I'm so new to Harlowe and not a programmer anyway (read: ignorant moron), all of the rest might be entirely my fault.
Hey, it's obnoxious me from the past: "Add a textbox and get rid of whitespace!"
Hope you get your depression sorted. :-/
EDIT: The numbered list thing has been fixed as far as I can tell using the latest build.
However, whitespace has seemingly, to me, been vastly increased. I think I'm going to PM you my story, L, and see what I'm doing wrong or if there's something up, because a passage that renders fine goes whitespace crazy after looping back to the same passage.
No need to apologize for anything. Considering how much you have given to this community over the years, you're allowed a bit of self-care. Take whatever time you need.
Secondly, when you feel like poking around the engine again ...
I am seeing the similar issues with regard to increased whitespace from release version to beta. Adding curly braces around the code snippet below when using the release version ends up printing out the hash signs so that's why I haven't used them. That doesn't happen with the beta version, though. In that case, the braces simply make zero difference in the spacing.
Backslashes at the end of lines at not always escaped:
This backslash works and the text will be \
displayed on a single line.
#This backslash does not work and is displayed as text instead \
some other text
New build. I'm sorry, everyone - I've been a bit depressed this month, and also working on a commission, so I haven't been able to get this together in a timely fashion.
I'm really new to Twine and to Interactive Fiction, but I wanted to say THANKS for all the work you have put into the Harlowe format and work in Twine.
It has been a very enjoyable experience for me to use this program and learn new skills in a creative way.
Backslashes at the end of lines at not always escaped:
This backslash works and the text will be \
displayed on a single line.
#This backslash does not work and is displayed as text instead \
some other text
This particular bug should now be fixed, thanks, as is the aforementioned heading whitespace bug.
New build. This should fix the display issues with your CSS, at the cost of rolling back a few small fixes (specifically about <tw-story> being placed inside <html> instead of <body>) which will be reinstated post-release when a major version upgrade path is revealed.
I'll formally release this as Halowe 1.1.0 if no one has any more problems with it.
Crap, L, I really love it but I'm still having the "0." bug I mentioned.
Put this in a passage:
I have .5 apples.
I have 0.5 apples.
It will produce:
New story, no stylesheet, newest versions of Chrome, FF, IE, Windows 7x64 (and I usually test using the newest version of Chrome on my iPhone 6 with newest OS, but not for this).
With my stylesheet (which hasn't changed from the link I sent you), for some reason, it looks like this:
I can understand if issues with a stylesheet are on me, though.
Also, may I ask if the following doe is doing the right thing?
(set: $foo to (random: 0.25, 0.5))
$foo
(set: $foo to (random: 0.25, 0.5))
$foo
(set: $foo to (random: 0.25, 0.5))
$foo
If you put that in a passage and refresh it over and over, $foo always prints the same number ("1.25") and the white-space and letting or whatever is always slightly different (no SS, new story, etc.). Like sometimes the middle one will be indented and other times there will be a lot of white-space, etc. Maybe that's not doing what I think it should, but it's doing the right thing. Dunno.
Sorry I didn't test Harlowe for you before while I was out of the loop for a year or so.
As far as I can tell, my white-space and passage's being centered is the same as release, so I'll be very happy to use this for my game for the challenge, since it has saves.
Comments
That's a drag. I haven't noticed any slowdowns on my Mac, even with large passages. It's 6 years old with only a 2 GHz CPU, though a solid-state drive.
I'm revising my opinion. Now that people have pointed it out, yes there is a little lag when typing. It's not near as bad as some are experiencing, but there is a lag amounting to fractions of a second. The highlighting is well worth it, though. Mac OS X 10.7.5, Firefox 35.0.1.
Which web-browser (brand, version) and OS (brand, version) are you using when you have the highlighting issues?
Since the most recent beta no longer uses $Saves and $Passages, will you be using v1.1 after all or are there other incompatibility issues that'll give it v2.0?
The aforementioned (hook:) bug will be fixed, thanks.
Improving syntax highlighting perf is kind of difficult, though, but I'll try my best.
"JavaScript
Sorry to interrupt, but this page's code has got itself in a mess. (Reference Error: Can't find variable: requestAnimationFrame)
(This is probably due to a bug in the Twine game engine)"
This doesn't happen in Firefox, but happens in Safari 5.1.7 and Chrome 18.x (Mac).
Please forgive my noobiness with this issue. I am trying to work out if I will have to redo all the work I have started doing on Harlowe.
Are you saying that I can no longer have expressions such as:
Also if I wanted to do something where I set a variable to different numbers, e.g. 1, 2, 3, 4, either by adding +1 whenever someone visits a passage, or by setting the variable to a specific number, then does that mean that I can't use the if statement anymore? For example:
Sorry if this is obvious and I am just missing something here, but I wanted to know how I should express my macros if the "if" statement no longer accepts numbers.
So in your example the conditional part is $variable is 0 and this when evaluated is either true or false, so it is ok.
On the other hand the other example quoted (if: $value is 2 or 3) is a composite expression, consisting of two conditionals separated by an or.
The first conditional is $value is 2 which will evaluate to either true or false, so it is ok but the second conditional is 3 and in this case three does not evaluate to either true or false. **
The (if: $value is 2 or 3) example is actually invalid and should be written like follows: ** note: generally any non-zero number does equate to true but Harlowe is designed so it is not.
Thanks, greyelf! I understand it now thanks to your explanation. And thanks for showing how we can use the value equals 2 or 3 example.
I have started my project in Harlowe and am realising that perhaps I should have learned SugarCube instead, even though harlowe seemed a cleaner, easier to understand code.
Also, I thought I read in another post that there are problems with Harlowe when the story is too big?? What would be too big a story for Harlowe? What would cause it to take too long to load the game??
Ideally, I want to continue using harlowe (or else i would have to translate all my code to SugarCube, which who knows how long it will take or how to go about doing it).
...Is outputting 3 lines of whitespace above the "Test..." text. So does:
I ask because I just tested both of your examples using Twine 2.0.4 (both online & download versions) and there were no extra lines of white space in the output.
note: I tested by placing each of your examples one at a time at the top of a new story's start page and then used Test, Play, and Publish to File to test each use case. I did this using Firefox 37.0.1 and Chrome 42.0.2311.135 on Windows
Where is 2.0.4? I used the download link at the top of this thread.
This does not:
Notice that the only difference is "Harlowe 1,000" and "Harlowe 1,001".
I started a new game and it was the only text in the only passage for testing purposes. Commas didn't matter.
Changes include:
* Arithmetic now uses the correct precedence (not always left-to-right).
* The (hook:) macro works again.
* Removed (position-x:) and (position-y:) for now, as I don't yet like how it handles passage element flow (that is, the entire hook's content is taken out of flow, leaving no space, which seems a tad counterintuitive).
* HTML comments can now be nested.
* (display:) loops and things like should now produce an error rather than freezing the browser.
I couldn't confirm the "Harlowe 1,000" bug reported above, so it may be fixed too.
I've been making my first game using Twine 2/Harlowe this weekend.
Highest among my suggestions and requests, by far, is to include a text box input like Sugarcane's. It feels like going back to Twine 1.3.5 without it. I've yet to make a game lacking it.
Also, whitespace has been harrying me terribly in Harlowe. I'm glad to see this new version will bring back the standalone backslash, which will hack out the worst of that fluff. Since I'm so new to Harlowe and not a programmer anyway (read: ignorant moron), all of the rest might be entirely my fault.
Hey, it's obnoxious me from the past: "Add a textbox and get rid of whitespace!"
Hope you get your depression sorted. :-/
EDIT: The numbered list thing has been fixed as far as I can tell using the latest build.
However, whitespace has seemingly, to me, been vastly increased. I think I'm going to PM you my story, L, and see what I'm doing wrong or if there's something up, because a passage that renders fine goes whitespace crazy after looping back to the same passage.
No need to apologize for anything. Considering how much you have given to this community over the years, you're allowed a bit of self-care. Take whatever time you need.
Secondly, when you feel like poking around the engine again ...
I am seeing the similar issues with regard to increased whitespace from release version to beta. Adding curly braces around the code snippet below when using the release version ends up printing out the hash signs so that's why I haven't used them. That doesn't happen with the beta version, though. In that case, the braces simply make zero difference in the spacing.
Example code:
Release version of Harlowe:
Beta version of Harlowe:
Side by side comparison:
I'm really new to Twine and to Interactive Fiction, but I wanted to say THANKS for all the work you have put into the Harlowe format and work in Twine.
It has been a very enjoyable experience for me to use this program and learn new skills in a creative way.
Also, the passages aren't centered any longer, which could be all my fault. Of course, all this could be my own fault!
My stylesheet:
Here's some screenshots, same exact game, release Harlowe Vs. the Harlowe build above (2.0.0):
Release (there are no braces in the code in this screenshot):
Beta (there are no braces in the code in this screenshot):
Release:
Beta (so much white-space it doesn't fit on the page):
Release:
Beta (again, same code, small block of text doesn't fit on page):
I'll PM you my game. Don't want to make it public quite yet. Waiting until tomorrow night since I can't work on it Friday-Monday.
I've tested the save/load macro and it works well. Boy, would I sure love to use it.
I'll formally release this as Halowe 1.1.0 if no one has any more problems with it.
Put this in a passage:
It will produce:
New story, no stylesheet, newest versions of Chrome, FF, IE, Windows 7x64 (and I usually test using the newest version of Chrome on my iPhone 6 with newest OS, but not for this).
With my stylesheet (which hasn't changed from the link I sent you), for some reason, it looks like this:
I can understand if issues with a stylesheet are on me, though.
Also, may I ask if the following doe is doing the right thing?
If you put that in a passage and refresh it over and over, $foo always prints the same number ("1.25") and the white-space and letting or whatever is always slightly different (no SS, new story, etc.). Like sometimes the middle one will be indented and other times there will be a lot of white-space, etc. Maybe that's not doing what I think it should, but it's doing the right thing. Dunno.
Sorry I didn't test Harlowe for you before while I was out of the loop for a year or so.
As far as I can tell, my white-space and passage's being centered is the same as release, so I'll be very happy to use this for my game for the challenge, since it has saves.
Thanks a lot, L!