Howdy, Stranger!

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

How to add paths based on character emotions

Hi, so I've read about how to make an inventory (still having trouble making it work), but I was wondering if it could help to direct the story.
Say the Char = angry, and I want to make Char = happy or Char = furious, and those decisions could affect how the story reacts in the future. Is this possible?

Also, I didn't understand what to do with Inventory, so help?

Comments

  • You need to state which story format you are using when you ask a question, as answers can be different for each one. I am going to assume you are using the default which is Harlowe.

    You can use a variable to store the character's current emotion, you use Harlowe's (set:) macro to create and assign a value to a variable.
    (set: $charEmotion to "angry")
    
    You are currently feeling $charEmotion but you are unsure what is making you feel (print: $charEmotion).
    
    One way you could get the Reader to change the emotion is to use links within a passage, there are a number of ways to show a link but because we want to change the value of a variable when the link is clicked we will use the (link:) macro.
    You see John pull Jane's hair, how does this make you feel?
    
    (link: "Happy")[(set: $charEmotion to "happy")]
    (link: "Furious")[(set: $charEmotion to "furious")]
    
    You can use a variable to effect what is shown to the Reader
    (if: $charEmotion is "angry")[You are still angry, you must of not seen John pull Jane's hair.]
    (else-if: $charEmotion is "happy")[Why did you liked John pulling Jane's hair?]
    (else-if: $charEmotion is "furious")[John should not pull Jane's hair.]
    (else:)[You should only see this if the variable has some other value.]
    
Sign In or Register to comment.