Understanding more than one word from a property

In my WIP, I have a lot of things I’ll be placing around the map. I would like to have the player be able to refer to each thing by its synonym property.

Unfortunately, it doesn’t appear I can put multiple synonyms in a single property. For example:

A prop is a kind of thing. Some props are defined by the Table of Prop Creation. The description of a prop is "[basic-description]". 

Table of Prop Creation
awesome prop	basic-description	synonym
a stone	"It's a freaking rock."	"rock/pebble" 


Understand the synonym property as describing a prop.

The command
> x rock
doesn’t work.

But the command
> x rock/pebble
prints It's a freaking rock.

Is there a way I can put more than one synonym in a single property?

Nope. But you can use multiple properties like I did in this example…

Well, shoot … I was afraid of that. Thanks for your quick reply, Zed!

1 Like

On my end, I’m currently trying to streamline the management of synonyms (for people as well as objects) by using relations. I’m far from succeeding at the moment! But it’s very interesting.

In the meantime, I advise against using tables to declare objects because this unduly impacts the property of all rooms:

Lab

>showme Lab
Lab - room
    yourself - person
lighted, visited; singular-named, improper-named
description: none
printed name: "Lab"
printed plural name: none
indefinite article: none
list grouping key: none
basic-description: none
synonym: none

If you still want to use tables for this purpose (which I also do, but not for managing synonyms), perhaps this thread will be useful to you.

I haven’t finished my work on this subject, but I’ve made good progress. Enough to offer an alternative using relations (use with caution and tests, especially with complex names):

 "The troupe"

The square is a room. 

ThingAltname is a kind of value.
The ThingAltnames are caravan, trailer, vardo, wagon, platform, stage, podium, minstrel, bard, gleeman, poet-singer, singer, storyteller, onlooker, passerby, spectator and idler.

A thing has a ThingAltname.
Understand the ThingAltname property as describing a thing.

Altnaming relates various ThingAltnames to various things.
The verb to altname means the altnaming relation.

After reading a command:
	if the player's command includes "[ThingAltname]":
		let LocalAltname be the ThingAltname understood;
		say "ThingAltname understood: [LocalAltname][line break]";
		repeat with LocalThing running through things which are altnamed by LocalAltname:
			say "Thing found: [LocalThing][line break]";
			now the ThingAltname of LocalThing is the ThingAltname understood;

Belcyrd is a man in the square.
Minstrel, gleeman and bard altname Belcyrd.

Dolaria is a woman in the square.
Storyteller, bard, poet-singer and singer altname Dolaria.

Grimphy is a man in the square.
Onlooker, passerby, spectator and idler altname Grimphy.

The theater troupe's cart is in the square.
Caravan and vardo altname the theater troupe's cart.

The old Grimphy's carriage is in the square.
Trailer and wagon altname the old Grimphy's carriage.

The stand is in the square.
Platform, stage and podium altname the stand.
square
You can see Belcyrd, Dolaria, Grimphy, a theater troupe's cart, an old Grimphy's carriage and a stand here.

>examine minstrel
ThingAltname understood: minstrel
Thing found: Belcyrd

You see nothing special about Belcyrd.

>examine bard
ThingAltname understood: bard
Thing found: Belcyrd
Thing found: Dolaria

Who do you mean, Belcyrd or Dolaria?

>Dolaria
ThingAltname understood: bard
Thing found: Belcyrd
Thing found: Dolaria

You see nothing special about Dolaria.

>examine platform
ThingAltname understood: platform
Thing found: stand

You see nothing special about the stand.

>examine spectator
ThingAltname understood: spectator
Thing found: Grimphy

You see nothing special about Grimphy.

>examine wagon
ThingAltname understood: wagon
Thing found: old Grimphy's carriage

You see nothing special about the old Grimphy's carriage.

>examine storyteller
ThingAltname understood: storyteller
Thing found: Dolaria

You see nothing special about Dolaria.

>examine cart
You see nothing special about the theater troupe's cart.

>

I’m a bit puzzled. What does this code do that that a plain understand phrase doesn’t?

If left as is, nothing more than, according to me, a greater potential. Besides, the code itself is fundamentally based on an understand instruction, so you’re right:

Understand the ThingAltname property as describing a thing.

I also find the use of relationships less tedious and more readable for linking synonyms to objects, but it’s probably a matter of preference.

I’m working on this theme because initially, I was looking for a way to streamline synonyms for people (who are also things) using the method proposed by the Straw into Gold example from the manual. Thanks to relations, a streamlined process becomes possible, without working with the tables and the famous room-property bug.

For example, it’s now very easy to use synonyms to adapt dynamically the presentation of objects according to those the player prefers to use to refer to an object or a person. Compared to a simple Understand instruction, here we can control what is written and not just what is read.

 "The troupe"

The square is a room.

A person can be identified or unidentified.
A person is usually unidentified.

Definition: a thing is nearby if (it is in the location of the player).

ThingAltname is a kind of value.
The ThingAltnames are caravan, trailer, vardo, wagon, platform, stage, podium, minstrel, bard, gleeman, poet-singer, singer, storyteller, onlooker, passerby, spectator and idler.

A thing has a ThingAltname.
Understand the ThingAltname property as describing a thing.

Altnaming relates various ThingAltnames to one thing.
The verb to altname means the altnaming relation.
The verb to namemorph means the reversed altnaming relation.

After reading a command:
	if (the player's command includes "[ThingAltname]"):
		let LocalAltname be the ThingAltname understood;
		repeat with LocalThing running through things which namemorph LocalAltname:
			now the ThingAltname of LocalThing is the ThingAltname understood;
							
Rule for printing the name of a person (called LocalPerson) which is unidentified:
	say "[an ThingAltname of LocalPerson]";

Belcyrd is an improper-named man in the square.
Minstrel, gleeman and bard altname Belcyrd.
The ThingAltname of Belcyrd is minstrel.

Dolaria is an improper-named woman in the square.
Storyteller, poet-singer and singer altname Dolaria.
The ThingAltname of Dolaria is singer.

Grimphy is an improper-named man in the square.
Onlooker, passerby, spectator and idler altname Grimphy.
The ThingAltname of Grimphy is spectator.

The theater troupe's cart is in the square.
Caravan and vardo altname the theater troupe's cart.

The old Grimphy's carriage is in the square.
Trailer and wagon altname the old Grimphy's carriage.

The stand is in the square.
Platform, stage and podium altname the stand.
square
You can see a minstrel, a singer, a spectator, a theater troupe's cart, an old Grimphy's carriage and a stand here.

>examine passerby
You see nothing special about the passerby.

>look
square
You can see a minstrel, a singer, a passerby, a theater troupe's cart, an old Grimphy's carriage and a stand here.

>examine bard
You see nothing special about the bard.

>look
square
You can see a bard, a singer, a passerby, a theater troupe's cart, an old Grimphy's carriage and a stand here.

>

Next steps for me are: to catch the name of a person in a snippet to make them identified and so proper-named (I’m stuck) and to dynamically describe non-person items thanks to the synonyms (a possibility not offered by Understand, as far as I understand.)

EDIT : done (not this code, but an improved version that is starting to go seriously off-topic). Honestly, using relations to automate and refine the naming of objects and people based on their commonness (or uniqueness), how they are identified by the player, and the player’s vocabulary preferences—I think it’s cool for making the game world feel more familiar as the player becomes more invested in it.

Sorry for digressing this way, it’s just that @rpatten 's use of tables in the thread reignited my desire to streamline the management of synonyms. A side question: I obviously couldn’t find any built-in understanding-type relation, but maybe I haven’t done enough research? That would have saved me from writing the code that @rileypb rightly found redundant.

1 Like

FYI, BBA #1 was about this problem.

1 Like

Wow, I’m impressed by the different approaches taken here! I appreciate everyone’s help, and I’m learning a lot with the answers you gave – don’t worry about going off topic! And I had no idea about the bug with giving rooms the attributes of the things you create in the tables. I tested and confirmed that today – it is certainly weird.

To shed more light on the reasoning behind my question: I didn’t ask it out of curiosity or desire for esoteric Inform knowledge. Well, not entirely.

My WIP involves multiple viewpoint characters and thus, multiple sets of descriptions. (It’s like writing the same game slightly differently multiple times! Yes, I’ve already tried to talk myself out of it.) The challenge is not getting lost in the complexity.

My usual hack-and-slash style won’t work here – not if I want to finish. I’m trying to make the code as clean and maintainable as I know how.

I am using tables more frequently than I normally do – mostly because I need to keep similar content together, such as different descriptions of the same room or thing. That’s why I would love to define synonyms in the same place as I define things. Jumping around means more typing and increased likelihood of me not noticing I am missing something.

However, with the fiery hoops I’d have to jump through, it appears defining both things and synonyms in a table would be a clunky way to go at the moment. I may just have to play by Inform’s normal rules here and define the things, describe them, and give synonyms (with good old “Understand” for everything) in different parts of the code. It’s probably not the end of the world. I need to think about this.

Maybe defining things/declaring synonyms in inserted Inform 6 code would be a good middle ground, as I could include the synonyms in the definition (and thus in one place)? I’m guessing it’s probably not a great idea, and I don’t know a ton about I6 …

1 Like