+2 votes
by (420 points)
I'm trying to state a variable within a <<link>> <</link>> macro, for example this:

<<link [[Continue to Chapter 1 in $difficulty |Chapter 1: Loss Page 1]]>><<script>> Dialog.close()<</script>><</link>>

However Twine does not recognise $difficulty and shows "$difficulty" instead of it's actual value.

Is there a way around this?
Thanks in advance.

1 Answer

+1 vote
by (420 points)
by (158k points)

Or simply use the version of the <<link>> macro that accepts two String values.

<<set $difficulty to "Abcd">>

<<link "Continue to Chapter 1 in $difficulty" "Chapter 1: Loss Page 1">><<script>> Dialog.close()<</script>><</link>>


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.