Welp, here's another demo for something from me. My intentions here were to make a certain kind of game, I have no idea if there's a name for the genre, but? Something like HabitRPG or a similar game, that rewards you for doing real life self-care.
I'm pretty happy with how it looks. Obvious stuff right now:
- I've been too lazy to draw the graphics :u
- I don't know what I should do for a reliable autosave feature. This kind of game needs to be able to save your progress constantly, and right now, one has to click save before you exit. Anyone have suggestions? (Latest edition of Harlowe)
Comments
I don't know how much Harlowe supports in terms of saving games, but an inelegant solution would be to automatically save whenever a stat is changed in the add-stat passages by coding it in after changing the variable. This might be a bit brute-force, but it would work.
Anyway. Autosaving in Harlowe has come up before, I believe the Automatically Saving the Game in Harlowe thread may have the information you need.
Assuming you're referring to the <<return>> macro, that is not a bug, it's simply how the macro works. You're talking about an arbitrary number of passages here, the code can't magically pull the correct destination passage out of thin air.
The most common way to resolve the arbitrarily-long-return issue is to use a bit of JavaScript to record the last non-menu passage into a story variable and then to create a link with that.
For example, the code to record the last non-menu passage: (goes in Story JavaScript) You'll need to tag each and every one of your menu passages with noreturn—you may use any tag you wish (e.g. menu, inventory), just ensure you change the name in the code if you decide upon another.
In your menu passages, your long-return links will simply reference the $return story variable, like so:
You should be able to simply do something like the following: I don't recommend that, however, as Twine 2's automatic passage creation feature will stupidly create a passage named $return, which you will have to delete, so I find it's better to avoid the issue by the using the previously mentioned <<link>> version—YMMV.
PS: If you thought that you had found a bug, why didn't you report it. The developers of both Twine and the story formats cannot fix bugs if we do not know about them. Even if it's not actually a bug, we'll probably give you a work around or explain what you should be doing instead—case in point, what I just did. Please, seriously please, report every bug you think you've found.
Sorry, I didn't even think about that. Thank you, this should be about what I need.
It did save at some point, though, since body stat was 5. Also when I loaded it went straight into a "you did great!" passage which increased the home stat to 2 (it was previously 1) without me doing anything.
Also, not sure if you're aware, but, when you go into customize, even if you cancel, your name/gender changes.
Okay, thank you for testing it out! I'll try to figure things out.
And as for customize, I've noticed it does that. I'm not sure what to do to prevent it from behaving that way, though. :?
That's another thing I'd love advice on, TBH.
I also suggest reading the [Harlowe] Multiple saves in the same passage thread, as it explains what actually happens when you save or load a game.
One possible error I noticed while looking at your story is that you may of assigned the wrong tag to your startup passage, you should be using the startup special tag instead of the startup-header you have if you want the contents of that passage to be processed before the first passage of your story is shown.
I'm a really good coder, you guys.
It's been a while. I picked this game back up, and decided to essentially rebuild it with the same mechanic. I have a couple of different issues I'd like a sanity check for. Sorry if it's obvious and I'm missing it, I'm just kind of scrambled.
Working in Harlowe 2.1.1, and...
a) Variables which display the dragon's status aren't showing up. Could be because it's only responding to the exact numbers? I have it set up like so in a couple places: b) The link to the passage called "talk to you" doesn't work? I think twine might not be liking how I've got so many dang if: macros in one sentence? I dunno.
Go to the menu within the story editor and select Change Story Format. The story format which is selected in that dialog is the one your project is actually using. Its version is listed along with its name. You should find that you are using Harlowe v1—specifically, v1.2.3—not Harlowe v2.
That code will not work as written in Harlowe v1 because you're attempting to combine various conditional operators—specifically, the equality operator is with the relational operator >=—which is not legal. Harlowe v2 includes workarounds to allow for those combinations, though I would still recommend against doing so, since it's meaningless and will not work just about anywhere else—frankly, a targeted error message would have been better than allowing the combinations, IMO.
You also should be using (elseif:) for the follow-on clauses, elsewise you'll end up showing multiple statuses.
For example, try something like the following: That said, the above simply fixes the operator shenanigans you had going on. The operator of your second clause is pointless in the face of the operator in the first. There's no way the value of $d can be greater-than-or-equal to zero in the second clause if the first clause becomes true if the value is equal to zero.
They should probably be something like the following: Whether the follow-on clauses need adjustment is up to you.
A link to "talk to you" from which passage? Don't make us hunt for your issues.
After hunting through your project, I found two passages which link to "talk to you", the "view stats" passage and the "talk to you" passage. Your issue is that you're doing the same operator shenanigans I pointed out above, fix those and the code should work.
Beyond that, you're also likely running into a bug in the current releases of Twine 2.1, which breaks automatic passage creation and story map arrows. It's triggered if a source passage contains multiple links to the same destination passage. That may also be causing some confusion for you.