Hi guys I am new to twine, and i love using twine 2. Love the interface and other few bits. However I noticed there is hardly anything out there on Twine 2 Harlowe . To help me start a story for example.
I want to do a few things in my story, I need choice, which I cant seem to find online as it says the syntax is from twine one. I want to buy items from my shop so for example.
<<choice "Drink">>
<<choice "Bar of Chocolate">>
This does not work in twine 2, and i cant find any help online or on this forum on how to do choice.
Also when i pick a choice i want it to be greyed out. So it cannot be picked. And how would u get a message from it also? so instead of a link to another page, I would want a message that says: You buyed 1 drink. Which comes after say the choice drink or replaces it when you click it?
Thanks.
Comments
This is a normal link. It just gets you to another page
For dissapearing links, you can set "if" conditios using variables.
That is a macro based link, a (normal?) markup link looks like the following:
That, or I was just refering to "normal" links as the ones that do not set any variable on click.
(link: "text on page")[(set: $variable to "value")(goto: "page name")]
(link: "text on page")[(set: $variable to it + 1)(goto: "page name")]
Yes the value 0 comes on both pages when you go to them. However it dosnt add up? They stay at 0, on both pages. I put this $value on both goto pages. Just trying to understand this, but its confusing me. Could u give me a further explanation with a simple example with anything?
Also for the If statement, how would i go about making this? for example
shop
park
train station
When you click shop, park and train station disappear or are greyed out. Also when you click shop it does not take you to another page, it replaces the word shop with more words.
For example, when you click Shop it disspears and the sentence "you went to the shop" comes up. Im guessing a replace code would be needed? Could you give an example?
Thanks, really sorry im not very good at this trying to learn.
This is an example on how to set several variables at once, and different kinds of ways to set them.
Remember to set them in a passage that is only visited once, or they will reset every time you visit the passage where they are set.
Take the following example: In this case $variable will equal "here" until the "text on page" link is clicked and then $variable will equal "there". In general it is a good idea to initialize all your $variables at the start of your story and not rely on them defaulting to zero.
If I added your example to my main passage: .. and I created a second passage named page name containing the following: .. and I then clicked on each of the two links in the order that they appeared, the second passage showed the following two outputs:
You can do what you want using a tagged hook, like the following: ... the above opts tagged hook reformatted to make it easier to read:
I understood both better now. I checked out some other stuff you said about live and timing, which has helped me even more you very knowledgeable.
Just one last thing.
It changes the answer, but how do i continue? To the next passage? because it has to be in the same passage right? somthing like this? Didn't work.
|opts>[(link: "shop")[(replace: ?opts)[you went to the shop]]
Continue
(link: "park")[(replace: ?opts)[you went to the park]]
(link: "train station")[(replace: ?opts)[you went to the train station]]]
So basically how do i keep going because it just stops there.
A simple way to show a Continue markup link after the click is to add it to each of the three (replace:) macros: note: be careful not to leave out any of the open/close square-brackets, and I am using line-breaks to format the text within the (replace:) macros.