Howdy, Stranger!

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

How to increment variable in [[ ]] ?

Hello there, I'm fairly new to Twine, and I'm having a hell lot of fun.
I'd like to do something of that kind :
A damsell in distress !!

[[ Help -> Outcome]]
[[ Flee -> Outcome]]

And I'd like for the variable $courage to gain +1 if "Help" is chosen. How do I do ?
I've tried weird stuff like :
[[ Help -> Outcome ] (set: $courage to $courage + 1)]

But it didn't work. If there's anything I've explained badly, do say so !

Thanks in advance !

Comments

  • I don't think you can increment a variable using the [[ ]] markup in Harlowe. You can do it with (link:) though:
    (link: "Help")[(set: $courage to $courage + 1)(goto: "Outcome")]
    
  • Wishaled wrote: »
    You should not add space characters (or any other form of white-space) between the -> delimited and the Target Passage Name of a markup based link, because that white-space will be added to the start of the Name of the Passage automatically created by the editor. You should also not add white-space between the Target Passage Name and the first close square bracket of a markup based link.

    The correct format of your example links:
    [[ Help ->Outcome]]
    [[ Flee ->Outcome]]
    
    or even better:
    
    [[Help->Outcome]]
    [[Flee->Outcome]]
    
  • Thanks a lot Chapel !

    And it's duly noted, greyelf :)

    While I'm here, can anyone tell me why
    [[gotobo]]
    [[gotboba]]
    

    gives me this ?

    163682erreur.png

    Why isn't gotoba created ? Strangely enough, if I do
    [[gotobo]]
    [[gotboba ]]
    

    It works. "gotoba " is created.

    Even stranger, if I start by doing

    [[gotobo]]
    [[gotboba ]]
    

    then edit it so it is

    [[gotobo]]
    [[gotboba]]
    

    It works perfectly well ! Is it some kind of magic ?




  • Oh, and for a reason I ignore, Twine won't save stories I write. I have to click the ''Publish towards file'', and open the file through the HTML file it gives me... Do anyone knows anything about it ?
    What's more, I can't close Twine. When I go to Twine -> Quit, it does nothing. When I click on the cross on the upper right, it does nothing either...
  • @Wishaled
    Which operating system (name, version, edition, 32/64bit) are you using?

    Which version of Twine 2 are you using, and is it the install-able application or web-browser based release.
  • I am on Windows 10 family, Version : "1607", 64 bit.

    I am using the install-able application, on Harlowe 2.0, and Twine 2.1.0
Sign In or Register to comment.