problem with {exit:name}
Brian5757
24 Feb 2020, 12:47I'm trying to get the command {exit.name} to work in the room description
If I use
{exit:Games Room}
then displayed is
'Games Room' and not the exits alias 'north' Also the hyperlink does not appear.
Is this an error in Quest or does this command not work in the room description?
Pertex
24 Feb 2020, 15:06Is "Games Room" your room? Then this command wil not work. {exit:name} expects the name of an exit like {exit:north}
mrangel
24 Feb 2020, 15:31I should add that {exit:north}
will probably not work, as "north" is usually the alias of an exit.
An exit's name is usually just "exit" and a number. So you would want something that looks like {exit:exit68}
unless you've specifically given the exit a name.
If the hyperlink doesn't appear, it probably means the specified exit isn't in the current room, isn't visible, or isn't an exit.
Brian5757
24 Feb 2020, 22:21Hi mrangel.
I'm still not clear on where the exit68 comes from, is this a name the user creates or is the name from somewhere in Quest?
In my example if I go north from my current location then I go to the Games Room.
mrangel
24 Feb 2020, 22:53All objects must have a name.
When you're looking at the exit in the editor, there's a "Name" field, which is initially blank.
If you leave an exit with a blank name, it will be automatically given a name which is something like "exit68". (all unnamed exits are numbered when the game starts, if I understand correctly. There's no guarantee that adding a new exit won't change the numbers of existing ones, so if you're intending to use the exit in code at all, you should probably give it a name)
Or you could get the name of the exit (exit92 or whatever it happens to be) by doing either: {exit:{=GetExitByLink(game.pov.parent,Games Room}}
or {exit:{=GetExitByName(game.pov.parent, "north"}}
Brian5757
25 Feb 2020, 23:44Thanks mrangel.
I understand now.