Howdy, Stranger!

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

[Harlowe] Passage Within Variable Doesn't Work

Heyo,

I just joined a game dev team as a writer and have been getting used to Twine within the last few days by writing out quests from other games.

In a current "exercise" (with the Bait and Switch quest from Dragon Age 2) I tried this:
(if: $party is "Carver")[ FENRIS: You are skilled. [[I know that much.->Carver Defends Hawke]] ]
(else:)[ FENRIS: You are skilled. [[I know that much.->Fenris Apologises For Being An Arse]] ]

I have a
(set: $party to "Carver")
in the beginning but whenever I reach the above point in the conversation I won't get to either passage I've linked to. The story just ends there, too, which it's not supposed to.

Or this:
(if: $party is "Varric")[ HAWKE: I could stand to know a little more about this [[Danarius.->Fenris Tells About Danarius 2.0]] ]
(else:)[ HAWKE: I could stand to know a little more about this [[Danarius.->Fenris Tells About Danarius]] ]]

The "Fenris Tells About Danarius 2.0" is the same conversation, only with Varric chiming in with a comment. Both eventually lead back to the same passage since it's a loop dialogue option. But even if I choose to take Varric with me in the beginning--I do have a
(set: $party to "Varric")
--it goes to "Fenris Tells About Danarius" immediately, then back to the dialogue choices.

I don't know if it's just me or if it's that passage links don't work with variables or whatever. Gender variables changing pronouns work. Different conversations because the player chose a different class in the beginning work as well. I'm a bit clueless.

Thanks in advance for any answers.

Comments

  • I just tried your code and it worked fine for me. This is odd. What version of Harlowe are you using? Also, consdier using an array for $party so you can have a party that's larger than one person.
  • edited April 23
    Chapel wrote: »
    I just tried your code and it worked fine for me. This is odd. What version of Harlowe are you using? Also, consdier using an array for $party so you can have a party that's larger than one person.

    Yeah, it looks fine to me. are you sure that you've selected harlowe?
  • Sorry for the late reply.

    I think I know exactly what the problem is. I didn't use an array so there was always only one party member there: the last one selected. I'll try the array thingy and report back about how it worked out.

    Thanks for your help so far!
  • edited May 1
    Oookaaay. I'm having hell of a fight with this array. It doesn't work. (Or I'm too dull for this.)

    I have
    (set: $party to (a:))
    
    right in the first passage. When I ask the player if X is in their party and they click yes, the next passage has this
    (set: $party to $party + (a: "Carver"))
    
    or respectively this
    (set: $party to $party + (a: "Varric"))
    
    in it. But Twine still acts like neither of them is in the party.

    When testing, the thing in the right bottom corner of the screen says $party --- an array and stays like this, even if I choose to take both, Varric and Carver.
  • You need to state the name and full version number of the Story Format you are using, as answers can be different for each one. I will assume you are using v1.2.4 as it is the latest default version of Harlowe.
    But Twine still acts like neither of them...
    Slight correction: the story format (Harlowe in this case) is responsible for executing your Passage's content, the Twine application is responsible for editing the Passage content.
    It doesn't work. ....
    Your post talks about comparing and output the content of an Array object but doesn't contain any code examples of these two activities, it is difficult to debug code and determine what is wrong with it without being able to see said code.

    One comment technique used when trying to learn and debug new functionality is to place the relevant code within a single new passage, and then to view it to see what happens.

    The following code tests adding values to an Array datatype, using the associated Array operators to determine if particular values are/aren't contained within it, and determine which methods of outputting a variable's value work.
    (set: $party to (a:))
    
    (set: $party to it + (a: "Carver"))
    
    (set: $party to it + (a: "Varric"))
    
    (if: $party contains "Carver")[Carver is in the party.]
    
    (if: $party contains "Varric")[Varric is in the party.]
    
    (if: not ($party contains "Banana"))[There is no Banana in the party!]
    
    <!-- using Print Macro -->
    The party consists of: (print: $party)
    
    <!-- using Naked Variable Printing -->
    The party consists of: $party
    
  • There is no Banana in the party!
    
    Then is it really even a party at that point?
  • edited May 3
    greyelf wrote: »
    I will assume you are using v1.2.4 as it is the latest default version of Harlowe.
    Indeed. :-D
    greyelf wrote: »
    Slight correction: the story format (Harlowe in this case) is responsible for executing your Passage's content, the Twine application is responsible for editing the Passage content.
    All right, copy that.

    And you know what? It's embarassing. The moment I saw the code example you posted I knew why it still didn't work. Party contains. I had is. [facepalm]

    Thanks so much for your help, folks. It should work now. :-)
Sign In or Register to comment.