+1 vote
asked by (350 points)

I cannot for the life of me figure out how to do this.

I've looked in the questions, the tutorials, but no one is doing this exact thing or they already know it and think it needs no explanation, I dunno.

I'm a super newbie but I at least understand the basics of how to use macros-- I just need a really simple, easy explanation of how to do this. If I need to switch to another story type that's gonna suck cause Sugarcube has the save game function and I need that.

What I'm looking for specifically is this:

What is it you want out of life?

*To be great

{When clicked I want this to say a whole paragraph or two about why the character thinks this way without going to a new passage and I want the other two options to disappear.}

*To be loved

{When clicked I want this to say a whole paragraph or two about why the character thinks this way without going to a new passage and I want the other two options to disappear.}

*To be accomplished

{When clicked I want this to say a whole paragraph or two about why the character thinks this way without going to a new passage and I want the other two options to disappear.}

End passage, continue link.

I'm also adding on to the values of some stuff but I already know how to do that whole +=1 thing.

Thanks in advance for any help at all. I know I'm probably asking a silly, beginner question but I am a beginner, so.

2 Answers

+1 vote
answered by (16.7k points)

Use <<replace>>:

<<nobr>>
@@#question;
What do you want to be in live?
<br>
<br>
<<link "To be loved">>
	<<replace "#question">>
	Text you want to be shown. <br> [[Continue]]
	<</replace>>
<</link>>
<br>
<<link "To be accomplished">>
	<<replace "#question">>
	Text you want to be shown. <br> [[Continue]]
	<</replace>>
<</link>>
<br>
<<link "To be great">>
	<<replace "#question">>
	Text you want to be shown. <br> [[Continue]]
	<</replace>>
<</link>>
@@
<</nobr>>

 

commented by (350 points)

I tried your code but it deleted the question itself, too. I only want the options to disappear. It's okay, the guy under you's way works, but thank you for trying to help me!

commented by (16.7k points)
It's the same code. He just already added the question to the "Text you want to be shown" segment.
commented by (350 points)
Ah okay, so I misunderstood when I plugged it in to test and see what it did.

Thank you both, then!
commented by (125k points)

warning: The above example is using the 'block' based syntax of Custom Style markup which normally generates a div HTML element, however because the <<nobr>> macro is wrapping the markup the line-break required by the 'block' syntax is being suppressed. This causes the markup to change to the 'inline' syntax which generates a span HTML element instead.

This is why the <<nobr>> macro in my example is placed inside the content of the Custom Style markup.

commented by (16.7k points)
What's the problem with using a span instead of a div?
+1 vote
answered by (125k points)

The following example uses Custom Styling markup to wrap all the option links in an area with an ID of options, and then uses the <<replace>> macro to replace all the option related links with specific output.

What is it you want out of life?

@@#options;
<<nobr>>
<<link "To be great">>
  <<replace "#options">>
    To be great<br><br>
    Whole paragraph or two about why the character thinks this way.
  <</replace>>
<</link>>
<br>
<<link "To be loved">>
  <<replace "#options">>
    To be loved<br><br>
    Whole paragraph or two about why the character thinks this way.
  <</replace>>
<</link>>
<br>
<<link "To be accomplished">>
  <<replace "#options">>
    To be accomplished<br><br>
    Whole paragraph or two about why the character thinks this way.
  <</replace>>
<</link>>
<</nobr>>\
@@\

[[Continue|Target Passage Name]]

 

commented by (350 points)
OH MY GOD THANK YOU SO MUCH

I was literally crying over this for so long. I kept trying to look up how to use replace and other macros and nothing seemed to work.

You've saved me.
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...