0 votes
by (240 points)

Twine 2.2.1, Harlowe 2.1.0.

So far, (this is a new story) I only have one variable setup in startup, which is supposed to allow the player to go to that website (because the story I'm making is about the Internet). The site, called www.lkmn.com, is hinted towards in the main passage, and it should be easy to get to. When I put in the site name correctly, it prints what I put in as I hoped, but in the area where the URL is supposed to show, it doesn't do anything. My "home page" has this code:

Current page: https://www.google.com/home
[[Reload->https://www.google.com/home]] | (link: "Enter URL")[(set: $url to (prompt: "What site do you want to head to?","www.example.com"))(print: $url)]

(link: "Search")[(set: $search_bar to (prompt: "What do you want to search?","searchexample"))]

Welcome to your personalkmn homepage!

Is the URL correct? Then it will appear here!
(if: $url is $lkmn)[ [[www.lkmn.com]] ]

The link it's supposed to go to has nothing so far, and the startup only has this (as of the time I write this question):

(set: $lkmn to "www.lkmn.com")

I'm not sure how to fix this issue.

1 Answer

+1 vote
by (156k points)
selected by
Best answer

The Target Passage Name part of both Markup based links and macros like (link:) can only reference a passage within your project.

You will need to use the (open-url: ) macro combined with a macro like (link:) to achive the effect you want.

(link: "Reload")[
	(open-url: "https://www.google.com/")

warning: The above example was written from memory and has not been tested.

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.