Howdy, Stranger!

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

Track Character's Discussions?

edited September 2015 in Help! with 2.0
I'm looking to add the option of conversing with certain characters in my story, and I didn't know if it was possible to later have those discussions be counted, and have those characters give different lines based on them.

Basically, if the player talks to character X in an entirely optional side-activity of sorts, can I then later have character X give a different line in a mandatory interaction with them?

I'm not looking to really have dialogue options, so I don't need to track what the players says, just if they initiated the conversation or not.

Comments

  • You need to state which story format you are using, as answers can be different for each one. I am going to assume you are using Harlowe.

    notes:
    a. I am going to name character X as John and character Y as Jane
    b. You should initialize your variables inside a passage tagged with startup.

    You can use a $variable to track if something happened or not. So in your startup tagged passage you would initialize a variable indicating that the conversation has not happened:
    (set: $talkedToJane to false)
    
    ... then in the passage where John talks to Jane you would change the value of $talkedToJane to true:
    John said hello to Jane.
    (set: $talkedToJane to true)
    
    ... later when you need to check if John talked to Jane you could do the following:
    Bob asked John if he had ever spoken to Jane and John replied "(if: $talkedToJane)[Yes](else:)[No]".
    
  • Oh, I should have mentioned I switched to SugarCube, but since I haven't done any advanced formatting yet, I might switch back - I just heard that SC was a better alternative?

    Thanks though, this is what I was looking for!
  • The SugarCube equivalent to the above would be as follows.

    Initialize the variable within your StoryInit passage, this is one of SC's special passage:
    <<set $talkedToJane to false>>
    
    ... then in the passage where John talks to Jane you would change the value of $talkedToJane to true:
    John said hello to Jane.
    <<set $talkedToJane to true>>
    
    ... later when you need to check if John talked to Jane you could do the following:
    Bob asked John if he had ever spoken to Jane and John replied "<<if $talkedToJane>>Yes<<else>>No<</if>>".
    
Sign In or Register to comment.