Howdy, Stranger!

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

Chat like Conversations for Harlowe

Some people have asked how to implement Harlowe equivalents of the solutions supplied by TheMadExile in the Conversations like in a chat(sugarcube 2) thread, the following examples are one way to do so.

1. An equivalent to the linkappend solution.

This can be achieved by using Harlowe's (link-reveal: ) macro
(link-reveal: "Me: <q>Hi!</q>")[
(link-reveal: "She: <q>Hallo!</q>")[
(link-reveal: "Me: <q>What's going on here?</q>")[
(link-reveal: "She: <q>I don't know!</q>")[
(link-reveal: "Me: <q>Everything what we are talking about looks like in a chat…</q>")[
(link-reveal: "She: <q>That's mysterious!</q>")[
Me: <q>LOOK THERE IS A UFO landing!!!!!!!!!!!!!!!!11eleven!!!111!!</q>
]
]
]
]
]
]

note: The next two examples use a common technique of using a (display:) macro to execute a passage containing logic code, the logic code uses a variable ($chat) determine what happens each time it is run.

2. An equivalent to the replacelink with gains solution, the example consists of two parts:

2a. The part that goes in the passage you want the conversation to appear in.
(set: $chat to 0)\
|output>[(display: "Replacelink with Gains Logic")]

2b. The passage containing the logic to determine what gets shown, named Replacelink with Gains Logic in this example but you can give it any name you like as long as you also change the name in 2a.
(if: $chat is 0)[
	(replace: ?output)[Me: "Hi!"]
	(click: ?output)[
		(set: $chat to it + 1)
		(display: "Replacelink with Gains Logic")
	]
](else-if: $chat is 1)[
	(append: ?output)[<br>She: "Hallo!"]
	(click: ?output)[
		(set: $chat to it + 1)
		(display: "Replacelink with Gains Logic")
	]
](else-if: $chat is 2)[
	(append: ?output)[<br>Me: "What's going on here?"]
	(click: ?output)[
		(set: $chat to it + 1)
		(display: "Replacelink with Gains Logic")
	]
](else-if: $chat is 3)[
	(append: ?output)[<br>She: "I don't know!"]
	(click: ?output)[
		(set: $chat to it + 1)
		(display: "Replacelink with Gains Logic")
	]
](else-if: $chat is 4)[
	(append: ?output)[<br>Me: "Everything what we are talking about is looking... like in a chat..."]
	(click: ?output)[
		(set: $chat to it + 1)
		(display: "Replacelink with Gains Logic")
	]
](else-if: $chat is 4)[
	(append: ?output)[<br>She:"Yes... that 's mysterious!"]
	(click: ?output)[
		(set: $chat to it + 1)
		(display: "Replacelink with Gains Logic")
	]
](else:)[
	(append: ?output)[<br>Me: "LOOK THERE IS A UFO landing!!!!!!!!!!!!!!!!11eleven!!!111!!"]
]


3. An equivalent to the continuelink solution, the example consists of two parts:

3a. The part that goes in the passage you want the conversation to appear in.
(set: $chat to 0)\
|output>[(display: "Continuelink Logic")]
|link>[]

3b. The passage containing the logic to determine what gets shown, named Continuelink Logic in this example but you can give it any name you like as long as you also change the name in 3a.
{
(if: $chat is 0)[
	(replace: ?output)[Me: "Hi!"]
](elseif: $chat is 1)[
	(append: ?output)[<br>She: "Hallo!"]
](elseif: $chat is 2)[
	(append: ?output)[<br>Me: "What's going on here?"]
](elseif: $chat is 3)[
	(append: ?output)[<br>She: "I don't know!"]
](elseif: $chat is 4)[
	(append: ?output)[<br>Me: "Everything what we are talking about looks like in a chat..."]
](elseif: $chat is 5)[
	(append: ?output)[<br>She: "That's mysterious!"]
](elseif: $chat is 6)[
	(append: ?output)[<br>Me: "LOOK THERE IS A UFO landing!!!!!!!!!!!!!!!!11eleven!!!111!!" ]
]
(if: $chat < 6)[
	(replace: ?link)[\
		(link: "(next)")[
			(set: $chat to it + 1)
			(display: "Continuelink Logic")
		]\
	]
]
}


If anyone needs any part of any of the above examples explained then just ask.

Comments

  • @greyelf, I think you haven't changed the 4 after you copy-pasted the block in example 2b, for the "it's mysterious" block.

    Aside from that, this is an amazing reference. Going to star this one.
  • I think you haven't changed the 4 after you copy-pasted the block in example 2b, for the "it's mysterious" block.
    Well spotted.

    Unfortunately because of how the forum software works I can't modify the original post to correct the cut-n-paste error.
  • edited November 2016
    That's awesome! Thank you for responding to my post. Though I only realized after asking, I was actually looking for a non-link based solution where pieces of text pop up one after another.

    I managed to hack something together to make that happen using the below code. Not sure if it's the most efficient solution in terms of effort or processing power, but it seems to work visually.
    {(set: $count to 0)
    (Live: 1s)[(set: $count to it + 1)
    (if: $count >= 1)[(print: "Passage1
    ")]
    (if: $count >= 2)[(print:"Passage2
    ")]
    (if: $count >= 3)[(print:"Passage3
    ")]
    (if: $count >= 4)[(stop:)]
    ]}
  • edited November 2016
    Also tried this one on for size.
    |output>[]
    {(set: $count to 0)
    (Live: 1s)[(set: $count to it + 1)
    (if: $count >= 1)[(replace: ?output)[Me: "Hi!"]]
    (if: $count >= 2)[(append: ?output)[<br>She: "Hallo!"]]
    (if: $count >= 3)[(append: ?output)[<br>Me: "What's going on here?"]]
    (if: $count >= 4)[(append: ?output)[<br>She: "I don't know!"]]
    (if: $count >= 5)[(stop:)]]}
  • Plus, I'm dumb. You already answered it awesomely here, greyelf. Thanks for all the help. :)
Sign In or Register to comment.