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
Aside from that, this is an amazing reference. Going to star this one.
Unfortunately because of how the forum software works I can't modify the original post to correct the cut-n-paste error.
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.