This is difficult, as I understand it. The paradigm in Inform is that you have a bunch of ways of referring to things and other objects, but once the parser processes your command into an action involving an object it discards the way that the command referred to the object. So you can use understanding by relations to know that “baron” can be used to refer to Maltravers (in the Peers example); but this will not allow “duke” to be used to refer to as Maltravers, so when you type “duke maltravers” the parser will simply not resolve that to an object, as if you had typed “X BLUE ORB” in the presence of a red orb. Which gives the you-can’t-see-that error. And if you did rig things so that the parser could understand “duke maltravers” as Maltravers, then at the action-processing stage the game would have forgotten that Maltravers was referred to using the wrong title! So that’s no good.
One thing you can do sometimes here is use a check on “if/when the player’s command includes…” to see if the command referred to an object by a forbidden string… but that seems like it would be very awkward in this case, when there are so many possible forbidden strings.
Here’s something inspired by the Puncak Jaya example, which uses “ghost” objects to allow you to refer to people you can’t see… by making sure the ghost object is nearby and can intercept commands that refer to an absent person. It’s pretty messy, though–I had to create a separate misnomer for every person for every possible title (and if you add another title you have to change the number of incorporated misnomers by hand, at least I don’t know how to automate it). Multiplying things like that might hammer the performance of your game. Also, it produces weird clarification messages, and it relies on Does The Player Mean rules which I never count on not to break. (If you already have a way to disambiguate titles you probably understand DTMP rules better than me.) But it might be a start.
[code]A title is a kind of value. The titles are Baron, Viscount, Earl, Marquess, Duke and Prince.
A peer is a kind of man. A peer has a title. A peer is usually a Baron. Before printing the name of a peer, say "[title] ". Understand the title property as describing a peer.
The House of Lords is a room. Maltravers, Pollifax, Omnium and St Vincent are peers in the House of Lords. Omnium is a Duke. St Vincent is an Earl.
A misnomer is a kind of thing. A misnomer is usually privately-named. Six misnomers are part of every peer. A misnomer has a title.
Misnomership relates one peer (called the owner) to various misnomers. The verb to misname means the reversed misnomership relation.
When play begins:
repeat with noble running through peers:
let current title be a title;
repeat with malaprop running through misnomers incorporated by noble:
now malaprop misnames noble;
now the title of malaprop is current title;
now current title is the title after current title.
Understand the title property as describing a misnomer. Understand “[something related by reversed misnomership]” as a misnomer.
Does the player mean doing something with a misnomer: it is very unlikely.
Before doing something when the noun is a misnomer (called malaprop): say “You can’t call [owner of malaprop] that!” instead.
Before doing something when the second noun is a misnomer (called malaprop): say “You can’t call [owner of malaprop] that!” instead. [/code]