What script creates a link to a page?

0 votes
28 views
asked Oct 18 in Authoring by J.S. (1 point)

Simple question. What script do I need to write to add a link to the current page which will take the player to the specified page if they click on it?

I am using Quest in gamebook mode and writing my pages as scripts and ignoring all the gibberish of the G.U.I. and just typing the code directly, nice and simple like, but I don't know how to add text that links to another page.

I don't want to just use text+script pages and add the links down at the bottom, because that's weak, as I can't put the link inside of other code to make it only run under certain circumstances. (approximate example: if object.attribute=1 { (link: "this string", to page5) } )

1 Answer

0 votes
answered Oct 19 by The Pixie (121 points)

It goes like this:

{page:Page2:Next page}

... where "Page2" is the name of the page to go to, and "Next page" is the text displayed. It is the same in the GUI as in code.

By the way, have you thought about do this as a text adventure that looks like a game book? Sounds like you might want something a bit more advanced than the standard gamebook.
http://forum.textadventures.co.uk/viewtopic.php?f=18&t=4772

commented Oct 21 by J.S. (1 point)
I'm getting an error. Function not found. It's trying to read that line as a function, nomatter how I break it up or how I format it.

"Error: Error adding script attribute 'script' to element 'Page2': Function not found: '{page:Page2:Second}'"

Is there a different way I should format it in the code view?

Also, in the GUI, the closest thing I see is "Add Page Link," which is formatted AddPageLink (Room1, Room2, "Go from room1 to room2"), but it doesn't do anything, at least not when I call it in the "Room1" script of the above example.


I have started thinking about doing this particular project as a textadventure instead, but there's another project I'd like to do as a gemebook, but utilising variables (or in this case, attributes.) Basically, certain links would only appear based on the value of certain variables. For example, over the course of the gamebook you could have opportunities to gather coins or not, and then later you would have certain options that only appear if you have the coins. I've figured out how to keep track of the statistics, just not how to write the link within the code.
This site is now closed.
As of 1st November 2015, this site is a read-only archive. For more information see the intfiction forum post

Welcome to IF Answers, a site for questions and answers about Interactive Fiction.

Technical questions about interactive fiction development tools such as Inform, Twine, Quest, QuestKit, Squiffy, Adrift, TADS etc. are all on-topic here.

Non-technical questions about interactive fiction are also on-topic. These questions could be about general IF design, specific games, entering the IF Comp etc.
...