Vorple/Hyperlinks: Rule for printing the name of a thing as a hyperlink

Hello there,

Using Vorple to handle Hyperlinks, I wanted to know if its possible to achieve printing things as hyperlinks that makes it easy to examine things by simply clicking them. The code that I have already tried:

Rule for printing the name of a thing: place a link to command “examine [the item described]” reading “[the item described]”.

This will not return any errors, but the end result is simply a blank print.

The example Demo “Neon Vortex” has this functionality, but nothing in the source code suggests how its implemented.

Another slightly related question that I have in regards to using the “After examining” function of a thing. Is there an extension or a way to make it so that once something has been examined, a line of suggested actions are printed as well. Something similar to this:

Examine Bill
A hearty guy from down the street. Suggested actions: [Talk], [Punch] or [Wave].

Thanks,

1 Like

It will work with “[the printed name of the item described]”:

Rule for printing the name of something:
	place a link to command "examine [the printed name of the item described]" reading "[the printed name of the item described]";

One way to do this would be via a table where you look up the object and some associated actions. Here’s a quick-and-dirty example which works, just to show the idea:

[... Include Vorple extensions here ...]

The Library is a room.

The book is in the Library.

The orb is in the Library.

The sign is in the Library.

Table of Object Actions
obj (a thing)	action1 (a text)	action2 (a text)	action3 (a text)
book	"read"	"take"	--
orb	"take"	"rub"	"break"
sign	"read"	--	--

After examining something:
	if there is an obj of noun in the Table of Object Actions:
		choose row with an obj of noun in the Table of Object Actions;
		say "Suggested actions: ";
		if there is an action1 entry:
			place a link to command "[action1 entry] [noun]" reading "[action1 entry]";
			if there is an action2 entry:
				place a link to command "[action2 entry] [noun]" reading "; [action2 entry]";
				if there is an action3 entry:
					place a link to command "[action3 entry] [noun]" reading "; [action3 entry]";
		say ".";

Result:

2 Likes

The problem is that using “[the item described]” runs the “printing the name of” activity. That’s why StJohnLimbo’s solution, accessing the printed name property instead, fixes it.

2 Likes

I see, interesting.

Thanks!

1 Like