Howdy, Stranger!

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

TakeCareOf: a game where you take care of.

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 work in Harlowe, but a bug I found was that the return button is mapped to go back to the last item in the history which can get you caught in a loop. When I open 'emotions' from the 'care' menu, then go to 'add emotions' it would make sense to hit return twice to go back to the 'care menu. As it is, you would keep going back and forth between the 'emotion' and 'add emotion' passages. One way to fix this is by making hard links back to the previous menu in that case.

    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.
  • edited February 2017
    - 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)
    Does "latest edition" mean:
    • Harlowe v1.2.2: The currently available version, included with the current release of Twine 2 (v2.0.11).
    • Harlowe v1.2.3: The current release version of the v1-series, included with the latest beta of the next major version Twine 2 (v2.1.0).
    • Harlowe v2.0.0: The current release (beta?) of the v2-series, included with the latest beta of the next major version Twine 2 (v2.1.0).
    You should always specify the version number, using a vague description is unhelpful.

    Anyway. Autosaving in Harlowe has come up before, I believe the Automatically Saving the Game in Harlowe thread may have the information you need.

    […] a bug I found was that the return button is mapped to go back to the last item in the history which can get you caught in a loop. When I open 'emotions' from the 'care' menu, then go to 'add emotions' it would make sense to hit return twice to go back to the 'care menu. As it is, you would keep going back and forth between the 'emotion' and 'add emotion' passages. One way to fix this is by making hard links back to the previous menu in that case.
    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)
    prerender['set-return'] = function () {
    	if (!tags().includes('noreturn')) {
    		State.variables['return'] = passage();
    	}
    };
    
    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:
    <<link "Return" $return>><</link>>
    


    You should be able to simply do something like the following:
    [[Return|$return]]
    
    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.
  • I meant a bug in his code not Twine's, my apology. I should have been more clear. In my own story I use something similar once a couple of levels deep into the inventory. I think he may appreciate your solution to that problem, I simply don't have the knowledge to put it in practice in Harlowe so I didn't put forward my code.
  • I simply don't have the knowledge to put it in practice in Harlowe so I didn't put forward my code.
    The Basic "return from menu passages" handling for Harlowe thread describes one possible solution to this issue for Harlowe 1.x
  • Does "latest edition" mean:
    • Harlowe v1.2.2: The currently available version, included with the current release of Twine 2 (v2.0.11).
    • Harlowe v1.2.3: The current release version of the v1-series, included with the latest beta of the next major version Twine 2 (v2.1.0).
    • Harlowe v2.0.0: The current release (beta?) of the v2-series, included with the latest beta of the next major version Twine 2 (v2.1.0).
    You should always specify the version number, using a vague description is unhelpful.

    Anyway. Autosaving in Harlowe has come up before, I believe the Automatically Saving the Game in Harlowe thread may have the information you need.

    Sorry, I didn't even think about that. Thank you, this should be about what I need.

  • Hey, poking this thread to show what I came up with. It seems to work for me, but can someone take a look and tell me if the autosave works when they play for a while, then close and come back?
  • It doesn't seem to be working with me. I mean, I had a dragon lvl 1 but then I loaded and was back to the sad and cold egg.
    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.
  • It doesn't seem to be working with me. I mean, I had a dragon lvl 1 but then I loaded and was back to the sad and cold egg.
    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.
  • The only location in your example story where I found reference to the (save-game) macro was within the add home passage. If the autosave feature of your story is meant to be based on the thread linked to by TheMadExile then you are missing the functionality described in point 2's header passage, which is what is doing the actual auto-saving.

    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.
  • Mmm. So I stopped with my weird trying to fudge it I'd done in the last example, and just tried it exactly as instructed in the Multiple saves in the same passage thread.
    I'm a really good coder, you guys.
  • There is an error that makes me unable to play the game. It says "I can't (go-to:) the passage 'THE REAL START OF THE GAME' because it doesn't exist."
  • Does it count as bumping if it's actually revelant to the original topic? :hushed:
    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:
    (if: $d is 0)[ sad and cold egg. ](if: $d is >= 0)[ newly hatched. ](if: $d is >= 10)[ toddler. ](if: $d is >= 20 )[ child. ](if: $d is >= 40 )[ teenager. ](if: $d is >= 50 )[ young adult. ](if: $d is >= 60)[ fully grown, thriving. ]
    
    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.
  • And I'm smart. I forgot to attach the file to show it. I'm. I'm doing great.
  • edited April 2017
    Working in Harlowe 2.1.1, and...
    There is no such version of Harlowe. That's the current full version of Twine 2.1.

    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.

    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:
    (if: $d is 0)[ sad and cold egg. ](if: $d is >= 0)[ newly hatched. ](if: $d is >= 10)[ toddler. ](if: $d is >= 20 )[ child. ](if: $d is >= 40 )[ teenager. ](if: $d is >= 50 )[ young adult. ](if: $d is >= 60)[ fully grown, thriving. ]
    
    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:
    {
    (if: $d is 0)[ sad and cold egg. ]
    (elseif: $d >= 0)[ newly hatched. ]
    (elseif: $d >= 10)[ toddler. ]
    (elseif: $d >= 20 )[ child. ]
    (elseif: $d >= 40 )[ teenager. ]
    (elseif: $d >= 50 )[ young adult. ]
    (elseif: $d >= 60)[ fully grown, thriving. ]
    }
    
    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:
    {
    (if: $d is 0)[ sad and cold egg. ]
    (elseif: $d > 0)[ newly hatched. ]
    …
    }
    
    Whether the follow-on clauses need adjustment is up to you.


    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.
    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.
Sign In or Register to comment.